@macalinao/clients-mpl-bubblegum 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/accounts/index.d.ts +2 -1
- package/dist/generated/accounts/treeConfig.d.ts +22 -7
- package/dist/generated/accounts/treeConfig.d.ts.map +1 -1
- package/dist/generated/accounts/treeConfig.js +7 -0
- package/dist/generated/accounts/treeConfig.js.map +1 -1
- package/dist/generated/accounts/voucher.d.ts +14 -7
- package/dist/generated/accounts/voucher.d.ts.map +1 -1
- package/dist/generated/accounts/voucher.js +7 -0
- package/dist/generated/accounts/voucher.js.map +1 -1
- package/dist/generated/errors/bubblegum.d.ts +0 -1
- package/dist/generated/errors/bubblegum.d.ts.map +1 -1
- package/dist/generated/errors/bubblegum.js +66 -59
- package/dist/generated/errors/bubblegum.js.map +1 -1
- package/dist/generated/errors/index.d.ts +2 -1
- package/dist/generated/index.d.ts +8 -1
- package/dist/generated/instructions/burn.d.ts +141 -17
- package/dist/generated/instructions/burn.d.ts.map +1 -1
- package/dist/generated/instructions/burn.js +23 -0
- package/dist/generated/instructions/burn.js.map +1 -1
- package/dist/generated/instructions/burnV2.d.ts +179 -31
- package/dist/generated/instructions/burnV2.d.ts.map +1 -1
- package/dist/generated/instructions/burnV2.js +21 -0
- package/dist/generated/instructions/burnV2.js.map +1 -1
- package/dist/generated/instructions/cancelRedeem.d.ts +99 -13
- package/dist/generated/instructions/cancelRedeem.d.ts.map +1 -1
- package/dist/generated/instructions/cancelRedeem.js +19 -0
- package/dist/generated/instructions/cancelRedeem.js.map +1 -1
- package/dist/generated/instructions/closeTreeV2.d.ts +85 -19
- package/dist/generated/instructions/closeTreeV2.d.ts.map +1 -1
- package/dist/generated/instructions/closeTreeV2.js +21 -0
- package/dist/generated/instructions/closeTreeV2.js.map +1 -1
- package/dist/generated/instructions/collectV2.d.ts +20 -7
- package/dist/generated/instructions/collectV2.d.ts.map +1 -1
- package/dist/generated/instructions/collectV2.js +10 -0
- package/dist/generated/instructions/collectV2.js.map +1 -1
- package/dist/generated/instructions/compress.d.ts +119 -9
- package/dist/generated/instructions/compress.d.ts.map +1 -1
- package/dist/generated/instructions/compress.js +21 -0
- package/dist/generated/instructions/compress.js.map +1 -1
- package/dist/generated/instructions/createTree.d.ts +117 -11
- package/dist/generated/instructions/createTree.d.ts.map +1 -1
- package/dist/generated/instructions/createTree.js +23 -0
- package/dist/generated/instructions/createTree.js.map +1 -1
- package/dist/generated/instructions/createTreeV2.d.ts +109 -14
- package/dist/generated/instructions/createTreeV2.d.ts.map +1 -1
- package/dist/generated/instructions/createTreeV2.js +23 -0
- package/dist/generated/instructions/createTreeV2.js.map +1 -1
- package/dist/generated/instructions/decompressV1.d.ts +106 -11
- package/dist/generated/instructions/decompressV1.d.ts.map +1 -1
- package/dist/generated/instructions/decompressV1.js +25 -0
- package/dist/generated/instructions/decompressV1.js.map +1 -1
- package/dist/generated/instructions/delegate.d.ts +140 -17
- package/dist/generated/instructions/delegate.d.ts.map +1 -1
- package/dist/generated/instructions/delegate.js +19 -0
- package/dist/generated/instructions/delegate.js.map +1 -1
- package/dist/generated/instructions/delegateAndFreezeV2.d.ts +171 -27
- package/dist/generated/instructions/delegateAndFreezeV2.d.ts.map +1 -1
- package/dist/generated/instructions/delegateAndFreezeV2.js +17 -0
- package/dist/generated/instructions/delegateAndFreezeV2.js.map +1 -1
- package/dist/generated/instructions/delegateV2.d.ts +169 -27
- package/dist/generated/instructions/delegateV2.d.ts.map +1 -1
- package/dist/generated/instructions/delegateV2.js +15 -0
- package/dist/generated/instructions/delegateV2.js.map +1 -1
- package/dist/generated/instructions/freezeV2.d.ts +174 -28
- package/dist/generated/instructions/freezeV2.d.ts.map +1 -1
- package/dist/generated/instructions/freezeV2.js +23 -0
- package/dist/generated/instructions/freezeV2.js.map +1 -1
- package/dist/generated/instructions/index.d.ts +2 -1
- package/dist/generated/instructions/mintToCollectionV1.d.ts +171 -20
- package/dist/generated/instructions/mintToCollectionV1.d.ts.map +1 -1
- package/dist/generated/instructions/mintToCollectionV1.js +23 -0
- package/dist/generated/instructions/mintToCollectionV1.js.map +1 -1
- package/dist/generated/instructions/mintV1.d.ts +109 -11
- package/dist/generated/instructions/mintV1.d.ts.map +1 -1
- package/dist/generated/instructions/mintV1.js +21 -0
- package/dist/generated/instructions/mintV1.js.map +1 -1
- package/dist/generated/instructions/mintV2.d.ts +163 -17
- package/dist/generated/instructions/mintV2.d.ts.map +1 -1
- package/dist/generated/instructions/mintV2.js +45 -0
- package/dist/generated/instructions/mintV2.js.map +1 -1
- package/dist/generated/instructions/redeem.d.ts +153 -17
- package/dist/generated/instructions/redeem.d.ts.map +1 -1
- package/dist/generated/instructions/redeem.js +23 -0
- package/dist/generated/instructions/redeem.js.map +1 -1
- package/dist/generated/instructions/setAndVerifyCollection.d.ts +222 -38
- package/dist/generated/instructions/setAndVerifyCollection.d.ts.map +1 -1
- package/dist/generated/instructions/setAndVerifyCollection.js +21 -0
- package/dist/generated/instructions/setAndVerifyCollection.js.map +1 -1
- package/dist/generated/instructions/setCollectionV2.d.ts +186 -39
- package/dist/generated/instructions/setCollectionV2.d.ts.map +1 -1
- package/dist/generated/instructions/setCollectionV2.js +21 -0
- package/dist/generated/instructions/setCollectionV2.js.map +1 -1
- package/dist/generated/instructions/setDecompressableState.d.ts +40 -9
- package/dist/generated/instructions/setDecompressableState.d.ts.map +1 -1
- package/dist/generated/instructions/setDecompressableState.js +13 -0
- package/dist/generated/instructions/setDecompressableState.js.map +1 -1
- package/dist/generated/instructions/setDecompressibleState.d.ts +41 -9
- package/dist/generated/instructions/setDecompressibleState.d.ts.map +1 -1
- package/dist/generated/instructions/setDecompressibleState.js +14 -0
- package/dist/generated/instructions/setDecompressibleState.js.map +1 -1
- package/dist/generated/instructions/setNonTransferableV2.d.ts +166 -31
- package/dist/generated/instructions/setNonTransferableV2.d.ts.map +1 -1
- package/dist/generated/instructions/setNonTransferableV2.js +23 -0
- package/dist/generated/instructions/setNonTransferableV2.js.map +1 -1
- package/dist/generated/instructions/setTreeDelegate.d.ts +65 -9
- package/dist/generated/instructions/setTreeDelegate.d.ts.map +1 -1
- package/dist/generated/instructions/setTreeDelegate.js +21 -0
- package/dist/generated/instructions/setTreeDelegate.js.map +1 -1
- package/dist/generated/instructions/thawAndRevokeV2.d.ts +158 -24
- package/dist/generated/instructions/thawAndRevokeV2.d.ts.map +1 -1
- package/dist/generated/instructions/thawAndRevokeV2.js +17 -0
- package/dist/generated/instructions/thawAndRevokeV2.js.map +1 -1
- package/dist/generated/instructions/thawV2.d.ts +166 -28
- package/dist/generated/instructions/thawV2.d.ts.map +1 -1
- package/dist/generated/instructions/thawV2.js +15 -0
- package/dist/generated/instructions/thawV2.js.map +1 -1
- package/dist/generated/instructions/transfer.d.ts +140 -17
- package/dist/generated/instructions/transfer.d.ts.map +1 -1
- package/dist/generated/instructions/transfer.js +19 -0
- package/dist/generated/instructions/transfer.js.map +1 -1
- package/dist/generated/instructions/transferV2.d.ts +167 -31
- package/dist/generated/instructions/transferV2.d.ts.map +1 -1
- package/dist/generated/instructions/transferV2.js +21 -0
- package/dist/generated/instructions/transferV2.js.map +1 -1
- package/dist/generated/instructions/unverifyCollection.d.ts +215 -38
- package/dist/generated/instructions/unverifyCollection.d.ts.map +1 -1
- package/dist/generated/instructions/unverifyCollection.js +19 -0
- package/dist/generated/instructions/unverifyCollection.js.map +1 -1
- package/dist/generated/instructions/unverifyCreator.d.ts +161 -17
- package/dist/generated/instructions/unverifyCreator.d.ts.map +1 -1
- package/dist/generated/instructions/unverifyCreator.js +19 -0
- package/dist/generated/instructions/unverifyCreator.js.map +1 -1
- package/dist/generated/instructions/unverifyCreatorV2.d.ts +143 -21
- package/dist/generated/instructions/unverifyCreatorV2.d.ts.map +1 -1
- package/dist/generated/instructions/unverifyCreatorV2.js +19 -0
- package/dist/generated/instructions/unverifyCreatorV2.js.map +1 -1
- package/dist/generated/instructions/updateAssetDataV2.d.ts +180 -28
- package/dist/generated/instructions/updateAssetDataV2.d.ts.map +1 -1
- package/dist/generated/instructions/updateAssetDataV2.js +21 -0
- package/dist/generated/instructions/updateAssetDataV2.js.map +1 -1
- package/dist/generated/instructions/updateMetadata.d.ts +183 -28
- package/dist/generated/instructions/updateMetadata.d.ts.map +1 -1
- package/dist/generated/instructions/updateMetadata.js +21 -0
- package/dist/generated/instructions/updateMetadata.js.map +1 -1
- package/dist/generated/instructions/updateMetadataV2.d.ts +162 -27
- package/dist/generated/instructions/updateMetadataV2.d.ts.map +1 -1
- package/dist/generated/instructions/updateMetadataV2.js +19 -0
- package/dist/generated/instructions/updateMetadataV2.js.map +1 -1
- package/dist/generated/instructions/verifyCollection.d.ts +215 -38
- package/dist/generated/instructions/verifyCollection.d.ts.map +1 -1
- package/dist/generated/instructions/verifyCollection.js +19 -0
- package/dist/generated/instructions/verifyCollection.js.map +1 -1
- package/dist/generated/instructions/verifyCreator.d.ts +161 -17
- package/dist/generated/instructions/verifyCreator.d.ts.map +1 -1
- package/dist/generated/instructions/verifyCreator.js +19 -0
- package/dist/generated/instructions/verifyCreator.js.map +1 -1
- package/dist/generated/instructions/verifyCreatorV2.d.ts +143 -21
- package/dist/generated/instructions/verifyCreatorV2.d.ts.map +1 -1
- package/dist/generated/instructions/verifyCreatorV2.js +19 -0
- package/dist/generated/instructions/verifyCreatorV2.js.map +1 -1
- package/dist/generated/pdas/assetId.d.ts +2 -3
- package/dist/generated/pdas/assetId.d.ts.map +1 -1
- package/dist/generated/pdas/assetId.js +7 -0
- package/dist/generated/pdas/assetId.js.map +1 -1
- package/dist/generated/pdas/bubblegumSigner.d.ts +0 -1
- package/dist/generated/pdas/bubblegumSigner.d.ts.map +1 -1
- package/dist/generated/pdas/bubblegumSigner.js +7 -0
- package/dist/generated/pdas/bubblegumSigner.js.map +1 -1
- package/dist/generated/pdas/index.d.ts +2 -1
- package/dist/generated/pdas/masterEdition.d.ts +2 -3
- package/dist/generated/pdas/masterEdition.d.ts.map +1 -1
- package/dist/generated/pdas/masterEdition.js +7 -0
- package/dist/generated/pdas/masterEdition.js.map +1 -1
- package/dist/generated/pdas/metadata.d.ts +2 -3
- package/dist/generated/pdas/metadata.d.ts.map +1 -1
- package/dist/generated/pdas/metadata.js +7 -0
- package/dist/generated/pdas/metadata.js.map +1 -1
- package/dist/generated/pdas/mintAuthority.d.ts +2 -3
- package/dist/generated/pdas/mintAuthority.d.ts.map +1 -1
- package/dist/generated/pdas/mintAuthority.js +7 -0
- package/dist/generated/pdas/mintAuthority.js.map +1 -1
- package/dist/generated/pdas/treeConfig.d.ts +2 -3
- package/dist/generated/pdas/treeConfig.d.ts.map +1 -1
- package/dist/generated/pdas/treeConfig.js +7 -0
- package/dist/generated/pdas/treeConfig.js.map +1 -1
- package/dist/generated/pdas/voucher.d.ts +2 -3
- package/dist/generated/pdas/voucher.d.ts.map +1 -1
- package/dist/generated/pdas/voucher.js +7 -0
- package/dist/generated/pdas/voucher.js.map +1 -1
- package/dist/generated/programs/bubblegum.d.ts +17 -12
- package/dist/generated/programs/bubblegum.d.ts.map +1 -1
- package/dist/generated/programs/bubblegum.js +11 -1
- package/dist/generated/programs/bubblegum.js.map +1 -1
- package/dist/generated/programs/index.d.ts +2 -1
- package/dist/generated/programs/mplTokenMetadata.d.ts +8 -8
- package/dist/generated/programs/mplTokenMetadata.d.ts.map +1 -1
- package/dist/generated/programs/mplTokenMetadata.js +7 -0
- package/dist/generated/programs/mplTokenMetadata.js.map +1 -1
- package/dist/generated/types/assetDataSchema.d.ts +4 -1
- package/dist/generated/types/assetDataSchema.d.ts.map +1 -1
- package/dist/generated/types/assetDataSchema.js +11 -0
- package/dist/generated/types/assetDataSchema.js.map +1 -1
- package/dist/generated/types/bubblegumEventType.d.ts +4 -1
- package/dist/generated/types/bubblegumEventType.d.ts.map +1 -1
- package/dist/generated/types/bubblegumEventType.js +11 -0
- package/dist/generated/types/bubblegumEventType.js.map +1 -1
- package/dist/generated/types/collection.d.ts +9 -3
- package/dist/generated/types/collection.d.ts.map +1 -1
- package/dist/generated/types/collection.js +7 -0
- package/dist/generated/types/collection.js.map +1 -1
- package/dist/generated/types/creator.d.ts +9 -7
- package/dist/generated/types/creator.d.ts.map +1 -1
- package/dist/generated/types/creator.js +7 -0
- package/dist/generated/types/creator.js.map +1 -1
- package/dist/generated/types/decompressibleState.d.ts +5 -1
- package/dist/generated/types/decompressibleState.d.ts.map +1 -1
- package/dist/generated/types/decompressibleState.js +12 -0
- package/dist/generated/types/decompressibleState.js.map +1 -1
- package/dist/generated/types/index.d.ts +2 -1
- package/dist/generated/types/instructionName.d.ts +4 -1
- package/dist/generated/types/instructionName.d.ts.map +1 -1
- package/dist/generated/types/instructionName.js +11 -0
- package/dist/generated/types/instructionName.js.map +1 -1
- package/dist/generated/types/leafSchema.d.ts +51 -13
- package/dist/generated/types/leafSchema.d.ts.map +1 -1
- package/dist/generated/types/leafSchema.js +7 -0
- package/dist/generated/types/leafSchema.js.map +1 -1
- package/dist/generated/types/metadataArgs.d.ts +19 -7
- package/dist/generated/types/metadataArgs.d.ts.map +1 -1
- package/dist/generated/types/metadataArgs.js +7 -0
- package/dist/generated/types/metadataArgs.js.map +1 -1
- package/dist/generated/types/metadataArgsV2.d.ts +14 -7
- package/dist/generated/types/metadataArgsV2.d.ts.map +1 -1
- package/dist/generated/types/metadataArgsV2.js +7 -0
- package/dist/generated/types/metadataArgsV2.js.map +1 -1
- package/dist/generated/types/tokenProgramVersion.d.ts +1 -1
- package/dist/generated/types/tokenProgramVersion.d.ts.map +1 -1
- package/dist/generated/types/tokenProgramVersion.js +8 -0
- package/dist/generated/types/tokenProgramVersion.js.map +1 -1
- package/dist/generated/types/tokenStandard.d.ts +5 -1
- package/dist/generated/types/tokenStandard.d.ts.map +1 -1
- package/dist/generated/types/tokenStandard.js +12 -0
- package/dist/generated/types/tokenStandard.js.map +1 -1
- package/dist/generated/types/updateArgs.d.ts +26 -7
- package/dist/generated/types/updateArgs.d.ts.map +1 -1
- package/dist/generated/types/updateArgs.js +7 -0
- package/dist/generated/types/updateArgs.js.map +1 -1
- package/dist/generated/types/useMethod.d.ts +1 -1
- package/dist/generated/types/useMethod.d.ts.map +1 -1
- package/dist/generated/types/useMethod.js +8 -0
- package/dist/generated/types/useMethod.js.map +1 -1
- package/dist/generated/types/uses.d.ts +16 -5
- package/dist/generated/types/uses.d.ts.map +1 -1
- package/dist/generated/types/uses.js +7 -0
- package/dist/generated/types/uses.js.map +1 -1
- package/dist/generated/types/version.d.ts +5 -1
- package/dist/generated/types/version.d.ts.map +1 -1
- package/dist/generated/types/version.js +12 -0
- package/dist/generated/types/version.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +8 -12
- package/src/generated/accounts/treeConfig.ts +36 -27
- package/src/generated/accounts/voucher.ts +30 -23
- package/src/generated/errors/bubblegum.ts +121 -154
- package/src/generated/instructions/burn.ts +163 -44
- package/src/generated/instructions/burnV2.ts +205 -64
- package/src/generated/instructions/cancelRedeem.ts +122 -41
- package/src/generated/instructions/closeTreeV2.ts +102 -44
- package/src/generated/instructions/collectV2.ts +34 -23
- package/src/generated/instructions/compress.ts +146 -45
- package/src/generated/instructions/createTree.ts +143 -42
- package/src/generated/instructions/createTreeV2.ts +134 -45
- package/src/generated/instructions/decompressV1.ts +136 -49
- package/src/generated/instructions/delegate.ts +165 -47
- package/src/generated/instructions/delegateAndFreezeV2.ts +197 -60
- package/src/generated/instructions/delegateV2.ts +195 -60
- package/src/generated/instructions/freezeV2.ts +199 -58
- package/src/generated/instructions/mintToCollectionV1.ts +196 -52
- package/src/generated/instructions/mintV1.ts +133 -40
- package/src/generated/instructions/mintV2.ts +192 -57
- package/src/generated/instructions/redeem.ts +178 -47
- package/src/generated/instructions/setAndVerifyCollection.ts +246 -69
- package/src/generated/instructions/setCollectionV2.ts +212 -73
- package/src/generated/instructions/setDecompressableState.ts +59 -31
- package/src/generated/instructions/setDecompressibleState.ts +60 -31
- package/src/generated/instructions/setNonTransferableV2.ts +190 -61
- package/src/generated/instructions/setTreeDelegate.ts +84 -31
- package/src/generated/instructions/thawAndRevokeV2.ts +185 -57
- package/src/generated/instructions/thawV2.ts +191 -58
- package/src/generated/instructions/transfer.ts +162 -44
- package/src/generated/instructions/transferV2.ts +191 -61
- package/src/generated/instructions/unverifyCollection.ts +239 -69
- package/src/generated/instructions/unverifyCreator.ts +187 -48
- package/src/generated/instructions/unverifyCreatorV2.ts +170 -55
- package/src/generated/instructions/updateAssetDataV2.ts +206 -59
- package/src/generated/instructions/updateMetadata.ts +210 -67
- package/src/generated/instructions/updateMetadataV2.ts +189 -63
- package/src/generated/instructions/verifyCollection.ts +239 -69
- package/src/generated/instructions/verifyCreator.ts +187 -48
- package/src/generated/instructions/verifyCreatorV2.ts +170 -55
- package/src/generated/pdas/assetId.ts +4 -3
- package/src/generated/pdas/bubblegumSigner.ts +6 -2
- package/src/generated/pdas/masterEdition.ts +4 -3
- package/src/generated/pdas/metadata.ts +4 -3
- package/src/generated/pdas/mintAuthority.ts +8 -4
- package/src/generated/pdas/treeConfig.ts +8 -4
- package/src/generated/pdas/voucher.ts +4 -3
- package/src/generated/programs/bubblegum.ts +146 -144
- package/src/generated/programs/mplTokenMetadata.ts +5 -10
- package/src/generated/types/assetDataSchema.ts +14 -8
- package/src/generated/types/bubblegumEventType.ts +13 -7
- package/src/generated/types/collection.ts +13 -8
- package/src/generated/types/creator.ts +11 -10
- package/src/generated/types/decompressibleState.ts +14 -7
- package/src/generated/types/instructionName.ts +46 -40
- package/src/generated/types/leafSchema.ts +59 -22
- package/src/generated/types/metadataArgs.ts +35 -27
- package/src/generated/types/metadataArgsV2.ts +23 -20
- package/src/generated/types/tokenProgramVersion.ts +10 -7
- package/src/generated/types/tokenStandard.ts +16 -9
- package/src/generated/types/updateArgs.ts +36 -15
- package/src/generated/types/useMethod.ts +11 -8
- package/src/generated/types/uses.ts +24 -11
- package/src/generated/types/version.ts +14 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setCollectionV2.js","names":[],"sources":["../../../src/generated/instructions/setCollectionV2.ts"],"sourcesContent":["/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport type {\n AccountMeta,\n AccountSignerMeta,\n Address,\n Codec,\n Decoder,\n Encoder,\n Instruction,\n InstructionWithAccounts,\n InstructionWithData,\n Option,\n OptionOrNullable,\n ReadonlyAccount,\n ReadonlySignerAccount,\n ReadonlyUint8Array,\n TransactionSigner,\n WritableAccount,\n WritableSignerAccount,\n} from \"@solana/kit\";\nimport type { ResolvedInstructionAccount } from \"@solana/program-client-core\";\nimport type { MetadataArgsV2, MetadataArgsV2Args } from \"../types/index.js\";\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n} from \"@solana/program-client-core\";\nimport { findTreeConfigPda } from \"../pdas/index.js\";\nimport { BUBBLEGUM_PROGRAM_ADDRESS } from \"../programs/index.js\";\nimport {\n getMetadataArgsV2Decoder,\n getMetadataArgsV2Encoder,\n} from \"../types/index.js\";\n\nexport const SET_COLLECTION_V2_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([229, 35, 61, 91, 15, 14, 99, 160]);\n\nexport function getSetCollectionV2DiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n SET_COLLECTION_V2_DISCRIMINATOR,\n );\n}\n\nexport type SetCollectionV2Instruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountTreeAuthority extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountNewCollectionAuthority extends string | AccountMeta<string> = string,\n TAccountLeafOwner extends string | AccountMeta<string> = string,\n TAccountLeafDelegate extends string | AccountMeta<string> = string,\n TAccountMerkleTree extends string | AccountMeta<string> = string,\n TAccountCoreCollection extends string | AccountMeta<string> = string,\n TAccountNewCoreCollection extends string | AccountMeta<string> = string,\n TAccountMplCoreCpiSigner extends\n | string\n | AccountMeta<string> = \"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\",\n TAccountLogWrapper extends\n | string\n | AccountMeta<string> = \"mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3\",\n TAccountCompressionProgram extends\n | string\n | AccountMeta<string> = \"mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW\",\n TAccountMplCoreProgram extends\n | string\n | AccountMeta<string> = \"CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d\",\n TAccountSystemProgram extends\n | string\n | AccountMeta<string> = \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountTreeAuthority extends string\n ? WritableAccount<TAccountTreeAuthority>\n : TAccountTreeAuthority,\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> &\n AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountAuthority extends string\n ? ReadonlySignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountNewCollectionAuthority extends string\n ? ReadonlySignerAccount<TAccountNewCollectionAuthority> &\n AccountSignerMeta<TAccountNewCollectionAuthority>\n : TAccountNewCollectionAuthority,\n TAccountLeafOwner extends string\n ? ReadonlyAccount<TAccountLeafOwner>\n : TAccountLeafOwner,\n TAccountLeafDelegate extends string\n ? ReadonlyAccount<TAccountLeafDelegate>\n : TAccountLeafDelegate,\n TAccountMerkleTree extends string\n ? WritableAccount<TAccountMerkleTree>\n : TAccountMerkleTree,\n TAccountCoreCollection extends string\n ? WritableAccount<TAccountCoreCollection>\n : TAccountCoreCollection,\n TAccountNewCoreCollection extends string\n ? WritableAccount<TAccountNewCoreCollection>\n : TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner extends string\n ? ReadonlyAccount<TAccountMplCoreCpiSigner>\n : TAccountMplCoreCpiSigner,\n TAccountLogWrapper extends string\n ? ReadonlyAccount<TAccountLogWrapper>\n : TAccountLogWrapper,\n TAccountCompressionProgram extends string\n ? ReadonlyAccount<TAccountCompressionProgram>\n : TAccountCompressionProgram,\n TAccountMplCoreProgram extends string\n ? ReadonlyAccount<TAccountMplCoreProgram>\n : TAccountMplCoreProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport interface SetCollectionV2InstructionData {\n discriminator: ReadonlyUint8Array;\n root: number[];\n assetDataHash: Option<number[]>;\n flags: Option<number>;\n nonce: bigint;\n index: number;\n message: MetadataArgsV2;\n}\n\nexport interface SetCollectionV2InstructionDataArgs {\n root: number[];\n assetDataHash: OptionOrNullable<number[]>;\n flags: OptionOrNullable<number>;\n nonce: number | bigint;\n index: number;\n message: MetadataArgsV2Args;\n}\n\nexport function getSetCollectionV2InstructionDataEncoder(): Encoder<SetCollectionV2InstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"root\", getArrayEncoder(getU8Encoder(), { size: 32 })],\n [\n \"assetDataHash\",\n getOptionEncoder(getArrayEncoder(getU8Encoder(), { size: 32 })),\n ],\n [\"flags\", getOptionEncoder(getU8Encoder())],\n [\"nonce\", getU64Encoder()],\n [\"index\", getU32Encoder()],\n [\"message\", getMetadataArgsV2Encoder()],\n ]),\n (value) => ({ ...value, discriminator: SET_COLLECTION_V2_DISCRIMINATOR }),\n );\n}\n\nexport function getSetCollectionV2InstructionDataDecoder(): Decoder<SetCollectionV2InstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"root\", getArrayDecoder(getU8Decoder(), { size: 32 })],\n [\n \"assetDataHash\",\n getOptionDecoder(getArrayDecoder(getU8Decoder(), { size: 32 })),\n ],\n [\"flags\", getOptionDecoder(getU8Decoder())],\n [\"nonce\", getU64Decoder()],\n [\"index\", getU32Decoder()],\n [\"message\", getMetadataArgsV2Decoder()],\n ]);\n}\n\nexport function getSetCollectionV2InstructionDataCodec(): Codec<\n SetCollectionV2InstructionDataArgs,\n SetCollectionV2InstructionData\n> {\n return combineCodec(\n getSetCollectionV2InstructionDataEncoder(),\n getSetCollectionV2InstructionDataDecoder(),\n );\n}\n\nexport interface SetCollectionV2AsyncInput<\n TAccountTreeAuthority extends string = string,\n TAccountPayer extends string = string,\n TAccountAuthority extends string = string,\n TAccountNewCollectionAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountLeafDelegate extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountCoreCollection extends string = string,\n TAccountNewCoreCollection extends string = string,\n TAccountMplCoreCpiSigner extends string = string,\n TAccountLogWrapper extends string = string,\n TAccountCompressionProgram extends string = string,\n TAccountMplCoreProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> {\n treeAuthority?: Address<TAccountTreeAuthority>;\n payer: TransactionSigner<TAccountPayer>;\n /**\n * If item is not in a collection, then authority must be tree owner/delegate. If item is\n * getting removed from a collection, then this must be an authority for the existing\n * collection. Defaults to `payer`\n */\n authority?: TransactionSigner<TAccountAuthority>;\n /**\n * If item is getting added to a new collection, then this must be the authority\n * for the new collection. Defaults to `authority`\n */\n newCollectionAuthority?: TransactionSigner<TAccountNewCollectionAuthority>;\n leafOwner: Address<TAccountLeafOwner>;\n /** Defaults to `leaf_owner` */\n leafDelegate?: Address<TAccountLeafDelegate>;\n merkleTree: Address<TAccountMerkleTree>;\n coreCollection?: Address<TAccountCoreCollection>;\n newCoreCollection?: Address<TAccountNewCoreCollection>;\n mplCoreCpiSigner?: Address<TAccountMplCoreCpiSigner>;\n logWrapper?: Address<TAccountLogWrapper>;\n compressionProgram?: Address<TAccountCompressionProgram>;\n mplCoreProgram?: Address<TAccountMplCoreProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n root: SetCollectionV2InstructionDataArgs[\"root\"];\n assetDataHash: SetCollectionV2InstructionDataArgs[\"assetDataHash\"];\n flags: SetCollectionV2InstructionDataArgs[\"flags\"];\n nonce: SetCollectionV2InstructionDataArgs[\"nonce\"];\n index: SetCollectionV2InstructionDataArgs[\"index\"];\n message: SetCollectionV2InstructionDataArgs[\"message\"];\n}\n\nexport async function getSetCollectionV2InstructionAsync<\n TAccountTreeAuthority extends string,\n TAccountPayer extends string,\n TAccountAuthority extends string,\n TAccountNewCollectionAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountLeafDelegate extends string,\n TAccountMerkleTree extends string,\n TAccountCoreCollection extends string,\n TAccountNewCoreCollection extends string,\n TAccountMplCoreCpiSigner extends string,\n TAccountLogWrapper extends string,\n TAccountCompressionProgram extends string,\n TAccountMplCoreProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n>(\n input: SetCollectionV2AsyncInput<\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n SetCollectionV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? BUBBLEGUM_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n treeAuthority: { value: input.treeAuthority ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n newCollectionAuthority: {\n value: input.newCollectionAuthority ?? null,\n isWritable: false,\n },\n leafOwner: { value: input.leafOwner ?? null, isWritable: false },\n leafDelegate: { value: input.leafDelegate ?? null, isWritable: false },\n merkleTree: { value: input.merkleTree ?? null, isWritable: true },\n coreCollection: { value: input.coreCollection ?? null, isWritable: true },\n newCoreCollection: {\n value: input.newCoreCollection ?? null,\n isWritable: true,\n },\n mplCoreCpiSigner: {\n value: input.mplCoreCpiSigner ?? null,\n isWritable: false,\n },\n logWrapper: { value: input.logWrapper ?? null, isWritable: false },\n compressionProgram: {\n value: input.compressionProgram ?? null,\n isWritable: false,\n },\n mplCoreProgram: { value: input.mplCoreProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.treeAuthority.value) {\n accounts.treeAuthority.value = await findTreeConfigPda({\n merkleTree: getAddressFromResolvedInstructionAccount(\n \"merkleTree\",\n accounts.merkleTree.value,\n ),\n });\n }\n if (!accounts.mplCoreCpiSigner.value) {\n accounts.mplCoreCpiSigner.value =\n \"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\" as Address<\"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\">;\n }\n if (!accounts.logWrapper.value) {\n accounts.logWrapper.value =\n \"mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3\" as Address<\"mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3\">;\n }\n if (!accounts.compressionProgram.value) {\n accounts.compressionProgram.value =\n \"mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW\" as Address<\"mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW\">;\n }\n if (!accounts.mplCoreProgram.value) {\n accounts.mplCoreProgram.value =\n \"CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d\" as Address<\"CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"treeAuthority\", accounts.treeAuthority),\n getAccountMeta(\"payer\", accounts.payer),\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"newCollectionAuthority\", accounts.newCollectionAuthority),\n getAccountMeta(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"leafDelegate\", accounts.leafDelegate),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"coreCollection\", accounts.coreCollection),\n getAccountMeta(\"newCoreCollection\", accounts.newCoreCollection),\n getAccountMeta(\"mplCoreCpiSigner\", accounts.mplCoreCpiSigner),\n getAccountMeta(\"logWrapper\", accounts.logWrapper),\n getAccountMeta(\"compressionProgram\", accounts.compressionProgram),\n getAccountMeta(\"mplCoreProgram\", accounts.mplCoreProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getSetCollectionV2InstructionDataEncoder().encode(\n args as SetCollectionV2InstructionDataArgs,\n ),\n programAddress,\n } as SetCollectionV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >);\n}\n\nexport interface SetCollectionV2Input<\n TAccountTreeAuthority extends string = string,\n TAccountPayer extends string = string,\n TAccountAuthority extends string = string,\n TAccountNewCollectionAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountLeafDelegate extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountCoreCollection extends string = string,\n TAccountNewCoreCollection extends string = string,\n TAccountMplCoreCpiSigner extends string = string,\n TAccountLogWrapper extends string = string,\n TAccountCompressionProgram extends string = string,\n TAccountMplCoreProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> {\n treeAuthority: Address<TAccountTreeAuthority>;\n payer: TransactionSigner<TAccountPayer>;\n /**\n * If item is not in a collection, then authority must be tree owner/delegate. If item is\n * getting removed from a collection, then this must be an authority for the existing\n * collection. Defaults to `payer`\n */\n authority?: TransactionSigner<TAccountAuthority>;\n /**\n * If item is getting added to a new collection, then this must be the authority\n * for the new collection. Defaults to `authority`\n */\n newCollectionAuthority?: TransactionSigner<TAccountNewCollectionAuthority>;\n leafOwner: Address<TAccountLeafOwner>;\n /** Defaults to `leaf_owner` */\n leafDelegate?: Address<TAccountLeafDelegate>;\n merkleTree: Address<TAccountMerkleTree>;\n coreCollection?: Address<TAccountCoreCollection>;\n newCoreCollection?: Address<TAccountNewCoreCollection>;\n mplCoreCpiSigner?: Address<TAccountMplCoreCpiSigner>;\n logWrapper?: Address<TAccountLogWrapper>;\n compressionProgram?: Address<TAccountCompressionProgram>;\n mplCoreProgram?: Address<TAccountMplCoreProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n root: SetCollectionV2InstructionDataArgs[\"root\"];\n assetDataHash: SetCollectionV2InstructionDataArgs[\"assetDataHash\"];\n flags: SetCollectionV2InstructionDataArgs[\"flags\"];\n nonce: SetCollectionV2InstructionDataArgs[\"nonce\"];\n index: SetCollectionV2InstructionDataArgs[\"index\"];\n message: SetCollectionV2InstructionDataArgs[\"message\"];\n}\n\nexport function getSetCollectionV2Instruction<\n TAccountTreeAuthority extends string,\n TAccountPayer extends string,\n TAccountAuthority extends string,\n TAccountNewCollectionAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountLeafDelegate extends string,\n TAccountMerkleTree extends string,\n TAccountCoreCollection extends string,\n TAccountNewCoreCollection extends string,\n TAccountMplCoreCpiSigner extends string,\n TAccountLogWrapper extends string,\n TAccountCompressionProgram extends string,\n TAccountMplCoreProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n>(\n input: SetCollectionV2Input<\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): SetCollectionV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? BUBBLEGUM_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n treeAuthority: { value: input.treeAuthority ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n newCollectionAuthority: {\n value: input.newCollectionAuthority ?? null,\n isWritable: false,\n },\n leafOwner: { value: input.leafOwner ?? null, isWritable: false },\n leafDelegate: { value: input.leafDelegate ?? null, isWritable: false },\n merkleTree: { value: input.merkleTree ?? null, isWritable: true },\n coreCollection: { value: input.coreCollection ?? null, isWritable: true },\n newCoreCollection: {\n value: input.newCoreCollection ?? null,\n isWritable: true,\n },\n mplCoreCpiSigner: {\n value: input.mplCoreCpiSigner ?? null,\n isWritable: false,\n },\n logWrapper: { value: input.logWrapper ?? null, isWritable: false },\n compressionProgram: {\n value: input.compressionProgram ?? null,\n isWritable: false,\n },\n mplCoreProgram: { value: input.mplCoreProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.mplCoreCpiSigner.value) {\n accounts.mplCoreCpiSigner.value =\n \"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\" as Address<\"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\">;\n }\n if (!accounts.logWrapper.value) {\n accounts.logWrapper.value =\n \"mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3\" as Address<\"mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3\">;\n }\n if (!accounts.compressionProgram.value) {\n accounts.compressionProgram.value =\n \"mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW\" as Address<\"mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW\">;\n }\n if (!accounts.mplCoreProgram.value) {\n accounts.mplCoreProgram.value =\n \"CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d\" as Address<\"CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"treeAuthority\", accounts.treeAuthority),\n getAccountMeta(\"payer\", accounts.payer),\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"newCollectionAuthority\", accounts.newCollectionAuthority),\n getAccountMeta(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"leafDelegate\", accounts.leafDelegate),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"coreCollection\", accounts.coreCollection),\n getAccountMeta(\"newCoreCollection\", accounts.newCoreCollection),\n getAccountMeta(\"mplCoreCpiSigner\", accounts.mplCoreCpiSigner),\n getAccountMeta(\"logWrapper\", accounts.logWrapper),\n getAccountMeta(\"compressionProgram\", accounts.compressionProgram),\n getAccountMeta(\"mplCoreProgram\", accounts.mplCoreProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getSetCollectionV2InstructionDataEncoder().encode(\n args as SetCollectionV2InstructionDataArgs,\n ),\n programAddress,\n } as SetCollectionV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >);\n}\n\nexport interface ParsedSetCollectionV2Instruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> {\n programAddress: Address<TProgram>;\n accounts: {\n treeAuthority: TAccountMetas[0];\n payer: TAccountMetas[1];\n /**\n * If item is not in a collection, then authority must be tree owner/delegate. If item is\n * getting removed from a collection, then this must be an authority for the existing\n * collection. Defaults to `payer`\n */\n authority?: TAccountMetas[2] | undefined;\n /**\n * If item is getting added to a new collection, then this must be the authority\n * for the new collection. Defaults to `authority`\n */\n newCollectionAuthority?: TAccountMetas[3] | undefined;\n leafOwner: TAccountMetas[4];\n /** Defaults to `leaf_owner` */\n leafDelegate?: TAccountMetas[5] | undefined;\n merkleTree: TAccountMetas[6];\n coreCollection?: TAccountMetas[7] | undefined;\n newCoreCollection?: TAccountMetas[8] | undefined;\n mplCoreCpiSigner: TAccountMetas[9];\n logWrapper: TAccountMetas[10];\n compressionProgram: TAccountMetas[11];\n mplCoreProgram: TAccountMetas[12];\n systemProgram: TAccountMetas[13];\n };\n data: SetCollectionV2InstructionData;\n}\n\nexport function parseSetCollectionV2Instruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSetCollectionV2Instruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 14) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 14,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n const getNextOptionalAccount = () => {\n const accountMeta = getNextAccount();\n return accountMeta.address === BUBBLEGUM_PROGRAM_ADDRESS\n ? undefined\n : accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n treeAuthority: getNextAccount(),\n payer: getNextAccount(),\n authority: getNextOptionalAccount(),\n newCollectionAuthority: getNextOptionalAccount(),\n leafOwner: getNextAccount(),\n leafDelegate: getNextOptionalAccount(),\n merkleTree: getNextAccount(),\n coreCollection: getNextOptionalAccount(),\n newCoreCollection: getNextOptionalAccount(),\n mplCoreCpiSigner: getNextAccount(),\n logWrapper: getNextAccount(),\n compressionProgram: getNextAccount(),\n mplCoreProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getSetCollectionV2InstructionDataDecoder().decode(instruction.data),\n };\n}\n"],"mappings":";;;;;;AA8DA,MAAa,kCACX,IAAI,WAAW;CAAC;CAAK;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;AAAG,CAAC;AAEnD,SAAgB,uCAA2D;CACzE,OAAO,eAAe,gBAAgB,GAAG,CAAC,CAAC,CAAC,OAC1C,+BACF;AACF;AAqGA,SAAgB,2CAAwF;CACtG,OAAO,iBACL,iBAAiB;EACf,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC;EACtD,CAAC,QAAQ,gBAAgB,aAAa,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;EACtD,CACE,iBACA,iBAAiB,gBAAgB,aAAa,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,CAChE;EACA,CAAC,SAAS,iBAAiB,aAAa,CAAC,CAAC;EAC1C,CAAC,SAAS,cAAc,CAAC;EACzB,CAAC,SAAS,cAAc,CAAC;EACzB,CAAC,WAAW,yBAAyB,CAAC;CACxC,CAAC,IACA,WAAW;EAAE,GAAG;EAAO,eAAe;CAAgC,EACzE;AACF;AAEA,SAAgB,2CAAoF;CAClG,OAAO,iBAAiB;EACtB,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC;EACtD,CAAC,QAAQ,gBAAgB,aAAa,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;EACtD,CACE,iBACA,iBAA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9C,eAAe,gBAAgB,SAAS,YAAY;GACpD,eAAe,cAAc,SAAS,UAAU;GAChD,eAAe,kBAAkB,SAAS,cAAc;GACxD,eAAe,qBAAqB,SAAS,iBAAiB;GAC9D,eAAe,oBAAoB,SAAS,gBAAgB;GAC5D,eAAe,cAAc,SAAS,UAAU;GAChD,eAAe,sBAAsB,SAAS,kBAAkB;GAChE,eAAe,kBAAkB,SAAS,cAAc;GACxD,eAAe,iBAAiB,SAAS,aAAa;EACxD;EACA,MAAM,yCAAyC,CAAC,CAAC,OAC/C,IACF;EACA;CACF,CAgBC;AACH;AAoCA,SAAgB,gCAId,aAG2D;CAC3D,IAAI,YAAY,SAAS,SAAS,IAChC,MAAM,IAAI,YACR,2DACA;EACE,oBAAoB,YAAY,SAAS;EACzC,sBAAsB;CACxB,CACF;CAEF,IAAI,eAAe;CACnB,MAAM,uBAAuB;EAC3B,MAAM,cAAe,YAAY,SAA2B;EAC5D,gBAAgB;EAChB,OAAO;CACT;CACA,MAAM,+BAA+B;EACnC,MAAM,cAAc,eAAe;EACnC,OAAO,YAAY,YAAA,iDACf,KAAA,IACA;CACN;CACA,OAAO;EACL,gBAAgB,YAAY;EAC5B,UAAU;GACR,eAAe,eAAe;GAC9B,OAAO,eAAe;GACtB,WAAW,uBAAuB;GAClC,wBAAwB,uBAAuB;GAC/C,WAAW,eAAe;GAC1B,cAAc,uBAAuB;GACrC,YAAY,eAAe;GAC3B,gBAAgB,uBAAuB;GACvC,mBAAmB,uBAAuB;GAC1C,kBAAkB,eAAe;GACjC,YAAY,eAAe;GAC3B,oBAAoB,eAAe;GACnC,gBAAgB,eAAe;GAC/B,eAAe,eAAe;EAChC;EACA,MAAM,yCAAyC,CAAC,CAAC,OAAO,YAAY,IAAI;CAC1E;AACF"}
|
|
1
|
+
{"version":3,"file":"setCollectionV2.js","names":[],"sources":["../../../src/generated/instructions/setCollectionV2.ts"],"sourcesContent":["/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type Option,\n type OptionOrNullable,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/program-client-core\";\nimport { findTreeConfigPda } from \"../pdas/index.js\";\nimport { BUBBLEGUM_PROGRAM_ADDRESS } from \"../programs/index.js\";\nimport {\n getMetadataArgsV2Decoder,\n getMetadataArgsV2Encoder,\n type MetadataArgsV2,\n type MetadataArgsV2Args,\n} from \"../types/index.js\";\n\nexport const SET_COLLECTION_V2_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([229, 35, 61, 91, 15, 14, 99, 160]);\n\nexport function getSetCollectionV2DiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n SET_COLLECTION_V2_DISCRIMINATOR,\n );\n}\n\nexport type SetCollectionV2Instruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountTreeAuthority extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountNewCollectionAuthority extends string | AccountMeta<string> = string,\n TAccountLeafOwner extends string | AccountMeta<string> = string,\n TAccountLeafDelegate extends string | AccountMeta<string> = string,\n TAccountMerkleTree extends string | AccountMeta<string> = string,\n TAccountCoreCollection extends string | AccountMeta<string> = string,\n TAccountNewCoreCollection extends string | AccountMeta<string> = string,\n TAccountMplCoreCpiSigner extends string | AccountMeta<string> =\n \"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\",\n TAccountLogWrapper extends string | AccountMeta<string> =\n \"mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3\",\n TAccountCompressionProgram extends string | AccountMeta<string> =\n \"mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW\",\n TAccountMplCoreProgram extends string | AccountMeta<string> =\n \"CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d\",\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountTreeAuthority extends string\n ? WritableAccount<TAccountTreeAuthority>\n : TAccountTreeAuthority,\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> &\n AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountAuthority extends string\n ? ReadonlySignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountNewCollectionAuthority extends string\n ? ReadonlySignerAccount<TAccountNewCollectionAuthority> &\n AccountSignerMeta<TAccountNewCollectionAuthority>\n : TAccountNewCollectionAuthority,\n TAccountLeafOwner extends string\n ? ReadonlyAccount<TAccountLeafOwner>\n : TAccountLeafOwner,\n TAccountLeafDelegate extends string\n ? ReadonlyAccount<TAccountLeafDelegate>\n : TAccountLeafDelegate,\n TAccountMerkleTree extends string\n ? WritableAccount<TAccountMerkleTree>\n : TAccountMerkleTree,\n TAccountCoreCollection extends string\n ? WritableAccount<TAccountCoreCollection>\n : TAccountCoreCollection,\n TAccountNewCoreCollection extends string\n ? WritableAccount<TAccountNewCoreCollection>\n : TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner extends string\n ? ReadonlyAccount<TAccountMplCoreCpiSigner>\n : TAccountMplCoreCpiSigner,\n TAccountLogWrapper extends string\n ? ReadonlyAccount<TAccountLogWrapper>\n : TAccountLogWrapper,\n TAccountCompressionProgram extends string\n ? ReadonlyAccount<TAccountCompressionProgram>\n : TAccountCompressionProgram,\n TAccountMplCoreProgram extends string\n ? ReadonlyAccount<TAccountMplCoreProgram>\n : TAccountMplCoreProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SetCollectionV2InstructionData = {\n discriminator: ReadonlyUint8Array;\n /**\n * Current Merkle root of the tree, used together with the Merkle proof\n * (passed as remaining accounts) to verify the leaf being operated on.\n */\n root: Array<number>;\n /**\n * Expected current `assetDataHash` of the `LeafSchema` V2 leaf, if any,\n * carried through unchanged by this instruction.\n */\n assetDataHash: Option<Array<number>>;\n /**\n * Expected current status flags (e.g. frozen, non-transferable) of the\n * `LeafSchema` V2 leaf, verified before this instruction updates them.\n */\n flags: Option<number>;\n /**\n * Tree-scoped nonce identifying the leaf, equal to the tree's\n * `numMinted` at the time the leaf was minted. Combined with the tree\n * address to derive the leaf's asset id.\n */\n nonce: bigint;\n /**\n * Position of the leaf within the Merkle tree, used with the Merkle\n * proof to locate and verify the leaf.\n */\n index: number;\n /**\n * The leaf's current `MetadataArgsV2`, verified against `dataHash`\n * before its collection is set.\n */\n message: MetadataArgsV2;\n};\n\nexport type SetCollectionV2InstructionDataArgs = {\n /**\n * Current Merkle root of the tree, used together with the Merkle proof\n * (passed as remaining accounts) to verify the leaf being operated on.\n */\n root: Array<number>;\n /**\n * Expected current `assetDataHash` of the `LeafSchema` V2 leaf, if any,\n * carried through unchanged by this instruction.\n */\n assetDataHash: OptionOrNullable<Array<number>>;\n /**\n * Expected current status flags (e.g. frozen, non-transferable) of the\n * `LeafSchema` V2 leaf, verified before this instruction updates them.\n */\n flags: OptionOrNullable<number>;\n /**\n * Tree-scoped nonce identifying the leaf, equal to the tree's\n * `numMinted` at the time the leaf was minted. Combined with the tree\n * address to derive the leaf's asset id.\n */\n nonce: number | bigint;\n /**\n * Position of the leaf within the Merkle tree, used with the Merkle\n * proof to locate and verify the leaf.\n */\n index: number;\n /**\n * The leaf's current `MetadataArgsV2`, verified against `dataHash`\n * before its collection is set.\n */\n message: MetadataArgsV2Args;\n};\n\nexport function getSetCollectionV2InstructionDataEncoder(): Encoder<SetCollectionV2InstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"root\", getArrayEncoder(getU8Encoder(), { size: 32 })],\n [\n \"assetDataHash\",\n getOptionEncoder(getArrayEncoder(getU8Encoder(), { size: 32 })),\n ],\n [\"flags\", getOptionEncoder(getU8Encoder())],\n [\"nonce\", getU64Encoder()],\n [\"index\", getU32Encoder()],\n [\"message\", getMetadataArgsV2Encoder()],\n ]),\n (value) => ({ ...value, discriminator: SET_COLLECTION_V2_DISCRIMINATOR }),\n );\n}\n\nexport function getSetCollectionV2InstructionDataDecoder(): Decoder<SetCollectionV2InstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"root\", getArrayDecoder(getU8Decoder(), { size: 32 })],\n [\n \"assetDataHash\",\n getOptionDecoder(getArrayDecoder(getU8Decoder(), { size: 32 })),\n ],\n [\"flags\", getOptionDecoder(getU8Decoder())],\n [\"nonce\", getU64Decoder()],\n [\"index\", getU32Decoder()],\n [\"message\", getMetadataArgsV2Decoder()],\n ]);\n}\n\nexport function getSetCollectionV2InstructionDataCodec(): Codec<\n SetCollectionV2InstructionDataArgs,\n SetCollectionV2InstructionData\n> {\n return combineCodec(\n getSetCollectionV2InstructionDataEncoder(),\n getSetCollectionV2InstructionDataDecoder(),\n );\n}\n\nexport type SetCollectionV2AsyncInput<\n TAccountTreeAuthority extends string = string,\n TAccountPayer extends string = string,\n TAccountAuthority extends string = string,\n TAccountNewCollectionAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountLeafDelegate extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountCoreCollection extends string = string,\n TAccountNewCoreCollection extends string = string,\n TAccountMplCoreCpiSigner extends string = string,\n TAccountLogWrapper extends string = string,\n TAccountCompressionProgram extends string = string,\n TAccountMplCoreProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /**\n * The tree's `TreeConfig` PDA, which stores its configuration and acts\n * as the tree's authority for CPIs into the compression program.\n */\n treeAuthority?: Address<TAccountTreeAuthority>;\n /** Account that pays for the transaction and any account rent. */\n payer: TransactionSigner<TAccountPayer>;\n /**\n * If the item is not currently in a collection, must be the tree\n * owner/delegate. If the item is being removed from a collection,\n * must be an authority for the existing collection. Defaults to\n * `payer`.\n */\n authority?: TransactionSigner<TAccountAuthority>;\n /**\n * If the item is being added to a new collection, must be the\n * authority for the new collection. Defaults to `authority`.\n */\n newCollectionAuthority?: TransactionSigner<TAccountNewCollectionAuthority>;\n /** Owner of the compressed NFT leaf being operated on. */\n leafOwner: Address<TAccountLeafOwner>;\n /** Defaults to `leafOwner`. */\n leafDelegate?: Address<TAccountLeafDelegate>;\n /**\n * The concurrent Merkle tree account storing the compressed leaves,\n * owned by the account compression program.\n */\n merkleTree: Address<TAccountMerkleTree>;\n /** MPL Core collection account the asset belongs to (V2 collections). */\n coreCollection?: Address<TAccountCoreCollection>;\n /** MPL Core collection account the asset is being moved into. */\n newCoreCollection?: Address<TAccountNewCoreCollection>;\n /**\n * PDA Bubblegum uses to sign CPIs into the MPL Core program on behalf\n * of a core collection.\n */\n mplCoreCpiSigner?: Address<TAccountMplCoreCpiSigner>;\n /**\n * The SPL/MPL Noop program, used to log leaf data so off-chain indexers\n * can reconstruct the tree.\n */\n logWrapper?: Address<TAccountLogWrapper>;\n /**\n * The SPL/MPL Account Compression program that owns and manages the\n * Merkle tree.\n */\n compressionProgram?: Address<TAccountCompressionProgram>;\n /** The MPL Core program, invoked for V2 collection CPIs. */\n mplCoreProgram?: Address<TAccountMplCoreProgram>;\n /** The Solana System program. */\n systemProgram?: Address<TAccountSystemProgram>;\n root: SetCollectionV2InstructionDataArgs[\"root\"];\n assetDataHash: SetCollectionV2InstructionDataArgs[\"assetDataHash\"];\n flags: SetCollectionV2InstructionDataArgs[\"flags\"];\n nonce: SetCollectionV2InstructionDataArgs[\"nonce\"];\n index: SetCollectionV2InstructionDataArgs[\"index\"];\n message: SetCollectionV2InstructionDataArgs[\"message\"];\n};\n\n/**\n * Sets the collection on a `LeafSchema` V2 leaf node.\n *\n * Unlike the V1 flow, no separate verification step is required: any\n * collection recorded on a V2 leaf is automatically considered\n * verified.\n */\nexport async function getSetCollectionV2InstructionAsync<\n TAccountTreeAuthority extends string,\n TAccountPayer extends string,\n TAccountAuthority extends string,\n TAccountNewCollectionAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountLeafDelegate extends string,\n TAccountMerkleTree extends string,\n TAccountCoreCollection extends string,\n TAccountNewCoreCollection extends string,\n TAccountMplCoreCpiSigner extends string,\n TAccountLogWrapper extends string,\n TAccountCompressionProgram extends string,\n TAccountMplCoreProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n>(\n input: SetCollectionV2AsyncInput<\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n SetCollectionV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? BUBBLEGUM_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n treeAuthority: { value: input.treeAuthority ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n newCollectionAuthority: {\n value: input.newCollectionAuthority ?? null,\n isWritable: false,\n },\n leafOwner: { value: input.leafOwner ?? null, isWritable: false },\n leafDelegate: { value: input.leafDelegate ?? null, isWritable: false },\n merkleTree: { value: input.merkleTree ?? null, isWritable: true },\n coreCollection: { value: input.coreCollection ?? null, isWritable: true },\n newCoreCollection: {\n value: input.newCoreCollection ?? null,\n isWritable: true,\n },\n mplCoreCpiSigner: {\n value: input.mplCoreCpiSigner ?? null,\n isWritable: false,\n },\n logWrapper: { value: input.logWrapper ?? null, isWritable: false },\n compressionProgram: {\n value: input.compressionProgram ?? null,\n isWritable: false,\n },\n mplCoreProgram: { value: input.mplCoreProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.treeAuthority.value) {\n accounts.treeAuthority.value = await findTreeConfigPda({\n merkleTree: getAddressFromResolvedInstructionAccount(\n \"merkleTree\",\n accounts.merkleTree.value,\n ),\n });\n }\n if (!accounts.mplCoreCpiSigner.value) {\n accounts.mplCoreCpiSigner.value =\n \"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\" as Address<\"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\">;\n }\n if (!accounts.logWrapper.value) {\n accounts.logWrapper.value =\n \"mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3\" as Address<\"mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3\">;\n }\n if (!accounts.compressionProgram.value) {\n accounts.compressionProgram.value =\n \"mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW\" as Address<\"mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW\">;\n }\n if (!accounts.mplCoreProgram.value) {\n accounts.mplCoreProgram.value =\n \"CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d\" as Address<\"CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"treeAuthority\", accounts.treeAuthority),\n getAccountMeta(\"payer\", accounts.payer),\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"newCollectionAuthority\", accounts.newCollectionAuthority),\n getAccountMeta(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"leafDelegate\", accounts.leafDelegate),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"coreCollection\", accounts.coreCollection),\n getAccountMeta(\"newCoreCollection\", accounts.newCoreCollection),\n getAccountMeta(\"mplCoreCpiSigner\", accounts.mplCoreCpiSigner),\n getAccountMeta(\"logWrapper\", accounts.logWrapper),\n getAccountMeta(\"compressionProgram\", accounts.compressionProgram),\n getAccountMeta(\"mplCoreProgram\", accounts.mplCoreProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getSetCollectionV2InstructionDataEncoder().encode(\n args as SetCollectionV2InstructionDataArgs,\n ),\n programAddress,\n } as SetCollectionV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type SetCollectionV2Input<\n TAccountTreeAuthority extends string = string,\n TAccountPayer extends string = string,\n TAccountAuthority extends string = string,\n TAccountNewCollectionAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountLeafDelegate extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountCoreCollection extends string = string,\n TAccountNewCoreCollection extends string = string,\n TAccountMplCoreCpiSigner extends string = string,\n TAccountLogWrapper extends string = string,\n TAccountCompressionProgram extends string = string,\n TAccountMplCoreProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /**\n * The tree's `TreeConfig` PDA, which stores its configuration and acts\n * as the tree's authority for CPIs into the compression program.\n */\n treeAuthority: Address<TAccountTreeAuthority>;\n /** Account that pays for the transaction and any account rent. */\n payer: TransactionSigner<TAccountPayer>;\n /**\n * If the item is not currently in a collection, must be the tree\n * owner/delegate. If the item is being removed from a collection,\n * must be an authority for the existing collection. Defaults to\n * `payer`.\n */\n authority?: TransactionSigner<TAccountAuthority>;\n /**\n * If the item is being added to a new collection, must be the\n * authority for the new collection. Defaults to `authority`.\n */\n newCollectionAuthority?: TransactionSigner<TAccountNewCollectionAuthority>;\n /** Owner of the compressed NFT leaf being operated on. */\n leafOwner: Address<TAccountLeafOwner>;\n /** Defaults to `leafOwner`. */\n leafDelegate?: Address<TAccountLeafDelegate>;\n /**\n * The concurrent Merkle tree account storing the compressed leaves,\n * owned by the account compression program.\n */\n merkleTree: Address<TAccountMerkleTree>;\n /** MPL Core collection account the asset belongs to (V2 collections). */\n coreCollection?: Address<TAccountCoreCollection>;\n /** MPL Core collection account the asset is being moved into. */\n newCoreCollection?: Address<TAccountNewCoreCollection>;\n /**\n * PDA Bubblegum uses to sign CPIs into the MPL Core program on behalf\n * of a core collection.\n */\n mplCoreCpiSigner?: Address<TAccountMplCoreCpiSigner>;\n /**\n * The SPL/MPL Noop program, used to log leaf data so off-chain indexers\n * can reconstruct the tree.\n */\n logWrapper?: Address<TAccountLogWrapper>;\n /**\n * The SPL/MPL Account Compression program that owns and manages the\n * Merkle tree.\n */\n compressionProgram?: Address<TAccountCompressionProgram>;\n /** The MPL Core program, invoked for V2 collection CPIs. */\n mplCoreProgram?: Address<TAccountMplCoreProgram>;\n /** The Solana System program. */\n systemProgram?: Address<TAccountSystemProgram>;\n root: SetCollectionV2InstructionDataArgs[\"root\"];\n assetDataHash: SetCollectionV2InstructionDataArgs[\"assetDataHash\"];\n flags: SetCollectionV2InstructionDataArgs[\"flags\"];\n nonce: SetCollectionV2InstructionDataArgs[\"nonce\"];\n index: SetCollectionV2InstructionDataArgs[\"index\"];\n message: SetCollectionV2InstructionDataArgs[\"message\"];\n};\n\n/**\n * Sets the collection on a `LeafSchema` V2 leaf node.\n *\n * Unlike the V1 flow, no separate verification step is required: any\n * collection recorded on a V2 leaf is automatically considered\n * verified.\n */\nexport function getSetCollectionV2Instruction<\n TAccountTreeAuthority extends string,\n TAccountPayer extends string,\n TAccountAuthority extends string,\n TAccountNewCollectionAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountLeafDelegate extends string,\n TAccountMerkleTree extends string,\n TAccountCoreCollection extends string,\n TAccountNewCoreCollection extends string,\n TAccountMplCoreCpiSigner extends string,\n TAccountLogWrapper extends string,\n TAccountCompressionProgram extends string,\n TAccountMplCoreProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n>(\n input: SetCollectionV2Input<\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): SetCollectionV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? BUBBLEGUM_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n treeAuthority: { value: input.treeAuthority ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n newCollectionAuthority: {\n value: input.newCollectionAuthority ?? null,\n isWritable: false,\n },\n leafOwner: { value: input.leafOwner ?? null, isWritable: false },\n leafDelegate: { value: input.leafDelegate ?? null, isWritable: false },\n merkleTree: { value: input.merkleTree ?? null, isWritable: true },\n coreCollection: { value: input.coreCollection ?? null, isWritable: true },\n newCoreCollection: {\n value: input.newCoreCollection ?? null,\n isWritable: true,\n },\n mplCoreCpiSigner: {\n value: input.mplCoreCpiSigner ?? null,\n isWritable: false,\n },\n logWrapper: { value: input.logWrapper ?? null, isWritable: false },\n compressionProgram: {\n value: input.compressionProgram ?? null,\n isWritable: false,\n },\n mplCoreProgram: { value: input.mplCoreProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.mplCoreCpiSigner.value) {\n accounts.mplCoreCpiSigner.value =\n \"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\" as Address<\"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\">;\n }\n if (!accounts.logWrapper.value) {\n accounts.logWrapper.value =\n \"mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3\" as Address<\"mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3\">;\n }\n if (!accounts.compressionProgram.value) {\n accounts.compressionProgram.value =\n \"mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW\" as Address<\"mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW\">;\n }\n if (!accounts.mplCoreProgram.value) {\n accounts.mplCoreProgram.value =\n \"CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d\" as Address<\"CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"treeAuthority\", accounts.treeAuthority),\n getAccountMeta(\"payer\", accounts.payer),\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"newCollectionAuthority\", accounts.newCollectionAuthority),\n getAccountMeta(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"leafDelegate\", accounts.leafDelegate),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"coreCollection\", accounts.coreCollection),\n getAccountMeta(\"newCoreCollection\", accounts.newCoreCollection),\n getAccountMeta(\"mplCoreCpiSigner\", accounts.mplCoreCpiSigner),\n getAccountMeta(\"logWrapper\", accounts.logWrapper),\n getAccountMeta(\"compressionProgram\", accounts.compressionProgram),\n getAccountMeta(\"mplCoreProgram\", accounts.mplCoreProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getSetCollectionV2InstructionDataEncoder().encode(\n args as SetCollectionV2InstructionDataArgs,\n ),\n programAddress,\n } as SetCollectionV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountAuthority,\n TAccountNewCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountNewCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedSetCollectionV2Instruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /**\n * The tree's `TreeConfig` PDA, which stores its configuration and acts\n * as the tree's authority for CPIs into the compression program.\n */\n treeAuthority: TAccountMetas[0];\n /** Account that pays for the transaction and any account rent. */\n payer: TAccountMetas[1];\n /**\n * If the item is not currently in a collection, must be the tree\n * owner/delegate. If the item is being removed from a collection,\n * must be an authority for the existing collection. Defaults to\n * `payer`.\n */\n authority?: TAccountMetas[2] | undefined;\n /**\n * If the item is being added to a new collection, must be the\n * authority for the new collection. Defaults to `authority`.\n */\n newCollectionAuthority?: TAccountMetas[3] | undefined;\n /** Owner of the compressed NFT leaf being operated on. */\n leafOwner: TAccountMetas[4];\n /** Defaults to `leafOwner`. */\n leafDelegate?: TAccountMetas[5] | undefined;\n /**\n * The concurrent Merkle tree account storing the compressed leaves,\n * owned by the account compression program.\n */\n merkleTree: TAccountMetas[6];\n /** MPL Core collection account the asset belongs to (V2 collections). */\n coreCollection?: TAccountMetas[7] | undefined;\n /** MPL Core collection account the asset is being moved into. */\n newCoreCollection?: TAccountMetas[8] | undefined;\n /**\n * PDA Bubblegum uses to sign CPIs into the MPL Core program on behalf\n * of a core collection.\n */\n mplCoreCpiSigner: TAccountMetas[9];\n /**\n * The SPL/MPL Noop program, used to log leaf data so off-chain indexers\n * can reconstruct the tree.\n */\n logWrapper: TAccountMetas[10];\n /**\n * The SPL/MPL Account Compression program that owns and manages the\n * Merkle tree.\n */\n compressionProgram: TAccountMetas[11];\n /** The MPL Core program, invoked for V2 collection CPIs. */\n mplCoreProgram: TAccountMetas[12];\n /** The Solana System program. */\n systemProgram: TAccountMetas[13];\n };\n data: SetCollectionV2InstructionData;\n};\n\nexport function parseSetCollectionV2Instruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSetCollectionV2Instruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 14) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 14,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n const getNextOptionalAccount = () => {\n const accountMeta = getNextAccount();\n return accountMeta.address === BUBBLEGUM_PROGRAM_ADDRESS\n ? undefined\n : accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n treeAuthority: getNextAccount(),\n payer: getNextAccount(),\n authority: getNextOptionalAccount(),\n newCollectionAuthority: getNextOptionalAccount(),\n leafOwner: getNextAccount(),\n leafDelegate: getNextOptionalAccount(),\n merkleTree: getNextAccount(),\n coreCollection: getNextOptionalAccount(),\n newCoreCollection: getNextOptionalAccount(),\n mplCoreCpiSigner: getNextAccount(),\n logWrapper: getNextAccount(),\n compressionProgram: getNextAccount(),\n mplCoreProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getSetCollectionV2InstructionDataDecoder().decode(instruction.data),\n };\n}\n"],"mappings":";;;;;;;;;;;;;AA6DA,MAAa,kCACX,IAAI,WAAW;CAAC;CAAK;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;AAAG,CAAC;AAEnD,SAAgB,uCAA2D;CACzE,OAAO,eAAe,gBAAgB,GAAG,CAAC,CAAC,CAAC,OAC1C,+BACF;AACF;AAkJA,SAAgB,2CAAwF;CACtG,OAAO,iBACL,iBAAiB;EACf,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC;EACtD,CAAC,QAAQ,gBAAgB,aAAa,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;EACtD,CACE,iBACA,iBAAiB,gBAAgB,aAAa,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,CAChE;EACA,CAAC,SAAS,iBAAiB,aAAa,CAAC,CAAC;EAC1C,CAAC,SAAS,cAAc,CAAC;EACzB,CAAC,SAAS,cAAc,CAAC;EACzB,CAAC,WAAW,yBAAyB,CAAC;CACxC,CAAC,IACA,WAAW;EAAE,GAAG;EAAO,eAAe;CAAgC,EACzE;AACF;AAEA,SAAgB,2CAAoF;CAClG,OAAO,iBAAiB;EACtB,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC;EACtD,CAAC,QAAQ,gBAAgB,aAAa,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;EACtD,CACE,iBACA,iBAAiB,gBAAgB,aAAa,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,CAChE;EACA,CAAC,SAAS,iBAAiB,aAAa,CAAC,CAAC;EAC1C,CAAC,SAAS,cAAc,CAAC;EACzB,CAAC,SAAS,cAAc,CAAC;EAC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AAS,gBAAgB;GAC5D,eAAe,cAAc,SAAS,UAAU;GAChD,eAAe,sBAAsB,SAAS,kBAAkB;GAChE,eAAe,kBAAkB,SAAS,cAAc;GACxD,eAAe,iBAAiB,SAAS,aAAa;EACxD;EACA,MAAM,yCAAyC,CAAC,CAAC,OAC/C,IACF;EACA;CACF,CAgBC;AACH;AA+DA,SAAgB,gCAId,aAG2D;CAC3D,IAAI,YAAY,SAAS,SAAS,IAChC,MAAM,IAAI,YACR,2DACA;EACE,oBAAoB,YAAY,SAAS;EACzC,sBAAsB;CACxB,CACF;CAEF,IAAI,eAAe;CACnB,MAAM,uBAAuB;EAC3B,MAAM,cAAe,YAAY,SAA2B;EAC5D,gBAAgB;EAChB,OAAO;CACT;CACA,MAAM,+BAA+B;EACnC,MAAM,cAAc,eAAe;EACnC,OAAO,YAAY,YAAA,iDACf,KAAA,IACA;CACN;CACA,OAAO;EACL,gBAAgB,YAAY;EAC5B,UAAU;GACR,eAAe,eAAe;GAC9B,OAAO,eAAe;GACtB,WAAW,uBAAuB;GAClC,wBAAwB,uBAAuB;GAC/C,WAAW,eAAe;GAC1B,cAAc,uBAAuB;GACrC,YAAY,eAAe;GAC3B,gBAAgB,uBAAuB;GACvC,mBAAmB,uBAAuB;GAC1C,kBAAkB,eAAe;GACjC,YAAY,eAAe;GAC3B,oBAAoB,eAAe;GACnC,gBAAgB,eAAe;GAC/B,eAAe,eAAe;EAChC;EACA,MAAM,yCAAyC,CAAC,CAAC,OAAO,YAAY,IAAI;CAC1E;AACF"}
|
|
@@ -1,37 +1,68 @@
|
|
|
1
1
|
import { DecompressibleState, DecompressibleStateArgs } from "../types/decompressibleState.js";
|
|
2
|
+
import "../types/index.js";
|
|
2
3
|
import { BUBBLEGUM_PROGRAM_ADDRESS } from "../programs/bubblegum.js";
|
|
4
|
+
import "../programs/index.js";
|
|
3
5
|
import { AccountMeta, AccountSignerMeta, Address, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlySignerAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount } from "@solana/kit";
|
|
4
|
-
|
|
5
6
|
//#region src/generated/instructions/setDecompressableState.d.ts
|
|
6
7
|
declare const SET_DECOMPRESSABLE_STATE_DISCRIMINATOR: ReadonlyUint8Array;
|
|
7
8
|
declare function getSetDecompressableStateDiscriminatorBytes(): ReadonlyUint8Array;
|
|
8
9
|
type SetDecompressableStateInstruction<TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS, TAccountTreeAuthority extends string | AccountMeta<string> = string, TAccountTreeCreator extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountTreeAuthority extends string ? WritableAccount<TAccountTreeAuthority> : TAccountTreeAuthority, TAccountTreeCreator extends string ? ReadonlySignerAccount<TAccountTreeCreator> & AccountSignerMeta<TAccountTreeCreator> : TAccountTreeCreator, ...TRemainingAccounts]>;
|
|
9
|
-
|
|
10
|
+
type SetDecompressableStateInstructionData = {
|
|
10
11
|
discriminator: ReadonlyUint8Array;
|
|
12
|
+
/**
|
|
13
|
+
* The new decompressible state to set on the tree: `Enabled` allows
|
|
14
|
+
* `redeem`/`decompressV1`, `Disabled` blocks them.
|
|
15
|
+
*/
|
|
11
16
|
decompressableState: DecompressibleState;
|
|
12
|
-
}
|
|
13
|
-
|
|
17
|
+
};
|
|
18
|
+
type SetDecompressableStateInstructionDataArgs = {
|
|
19
|
+
/**
|
|
20
|
+
* The new decompressible state to set on the tree: `Enabled` allows
|
|
21
|
+
* `redeem`/`decompressV1`, `Disabled` blocks them.
|
|
22
|
+
*/
|
|
14
23
|
decompressableState: DecompressibleStateArgs;
|
|
15
|
-
}
|
|
24
|
+
};
|
|
16
25
|
declare function getSetDecompressableStateInstructionDataEncoder(): FixedSizeEncoder<SetDecompressableStateInstructionDataArgs>;
|
|
17
26
|
declare function getSetDecompressableStateInstructionDataDecoder(): FixedSizeDecoder<SetDecompressableStateInstructionData>;
|
|
18
27
|
declare function getSetDecompressableStateInstructionDataCodec(): FixedSizeCodec<SetDecompressableStateInstructionDataArgs, SetDecompressableStateInstructionData>;
|
|
19
|
-
|
|
28
|
+
type SetDecompressableStateInput<TAccountTreeAuthority extends string = string, TAccountTreeCreator extends string = string> = {
|
|
29
|
+
/**
|
|
30
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
31
|
+
* as the tree's authority for CPIs into the compression program.
|
|
32
|
+
*/
|
|
20
33
|
treeAuthority: Address<TAccountTreeAuthority>;
|
|
34
|
+
/**
|
|
35
|
+
* Creator of the tree, recorded in `TreeConfig` when the tree was
|
|
36
|
+
* created.
|
|
37
|
+
*/
|
|
21
38
|
treeCreator: TransactionSigner<TAccountTreeCreator>;
|
|
22
39
|
decompressableState: SetDecompressableStateInstructionDataArgs["decompressableState"];
|
|
23
|
-
}
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Sets the `decompressible_state` of a tree.
|
|
43
|
+
*
|
|
44
|
+
* Deprecated alias for `setDecompressibleState`, kept for backwards
|
|
45
|
+
* compatibility; prefer `setDecompressibleState` in new code.
|
|
46
|
+
*/
|
|
24
47
|
declare function getSetDecompressableStateInstruction<TAccountTreeAuthority extends string, TAccountTreeCreator extends string, TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS>(input: SetDecompressableStateInput<TAccountTreeAuthority, TAccountTreeCreator>, config?: {
|
|
25
48
|
programAddress?: TProgramAddress;
|
|
26
49
|
}): SetDecompressableStateInstruction<TProgramAddress, TAccountTreeAuthority, TAccountTreeCreator>;
|
|
27
|
-
|
|
50
|
+
type ParsedSetDecompressableStateInstruction<TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
28
51
|
programAddress: Address<TProgram>;
|
|
29
52
|
accounts: {
|
|
53
|
+
/**
|
|
54
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
55
|
+
* as the tree's authority for CPIs into the compression program.
|
|
56
|
+
*/
|
|
30
57
|
treeAuthority: TAccountMetas[0];
|
|
58
|
+
/**
|
|
59
|
+
* Creator of the tree, recorded in `TreeConfig` when the tree was
|
|
60
|
+
* created.
|
|
61
|
+
*/
|
|
31
62
|
treeCreator: TAccountMetas[1];
|
|
32
63
|
};
|
|
33
64
|
data: SetDecompressableStateInstructionData;
|
|
34
|
-
}
|
|
65
|
+
};
|
|
35
66
|
declare function parseSetDecompressableStateInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSetDecompressableStateInstruction<TProgram, TAccountMetas>;
|
|
36
67
|
//#endregion
|
|
37
68
|
export { ParsedSetDecompressableStateInstruction, SET_DECOMPRESSABLE_STATE_DISCRIMINATOR, SetDecompressableStateInput, SetDecompressableStateInstruction, SetDecompressableStateInstructionData, SetDecompressableStateInstructionDataArgs, getSetDecompressableStateDiscriminatorBytes, getSetDecompressableStateInstruction, getSetDecompressableStateInstructionDataCodec, getSetDecompressableStateInstructionDataDecoder, getSetDecompressableStateInstructionDataEncoder, parseSetDecompressableStateInstruction };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setDecompressableState.d.ts","names":[],"sources":["../../../src/generated/instructions/setDecompressableState.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"setDecompressableState.d.ts","names":[],"sources":["../../../src/generated/instructions/setDecompressableState.ts"],"mappings":";;;;;;cA6Ca,wCAAwC;iBAGrC,+CAA+C;KAMnD,kCACV,iCAAiC,2BACjC,uCAAuC,8BACvC,qCAAqC,8BACrC,oCAAoC,8BAClC,YAAY,YACd,oBAAoB,sBACpB,yBAEI,uCACI,gBAAgB,yBAChB,uBACJ,qCACI,sBAAsB,uBACpB,kBAAkB,uBACpB,wBACD;KAIG;EACV,eAAe;;;;;EAKf,qBAAqB;;KAGX;;;;;EAKV,qBAAqB;;iBAGP,mDAAmD,iBAAiB;iBAapE,mDAAmD,iBAAiB;iBAOpE,iDAAiD,eAC/D,2CACA;KAQU,4BACV,+CACA;;;;;EAMA,eAAe,QAAQ;;;;;EAKvB,aAAa,kBAAkB;EAC/B,qBAAqB;;;;;;;;iBASP,qCACd,sCACA,oCACA,wBAAwB,iBAAiB,2BAEzC,OAAO,4BACL,uBACA,sBAEF;EAAW,iBAAiB;IAC3B,kCACD,iBACA,uBACA;KAmCU,wCACV,iCAAiC,2BACjC,+BAA+B,yBAAyB;EAExD,gBAAgB,QAAQ;EACxB;;;;;IAKE,eAAe;;;;;IAKf,aAAa;;EAEf,MAAM;;iBAGQ,uCACd,yBACA,+BAA+B,eAE/B,aAAa,YAAY,YACvB,wBAAwB,iBACxB,oBAAoB,sBACrB,wCAAwC,UAAU"}
|
|
@@ -3,6 +3,13 @@ import "../programs/bubblegum.js";
|
|
|
3
3
|
import { SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, transformEncoder } from "@solana/kit";
|
|
4
4
|
import { getAccountMetaFactory } from "@solana/program-client-core";
|
|
5
5
|
//#region src/generated/instructions/setDecompressableState.ts
|
|
6
|
+
/**
|
|
7
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
8
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
9
|
+
* to add features, then rerun Codama to update it.
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/codama-idl/codama
|
|
12
|
+
*/
|
|
6
13
|
const SET_DECOMPRESSABLE_STATE_DISCRIMINATOR = new Uint8Array([
|
|
7
14
|
18,
|
|
8
15
|
135,
|
|
@@ -28,6 +35,12 @@ function getSetDecompressableStateInstructionDataDecoder() {
|
|
|
28
35
|
function getSetDecompressableStateInstructionDataCodec() {
|
|
29
36
|
return combineCodec(getSetDecompressableStateInstructionDataEncoder(), getSetDecompressableStateInstructionDataDecoder());
|
|
30
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Sets the `decompressible_state` of a tree.
|
|
40
|
+
*
|
|
41
|
+
* Deprecated alias for `setDecompressibleState`, kept for backwards
|
|
42
|
+
* compatibility; prefer `setDecompressibleState` in new code.
|
|
43
|
+
*/
|
|
31
44
|
function getSetDecompressableStateInstruction(input, config) {
|
|
32
45
|
const programAddress = config?.programAddress ?? "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
33
46
|
const accounts = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setDecompressableState.js","names":[],"sources":["../../../src/generated/instructions/setDecompressableState.ts"],"sourcesContent":["/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"setDecompressableState.js","names":[],"sources":["../../../src/generated/instructions/setDecompressableState.ts"],"sourcesContent":["/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/program-client-core\";\nimport { BUBBLEGUM_PROGRAM_ADDRESS } from \"../programs/index.js\";\nimport {\n getDecompressibleStateDecoder,\n getDecompressibleStateEncoder,\n type DecompressibleState,\n type DecompressibleStateArgs,\n} from \"../types/index.js\";\n\nexport const SET_DECOMPRESSABLE_STATE_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([18, 135, 238, 168, 246, 195, 61, 115]);\n\nexport function getSetDecompressableStateDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n SET_DECOMPRESSABLE_STATE_DISCRIMINATOR,\n );\n}\n\nexport type SetDecompressableStateInstruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountTreeAuthority extends string | AccountMeta<string> = string,\n TAccountTreeCreator extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountTreeAuthority extends string\n ? WritableAccount<TAccountTreeAuthority>\n : TAccountTreeAuthority,\n TAccountTreeCreator extends string\n ? ReadonlySignerAccount<TAccountTreeCreator> &\n AccountSignerMeta<TAccountTreeCreator>\n : TAccountTreeCreator,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SetDecompressableStateInstructionData = {\n discriminator: ReadonlyUint8Array;\n /**\n * The new decompressible state to set on the tree: `Enabled` allows\n * `redeem`/`decompressV1`, `Disabled` blocks them.\n */\n decompressableState: DecompressibleState;\n};\n\nexport type SetDecompressableStateInstructionDataArgs = {\n /**\n * The new decompressible state to set on the tree: `Enabled` allows\n * `redeem`/`decompressV1`, `Disabled` blocks them.\n */\n decompressableState: DecompressibleStateArgs;\n};\n\nexport function getSetDecompressableStateInstructionDataEncoder(): FixedSizeEncoder<SetDecompressableStateInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"decompressableState\", getDecompressibleStateEncoder()],\n ]),\n (value) => ({\n ...value,\n discriminator: SET_DECOMPRESSABLE_STATE_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getSetDecompressableStateInstructionDataDecoder(): FixedSizeDecoder<SetDecompressableStateInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"decompressableState\", getDecompressibleStateDecoder()],\n ]);\n}\n\nexport function getSetDecompressableStateInstructionDataCodec(): FixedSizeCodec<\n SetDecompressableStateInstructionDataArgs,\n SetDecompressableStateInstructionData\n> {\n return combineCodec(\n getSetDecompressableStateInstructionDataEncoder(),\n getSetDecompressableStateInstructionDataDecoder(),\n );\n}\n\nexport type SetDecompressableStateInput<\n TAccountTreeAuthority extends string = string,\n TAccountTreeCreator extends string = string,\n> = {\n /**\n * The tree's `TreeConfig` PDA, which stores its configuration and acts\n * as the tree's authority for CPIs into the compression program.\n */\n treeAuthority: Address<TAccountTreeAuthority>;\n /**\n * Creator of the tree, recorded in `TreeConfig` when the tree was\n * created.\n */\n treeCreator: TransactionSigner<TAccountTreeCreator>;\n decompressableState: SetDecompressableStateInstructionDataArgs[\"decompressableState\"];\n};\n\n/**\n * Sets the `decompressible_state` of a tree.\n *\n * Deprecated alias for `setDecompressibleState`, kept for backwards\n * compatibility; prefer `setDecompressibleState` in new code.\n */\nexport function getSetDecompressableStateInstruction<\n TAccountTreeAuthority extends string,\n TAccountTreeCreator extends string,\n TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n>(\n input: SetDecompressableStateInput<\n TAccountTreeAuthority,\n TAccountTreeCreator\n >,\n config?: { programAddress?: TProgramAddress },\n): SetDecompressableStateInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountTreeCreator\n> {\n // Program address.\n const programAddress = config?.programAddress ?? BUBBLEGUM_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n treeAuthority: { value: input.treeAuthority ?? null, isWritable: true },\n treeCreator: { value: input.treeCreator ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"treeAuthority\", accounts.treeAuthority),\n getAccountMeta(\"treeCreator\", accounts.treeCreator),\n ],\n data: getSetDecompressableStateInstructionDataEncoder().encode(\n args as SetDecompressableStateInstructionDataArgs,\n ),\n programAddress,\n } as SetDecompressableStateInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountTreeCreator\n >);\n}\n\nexport type ParsedSetDecompressableStateInstruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /**\n * The tree's `TreeConfig` PDA, which stores its configuration and acts\n * as the tree's authority for CPIs into the compression program.\n */\n treeAuthority: TAccountMetas[0];\n /**\n * Creator of the tree, recorded in `TreeConfig` when the tree was\n * created.\n */\n treeCreator: TAccountMetas[1];\n };\n data: SetDecompressableStateInstructionData;\n};\n\nexport function parseSetDecompressableStateInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSetDecompressableStateInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n treeAuthority: getNextAccount(),\n treeCreator: getNextAccount(),\n },\n data: getSetDecompressableStateInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n"],"mappings":";;;;;;;;;;;;AA6CA,MAAa,yCACX,IAAI,WAAW;CAAC;CAAI;CAAK;CAAK;CAAK;CAAK;CAAK;CAAI;AAAG,CAAC;AAEvD,SAAgB,8CAAkE;CAChF,OAAO,eAAe,gBAAgB,GAAG,CAAC,CAAC,CAAC,OAC1C,sCACF;AACF;AAuCA,SAAgB,kDAA+G;CAC7H,OAAO,iBACL,iBAAiB,CACf,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC,GACtD,CAAC,uBAAuB,8BAA8B,CAAC,CACzD,CAAC,IACA,WAAW;EACV,GAAG;EACH,eAAe;CACjB,EACF;AACF;AAEA,SAAgB,kDAA2G;CACzH,OAAO,iBAAiB,CACtB,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC,GACtD,CAAC,uBAAuB,8BAA8B,CAAC,CACzD,CAAC;AACH;AAEA,SAAgB,gDAGd;CACA,OAAO,aACL,gDAAgD,GAChD,gDAAgD,CAClD;AACF;;;;;;;AAyBA,SAAgB,qCAKd,OAIA,QAKA;CAEA,MAAM,iBAAiB,QAAQ,kBAAA;CAO/B,MAAM,WAAW;EAHf,eAAe;GAAE,OAAO,MAAM,iBAAiB;GAAM,YAAY;EAAK;EACtE,aAAa;GAAE,OAAO,MAAM,eAAe;GAAM,YAAY;EAAM;CAErC;CAMhC,MAAM,OAAO,EAAE,GAAG,MAAM;CAExB,MAAM,iBAAiB,sBAAsB,gBAAgB,WAAW;CACxE,OAAO,OAAO,OAAO;EACnB,UAAU,CACR,eAAe,iBAAiB,SAAS,aAAa,GACtD,eAAe,eAAe,SAAS,WAAW,CACpD;EACA,MAAM,gDAAgD,CAAC,CAAC,OACtD,IACF;EACA;CACF,CAIC;AACH;AAsBA,SAAgB,uCAId,aAGkE;CAClE,IAAI,YAAY,SAAS,SAAS,GAChC,MAAM,IAAI,YACR,2DACA;EACE,oBAAoB,YAAY,SAAS;EACzC,sBAAsB;CACxB,CACF;CAEF,IAAI,eAAe;CACnB,MAAM,uBAAuB;EAC3B,MAAM,cAAe,YAAY,SAA2B;EAC5D,gBAAgB;EAChB,OAAO;CACT;CACA,OAAO;EACL,gBAAgB,YAAY;EAC5B,UAAU;GACR,eAAe,eAAe;GAC9B,aAAa,eAAe;EAC9B;EACA,MAAM,gDAAgD,CAAC,CAAC,OACtD,YAAY,IACd;CACF;AACF"}
|
|
@@ -1,37 +1,69 @@
|
|
|
1
1
|
import { DecompressibleState, DecompressibleStateArgs } from "../types/decompressibleState.js";
|
|
2
|
+
import "../types/index.js";
|
|
2
3
|
import { BUBBLEGUM_PROGRAM_ADDRESS } from "../programs/bubblegum.js";
|
|
4
|
+
import "../programs/index.js";
|
|
3
5
|
import { AccountMeta, AccountSignerMeta, Address, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlySignerAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount } from "@solana/kit";
|
|
4
|
-
|
|
5
6
|
//#region src/generated/instructions/setDecompressibleState.d.ts
|
|
6
7
|
declare const SET_DECOMPRESSIBLE_STATE_DISCRIMINATOR: ReadonlyUint8Array;
|
|
7
8
|
declare function getSetDecompressibleStateDiscriminatorBytes(): ReadonlyUint8Array;
|
|
8
9
|
type SetDecompressibleStateInstruction<TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS, TAccountTreeAuthority extends string | AccountMeta<string> = string, TAccountTreeCreator extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountTreeAuthority extends string ? WritableAccount<TAccountTreeAuthority> : TAccountTreeAuthority, TAccountTreeCreator extends string ? ReadonlySignerAccount<TAccountTreeCreator> & AccountSignerMeta<TAccountTreeCreator> : TAccountTreeCreator, ...TRemainingAccounts]>;
|
|
9
|
-
|
|
10
|
+
type SetDecompressibleStateInstructionData = {
|
|
10
11
|
discriminator: ReadonlyUint8Array;
|
|
12
|
+
/**
|
|
13
|
+
* The new decompressible state to set on the tree: `Enabled` allows
|
|
14
|
+
* `redeem`/`decompressV1`, `Disabled` blocks them.
|
|
15
|
+
*/
|
|
11
16
|
decompressableState: DecompressibleState;
|
|
12
|
-
}
|
|
13
|
-
|
|
17
|
+
};
|
|
18
|
+
type SetDecompressibleStateInstructionDataArgs = {
|
|
19
|
+
/**
|
|
20
|
+
* The new decompressible state to set on the tree: `Enabled` allows
|
|
21
|
+
* `redeem`/`decompressV1`, `Disabled` blocks them.
|
|
22
|
+
*/
|
|
14
23
|
decompressableState: DecompressibleStateArgs;
|
|
15
|
-
}
|
|
24
|
+
};
|
|
16
25
|
declare function getSetDecompressibleStateInstructionDataEncoder(): FixedSizeEncoder<SetDecompressibleStateInstructionDataArgs>;
|
|
17
26
|
declare function getSetDecompressibleStateInstructionDataDecoder(): FixedSizeDecoder<SetDecompressibleStateInstructionData>;
|
|
18
27
|
declare function getSetDecompressibleStateInstructionDataCodec(): FixedSizeCodec<SetDecompressibleStateInstructionDataArgs, SetDecompressibleStateInstructionData>;
|
|
19
|
-
|
|
28
|
+
type SetDecompressibleStateInput<TAccountTreeAuthority extends string = string, TAccountTreeCreator extends string = string> = {
|
|
29
|
+
/**
|
|
30
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
31
|
+
* as the tree's authority for CPIs into the compression program.
|
|
32
|
+
*/
|
|
20
33
|
treeAuthority: Address<TAccountTreeAuthority>;
|
|
34
|
+
/**
|
|
35
|
+
* Creator of the tree, recorded in `TreeConfig` when the tree was
|
|
36
|
+
* created.
|
|
37
|
+
*/
|
|
21
38
|
treeCreator: TransactionSigner<TAccountTreeCreator>;
|
|
22
39
|
decompressableState: SetDecompressibleStateInstructionDataArgs["decompressableState"];
|
|
23
|
-
}
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Sets the `decompressible_state` of a tree.
|
|
43
|
+
*
|
|
44
|
+
* Controls whether leaves in the tree may be `redeem`ed and
|
|
45
|
+
* `decompressV1`'d into regular NFTs. Only the tree creator may call
|
|
46
|
+
* this instruction.
|
|
47
|
+
*/
|
|
24
48
|
declare function getSetDecompressibleStateInstruction<TAccountTreeAuthority extends string, TAccountTreeCreator extends string, TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS>(input: SetDecompressibleStateInput<TAccountTreeAuthority, TAccountTreeCreator>, config?: {
|
|
25
49
|
programAddress?: TProgramAddress;
|
|
26
50
|
}): SetDecompressibleStateInstruction<TProgramAddress, TAccountTreeAuthority, TAccountTreeCreator>;
|
|
27
|
-
|
|
51
|
+
type ParsedSetDecompressibleStateInstruction<TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
28
52
|
programAddress: Address<TProgram>;
|
|
29
53
|
accounts: {
|
|
54
|
+
/**
|
|
55
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
56
|
+
* as the tree's authority for CPIs into the compression program.
|
|
57
|
+
*/
|
|
30
58
|
treeAuthority: TAccountMetas[0];
|
|
59
|
+
/**
|
|
60
|
+
* Creator of the tree, recorded in `TreeConfig` when the tree was
|
|
61
|
+
* created.
|
|
62
|
+
*/
|
|
31
63
|
treeCreator: TAccountMetas[1];
|
|
32
64
|
};
|
|
33
65
|
data: SetDecompressibleStateInstructionData;
|
|
34
|
-
}
|
|
66
|
+
};
|
|
35
67
|
declare function parseSetDecompressibleStateInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSetDecompressibleStateInstruction<TProgram, TAccountMetas>;
|
|
36
68
|
//#endregion
|
|
37
69
|
export { ParsedSetDecompressibleStateInstruction, SET_DECOMPRESSIBLE_STATE_DISCRIMINATOR, SetDecompressibleStateInput, SetDecompressibleStateInstruction, SetDecompressibleStateInstructionData, SetDecompressibleStateInstructionDataArgs, getSetDecompressibleStateDiscriminatorBytes, getSetDecompressibleStateInstruction, getSetDecompressibleStateInstructionDataCodec, getSetDecompressibleStateInstructionDataDecoder, getSetDecompressibleStateInstructionDataEncoder, parseSetDecompressibleStateInstruction };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setDecompressibleState.d.ts","names":[],"sources":["../../../src/generated/instructions/setDecompressibleState.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"setDecompressibleState.d.ts","names":[],"sources":["../../../src/generated/instructions/setDecompressibleState.ts"],"mappings":";;;;;;cA6Ca,wCAAwC;iBAGrC,+CAA+C;KAMnD,kCACV,iCAAiC,2BACjC,uCAAuC,8BACvC,qCAAqC,8BACrC,oCAAoC,8BAClC,YAAY,YACd,oBAAoB,sBACpB,yBAEI,uCACI,gBAAgB,yBAChB,uBACJ,qCACI,sBAAsB,uBACpB,kBAAkB,uBACpB,wBACD;KAIG;EACV,eAAe;;;;;EAKf,qBAAqB;;KAGX;;;;;EAKV,qBAAqB;;iBAGP,mDAAmD,iBAAiB;iBAapE,mDAAmD,iBAAiB;iBAOpE,iDAAiD,eAC/D,2CACA;KAQU,4BACV,+CACA;;;;;EAMA,eAAe,QAAQ;;;;;EAKvB,aAAa,kBAAkB;EAC/B,qBAAqB;;;;;;;;;iBAUP,qCACd,sCACA,oCACA,wBAAwB,iBAAiB,2BAEzC,OAAO,4BACL,uBACA,sBAEF;EAAW,iBAAiB;IAC3B,kCACD,iBACA,uBACA;KAmCU,wCACV,iCAAiC,2BACjC,+BAA+B,yBAAyB;EAExD,gBAAgB,QAAQ;EACxB;;;;;IAKE,eAAe;;;;;IAKf,aAAa;;EAEf,MAAM;;iBAGQ,uCACd,yBACA,+BAA+B,eAE/B,aAAa,YAAY,YACvB,wBAAwB,iBACxB,oBAAoB,sBACrB,wCAAwC,UAAU"}
|
|
@@ -3,6 +3,13 @@ import "../programs/bubblegum.js";
|
|
|
3
3
|
import { SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, transformEncoder } from "@solana/kit";
|
|
4
4
|
import { getAccountMetaFactory } from "@solana/program-client-core";
|
|
5
5
|
//#region src/generated/instructions/setDecompressibleState.ts
|
|
6
|
+
/**
|
|
7
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
8
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
9
|
+
* to add features, then rerun Codama to update it.
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/codama-idl/codama
|
|
12
|
+
*/
|
|
6
13
|
const SET_DECOMPRESSIBLE_STATE_DISCRIMINATOR = new Uint8Array([
|
|
7
14
|
82,
|
|
8
15
|
104,
|
|
@@ -28,6 +35,13 @@ function getSetDecompressibleStateInstructionDataDecoder() {
|
|
|
28
35
|
function getSetDecompressibleStateInstructionDataCodec() {
|
|
29
36
|
return combineCodec(getSetDecompressibleStateInstructionDataEncoder(), getSetDecompressibleStateInstructionDataDecoder());
|
|
30
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Sets the `decompressible_state` of a tree.
|
|
40
|
+
*
|
|
41
|
+
* Controls whether leaves in the tree may be `redeem`ed and
|
|
42
|
+
* `decompressV1`'d into regular NFTs. Only the tree creator may call
|
|
43
|
+
* this instruction.
|
|
44
|
+
*/
|
|
31
45
|
function getSetDecompressibleStateInstruction(input, config) {
|
|
32
46
|
const programAddress = config?.programAddress ?? "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
33
47
|
const accounts = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setDecompressibleState.js","names":[],"sources":["../../../src/generated/instructions/setDecompressibleState.ts"],"sourcesContent":["/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"setDecompressibleState.js","names":[],"sources":["../../../src/generated/instructions/setDecompressibleState.ts"],"sourcesContent":["/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/program-client-core\";\nimport { BUBBLEGUM_PROGRAM_ADDRESS } from \"../programs/index.js\";\nimport {\n getDecompressibleStateDecoder,\n getDecompressibleStateEncoder,\n type DecompressibleState,\n type DecompressibleStateArgs,\n} from \"../types/index.js\";\n\nexport const SET_DECOMPRESSIBLE_STATE_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([82, 104, 152, 6, 149, 111, 100, 13]);\n\nexport function getSetDecompressibleStateDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n SET_DECOMPRESSIBLE_STATE_DISCRIMINATOR,\n );\n}\n\nexport type SetDecompressibleStateInstruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountTreeAuthority extends string | AccountMeta<string> = string,\n TAccountTreeCreator extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountTreeAuthority extends string\n ? WritableAccount<TAccountTreeAuthority>\n : TAccountTreeAuthority,\n TAccountTreeCreator extends string\n ? ReadonlySignerAccount<TAccountTreeCreator> &\n AccountSignerMeta<TAccountTreeCreator>\n : TAccountTreeCreator,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SetDecompressibleStateInstructionData = {\n discriminator: ReadonlyUint8Array;\n /**\n * The new decompressible state to set on the tree: `Enabled` allows\n * `redeem`/`decompressV1`, `Disabled` blocks them.\n */\n decompressableState: DecompressibleState;\n};\n\nexport type SetDecompressibleStateInstructionDataArgs = {\n /**\n * The new decompressible state to set on the tree: `Enabled` allows\n * `redeem`/`decompressV1`, `Disabled` blocks them.\n */\n decompressableState: DecompressibleStateArgs;\n};\n\nexport function getSetDecompressibleStateInstructionDataEncoder(): FixedSizeEncoder<SetDecompressibleStateInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"decompressableState\", getDecompressibleStateEncoder()],\n ]),\n (value) => ({\n ...value,\n discriminator: SET_DECOMPRESSIBLE_STATE_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getSetDecompressibleStateInstructionDataDecoder(): FixedSizeDecoder<SetDecompressibleStateInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"decompressableState\", getDecompressibleStateDecoder()],\n ]);\n}\n\nexport function getSetDecompressibleStateInstructionDataCodec(): FixedSizeCodec<\n SetDecompressibleStateInstructionDataArgs,\n SetDecompressibleStateInstructionData\n> {\n return combineCodec(\n getSetDecompressibleStateInstructionDataEncoder(),\n getSetDecompressibleStateInstructionDataDecoder(),\n );\n}\n\nexport type SetDecompressibleStateInput<\n TAccountTreeAuthority extends string = string,\n TAccountTreeCreator extends string = string,\n> = {\n /**\n * The tree's `TreeConfig` PDA, which stores its configuration and acts\n * as the tree's authority for CPIs into the compression program.\n */\n treeAuthority: Address<TAccountTreeAuthority>;\n /**\n * Creator of the tree, recorded in `TreeConfig` when the tree was\n * created.\n */\n treeCreator: TransactionSigner<TAccountTreeCreator>;\n decompressableState: SetDecompressibleStateInstructionDataArgs[\"decompressableState\"];\n};\n\n/**\n * Sets the `decompressible_state` of a tree.\n *\n * Controls whether leaves in the tree may be `redeem`ed and\n * `decompressV1`'d into regular NFTs. Only the tree creator may call\n * this instruction.\n */\nexport function getSetDecompressibleStateInstruction<\n TAccountTreeAuthority extends string,\n TAccountTreeCreator extends string,\n TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n>(\n input: SetDecompressibleStateInput<\n TAccountTreeAuthority,\n TAccountTreeCreator\n >,\n config?: { programAddress?: TProgramAddress },\n): SetDecompressibleStateInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountTreeCreator\n> {\n // Program address.\n const programAddress = config?.programAddress ?? BUBBLEGUM_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n treeAuthority: { value: input.treeAuthority ?? null, isWritable: true },\n treeCreator: { value: input.treeCreator ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"treeAuthority\", accounts.treeAuthority),\n getAccountMeta(\"treeCreator\", accounts.treeCreator),\n ],\n data: getSetDecompressibleStateInstructionDataEncoder().encode(\n args as SetDecompressibleStateInstructionDataArgs,\n ),\n programAddress,\n } as SetDecompressibleStateInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountTreeCreator\n >);\n}\n\nexport type ParsedSetDecompressibleStateInstruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /**\n * The tree's `TreeConfig` PDA, which stores its configuration and acts\n * as the tree's authority for CPIs into the compression program.\n */\n treeAuthority: TAccountMetas[0];\n /**\n * Creator of the tree, recorded in `TreeConfig` when the tree was\n * created.\n */\n treeCreator: TAccountMetas[1];\n };\n data: SetDecompressibleStateInstructionData;\n};\n\nexport function parseSetDecompressibleStateInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSetDecompressibleStateInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n treeAuthority: getNextAccount(),\n treeCreator: getNextAccount(),\n },\n data: getSetDecompressibleStateInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n"],"mappings":";;;;;;;;;;;;AA6CA,MAAa,yCACX,IAAI,WAAW;CAAC;CAAI;CAAK;CAAK;CAAG;CAAK;CAAK;CAAK;AAAE,CAAC;AAErD,SAAgB,8CAAkE;CAChF,OAAO,eAAe,gBAAgB,GAAG,CAAC,CAAC,CAAC,OAC1C,sCACF;AACF;AAuCA,SAAgB,kDAA+G;CAC7H,OAAO,iBACL,iBAAiB,CACf,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC,GAC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