Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 1a8dc29

Browse files
committed
add support for ConfigureAccountWithRegistry in the token-client
1 parent 3104459 commit 1a8dc29

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

Cargo.lock

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

token/client/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ solana-rpc-client = "2.0.3"
2020
solana-rpc-client-api = "2.0.3"
2121
solana-sdk = "2.0.3"
2222
spl-associated-token-account-client = { version = "1.0.0", path = "../../associated-token-account/client" }
23+
spl-elgamal-registry = { version = "0.1.0", path = "../confidential-transfer/elgamal-registry"}
2324
spl-memo = { version = "5.0", path = "../../memo/program", features = [
2425
"no-entrypoint",
2526
] }
2627
spl-record = { version = "0.2.1", path = "../../record/program", features = ["no-entrypoint"] }
2728
spl-token = { version = "6.0", path = "../program", features = [
2829
"no-entrypoint",
2930
] }
31+
spl-token-confidential-transfer-proof-extraction = { version = "0.1.0", path = "../confidential-transfer/proof-extraction" }
3032
spl-token-confidential-transfer-proof-generation = { version = "0.1.0", path = "../confidential-transfer/proof-generation" }
3133
spl-token-2022 = { version = "5.0.2", path = "../program-2022" }
3234
spl-token-group-interface = { version = "0.4.2", path = "../../token-group/interface" }

token/client/src/token.rs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ use {
4747
BaseStateWithExtensions, Extension, ExtensionType, StateWithExtensionsOwned,
4848
},
4949
instruction, offchain,
50-
proof::{zk_proof_type_to_instruction, ProofData, ProofLocation},
5150
solana_zk_sdk::{
5251
encryption::{
5352
auth_encryption::AeKey,
@@ -63,6 +62,9 @@ use {
6362
},
6463
state::{Account, AccountState, Mint, Multisig},
6564
},
65+
spl_token_confidential_transfer_proof_extraction::{
66+
zk_proof_type_to_instruction, ProofData, ProofLocation,
67+
},
6668
spl_token_confidential_transfer_proof_generation::{
6769
transfer::TransferProofData, transfer_with_fee::TransferWithFeeProofData,
6870
withdraw::WithdrawProofData,
@@ -1972,6 +1974,29 @@ where
19721974
.await
19731975
}
19741976

1977+
/// Configures confidential transfers for a token account using an ElGamal
1978+
/// registry account
1979+
pub async fn confidential_transfer_configure_token_account_with_registry(
1980+
&self,
1981+
account: &Pubkey,
1982+
elgamal_registry_account: &Pubkey,
1983+
authority: &Pubkey,
1984+
) -> TokenResult<T::Output> {
1985+
self.process_ixs::<[&dyn Signer; 0]>(
1986+
&[
1987+
confidential_transfer::instruction::configure_account_with_registry(
1988+
&self.program_id,
1989+
account,
1990+
&self.pubkey,
1991+
elgamal_registry_account,
1992+
authority,
1993+
)?,
1994+
],
1995+
&[],
1996+
)
1997+
.await
1998+
}
1999+
19752000
/// Approves a token account for confidential transfers
19762001
pub async fn confidential_transfer_approve_account<S: Signers>(
19772002
&self,

0 commit comments

Comments
 (0)