Skip to content

Commit

Permalink
solana-labs#2406: initializeTransferFeeConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrushi20 committed Apr 26, 2024
1 parent a29bfee commit 6ad8073
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/rpc-graphql/src/__tests__/__setup__.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,22 @@ export const mockTransactionToken2022AllExtensions = {
programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
stackHeight: null,
},
// Transfer Fee Instruction InitializeTransferFeeConfig
{
parsed: {
info: {
maximumFee: 5000,
mint: 'FsHcsGiY43QmZc6yTgwYC1DA5U3ZgycXxn3bd2oBjrEZ',
transferFeeBasisPoints: 50,
transferFeeConfigAuthority: '2Pwe6Yahh5cbzvCwRMtTYFeboSwYiWeHhYJzZZBsU6eB',
withdrawWithheldAuthority: '2Pwe6Yahh5cbzvCwRMtTYFeboSwYiWeHhYJzZZBsU6eB',
},
type: 'initializeTransferFeeConfig',
},
program: 'spl-token',
programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
stackHeight: null,
},
// TODO (more) ...
],
recentBlockhash: '6vRS7MoToVccMqfQecdVC6UbmARaT5mha91zhreqnce9',
Expand Down
8 changes: 8 additions & 0 deletions packages/rpc-graphql/src/resolvers/instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ export const instructionResolvers = {
delegate: resolveAccount('delegate'),
mint: resolveAccount('mint'),
},
SplTokenInitializeTransferFeeConfig: {
mint: resolveAccount('mint'),
transferFeeConfigAuthority: resolveAccount('account'),
withdrawWithheldAuthority: resolveAccount('account'),
},
SplTokenMintToCheckedInstruction: {
account: resolveAccount('account'),
authority: resolveAccount('authority'),
Expand Down Expand Up @@ -547,6 +552,9 @@ export const instructionResolvers = {
if (jsonParsedConfigs.instructionType === 'updateMetadataPointer') {
return 'SplTokenUpdateMetadataPointerInstruction';
}
if (jsonParsedConfigs.instructionType === 'initializeTransferFeeConfig') {
return 'SplTokenInitializeTransferFeeConfig';
}
}
if (jsonParsedConfigs.programName === 'stake') {
if (jsonParsedConfigs.instructionType === 'initialize') {
Expand Down
12 changes: 12 additions & 0 deletions packages/rpc-graphql/src/schema/instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,18 @@ export const instructionTypeDefs = /* GraphQL */ `
mint: Account
}
"""
SplToken-2022: InitializeTransferFeeConfig instruction
"""
type SplTokenInitializeTransferFeeConfig implements TransactionInstruction {
programId: Address
mint: Account
transferFeeBasisPoints: Int
transferFeeConfigAuthority: Account
withdrawWithheldAuthority: Account
maximumFee: Int
}
# TODO: Extensions!
# ...
Expand Down

0 comments on commit 6ad8073

Please sign in to comment.