forked from solana-developers/program-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsdk.rs
More file actions
22 lines (21 loc) · 687 Bytes
/
sdk.rs
File metadata and controls
22 lines (21 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use steel::*;
use crate::prelude::*;
pub fn create_token(
signer: Pubkey,
mint: Pubkey,
data: Token
) -> Instruction {
Instruction {
program_id: crate::ID,
accounts: vec![
AccountMeta::new(signer, true),
AccountMeta::new(mint, true),
AccountMeta::new(metadata_pda(&mint).0, false),
AccountMeta::new_readonly(system_program::ID, false),
AccountMeta::new_readonly(spl_token::ID, false),
AccountMeta::new_readonly(mpl_token_metadata::ID, false),
AccountMeta::new_readonly(sysvar::rent::ID, false)
],
data: CreateToken { data }.to_bytes()
}
}