diff --git a/clients/js/src/generated/instructions/index.ts b/clients/js/src/generated/instructions/index.ts index c6cf1c0..6543bef 100644 --- a/clients/js/src/generated/instructions/index.ts +++ b/clients/js/src/generated/instructions/index.ts @@ -36,6 +36,7 @@ export * from './initializeAccount2'; export * from './initializeAccount3'; export * from './initializeConfidentialTransferMint'; export * from './initializeDefaultAccountState'; +export * from './initializeGroupPointer'; export * from './initializeImmutableOwner'; export * from './initializeMetadataPointer'; export * from './initializeMint'; @@ -59,6 +60,7 @@ export * from './transferCheckedWithFee'; export * from './uiAmountToAmount'; export * from './updateConfidentialTransferMint'; export * from './updateDefaultAccountState'; +export * from './updateGroupPointer'; export * from './updateMetadataPointer'; export * from './withdrawWithheldTokensFromAccounts'; export * from './withdrawWithheldTokensFromMint'; diff --git a/clients/js/src/generated/instructions/initializeGroupPointer.ts b/clients/js/src/generated/instructions/initializeGroupPointer.ts new file mode 100644 index 0000000..b14aef5 --- /dev/null +++ b/clients/js/src/generated/instructions/initializeGroupPointer.ts @@ -0,0 +1,221 @@ +/** + * This code was AUTOGENERATED using the codama library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun codama to update it. + * + * @see https://github.com/codama-idl/codama + */ + +import { + combineCodec, + getAddressDecoder, + getAddressEncoder, + getOptionDecoder, + getOptionEncoder, + getStructDecoder, + getStructEncoder, + getU8Decoder, + getU8Encoder, + transformEncoder, + type Address, + type Codec, + type Decoder, + type Encoder, + type IAccountMeta, + type IInstruction, + type IInstructionWithAccounts, + type IInstructionWithData, + type Option, + type OptionOrNullable, + type WritableAccount, +} from '@solana/web3.js'; +import { TOKEN_2022_PROGRAM_ADDRESS } from '../programs'; +import { getAccountMetaFactory, type ResolvedAccount } from '../shared'; + +export const INITIALIZE_GROUP_POINTER_DISCRIMINATOR = 40; + +export function getInitializeGroupPointerDiscriminatorBytes() { + return getU8Encoder().encode(INITIALIZE_GROUP_POINTER_DISCRIMINATOR); +} + +export const INITIALIZE_GROUP_POINTER_GROUP_POINTER_DISCRIMINATOR = 0; + +export function getInitializeGroupPointerGroupPointerDiscriminatorBytes() { + return getU8Encoder().encode( + INITIALIZE_GROUP_POINTER_GROUP_POINTER_DISCRIMINATOR + ); +} + +export type InitializeGroupPointerInstruction< + TProgram extends string = typeof TOKEN_2022_PROGRAM_ADDRESS, + TAccountMint extends string | IAccountMeta = string, + TRemainingAccounts extends readonly IAccountMeta[] = [], +> = IInstruction & + IInstructionWithData & + IInstructionWithAccounts< + [ + TAccountMint extends string + ? WritableAccount + : TAccountMint, + ...TRemainingAccounts, + ] + >; + +export type InitializeGroupPointerInstructionData = { + discriminator: number; + groupPointerDiscriminator: number; + /** The public key for the account that can update the group address. */ + authority: Option
; + /** The account address that holds the group. */ + groupAddress: Option
; +}; + +export type InitializeGroupPointerInstructionDataArgs = { + /** The public key for the account that can update the group address. */ + authority: OptionOrNullable
; + /** The account address that holds the group. */ + groupAddress: OptionOrNullable
; +}; + +export function getInitializeGroupPointerInstructionDataEncoder(): Encoder { + return transformEncoder( + getStructEncoder([ + ['discriminator', getU8Encoder()], + ['groupPointerDiscriminator', getU8Encoder()], + [ + 'authority', + getOptionEncoder(getAddressEncoder(), { + prefix: null, + noneValue: 'zeroes', + }), + ], + [ + 'groupAddress', + getOptionEncoder(getAddressEncoder(), { + prefix: null, + noneValue: 'zeroes', + }), + ], + ]), + (value) => ({ + ...value, + discriminator: INITIALIZE_GROUP_POINTER_DISCRIMINATOR, + groupPointerDiscriminator: + INITIALIZE_GROUP_POINTER_GROUP_POINTER_DISCRIMINATOR, + }) + ); +} + +export function getInitializeGroupPointerInstructionDataDecoder(): Decoder { + return getStructDecoder([ + ['discriminator', getU8Decoder()], + ['groupPointerDiscriminator', getU8Decoder()], + [ + 'authority', + getOptionDecoder(getAddressDecoder(), { + prefix: null, + noneValue: 'zeroes', + }), + ], + [ + 'groupAddress', + getOptionDecoder(getAddressDecoder(), { + prefix: null, + noneValue: 'zeroes', + }), + ], + ]); +} + +export function getInitializeGroupPointerInstructionDataCodec(): Codec< + InitializeGroupPointerInstructionDataArgs, + InitializeGroupPointerInstructionData +> { + return combineCodec( + getInitializeGroupPointerInstructionDataEncoder(), + getInitializeGroupPointerInstructionDataDecoder() + ); +} + +export type InitializeGroupPointerInput = + { + /** The mint to initialize. */ + mint: Address; + authority: InitializeGroupPointerInstructionDataArgs['authority']; + groupAddress: InitializeGroupPointerInstructionDataArgs['groupAddress']; + }; + +export function getInitializeGroupPointerInstruction< + TAccountMint extends string, + TProgramAddress extends Address = typeof TOKEN_2022_PROGRAM_ADDRESS, +>( + input: InitializeGroupPointerInput, + config?: { programAddress?: TProgramAddress } +): InitializeGroupPointerInstruction { + // Program address. + const programAddress = config?.programAddress ?? TOKEN_2022_PROGRAM_ADDRESS; + + // Original accounts. + const originalAccounts = { + mint: { value: input.mint ?? null, isWritable: true }, + }; + const accounts = originalAccounts as Record< + keyof typeof originalAccounts, + ResolvedAccount + >; + + // Original args. + const args = { ...input }; + + const getAccountMeta = getAccountMetaFactory(programAddress, 'programId'); + const instruction = { + accounts: [getAccountMeta(accounts.mint)], + programAddress, + data: getInitializeGroupPointerInstructionDataEncoder().encode( + args as InitializeGroupPointerInstructionDataArgs + ), + } as InitializeGroupPointerInstruction; + + return instruction; +} + +export type ParsedInitializeGroupPointerInstruction< + TProgram extends string = typeof TOKEN_2022_PROGRAM_ADDRESS, + TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[], +> = { + programAddress: Address; + accounts: { + /** The mint to initialize. */ + mint: TAccountMetas[0]; + }; + data: InitializeGroupPointerInstructionData; +}; + +export function parseInitializeGroupPointerInstruction< + TProgram extends string, + TAccountMetas extends readonly IAccountMeta[], +>( + instruction: IInstruction & + IInstructionWithAccounts & + IInstructionWithData +): ParsedInitializeGroupPointerInstruction { + if (instruction.accounts.length < 1) { + // TODO: Coded error. + throw new Error('Not enough accounts'); + } + let accountIndex = 0; + const getNextAccount = () => { + const accountMeta = instruction.accounts![accountIndex]!; + accountIndex += 1; + return accountMeta; + }; + return { + programAddress: instruction.programAddress, + accounts: { + mint: getNextAccount(), + }, + data: getInitializeGroupPointerInstructionDataDecoder().decode( + instruction.data + ), + }; +} diff --git a/clients/js/src/generated/instructions/updateGroupPointer.ts b/clients/js/src/generated/instructions/updateGroupPointer.ts new file mode 100644 index 0000000..2aaecac --- /dev/null +++ b/clients/js/src/generated/instructions/updateGroupPointer.ts @@ -0,0 +1,253 @@ +/** + * This code was AUTOGENERATED using the codama library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun codama to update it. + * + * @see https://github.com/codama-idl/codama + */ + +import { + AccountRole, + combineCodec, + getAddressDecoder, + getAddressEncoder, + getOptionDecoder, + getOptionEncoder, + getStructDecoder, + getStructEncoder, + getU8Decoder, + getU8Encoder, + transformEncoder, + type Address, + type Codec, + type Decoder, + type Encoder, + type IAccountMeta, + type IAccountSignerMeta, + type IInstruction, + type IInstructionWithAccounts, + type IInstructionWithData, + type Option, + type OptionOrNullable, + type ReadonlyAccount, + type ReadonlySignerAccount, + type TransactionSigner, + type WritableAccount, +} from '@solana/web3.js'; +import { TOKEN_2022_PROGRAM_ADDRESS } from '../programs'; +import { getAccountMetaFactory, type ResolvedAccount } from '../shared'; + +export const UPDATE_GROUP_POINTER_DISCRIMINATOR = 40; + +export function getUpdateGroupPointerDiscriminatorBytes() { + return getU8Encoder().encode(UPDATE_GROUP_POINTER_DISCRIMINATOR); +} + +export const UPDATE_GROUP_POINTER_GROUP_POINTER_DISCRIMINATOR = 1; + +export function getUpdateGroupPointerGroupPointerDiscriminatorBytes() { + return getU8Encoder().encode( + UPDATE_GROUP_POINTER_GROUP_POINTER_DISCRIMINATOR + ); +} + +export type UpdateGroupPointerInstruction< + TProgram extends string = typeof TOKEN_2022_PROGRAM_ADDRESS, + TAccountMint extends string | IAccountMeta = string, + TAccountGroupPointerAuthority extends string | IAccountMeta = string, + TRemainingAccounts extends readonly IAccountMeta[] = [], +> = IInstruction & + IInstructionWithData & + IInstructionWithAccounts< + [ + TAccountMint extends string + ? WritableAccount + : TAccountMint, + TAccountGroupPointerAuthority extends string + ? ReadonlyAccount + : TAccountGroupPointerAuthority, + ...TRemainingAccounts, + ] + >; + +export type UpdateGroupPointerInstructionData = { + discriminator: number; + groupPointerDiscriminator: number; + /** The new account address that holds the group configurations. */ + groupAddress: Option
; +}; + +export type UpdateGroupPointerInstructionDataArgs = { + /** The new account address that holds the group configurations. */ + groupAddress: OptionOrNullable
; +}; + +export function getUpdateGroupPointerInstructionDataEncoder(): Encoder { + return transformEncoder( + getStructEncoder([ + ['discriminator', getU8Encoder()], + ['groupPointerDiscriminator', getU8Encoder()], + [ + 'groupAddress', + getOptionEncoder(getAddressEncoder(), { + prefix: null, + noneValue: 'zeroes', + }), + ], + ]), + (value) => ({ + ...value, + discriminator: UPDATE_GROUP_POINTER_DISCRIMINATOR, + groupPointerDiscriminator: + UPDATE_GROUP_POINTER_GROUP_POINTER_DISCRIMINATOR, + }) + ); +} + +export function getUpdateGroupPointerInstructionDataDecoder(): Decoder { + return getStructDecoder([ + ['discriminator', getU8Decoder()], + ['groupPointerDiscriminator', getU8Decoder()], + [ + 'groupAddress', + getOptionDecoder(getAddressDecoder(), { + prefix: null, + noneValue: 'zeroes', + }), + ], + ]); +} + +export function getUpdateGroupPointerInstructionDataCodec(): Codec< + UpdateGroupPointerInstructionDataArgs, + UpdateGroupPointerInstructionData +> { + return combineCodec( + getUpdateGroupPointerInstructionDataEncoder(), + getUpdateGroupPointerInstructionDataDecoder() + ); +} + +export type UpdateGroupPointerInput< + TAccountMint extends string = string, + TAccountGroupPointerAuthority extends string = string, +> = { + /** The mint to initialize. */ + mint: Address; + /** The group pointer authority or its multisignature account. */ + groupPointerAuthority: + | Address + | TransactionSigner; + groupAddress: UpdateGroupPointerInstructionDataArgs['groupAddress']; + multiSigners?: Array; +}; + +export function getUpdateGroupPointerInstruction< + TAccountMint extends string, + TAccountGroupPointerAuthority extends string, + TProgramAddress extends Address = typeof TOKEN_2022_PROGRAM_ADDRESS, +>( + input: UpdateGroupPointerInput, + config?: { programAddress?: TProgramAddress } +): UpdateGroupPointerInstruction< + TProgramAddress, + TAccountMint, + (typeof input)['groupPointerAuthority'] extends TransactionSigner + ? ReadonlySignerAccount & + IAccountSignerMeta + : TAccountGroupPointerAuthority +> { + // Program address. + const programAddress = config?.programAddress ?? TOKEN_2022_PROGRAM_ADDRESS; + + // Original accounts. + const originalAccounts = { + mint: { value: input.mint ?? null, isWritable: true }, + groupPointerAuthority: { + value: input.groupPointerAuthority ?? null, + isWritable: false, + }, + }; + const accounts = originalAccounts as Record< + keyof typeof originalAccounts, + ResolvedAccount + >; + + // Original args. + const args = { ...input }; + + // Remaining accounts. + const remainingAccounts: IAccountMeta[] = (args.multiSigners ?? []).map( + (signer) => ({ + address: signer.address, + role: AccountRole.READONLY_SIGNER, + signer, + }) + ); + + const getAccountMeta = getAccountMetaFactory(programAddress, 'programId'); + const instruction = { + accounts: [ + getAccountMeta(accounts.mint), + getAccountMeta(accounts.groupPointerAuthority), + ...remainingAccounts, + ], + programAddress, + data: getUpdateGroupPointerInstructionDataEncoder().encode( + args as UpdateGroupPointerInstructionDataArgs + ), + } as UpdateGroupPointerInstruction< + TProgramAddress, + TAccountMint, + (typeof input)['groupPointerAuthority'] extends TransactionSigner + ? ReadonlySignerAccount & + IAccountSignerMeta + : TAccountGroupPointerAuthority + >; + + return instruction; +} + +export type ParsedUpdateGroupPointerInstruction< + TProgram extends string = typeof TOKEN_2022_PROGRAM_ADDRESS, + TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[], +> = { + programAddress: Address; + accounts: { + /** The mint to initialize. */ + mint: TAccountMetas[0]; + /** The group pointer authority or its multisignature account. */ + groupPointerAuthority: TAccountMetas[1]; + }; + data: UpdateGroupPointerInstructionData; +}; + +export function parseUpdateGroupPointerInstruction< + TProgram extends string, + TAccountMetas extends readonly IAccountMeta[], +>( + instruction: IInstruction & + IInstructionWithAccounts & + IInstructionWithData +): ParsedUpdateGroupPointerInstruction { + if (instruction.accounts.length < 2) { + // TODO: Coded error. + throw new Error('Not enough accounts'); + } + let accountIndex = 0; + const getNextAccount = () => { + const accountMeta = instruction.accounts![accountIndex]!; + accountIndex += 1; + return accountMeta; + }; + return { + programAddress: instruction.programAddress, + accounts: { + mint: getNextAccount(), + groupPointerAuthority: getNextAccount(), + }, + data: getUpdateGroupPointerInstructionDataDecoder().decode( + instruction.data + ), + }; +} diff --git a/clients/js/src/generated/instructions/updateMetadataPointer.ts b/clients/js/src/generated/instructions/updateMetadataPointer.ts index 69a5fa2..2c6053d 100644 --- a/clients/js/src/generated/instructions/updateMetadataPointer.ts +++ b/clients/js/src/generated/instructions/updateMetadataPointer.ts @@ -136,7 +136,7 @@ export type UpdateMetadataPointerInput< > = { /** The mint to initialize. */ mint: Address; - /** The account's owner or its multisignature account. */ + /** The metadata pointer authority or its multisignature account. */ metadataPointerAuthority: | Address | TransactionSigner; @@ -221,7 +221,7 @@ export type ParsedUpdateMetadataPointerInstruction< accounts: { /** The mint to initialize. */ mint: TAccountMetas[0]; - /** The account's owner or its multisignature account. */ + /** The metadata pointer authority or its multisignature account. */ metadataPointerAuthority: TAccountMetas[1]; }; data: UpdateMetadataPointerInstructionData; diff --git a/clients/js/src/generated/programs/token2022.ts b/clients/js/src/generated/programs/token2022.ts index 222bcba..6872076 100644 --- a/clients/js/src/generated/programs/token2022.ts +++ b/clients/js/src/generated/programs/token2022.ts @@ -41,6 +41,7 @@ import { type ParsedInitializeAccountInstruction, type ParsedInitializeConfidentialTransferMintInstruction, type ParsedInitializeDefaultAccountStateInstruction, + type ParsedInitializeGroupPointerInstruction, type ParsedInitializeImmutableOwnerInstruction, type ParsedInitializeMetadataPointerInstruction, type ParsedInitializeMint2Instruction, @@ -63,6 +64,7 @@ import { type ParsedUiAmountToAmountInstruction, type ParsedUpdateConfidentialTransferMintInstruction, type ParsedUpdateDefaultAccountStateInstruction, + type ParsedUpdateGroupPointerInstruction, type ParsedUpdateMetadataPointerInstruction, type ParsedWithdrawWithheldTokensFromAccountsInstruction, type ParsedWithdrawWithheldTokensFromMintInstruction, @@ -149,6 +151,8 @@ export enum Token2022Instruction { DisableMemoTransfers, InitializeMetadataPointer, UpdateMetadataPointer, + InitializeGroupPointer, + UpdateGroupPointer, } export function identifyToken2022Instruction( @@ -392,6 +396,18 @@ export function identifyToken2022Instruction( ) { return Token2022Instruction.UpdateMetadataPointer; } + if ( + containsBytes(data, getU8Encoder().encode(40), 0) && + containsBytes(data, getU8Encoder().encode(0), 1) + ) { + return Token2022Instruction.InitializeGroupPointer; + } + if ( + containsBytes(data, getU8Encoder().encode(40), 0) && + containsBytes(data, getU8Encoder().encode(1), 1) + ) { + return Token2022Instruction.UpdateGroupPointer; + } throw new Error( 'The provided instruction could not be identified as a token-2022 instruction.' ); @@ -558,4 +574,10 @@ export type ParsedToken2022Instruction< } & ParsedInitializeMetadataPointerInstruction) | ({ instructionType: Token2022Instruction.UpdateMetadataPointer; - } & ParsedUpdateMetadataPointerInstruction); + } & ParsedUpdateMetadataPointerInstruction) + | ({ + instructionType: Token2022Instruction.InitializeGroupPointer; + } & ParsedInitializeGroupPointerInstruction) + | ({ + instructionType: Token2022Instruction.UpdateGroupPointer; + } & ParsedUpdateGroupPointerInstruction); diff --git a/clients/js/src/getInitializeInstructionsForExtensions.ts b/clients/js/src/getInitializeInstructionsForExtensions.ts index 21fd045..1b5d9f5 100644 --- a/clients/js/src/getInitializeInstructionsForExtensions.ts +++ b/clients/js/src/getInitializeInstructionsForExtensions.ts @@ -5,6 +5,7 @@ import { getEnableMemoTransfersInstruction, getInitializeConfidentialTransferMintInstruction, getInitializeDefaultAccountStateInstruction, + getInitializeGroupPointerInstruction, getInitializeMetadataPointerInstruction, getInitializeTransferFeeConfigInstruction, } from './generated'; @@ -53,6 +54,14 @@ export function getPreInitializeInstructionsForMintExtensions( metadataAddress: extension.metadataAddress, }), ]; + case 'GroupPointer': + return [ + getInitializeGroupPointerInstruction({ + mint, + authority: extension.authority, + groupAddress: extension.groupAddress, + }), + ]; default: return []; } diff --git a/clients/js/test/extensions/groupPointer/initializeGroupPointer.test.ts b/clients/js/test/extensions/groupPointer/initializeGroupPointer.test.ts new file mode 100644 index 0000000..7ea16a4 --- /dev/null +++ b/clients/js/test/extensions/groupPointer/initializeGroupPointer.test.ts @@ -0,0 +1,59 @@ +import { Account, generateKeyPairSigner, some } from '@solana/web3.js'; +import test from 'ava'; +import { + Mint, + extension, + fetchMint, + getInitializeGroupPointerInstruction, +} from '../../../src'; +import { + createDefaultSolanaClient, + generateKeyPairSignerWithSol, + getCreateMintInstructions, + sendAndConfirmInstructions, +} from '../../_setup'; + +test('it initializes a mint account with a group pointer extension', async (t) => { + // Given some signer accounts. + const client = createDefaultSolanaClient(); + const [authority, mint, group, groupPointerAuthority] = await Promise.all([ + generateKeyPairSignerWithSol(client), + generateKeyPairSigner(), + generateKeyPairSigner(), + generateKeyPairSigner(), + ]); + + // And a group pointer extension. + const groupPointerExtension = extension('GroupPointer', { + authority: some(groupPointerAuthority.address), + groupAddress: some(group.address), + }); + + // When we create and initialize a mint account with this extension. + const [createMintInstruction, initMintInstruction] = + await getCreateMintInstructions({ + authority: authority.address, + client, + extensions: [groupPointerExtension], + mint, + payer: authority, + }); + await sendAndConfirmInstructions(client, authority, [ + createMintInstruction, + getInitializeGroupPointerInstruction({ + mint: mint.address, + authority: groupPointerExtension.authority, + groupAddress: groupPointerExtension.groupAddress, + }), + initMintInstruction, + ]); + + // Then we expect the mint account to exist and have the following extension. + const mintAccount = await fetchMint(client.rpc, mint.address); + t.like(mintAccount, >{ + address: mint.address, + data: { + extensions: some([groupPointerExtension]), + }, + }); +}); diff --git a/clients/js/test/extensions/groupPointer/updateGroupPointer.test.ts b/clients/js/test/extensions/groupPointer/updateGroupPointer.test.ts new file mode 100644 index 0000000..b6e0483 --- /dev/null +++ b/clients/js/test/extensions/groupPointer/updateGroupPointer.test.ts @@ -0,0 +1,61 @@ +import { Account, address, generateKeyPairSigner, some } from '@solana/web3.js'; +import test from 'ava'; +import { + Mint, + extension, + fetchMint, + getUpdateGroupPointerInstruction, +} from '../../../src'; +import { + createDefaultSolanaClient, + createMint, + generateKeyPairSignerWithSol, + sendAndConfirmInstructions, +} from '../../_setup'; + +test('it updates the group pointer extension on a mint account', async (t) => { + // Given some signer accounts. + const client = createDefaultSolanaClient(); + const [authority, groupPointerAuthority] = await Promise.all([ + generateKeyPairSignerWithSol(client), + generateKeyPairSigner(), + ]); + const oldGroup = address('8dtp4b6tB8EhLpSG1jgg4swSQtUKRst2f7rJYSwE2Me3'); + const newGroup = address('88F35KbnWKPeMnKFJDxZVjvEWmGms1FxW6wP52VABCVt'); + + // And a mint account initialized with a group pointer extension. + const mint = await createMint({ + authority: authority.address, + client, + extensions: [ + extension('GroupPointer', { + authority: groupPointerAuthority.address, + groupAddress: oldGroup, + }), + ], + payer: authority, + }); + + // When we update the group pointer on the mint account. + await sendAndConfirmInstructions(client, authority, [ + getUpdateGroupPointerInstruction({ + mint, + groupPointerAuthority, + groupAddress: newGroup, + }), + ]); + + // Then we expect the mint account to have the following updated data. + const mintAccount = await fetchMint(client.rpc, mint); + t.like(mintAccount, >{ + address: mint, + data: { + extensions: some([ + extension('GroupPointer', { + authority: some(groupPointerAuthority.address), + groupAddress: some(newGroup), + }), + ]), + }, + }); +}); diff --git a/program/idl.json b/program/idl.json index d45e5bd..74bddf6 100644 --- a/program/idl.json +++ b/program/idl.json @@ -5461,7 +5461,9 @@ "isWritable": false, "isSigner": "either", "isOptional": false, - "docs": ["The account's owner or its multisignature account."] + "docs": [ + "The metadata pointer authority or its multisignature account." + ] } ], "arguments": [ @@ -5531,6 +5533,197 @@ "offset": 1 } ] + }, + { + "kind": "instructionNode", + "name": "initializeGroupPointer", + "docs": [ + "Initialize a new mint with a group pointer", + "", + "Fails if the mint has already been initialized, so must be called before", + "`InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82", + "bytes), plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 40 + } + }, + { + "kind": "instructionArgumentNode", + "name": "groupPointerDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authority", + "docs": [ + "The public key for the account that can update the group address." + ], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "groupAddress", + "docs": ["The account address that holds the group."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "groupPointerDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateGroupPointer", + "docs": [ + "Update the group pointer address. Only supported for mints that", + "include the `GroupPointer` extension." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "groupPointerAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": [ + "The group pointer authority or its multisignature account." + ] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 40 + } + }, + { + "kind": "instructionArgumentNode", + "name": "groupPointerDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "groupAddress", + "docs": [ + "The new account address that holds the group configurations." + ], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "groupPointerDiscriminator", + "offset": 1 + } + ] } ], "definedTypes": [