diff --git a/packages/rpc-graphql/src/__tests__/__setup__.ts b/packages/rpc-graphql/src/__tests__/__setup__.ts index 2474d72e1beb..bf2ca9df7c11 100644 --- a/packages/rpc-graphql/src/__tests__/__setup__.ts +++ b/packages/rpc-graphql/src/__tests__/__setup__.ts @@ -2571,6 +2571,21 @@ export const mockTransactionToken2022AllExtensions = { programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', stackHeight: null, }, + { + parsed: { + info: { + authority: 'FsHcsGiY43QmZc6yTgwYC1DA5U3ZgycXxn3bd2oBjrEZ', + withdrawWithheldAuthorityElgamalPubkey: null, + harvestToMintEnabled: true, + withheldAmount: '57fZKMs9YqFhu6fENwKTe7mGZh+wJbIvYkQ3LI/FDnOdc2w7', + mint: '2Pwe6Yahh5cbzvCwRMtTYFeboSwYiWeHhYJzZZBsU6eB', + }, + type: 'initializeConfidentialTransferFeeConfig', + }, + program: 'spl-token', + programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', + stackHeight: null, + }, // TODO (more) ... ], recentBlockhash: '6vRS7MoToVccMqfQecdVC6UbmARaT5mha91zhreqnce9', diff --git a/packages/rpc-graphql/src/__tests__/transaction-tests.ts b/packages/rpc-graphql/src/__tests__/transaction-tests.ts index 3ef61b4f9cc1..0f0d7fa846fe 100644 --- a/packages/rpc-graphql/src/__tests__/transaction-tests.ts +++ b/packages/rpc-graphql/src/__tests__/transaction-tests.ts @@ -3285,6 +3285,55 @@ describe('transaction', () => { }, }); }); + + it('initialize-confidential-transfer-fee-config', async () => { + expect.assertions(1); + const source = /* GraphQL */ ` + query testQuery($signature: Signature!) { + transaction(signature: $signature) { + message { + instructions { + programId + ... on SplTokenInitializeConfidentialTransferFeeConfig { + authority { + address + } + harvestToMintEnabled + mint { + address + } + withdrawWithheldAuthorityElgamalPubkey + withheldAmount + } + } + } + } + } + `; + const result = await rpcGraphQL.query(source, { signature }); + expect(result).toMatchObject({ + data: { + transaction: { + message: { + instructions: expect.arrayContaining([ + { + authority: { + address: expect.any(String), + }, + harvestToMintEnabled: expect.any(Boolean), + mint: { + address: expect.any(String), + }, + programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', + withdrawWithheldAuthorityElgamalPubkey: null, + withheldAmount: expect.any(String), + }, + ]), + }, + }, + }, + }); + }); }); }); }); diff --git a/packages/rpc-graphql/src/resolvers/instruction.ts b/packages/rpc-graphql/src/resolvers/instruction.ts index 3170b0599ddf..cb7296817f4c 100644 --- a/packages/rpc-graphql/src/resolvers/instruction.ts +++ b/packages/rpc-graphql/src/resolvers/instruction.ts @@ -313,6 +313,10 @@ export const instructionResolvers = { owner: resolveAccount('owner'), rentSysvar: resolveAccount('rentSysvar'), }, + SplTokenInitializeConfidentialTransferFeeConfig: { + authority: resolveAccount('authority'), + mint: resolveAccount('mint'), + }, SplTokenInitializeConfidentialTransferMint: { authority: resolveAccount('authority'), mint: resolveAccount('mint'), @@ -875,6 +879,9 @@ export const instructionResolvers = { if (jsonParsedConfigs.instructionType === 'disableConfidentialTransferFeeHarvestToMint') { return 'SplTokenDisableConfidentialTransferFeeHarvestToMint'; } + if (jsonParsedConfigs.instructionType === 'initializeConfidentialTransferFeeConfig') { + return 'SplTokenInitializeConfidentialTransferFeeConfig'; + } } if (jsonParsedConfigs.programName === 'stake') { if (jsonParsedConfigs.instructionType === 'initialize') { diff --git a/packages/rpc-graphql/src/schema/instruction.ts b/packages/rpc-graphql/src/schema/instruction.ts index 8379e1673f19..8d1a60cf0dd0 100644 --- a/packages/rpc-graphql/src/schema/instruction.ts +++ b/packages/rpc-graphql/src/schema/instruction.ts @@ -1002,6 +1002,18 @@ export const instructionTypeDefs = /* GraphQL */ ` signers: Address } + """ + SplToken-2022: InitializeConfidentialTransferFeeConfig instruction + """ + type SplTokenInitializeConfidentialTransferFeeConfig implements TransactionInstruction { + programId: Address + authority: Account + harvestToMintEnabled: Boolean + mint: Account + withdrawWithheldAuthorityElgamalPubkey: Address + withheldAmount: String + } + type Lockup { custodian: Account epoch: Epoch