-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add rust client examples for light-token SDK #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
3202304 to
31c7176
Compare
31c7176 to
f51fd06
Compare
d97dcb2 to
fa941d2
Compare
13fa136 to
912ae0f
Compare
- Add mint_to_checked, transfer_checked, burn_checked instruction examples - Add action examples: approve, revoke, create_mint, create_ata, mint_to, transfer_checked, transfer_interface, wrap, unwrap - Restructure tests/ to examples-instructions/ and examples-actions/ - Add decimals field to SetupContext - Update README to match TypeScript client style
- Rename examples-actions → example-actions - Rename examples-instructions → example-instructions - Fix setup_for_unwrap to use Wrap action (SPL mints can't mint directly to Light ATAs) - Update Cargo.toml and README.md paths
- Remove verbose "using action API" / "using instruction API" from comments - Simplify setup comments to match instruction style - Rename transfer.rs -> transfer_interface.rs for consistency
- Merge TypeScript and Rust examples into unified list - Add all Rust-only examples (burn, freeze, thaw, close, etc.) - Update create_mint action to show TokenMetadata usage - Fix SDK compatibility: add token_metadata field, remove fee_payer - Fix rust-client README links and description
| .. | ||
| } = setup().await; | ||
|
|
||
| let delegate = Pubkey::new_unique(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
take keypair
| freeze_authority: None, | ||
| token_metadata: None, | ||
| } | ||
| .execute(&mut rpc, &payer, &payer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
payer rename to mint seed?
| } | ||
| .execute(&mut rpc, &payer) | ||
| .await | ||
| .unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add result and exchange unwrap w/ ?
| spl_token_program: None, | ||
| restricted: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be exposed.
| // Unwrap tokens from Light Token ATA to SPL ATA | ||
| Unwrap { | ||
| source: light_ata, | ||
| destination_spl_ata: spl_ata, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reame to destination_ata
in line 11
here only destination
| use solana_sdk::{signature::Keypair, signer::Signer}; | ||
|
|
||
| #[tokio::main] | ||
| async fn main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amend to only 1 transfer
Summary
Test plan
cargo testin rust-client directory