Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Token Group Interface #5190

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ members = [
"stake-pool/cli",
"stake-pool/program",
"stateless-asks/program",
"token-group/example",
"token-group/interface",
"token-lending/cli",
"token-lending/program",
"token-metadata/example",
Expand Down
35 changes: 35 additions & 0 deletions token-group/example/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "spl-token-group-example"
version = "0.1.0"
description = "Solana Program Library Token Group Example Program"
authors = ["Solana Labs Maintainers <[email protected]>"]
repository = "https://github.com/solana-labs/solana-program-library"
license = "Apache-2.0"
edition = "2021"

[features]
no-entrypoint = []
test-sbf = []

[dependencies]
borsh = "0.10"
solana-program = "1.16.3"
spl-discriminator = { version = "0.1.0" , path = "../../libraries/discriminator" }
spl-pod = { version = "0.1.0" , path = "../../libraries/pod" }
spl-token-2022 = { version = "0.8.0", path = "../../token/program-2022" }
spl-token-group-interface = { version = "0.1.0", path = "../interface" }
spl-token-metadata-interface = { version = "0.2.0", path = "../../token-metadata/interface" }
spl-tlv-account-resolution = { version = "0.3.0" , path = "../../libraries/tlv-account-resolution" }
spl-type-length-value = { version = "0.3.0" , path = "../../libraries/type-length-value" }

[dev-dependencies]
solana-program-test = "1.16.3"
solana-sdk = "1.16.3"
spl-token-client = { version = "0.6", path = "../../token/client" }
test-case = "3.1"

[lib]
crate-type = ["cdylib", "lib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
23 changes: 23 additions & 0 deletions token-group/example/src/entrypoint.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//! Program entrypoint

use {
crate::processor,
solana_program::{
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult,
program_error::PrintProgramError, pubkey::Pubkey,
},
spl_token_group_interface::error::TokenGroupError,
};

entrypoint!(process_instruction);
fn process_instruction(
program_id: &Pubkey,
accounts: &[AccountInfo],
instruction_data: &[u8],
) -> ProgramResult {
if let Err(error) = processor::process(program_id, accounts, instruction_data) {
error.print::<TokenGroupError>();
return Err(error);
}
Ok(())
}
11 changes: 11 additions & 0 deletions token-group/example/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//! Crate defining an example program for creating SPL token collections and
//! editions

#![deny(missing_docs)]
#![cfg_attr(not(test), forbid(unsafe_code))]

pub mod processor;
pub mod state;

#[cfg(not(feature = "no-entrypoint"))]
mod entrypoint;
Loading