Skip to content

Commit 436c64e

Browse files
committed
feat(spl): Update to Solana 3.0
1 parent 6072550 commit 436c64e

19 files changed

+521
-1808
lines changed

Cargo.lock

Lines changed: 489 additions & 1790 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spl/Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ rustdoc-args = ["--cfg", "docsrs"]
1313
[features]
1414
default = ["associated_token", "mint", "token", "token_2022", "token_2022_extensions"]
1515
anchor-debug = ["anchor-lang/anchor-debug"]
16-
associated_token = ["spl-associated-token-account"]
16+
associated_token = ["spl-associated-token-account-interface"]
1717
devnet = []
1818
governance = []
1919
idl-build = ["anchor-lang/idl-build"]
20-
memo = ["spl-memo"]
20+
memo = ["spl-memo-interface"]
2121
metadata = ["mpl-token-metadata"]
2222
mint = []
2323
stake = ["borsh"]
24-
token = ["spl-token"]
25-
token_2022 = ["spl-token-2022"]
24+
token = ["spl-token-interface"]
25+
token_2022 = ["spl-token-2022-interface"]
2626
token_2022_extensions = [
27-
"spl-token-2022",
27+
"spl-token-2022-interface",
2828
"spl-token-group-interface",
2929
"spl-token-metadata-interface",
3030
"spl-pod",
@@ -34,10 +34,10 @@ token_2022_extensions = [
3434
anchor-lang = { path = "../lang", version = "0.32.1", features = ["derive"] }
3535
borsh = { version = "1.5.7", optional = true }
3636
mpl-token-metadata = { version = "5", optional = true }
37-
spl-associated-token-account = { version = "7", features = ["no-entrypoint"], optional = true }
38-
spl-memo = { version = "6", features = ["no-entrypoint"], optional = true }
39-
spl-pod = { version = "0.5", optional = true }
40-
spl-token = { version = "8", features = ["no-entrypoint"], optional = true }
41-
spl-token-2022 = { version = "8", features = ["no-entrypoint"], optional = true }
42-
spl-token-group-interface = { version = "0.6", optional = true }
43-
spl-token-metadata-interface = { version = "0.7", optional = true }
37+
spl-associated-token-account-interface = { version = "2", optional = true }
38+
spl-memo-interface = { version = "2", optional = true }
39+
spl-pod = { version = "0.7", optional = true }
40+
spl-token-interface = { version = "2", optional = true }
41+
spl-token-2022-interface = { version = "2", optional = true }
42+
spl-token-group-interface = { version = "0.7", optional = true }
43+
spl-token-metadata-interface = { version = "0.8", optional = true }

spl/src/associated_token.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ use anchor_lang::solana_program::pubkey::Pubkey;
55
use anchor_lang::Result;
66
use anchor_lang::{context::CpiContext, Accounts};
77

8-
pub use spl_associated_token_account;
9-
pub use spl_associated_token_account::{
10-
get_associated_token_address, get_associated_token_address_with_program_id, ID,
8+
pub use spl_associated_token_account::address::{
9+
get_associated_token_address, get_associated_token_address_with_program_id,
1110
};
11+
pub use spl_associated_token_account::program::ID;
12+
pub use spl_associated_token_account_interface as spl_associated_token_account;
1213

1314
pub fn create<'info>(ctx: CpiContext<'_, '_, '_, 'info, Create<'info>>) -> Result<()> {
1415
let ix = spl_associated_token_account::instruction::create_associated_token_account(

spl/src/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use anchor_lang::Result;
77
use anchor_lang::{context::CpiContext, Accounts};
88
use std::ops::Deref;
99

10-
pub use spl_token;
1110
pub use spl_token::ID;
11+
pub use spl_token_interface as spl_token;
1212

1313
pub fn transfer<'info>(
1414
ctx: CpiContext<'_, '_, '_, 'info, Transfer<'info>>,

spl/src/token_2022.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use anchor_lang::solana_program::pubkey::Pubkey;
55
use anchor_lang::Result;
66
use anchor_lang::{context::CpiContext, Accounts};
77

8-
pub use spl_token_2022;
98
pub use spl_token_2022::ID;
9+
pub use spl_token_2022_interface as spl_token_2022;
1010

1111
#[deprecated(
1212
since = "0.28.0",

spl/src/token_2022_extensions/cpi_guard.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use anchor_lang::solana_program::account_info::AccountInfo;
44
use anchor_lang::solana_program::pubkey::Pubkey;
55
use anchor_lang::Result;
66
use anchor_lang::{context::CpiContext, Accounts};
7+
use spl_token_2022_interface as spl_token_2022;
78

89
pub fn cpi_guard_enable<'info>(ctx: CpiContext<'_, '_, '_, 'info, CpiGuard<'info>>) -> Result<()> {
910
let ix = spl_token_2022::extension::cpi_guard::instruction::enable_cpi_guard(

spl/src/token_2022_extensions/default_account_state.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use anchor_lang::solana_program::pubkey::Pubkey;
55
use anchor_lang::Result;
66
use anchor_lang::{context::CpiContext, Accounts};
77
use spl_token_2022::state::AccountState;
8+
use spl_token_2022_interface as spl_token_2022;
89

910
pub fn default_account_state_initialize<'info>(
1011
ctx: CpiContext<'_, '_, '_, 'info, DefaultAccountStateInitialize<'info>>,

spl/src/token_2022_extensions/group_member_pointer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use anchor_lang::solana_program::account_info::AccountInfo;
44
use anchor_lang::solana_program::pubkey::Pubkey;
55
use anchor_lang::Result;
66
use anchor_lang::{context::CpiContext, Accounts};
7+
use spl_token_2022_interface as spl_token_2022;
78

89
pub fn group_member_pointer_initialize<'info>(
910
ctx: CpiContext<'_, '_, '_, 'info, GroupMemberPointerInitialize<'info>>,

spl/src/token_2022_extensions/group_pointer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use anchor_lang::solana_program::account_info::AccountInfo;
44
use anchor_lang::solana_program::pubkey::Pubkey;
55
use anchor_lang::Result;
66
use anchor_lang::{context::CpiContext, Accounts};
7+
use spl_token_2022_interface as spl_token_2022;
78

89
pub fn group_pointer_initialize<'info>(
910
ctx: CpiContext<'_, '_, '_, 'info, GroupPointerInitialize<'info>>,

spl/src/token_2022_extensions/immutable_owner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use anchor_lang::solana_program::account_info::AccountInfo;
44
use anchor_lang::solana_program::pubkey::Pubkey;
55
use anchor_lang::Result;
66
use anchor_lang::{context::CpiContext, Accounts};
7+
use spl_token_2022_interface as spl_token_2022;
78

89
pub fn immutable_owner_initialize<'info>(
910
ctx: CpiContext<'_, '_, '_, 'info, ImmutableOwnerInitialize<'info>>,

0 commit comments

Comments
 (0)