@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,59 +1,145 @@
|
|
|
1
1
|
import { BUBBLEGUM_PROGRAM_ADDRESS } from "../programs/bubblegum.js";
|
|
2
|
+
import "../programs/index.js";
|
|
2
3
|
import { AccountMeta, AccountSignerMeta, Address, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlyAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount, WritableSignerAccount } from "@solana/kit";
|
|
3
|
-
|
|
4
4
|
//#region src/generated/instructions/cancelRedeem.d.ts
|
|
5
5
|
declare const CANCEL_REDEEM_DISCRIMINATOR: ReadonlyUint8Array;
|
|
6
6
|
declare function getCancelRedeemDiscriminatorBytes(): ReadonlyUint8Array;
|
|
7
7
|
type CancelRedeemInstruction<TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS, TAccountTreeAuthority extends string | AccountMeta<string> = string, TAccountLeafOwner extends string | AccountMeta<string> = string, TAccountMerkleTree extends string | AccountMeta<string> = string, TAccountVoucher extends string | AccountMeta<string> = string, TAccountLogWrapper extends string | AccountMeta<string> = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV", TAccountCompressionProgram extends string | AccountMeta<string> = "cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK", TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountTreeAuthority extends string ? ReadonlyAccount<TAccountTreeAuthority> : TAccountTreeAuthority, TAccountLeafOwner extends string ? WritableSignerAccount<TAccountLeafOwner> & AccountSignerMeta<TAccountLeafOwner> : TAccountLeafOwner, TAccountMerkleTree extends string ? WritableAccount<TAccountMerkleTree> : TAccountMerkleTree, TAccountVoucher extends string ? WritableAccount<TAccountVoucher> : TAccountVoucher, TAccountLogWrapper extends string ? ReadonlyAccount<TAccountLogWrapper> : TAccountLogWrapper, TAccountCompressionProgram extends string ? ReadonlyAccount<TAccountCompressionProgram> : TAccountCompressionProgram, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts]>;
|
|
8
|
-
|
|
8
|
+
type CancelRedeemInstructionData = {
|
|
9
9
|
discriminator: ReadonlyUint8Array;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Current Merkle root of the tree; the leaf recorded in `voucher` is
|
|
12
|
+
* re-inserted at its original position and verified against this root.
|
|
13
|
+
*/
|
|
14
|
+
root: Array<number>;
|
|
15
|
+
};
|
|
16
|
+
type CancelRedeemInstructionDataArgs = {
|
|
17
|
+
/**
|
|
18
|
+
* Current Merkle root of the tree; the leaf recorded in `voucher` is
|
|
19
|
+
* re-inserted at its original position and verified against this root.
|
|
20
|
+
*/
|
|
21
|
+
root: Array<number>;
|
|
22
|
+
};
|
|
15
23
|
declare function getCancelRedeemInstructionDataEncoder(): FixedSizeEncoder<CancelRedeemInstructionDataArgs>;
|
|
16
24
|
declare function getCancelRedeemInstructionDataDecoder(): FixedSizeDecoder<CancelRedeemInstructionData>;
|
|
17
25
|
declare function getCancelRedeemInstructionDataCodec(): FixedSizeCodec<CancelRedeemInstructionDataArgs, CancelRedeemInstructionData>;
|
|
18
|
-
|
|
26
|
+
type CancelRedeemAsyncInput<TAccountTreeAuthority extends string = string, TAccountLeafOwner extends string = string, TAccountMerkleTree extends string = string, TAccountVoucher extends string = string, TAccountLogWrapper extends string = string, TAccountCompressionProgram extends string = string, TAccountSystemProgram extends string = string> = {
|
|
27
|
+
/**
|
|
28
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
29
|
+
* as the tree's authority for CPIs into the compression program.
|
|
30
|
+
*/
|
|
19
31
|
treeAuthority?: Address<TAccountTreeAuthority>;
|
|
32
|
+
/** Owner of the compressed NFT leaf being operated on. */
|
|
20
33
|
leafOwner: TransactionSigner<TAccountLeafOwner>;
|
|
34
|
+
/**
|
|
35
|
+
* The concurrent Merkle tree account storing the compressed leaves,
|
|
36
|
+
* owned by the account compression program.
|
|
37
|
+
*/
|
|
21
38
|
merkleTree: Address<TAccountMerkleTree>;
|
|
39
|
+
/**
|
|
40
|
+
* Voucher PDA created by `redeem`; closed by this instruction as the
|
|
41
|
+
* leaf is restored to the tree.
|
|
42
|
+
*/
|
|
22
43
|
voucher: Address<TAccountVoucher>;
|
|
44
|
+
/**
|
|
45
|
+
* The SPL/MPL Noop program, used to log leaf data so off-chain indexers
|
|
46
|
+
* can reconstruct the tree.
|
|
47
|
+
*/
|
|
23
48
|
logWrapper?: Address<TAccountLogWrapper>;
|
|
49
|
+
/**
|
|
50
|
+
* The SPL/MPL Account Compression program that owns and manages the
|
|
51
|
+
* Merkle tree.
|
|
52
|
+
*/
|
|
24
53
|
compressionProgram?: Address<TAccountCompressionProgram>;
|
|
54
|
+
/** The Solana System program. */
|
|
25
55
|
systemProgram?: Address<TAccountSystemProgram>;
|
|
26
56
|
root: CancelRedeemInstructionDataArgs["root"];
|
|
27
|
-
}
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Cancels a pending redemption, restoring the leaf to the tree.
|
|
60
|
+
*
|
|
61
|
+
* Closes the `voucher` PDA created by `redeem` and re-inserts the leaf
|
|
62
|
+
* at its original position, verified against the current Merkle `root`.
|
|
63
|
+
*/
|
|
28
64
|
declare function getCancelRedeemInstructionAsync<TAccountTreeAuthority extends string, TAccountLeafOwner extends string, TAccountMerkleTree extends string, TAccountVoucher extends string, TAccountLogWrapper extends string, TAccountCompressionProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS>(input: CancelRedeemAsyncInput<TAccountTreeAuthority, TAccountLeafOwner, TAccountMerkleTree, TAccountVoucher, TAccountLogWrapper, TAccountCompressionProgram, TAccountSystemProgram>, config?: {
|
|
29
65
|
programAddress?: TProgramAddress;
|
|
30
66
|
}): Promise<CancelRedeemInstruction<TProgramAddress, TAccountTreeAuthority, TAccountLeafOwner, TAccountMerkleTree, TAccountVoucher, TAccountLogWrapper, TAccountCompressionProgram, TAccountSystemProgram>>;
|
|
31
|
-
|
|
67
|
+
type CancelRedeemInput<TAccountTreeAuthority extends string = string, TAccountLeafOwner extends string = string, TAccountMerkleTree extends string = string, TAccountVoucher extends string = string, TAccountLogWrapper extends string = string, TAccountCompressionProgram extends string = string, TAccountSystemProgram extends string = string> = {
|
|
68
|
+
/**
|
|
69
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
70
|
+
* as the tree's authority for CPIs into the compression program.
|
|
71
|
+
*/
|
|
32
72
|
treeAuthority: Address<TAccountTreeAuthority>;
|
|
73
|
+
/** Owner of the compressed NFT leaf being operated on. */
|
|
33
74
|
leafOwner: TransactionSigner<TAccountLeafOwner>;
|
|
75
|
+
/**
|
|
76
|
+
* The concurrent Merkle tree account storing the compressed leaves,
|
|
77
|
+
* owned by the account compression program.
|
|
78
|
+
*/
|
|
34
79
|
merkleTree: Address<TAccountMerkleTree>;
|
|
80
|
+
/**
|
|
81
|
+
* Voucher PDA created by `redeem`; closed by this instruction as the
|
|
82
|
+
* leaf is restored to the tree.
|
|
83
|
+
*/
|
|
35
84
|
voucher: Address<TAccountVoucher>;
|
|
85
|
+
/**
|
|
86
|
+
* The SPL/MPL Noop program, used to log leaf data so off-chain indexers
|
|
87
|
+
* can reconstruct the tree.
|
|
88
|
+
*/
|
|
36
89
|
logWrapper?: Address<TAccountLogWrapper>;
|
|
90
|
+
/**
|
|
91
|
+
* The SPL/MPL Account Compression program that owns and manages the
|
|
92
|
+
* Merkle tree.
|
|
93
|
+
*/
|
|
37
94
|
compressionProgram?: Address<TAccountCompressionProgram>;
|
|
95
|
+
/** The Solana System program. */
|
|
38
96
|
systemProgram?: Address<TAccountSystemProgram>;
|
|
39
97
|
root: CancelRedeemInstructionDataArgs["root"];
|
|
40
|
-
}
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Cancels a pending redemption, restoring the leaf to the tree.
|
|
101
|
+
*
|
|
102
|
+
* Closes the `voucher` PDA created by `redeem` and re-inserts the leaf
|
|
103
|
+
* at its original position, verified against the current Merkle `root`.
|
|
104
|
+
*/
|
|
41
105
|
declare function getCancelRedeemInstruction<TAccountTreeAuthority extends string, TAccountLeafOwner extends string, TAccountMerkleTree extends string, TAccountVoucher extends string, TAccountLogWrapper extends string, TAccountCompressionProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS>(input: CancelRedeemInput<TAccountTreeAuthority, TAccountLeafOwner, TAccountMerkleTree, TAccountVoucher, TAccountLogWrapper, TAccountCompressionProgram, TAccountSystemProgram>, config?: {
|
|
42
106
|
programAddress?: TProgramAddress;
|
|
43
107
|
}): CancelRedeemInstruction<TProgramAddress, TAccountTreeAuthority, TAccountLeafOwner, TAccountMerkleTree, TAccountVoucher, TAccountLogWrapper, TAccountCompressionProgram, TAccountSystemProgram>;
|
|
44
|
-
|
|
108
|
+
type ParsedCancelRedeemInstruction<TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
45
109
|
programAddress: Address<TProgram>;
|
|
46
110
|
accounts: {
|
|
111
|
+
/**
|
|
112
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
113
|
+
* as the tree's authority for CPIs into the compression program.
|
|
114
|
+
*/
|
|
47
115
|
treeAuthority: TAccountMetas[0];
|
|
116
|
+
/** Owner of the compressed NFT leaf being operated on. */
|
|
48
117
|
leafOwner: TAccountMetas[1];
|
|
118
|
+
/**
|
|
119
|
+
* The concurrent Merkle tree account storing the compressed leaves,
|
|
120
|
+
* owned by the account compression program.
|
|
121
|
+
*/
|
|
49
122
|
merkleTree: TAccountMetas[2];
|
|
123
|
+
/**
|
|
124
|
+
* Voucher PDA created by `redeem`; closed by this instruction as the
|
|
125
|
+
* leaf is restored to the tree.
|
|
126
|
+
*/
|
|
50
127
|
voucher: TAccountMetas[3];
|
|
128
|
+
/**
|
|
129
|
+
* The SPL/MPL Noop program, used to log leaf data so off-chain indexers
|
|
130
|
+
* can reconstruct the tree.
|
|
131
|
+
*/
|
|
51
132
|
logWrapper: TAccountMetas[4];
|
|
133
|
+
/**
|
|
134
|
+
* The SPL/MPL Account Compression program that owns and manages the
|
|
135
|
+
* Merkle tree.
|
|
136
|
+
*/
|
|
52
137
|
compressionProgram: TAccountMetas[5];
|
|
138
|
+
/** The Solana System program. */
|
|
53
139
|
systemProgram: TAccountMetas[6];
|
|
54
140
|
};
|
|
55
141
|
data: CancelRedeemInstructionData;
|
|
56
|
-
}
|
|
142
|
+
};
|
|
57
143
|
declare function parseCancelRedeemInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCancelRedeemInstruction<TProgram, TAccountMetas>;
|
|
58
144
|
//#endregion
|
|
59
145
|
export { CANCEL_REDEEM_DISCRIMINATOR, CancelRedeemAsyncInput, CancelRedeemInput, CancelRedeemInstruction, CancelRedeemInstructionData, CancelRedeemInstructionDataArgs, ParsedCancelRedeemInstruction, getCancelRedeemDiscriminatorBytes, getCancelRedeemInstruction, getCancelRedeemInstructionAsync, getCancelRedeemInstructionDataCodec, getCancelRedeemInstructionDataDecoder, getCancelRedeemInstructionDataEncoder, parseCancelRedeemInstruction };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancelRedeem.d.ts","names":[],"sources":["../../../src/generated/instructions/cancelRedeem.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"cancelRedeem.d.ts","names":[],"sources":["../../../src/generated/instructions/cancelRedeem.ts"],"mappings":";;;;cA8Ca,6BAA6B;iBAI1B,qCAAqC;KAMzC,wBACV,iCAAiC,2BACjC,uCAAuC,8BACvC,mCAAmC,8BACnC,oCAAoC,8BACpC,i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,iBAAiB,2BAEzC,OAAO,kBACL,uBACA,mBACA,oBACA,iBACA,oBACA,4BACA,wBAEF;EAAW,iBAAiB;IAC3B,wBACD,iBACA,uBACA,mBACA,oBACA,iBACA,oBACA,4BACA;KAmEU,8BACV,iCAAiC,2BACjC,+BAA+B,yBAAyB;EAExD,gBAAgB,QAAQ;EACxB;;;;;IAKE,eAAe;;IAEf,WAAW;;;;;IAKX,YAAY;;;;;IAKZ,SAAS;;;;;IAKT,YAAY;;;;;IAKZ,oBAAoB;;IAEpB,eAAe;;EAEjB,MAAM;;iBAGQ,6BACd,yBACA,+BAA+B,eAE/B,aAAa,YAAY,YACvB,wBAAwB,iBACxB,oBAAoB,sBACrB,8BAA8B,UAAU"}
|
|
@@ -3,6 +3,13 @@ import "../programs/bubblegum.js";
|
|
|
3
3
|
import { SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, combineCodec, fixDecoderSize, fixEncoderSize, getArrayDecoder, getArrayEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU8Decoder, getU8Encoder, transformEncoder } from "@solana/kit";
|
|
4
4
|
import { getAccountMetaFactory, getAddressFromResolvedInstructionAccount } from "@solana/program-client-core";
|
|
5
5
|
//#region src/generated/instructions/cancelRedeem.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 CANCEL_REDEEM_DISCRIMINATOR = new Uint8Array([
|
|
7
14
|
111,
|
|
8
15
|
76,
|
|
@@ -28,6 +35,12 @@ function getCancelRedeemInstructionDataDecoder() {
|
|
|
28
35
|
function getCancelRedeemInstructionDataCodec() {
|
|
29
36
|
return combineCodec(getCancelRedeemInstructionDataEncoder(), getCancelRedeemInstructionDataDecoder());
|
|
30
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Cancels a pending redemption, restoring the leaf to the tree.
|
|
40
|
+
*
|
|
41
|
+
* Closes the `voucher` PDA created by `redeem` and re-inserts the leaf
|
|
42
|
+
* at its original position, verified against the current Merkle `root`.
|
|
43
|
+
*/
|
|
31
44
|
async function getCancelRedeemInstructionAsync(input, config) {
|
|
32
45
|
const programAddress = config?.programAddress ?? "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
33
46
|
const accounts = {
|
|
@@ -80,6 +93,12 @@ async function getCancelRedeemInstructionAsync(input, config) {
|
|
|
80
93
|
programAddress
|
|
81
94
|
});
|
|
82
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Cancels a pending redemption, restoring the leaf to the tree.
|
|
98
|
+
*
|
|
99
|
+
* Closes the `voucher` PDA created by `redeem` and re-inserts the leaf
|
|
100
|
+
* at its original position, verified against the current Merkle `root`.
|
|
101
|
+
*/
|
|
83
102
|
function getCancelRedeemInstruction(input, config) {
|
|
84
103
|
const programAddress = config?.programAddress ?? "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
85
104
|
const accounts = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancelRedeem.js","names":[],"sources":["../../../src/generated/instructions/cancelRedeem.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 FixedSizeCodec,\n FixedSizeDecoder,\n FixedSizeEncoder,\n Instruction,\n InstructionWithAccounts,\n InstructionWithData,\n ReadonlyAccount,\n ReadonlyUint8Array,\n TransactionSigner,\n WritableAccount,\n WritableSignerAccount,\n} from \"@solana/kit\";\nimport type { ResolvedInstructionAccount } from \"@solana/program-client-core\";\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\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\";\n\nexport const CANCEL_REDEEM_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 111, 76, 232, 50, 39, 175, 48, 242,\n]);\n\nexport function getCancelRedeemDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CANCEL_REDEEM_DISCRIMINATOR,\n );\n}\n\nexport type CancelRedeemInstruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountTreeAuthority extends string | AccountMeta<string> = string,\n TAccountLeafOwner extends string | AccountMeta<string> = string,\n TAccountMerkleTree extends string | AccountMeta<string> = string,\n TAccountVoucher extends string | AccountMeta<string> = string,\n TAccountLogWrapper extends\n | string\n | AccountMeta<string> = \"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV\",\n TAccountCompressionProgram extends\n | string\n | AccountMeta<string> = \"cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK\",\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 ? ReadonlyAccount<TAccountTreeAuthority>\n : TAccountTreeAuthority,\n TAccountLeafOwner extends string\n ? WritableSignerAccount<TAccountLeafOwner> &\n AccountSignerMeta<TAccountLeafOwner>\n : TAccountLeafOwner,\n TAccountMerkleTree extends string\n ? WritableAccount<TAccountMerkleTree>\n : TAccountMerkleTree,\n TAccountVoucher extends string\n ? WritableAccount<TAccountVoucher>\n : TAccountVoucher,\n TAccountLogWrapper extends string\n ? ReadonlyAccount<TAccountLogWrapper>\n : TAccountLogWrapper,\n TAccountCompressionProgram extends string\n ? ReadonlyAccount<TAccountCompressionProgram>\n : TAccountCompressionProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport interface CancelRedeemInstructionData {\n discriminator: ReadonlyUint8Array;\n root: number[];\n}\n\nexport interface CancelRedeemInstructionDataArgs {\n root: number[];\n}\n\nexport function getCancelRedeemInstructionDataEncoder(): FixedSizeEncoder<CancelRedeemInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"root\", getArrayEncoder(getU8Encoder(), { size: 32 })],\n ]),\n (value) => ({ ...value, discriminator: CANCEL_REDEEM_DISCRIMINATOR }),\n );\n}\n\nexport function getCancelRedeemInstructionDataDecoder(): FixedSizeDecoder<CancelRedeemInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"root\", getArrayDecoder(getU8Decoder(), { size: 32 })],\n ]);\n}\n\nexport function getCancelRedeemInstructionDataCodec(): FixedSizeCodec<\n CancelRedeemInstructionDataArgs,\n CancelRedeemInstructionData\n> {\n return combineCodec(\n getCancelRedeemInstructionDataEncoder(),\n getCancelRedeemInstructionDataDecoder(),\n );\n}\n\nexport interface CancelRedeemAsyncInput<\n TAccountTreeAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountVoucher extends string = string,\n TAccountLogWrapper extends string = string,\n TAccountCompressionProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> {\n treeAuthority?: Address<TAccountTreeAuthority>;\n leafOwner: TransactionSigner<TAccountLeafOwner>;\n merkleTree: Address<TAccountMerkleTree>;\n voucher: Address<TAccountVoucher>;\n logWrapper?: Address<TAccountLogWrapper>;\n compressionProgram?: Address<TAccountCompressionProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n root: CancelRedeemInstructionDataArgs[\"root\"];\n}\n\nexport async function getCancelRedeemInstructionAsync<\n TAccountTreeAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountMerkleTree extends string,\n TAccountVoucher extends string,\n TAccountLogWrapper extends string,\n TAccountCompressionProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n>(\n input: CancelRedeemAsyncInput<\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CancelRedeemInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\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: false },\n leafOwner: { value: input.leafOwner ?? null, isWritable: true },\n merkleTree: { value: input.merkleTree ?? null, isWritable: true },\n voucher: { value: input.voucher ?? null, isWritable: true },\n logWrapper: { value: input.logWrapper ?? null, isWritable: false },\n compressionProgram: {\n value: input.compressionProgram ?? null,\n isWritable: false,\n },\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.logWrapper.value) {\n accounts.logWrapper.value =\n \"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV\" as Address<\"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV\">;\n }\n if (!accounts.compressionProgram.value) {\n accounts.compressionProgram.value =\n \"cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK\" as Address<\"cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK\">;\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(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"voucher\", accounts.voucher),\n getAccountMeta(\"logWrapper\", accounts.logWrapper),\n getAccountMeta(\"compressionProgram\", accounts.compressionProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCancelRedeemInstructionDataEncoder().encode(\n args as CancelRedeemInstructionDataArgs,\n ),\n programAddress,\n } as CancelRedeemInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountSystemProgram\n >);\n}\n\nexport interface CancelRedeemInput<\n TAccountTreeAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountVoucher extends string = string,\n TAccountLogWrapper extends string = string,\n TAccountCompressionProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> {\n treeAuthority: Address<TAccountTreeAuthority>;\n leafOwner: TransactionSigner<TAccountLeafOwner>;\n merkleTree: Address<TAccountMerkleTree>;\n voucher: Address<TAccountVoucher>;\n logWrapper?: Address<TAccountLogWrapper>;\n compressionProgram?: Address<TAccountCompressionProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n root: CancelRedeemInstructionDataArgs[\"root\"];\n}\n\nexport function getCancelRedeemInstruction<\n TAccountTreeAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountMerkleTree extends string,\n TAccountVoucher extends string,\n TAccountLogWrapper extends string,\n TAccountCompressionProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n>(\n input: CancelRedeemInput<\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CancelRedeemInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\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: false },\n leafOwner: { value: input.leafOwner ?? null, isWritable: true },\n merkleTree: { value: input.merkleTree ?? null, isWritable: true },\n voucher: { value: input.voucher ?? null, isWritable: true },\n logWrapper: { value: input.logWrapper ?? null, isWritable: false },\n compressionProgram: {\n value: input.compressionProgram ?? null,\n isWritable: false,\n },\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.logWrapper.value) {\n accounts.logWrapper.value =\n \"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV\" as Address<\"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV\">;\n }\n if (!accounts.compressionProgram.value) {\n accounts.compressionProgram.value =\n \"cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK\" as Address<\"cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK\">;\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(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"voucher\", accounts.voucher),\n getAccountMeta(\"logWrapper\", accounts.logWrapper),\n getAccountMeta(\"compressionProgram\", accounts.compressionProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCancelRedeemInstructionDataEncoder().encode(\n args as CancelRedeemInstructionDataArgs,\n ),\n programAddress,\n } as CancelRedeemInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountSystemProgram\n >);\n}\n\nexport interface ParsedCancelRedeemInstruction<\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 leafOwner: TAccountMetas[1];\n merkleTree: TAccountMetas[2];\n voucher: TAccountMetas[3];\n logWrapper: TAccountMetas[4];\n compressionProgram: TAccountMetas[5];\n systemProgram: TAccountMetas[6];\n };\n data: CancelRedeemInstructionData;\n}\n\nexport function parseCancelRedeemInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCancelRedeemInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 7) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 7,\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 leafOwner: getNextAccount(),\n merkleTree: getNextAccount(),\n voucher: getNextAccount(),\n logWrapper: getNextAccount(),\n compressionProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getCancelRedeemInstructionDataDecoder().decode(instruction.data),\n };\n}\n"],"mappings":";;;;;AAgDA,MAAa,8BAAkD,IAAI,WAAW;CAC5E;CAAK;CAAI;CAAK;CAAI;CAAI;CAAK;CAAI;AACjC,CAAC;AAED,SAAgB,oCAAwD;CACtE,OAAO,eAAe,gBAAgB,GAAG,CAAC,CAAC,CAAC,OAC1C,2BACF;AACF;AAyDA,SAAgB,wCAA2F;CACzG,OAAO,iBACL,iBAAiB,CACf,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC,GACtD,CAAC,QAAQ,gBAAgB,aAAa,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,CACxD,CAAC,IACA,WAAW;EAAE,GAAG;EAAO,eAAe;CAA4B,EACrE;AACF;AAEA,SAAgB,wCAAuF;CACrG,OAAO,iBAAiB,CACtB,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC,GACtD,CAAC,QAAQ,gBAAgB,aAAa,GAAG,EA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oB,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,WAAW,eAAe;GAC1B,YAAY,eAAe;GAC3B,SAAS,eAAe;GACxB,YAAY,eAAe;GAC3B,oBAAoB,eAAe;GACnC,eAAe,eAAe;EAChC;EACA,MAAM,sCAAsC,CAAC,CAAC,OAAO,YAAY,IAAI;CACvE;AACF"}
|
|
1
|
+
{"version":3,"file":"cancelRedeem.js","names":[],"sources":["../../../src/generated/instructions/cancelRedeem.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 getStructDecoder,\n getStructEncoder,\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 FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\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\";\n\nexport const CANCEL_REDEEM_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 111, 76, 232, 50, 39, 175, 48, 242,\n]);\n\nexport function getCancelRedeemDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CANCEL_REDEEM_DISCRIMINATOR,\n );\n}\n\nexport type CancelRedeemInstruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountTreeAuthority extends string | AccountMeta<string> = string,\n TAccountLeafOwner extends string | AccountMeta<string> = string,\n TAccountMerkleTree extends string | AccountMeta<string> = string,\n TAccountVoucher extends string | AccountMeta<string> = string,\n TAccountLogWrapper extends string | AccountMeta<string> =\n \"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV\",\n TAccountCompressionProgram extends string | AccountMeta<string> =\n \"cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK\",\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 ? ReadonlyAccount<TAccountTreeAuthority>\n : TAccountTreeAuthority,\n TAccountLeafOwner extends string\n ? WritableSignerAccount<TAccountLeafOwner> &\n AccountSignerMeta<TAccountLeafOwner>\n : TAccountLeafOwner,\n TAccountMerkleTree extends string\n ? WritableAccount<TAccountMerkleTree>\n : TAccountMerkleTree,\n TAccountVoucher extends string\n ? WritableAccount<TAccountVoucher>\n : TAccountVoucher,\n TAccountLogWrapper extends string\n ? ReadonlyAccount<TAccountLogWrapper>\n : TAccountLogWrapper,\n TAccountCompressionProgram extends string\n ? ReadonlyAccount<TAccountCompressionProgram>\n : TAccountCompressionProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CancelRedeemInstructionData = {\n discriminator: ReadonlyUint8Array;\n /**\n * Current Merkle root of the tree; the leaf recorded in `voucher` is\n * re-inserted at its original position and verified against this root.\n */\n root: Array<number>;\n};\n\nexport type CancelRedeemInstructionDataArgs = {\n /**\n * Current Merkle root of the tree; the leaf recorded in `voucher` is\n * re-inserted at its original position and verified against this root.\n */\n root: Array<number>;\n};\n\nexport function getCancelRedeemInstructionDataEncoder(): FixedSizeEncoder<CancelRedeemInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"root\", getArrayEncoder(getU8Encoder(), { size: 32 })],\n ]),\n (value) => ({ ...value, discriminator: CANCEL_REDEEM_DISCRIMINATOR }),\n );\n}\n\nexport function getCancelRedeemInstructionDataDecoder(): FixedSizeDecoder<CancelRedeemInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"root\", getArrayDecoder(getU8Decoder(), { size: 32 })],\n ]);\n}\n\nexport function getCancelRedeemInstructionDataCodec(): FixedSizeCodec<\n CancelRedeemInstructionDataArgs,\n CancelRedeemInstructionData\n> {\n return combineCodec(\n getCancelRedeemInstructionDataEncoder(),\n getCancelRedeemInstructionDataDecoder(),\n );\n}\n\nexport type CancelRedeemAsyncInput<\n TAccountTreeAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountVoucher extends string = string,\n TAccountLogWrapper extends string = string,\n TAccountCompressionProgram 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 /** Owner of the compressed NFT leaf being operated on. */\n leafOwner: TransactionSigner<TAccountLeafOwner>;\n /**\n * The concurrent Merkle tree account storing the compressed leaves,\n * owned by the account compression program.\n */\n merkleTree: Address<TAccountMerkleTree>;\n /**\n * Voucher PDA created by `redeem`; closed by this instruction as the\n * leaf is restored to the tree.\n */\n voucher: Address<TAccountVoucher>;\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 Solana System program. */\n systemProgram?: Address<TAccountSystemProgram>;\n root: CancelRedeemInstructionDataArgs[\"root\"];\n};\n\n/**\n * Cancels a pending redemption, restoring the leaf to the tree.\n *\n * Closes the `voucher` PDA created by `redeem` and re-inserts the leaf\n * at its original position, verified against the current Merkle `root`.\n */\nexport async function getCancelRedeemInstructionAsync<\n TAccountTreeAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountMerkleTree extends string,\n TAccountVoucher extends string,\n TAccountLogWrapper extends string,\n TAccountCompressionProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n>(\n input: CancelRedeemAsyncInput<\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CancelRedeemInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\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: false },\n leafOwner: { value: input.leafOwner ?? null, isWritable: true },\n merkleTree: { value: input.merkleTree ?? null, isWritable: true },\n voucher: { value: input.voucher ?? null, isWritable: true },\n logWrapper: { value: input.logWrapper ?? null, isWritable: false },\n compressionProgram: {\n value: input.compressionProgram ?? null,\n isWritable: false,\n },\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.logWrapper.value) {\n accounts.logWrapper.value =\n \"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV\" as Address<\"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV\">;\n }\n if (!accounts.compressionProgram.value) {\n accounts.compressionProgram.value =\n \"cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK\" as Address<\"cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK\">;\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(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"voucher\", accounts.voucher),\n getAccountMeta(\"logWrapper\", accounts.logWrapper),\n getAccountMeta(\"compressionProgram\", accounts.compressionProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCancelRedeemInstructionDataEncoder().encode(\n args as CancelRedeemInstructionDataArgs,\n ),\n programAddress,\n } as CancelRedeemInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type CancelRedeemInput<\n TAccountTreeAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountVoucher extends string = string,\n TAccountLogWrapper extends string = string,\n TAccountCompressionProgram 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 /** Owner of the compressed NFT leaf being operated on. */\n leafOwner: TransactionSigner<TAccountLeafOwner>;\n /**\n * The concurrent Merkle tree account storing the compressed leaves,\n * owned by the account compression program.\n */\n merkleTree: Address<TAccountMerkleTree>;\n /**\n * Voucher PDA created by `redeem`; closed by this instruction as the\n * leaf is restored to the tree.\n */\n voucher: Address<TAccountVoucher>;\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 Solana System program. */\n systemProgram?: Address<TAccountSystemProgram>;\n root: CancelRedeemInstructionDataArgs[\"root\"];\n};\n\n/**\n * Cancels a pending redemption, restoring the leaf to the tree.\n *\n * Closes the `voucher` PDA created by `redeem` and re-inserts the leaf\n * at its original position, verified against the current Merkle `root`.\n */\nexport function getCancelRedeemInstruction<\n TAccountTreeAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountMerkleTree extends string,\n TAccountVoucher extends string,\n TAccountLogWrapper extends string,\n TAccountCompressionProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n>(\n input: CancelRedeemInput<\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CancelRedeemInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\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: false },\n leafOwner: { value: input.leafOwner ?? null, isWritable: true },\n merkleTree: { value: input.merkleTree ?? null, isWritable: true },\n voucher: { value: input.voucher ?? null, isWritable: true },\n logWrapper: { value: input.logWrapper ?? null, isWritable: false },\n compressionProgram: {\n value: input.compressionProgram ?? null,\n isWritable: false,\n },\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.logWrapper.value) {\n accounts.logWrapper.value =\n \"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV\" as Address<\"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV\">;\n }\n if (!accounts.compressionProgram.value) {\n accounts.compressionProgram.value =\n \"cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK\" as Address<\"cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK\">;\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(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"voucher\", accounts.voucher),\n getAccountMeta(\"logWrapper\", accounts.logWrapper),\n getAccountMeta(\"compressionProgram\", accounts.compressionProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCancelRedeemInstructionDataEncoder().encode(\n args as CancelRedeemInstructionDataArgs,\n ),\n programAddress,\n } as CancelRedeemInstruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountLeafOwner,\n TAccountMerkleTree,\n TAccountVoucher,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedCancelRedeemInstruction<\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 /** Owner of the compressed NFT leaf being operated on. */\n leafOwner: TAccountMetas[1];\n /**\n * The concurrent Merkle tree account storing the compressed leaves,\n * owned by the account compression program.\n */\n merkleTree: TAccountMetas[2];\n /**\n * Voucher PDA created by `redeem`; closed by this instruction as the\n * leaf is restored to the tree.\n */\n voucher: TAccountMetas[3];\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[4];\n /**\n * The SPL/MPL Account Compression program that owns and manages the\n * Merkle tree.\n */\n compressionProgram: TAccountMetas[5];\n /** The Solana System program. */\n systemProgram: TAccountMetas[6];\n };\n data: CancelRedeemInstructionData;\n};\n\nexport function parseCancelRedeemInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCancelRedeemInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 7) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 7,\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 leafOwner: getNextAccount(),\n merkleTree: getNextAccount(),\n voucher: getNextAccount(),\n logWrapper: getNextAccount(),\n compressionProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getCancelRedeemInstructionDataDecoder().decode(instruction.data),\n };\n}\n"],"mappings":";;;;;;;;;;;;AA8CA,MAAa,8BAAkD,IAAI,WAAW;CAC5E;CAAK;CAAI;CAAK;CAAI;CAAI;CAAK;CAAI;AACjC,CAAC;AAED,SAAgB,oCAAwD;CACtE,OAAO,eAAe,gBAAgB,GAAG,CAAC,CAAC,CAAC,OAC1C,2BACF;AACF;AA8DA,SAAgB,wCAA2F;CACzG,OAAO,iBACL,iBAAiB,CACf,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC,GACtD,CAAC,QAAQ,gBAAgB,aAAa,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,CACxD,CAAC,IACA,WAAW;EAAE,GAAG;EAAO,eAAe;CAA4B,EACrE;AACF;AAEA,SAAgB,wCAAuF;CACrG,OAAO,iBAAiB,CACtB,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC,GACtD,CAAC,QAAQ,gBAAgB,aAAa,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,CACxD,CAAC;AACH;AAEA,SAAgB,sCAGd;CACA,OAAO,aACL,sCAAsC,GACtC,sCAAsC,CACxC;AACF;;;;;;;AAiDA,eAAsB,gCAUpB,OASA,QAYA;CAEA,MAAM,iBAAiB,QAAQ,kBAAA;CAe/B,MAAM,WAAW;EAXf,eAAe;GAAE,OAAO,MAAM,iBAAiB;GAAM,YAAY;EAAM;EACvE,WAAW;GAAE,OAAO,MAAM,aAAa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,oBAAoB,eAAe;GACnC,eAAe,eAAe;EAChC;EACA,MAAM,sCAAsC,CAAC,CAAC,OAAO,YAAY,IAAI;CACvE;AACF"}
|
|
@@ -1,68 +1,134 @@
|
|
|
1
1
|
import { BUBBLEGUM_PROGRAM_ADDRESS } from "../programs/bubblegum.js";
|
|
2
|
+
import "../programs/index.js";
|
|
2
3
|
import { AccountMeta, AccountSignerMeta, Address, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlyAccount, ReadonlySignerAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount } from "@solana/kit";
|
|
3
|
-
|
|
4
4
|
//#region src/generated/instructions/closeTreeV2.d.ts
|
|
5
5
|
declare const CLOSE_TREE_V2_DISCRIMINATOR: ReadonlyUint8Array;
|
|
6
6
|
declare function getCloseTreeV2DiscriminatorBytes(): ReadonlyUint8Array;
|
|
7
7
|
type CloseTreeV2Instruction<TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS, TAccountTreeAuthority extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TAccountMerkleTree extends string | AccountMeta<string> = string, TAccountRecipient extends string | AccountMeta<string> = string, TAccountCompressionProgram extends string | AccountMeta<string> = "mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW", TAccountLogWrapper extends string | AccountMeta<string> = "mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3", TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountTreeAuthority extends string ? WritableAccount<TAccountTreeAuthority> : TAccountTreeAuthority, TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountMerkleTree extends string ? WritableAccount<TAccountMerkleTree> : TAccountMerkleTree, TAccountRecipient extends string ? WritableAccount<TAccountRecipient> : TAccountRecipient, TAccountCompressionProgram extends string ? ReadonlyAccount<TAccountCompressionProgram> : TAccountCompressionProgram, TAccountLogWrapper extends string ? ReadonlyAccount<TAccountLogWrapper> : TAccountLogWrapper, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts]>;
|
|
8
|
-
|
|
8
|
+
type CloseTreeV2InstructionData = {
|
|
9
9
|
discriminator: ReadonlyUint8Array;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
type CloseTreeV2InstructionDataArgs = {};
|
|
12
12
|
declare function getCloseTreeV2InstructionDataEncoder(): FixedSizeEncoder<CloseTreeV2InstructionDataArgs>;
|
|
13
13
|
declare function getCloseTreeV2InstructionDataDecoder(): FixedSizeDecoder<CloseTreeV2InstructionData>;
|
|
14
14
|
declare function getCloseTreeV2InstructionDataCodec(): FixedSizeCodec<CloseTreeV2InstructionDataArgs, CloseTreeV2InstructionData>;
|
|
15
|
-
|
|
15
|
+
type CloseTreeV2AsyncInput<TAccountTreeAuthority extends string = string, TAccountAuthority extends string = string, TAccountMerkleTree extends string = string, TAccountRecipient extends string = string, TAccountCompressionProgram extends string = string, TAccountLogWrapper extends string = string, TAccountSystemProgram extends string = string> = {
|
|
16
|
+
/**
|
|
17
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
18
|
+
* as the tree's authority for CPIs into the compression program.
|
|
19
|
+
*/
|
|
16
20
|
treeAuthority?: Address<TAccountTreeAuthority>;
|
|
17
21
|
/** Tree creator or delegate. */
|
|
18
22
|
authority: TransactionSigner<TAccountAuthority>;
|
|
23
|
+
/**
|
|
24
|
+
* The concurrent Merkle tree account storing the compressed leaves,
|
|
25
|
+
* owned by the account compression program.
|
|
26
|
+
*/
|
|
19
27
|
merkleTree: Address<TAccountMerkleTree>;
|
|
20
28
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
* Recipient for the reclaimed lamports (tree + config PDA). Must be
|
|
30
|
+
* the tree creator or delegate.
|
|
31
|
+
*/
|
|
24
32
|
recipient: Address<TAccountRecipient>;
|
|
33
|
+
/**
|
|
34
|
+
* The SPL/MPL Account Compression program that owns and manages the
|
|
35
|
+
* Merkle tree.
|
|
36
|
+
*/
|
|
25
37
|
compressionProgram?: Address<TAccountCompressionProgram>;
|
|
38
|
+
/**
|
|
39
|
+
* The SPL/MPL Noop program, used to log leaf data so off-chain indexers
|
|
40
|
+
* can reconstruct the tree.
|
|
41
|
+
*/
|
|
26
42
|
logWrapper?: Address<TAccountLogWrapper>;
|
|
43
|
+
/** The Solana System program. */
|
|
27
44
|
systemProgram?: Address<TAccountSystemProgram>;
|
|
28
|
-
}
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Closes an empty V2 tree and its `TreeConfig` PDA, reclaiming rent.
|
|
48
|
+
*
|
|
49
|
+
* Only the tree creator or delegate may close a tree, and it must be
|
|
50
|
+
* empty (no un-burned leaves) for the underlying compression program
|
|
51
|
+
* to allow the close.
|
|
52
|
+
*/
|
|
29
53
|
declare function getCloseTreeV2InstructionAsync<TAccountTreeAuthority extends string, TAccountAuthority extends string, TAccountMerkleTree extends string, TAccountRecipient extends string, TAccountCompressionProgram extends string, TAccountLogWrapper extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS>(input: CloseTreeV2AsyncInput<TAccountTreeAuthority, TAccountAuthority, TAccountMerkleTree, TAccountRecipient, TAccountCompressionProgram, TAccountLogWrapper, TAccountSystemProgram>, config?: {
|
|
30
54
|
programAddress?: TProgramAddress;
|
|
31
55
|
}): Promise<CloseTreeV2Instruction<TProgramAddress, TAccountTreeAuthority, TAccountAuthority, TAccountMerkleTree, TAccountRecipient, TAccountCompressionProgram, TAccountLogWrapper, TAccountSystemProgram>>;
|
|
32
|
-
|
|
56
|
+
type CloseTreeV2Input<TAccountTreeAuthority extends string = string, TAccountAuthority extends string = string, TAccountMerkleTree extends string = string, TAccountRecipient extends string = string, TAccountCompressionProgram extends string = string, TAccountLogWrapper extends string = string, TAccountSystemProgram extends string = string> = {
|
|
57
|
+
/**
|
|
58
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
59
|
+
* as the tree's authority for CPIs into the compression program.
|
|
60
|
+
*/
|
|
33
61
|
treeAuthority: Address<TAccountTreeAuthority>;
|
|
34
62
|
/** Tree creator or delegate. */
|
|
35
63
|
authority: TransactionSigner<TAccountAuthority>;
|
|
64
|
+
/**
|
|
65
|
+
* The concurrent Merkle tree account storing the compressed leaves,
|
|
66
|
+
* owned by the account compression program.
|
|
67
|
+
*/
|
|
36
68
|
merkleTree: Address<TAccountMerkleTree>;
|
|
37
69
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
70
|
+
* Recipient for the reclaimed lamports (tree + config PDA). Must be
|
|
71
|
+
* the tree creator or delegate.
|
|
72
|
+
*/
|
|
41
73
|
recipient: Address<TAccountRecipient>;
|
|
74
|
+
/**
|
|
75
|
+
* The SPL/MPL Account Compression program that owns and manages the
|
|
76
|
+
* Merkle tree.
|
|
77
|
+
*/
|
|
42
78
|
compressionProgram?: Address<TAccountCompressionProgram>;
|
|
79
|
+
/**
|
|
80
|
+
* The SPL/MPL Noop program, used to log leaf data so off-chain indexers
|
|
81
|
+
* can reconstruct the tree.
|
|
82
|
+
*/
|
|
43
83
|
logWrapper?: Address<TAccountLogWrapper>;
|
|
84
|
+
/** The Solana System program. */
|
|
44
85
|
systemProgram?: Address<TAccountSystemProgram>;
|
|
45
|
-
}
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Closes an empty V2 tree and its `TreeConfig` PDA, reclaiming rent.
|
|
89
|
+
*
|
|
90
|
+
* Only the tree creator or delegate may close a tree, and it must be
|
|
91
|
+
* empty (no un-burned leaves) for the underlying compression program
|
|
92
|
+
* to allow the close.
|
|
93
|
+
*/
|
|
46
94
|
declare function getCloseTreeV2Instruction<TAccountTreeAuthority extends string, TAccountAuthority extends string, TAccountMerkleTree extends string, TAccountRecipient extends string, TAccountCompressionProgram extends string, TAccountLogWrapper extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof BUBBLEGUM_PROGRAM_ADDRESS>(input: CloseTreeV2Input<TAccountTreeAuthority, TAccountAuthority, TAccountMerkleTree, TAccountRecipient, TAccountCompressionProgram, TAccountLogWrapper, TAccountSystemProgram>, config?: {
|
|
47
95
|
programAddress?: TProgramAddress;
|
|
48
96
|
}): CloseTreeV2Instruction<TProgramAddress, TAccountTreeAuthority, TAccountAuthority, TAccountMerkleTree, TAccountRecipient, TAccountCompressionProgram, TAccountLogWrapper, TAccountSystemProgram>;
|
|
49
|
-
|
|
97
|
+
type ParsedCloseTreeV2Instruction<TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
50
98
|
programAddress: Address<TProgram>;
|
|
51
99
|
accounts: {
|
|
52
|
-
|
|
100
|
+
/**
|
|
101
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
102
|
+
* as the tree's authority for CPIs into the compression program.
|
|
103
|
+
*/
|
|
104
|
+
treeAuthority: TAccountMetas[0];
|
|
105
|
+
/** Tree creator or delegate. */
|
|
53
106
|
authority: TAccountMetas[1];
|
|
107
|
+
/**
|
|
108
|
+
* The concurrent Merkle tree account storing the compressed leaves,
|
|
109
|
+
* owned by the account compression program.
|
|
110
|
+
*/
|
|
54
111
|
merkleTree: TAccountMetas[2];
|
|
55
112
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
113
|
+
* Recipient for the reclaimed lamports (tree + config PDA). Must be
|
|
114
|
+
* the tree creator or delegate.
|
|
115
|
+
*/
|
|
59
116
|
recipient: TAccountMetas[3];
|
|
117
|
+
/**
|
|
118
|
+
* The SPL/MPL Account Compression program that owns and manages the
|
|
119
|
+
* Merkle tree.
|
|
120
|
+
*/
|
|
60
121
|
compressionProgram: TAccountMetas[4];
|
|
122
|
+
/**
|
|
123
|
+
* The SPL/MPL Noop program, used to log leaf data so off-chain indexers
|
|
124
|
+
* can reconstruct the tree.
|
|
125
|
+
*/
|
|
61
126
|
logWrapper: TAccountMetas[5];
|
|
127
|
+
/** The Solana System program. */
|
|
62
128
|
systemProgram: TAccountMetas[6];
|
|
63
129
|
};
|
|
64
130
|
data: CloseTreeV2InstructionData;
|
|
65
|
-
}
|
|
131
|
+
};
|
|
66
132
|
declare function parseCloseTreeV2Instruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCloseTreeV2Instruction<TProgram, TAccountMetas>;
|
|
67
133
|
//#endregion
|
|
68
134
|
export { CLOSE_TREE_V2_DISCRIMINATOR, CloseTreeV2AsyncInput, CloseTreeV2Input, CloseTreeV2Instruction, CloseTreeV2InstructionData, CloseTreeV2InstructionDataArgs, ParsedCloseTreeV2Instruction, getCloseTreeV2DiscriminatorBytes, getCloseTreeV2Instruction, getCloseTreeV2InstructionAsync, getCloseTreeV2InstructionDataCodec, getCloseTreeV2InstructionDataDecoder, getCloseTreeV2InstructionDataEncoder, parseCloseTreeV2Instruction };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closeTreeV2.d.ts","names":[],"sources":["../../../src/generated/instructions/closeTreeV2.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"closeTreeV2.d.ts","names":[],"sources":["../../../src/generated/instructions/closeTreeV2.ts"],"mappings":";;;;cA0Ca,6BAA6B;iBAI1B,oCAAoC;KAMxC,uBACV,iCAAiC,2BACjC,uCAAuC,8BACvC,mCAAmC,8BACnC,oCAAoC,8BACpC,mCAAmC,8BACnC,4CAA4C,qEAE5C,oCAAoC,qEAEpC,uCAAuC,0DAEvC,oCAAoC,8BAClC,YAAY,YAC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KA8DU,6BACV,iCAAiC,2BACjC,+BAA+B,yBAAyB;EAExD,gBAAgB,QAAQ;EACxB;;;;;IAKE,eAAe;;IAEf,WAAW;;;;;IAKX,YAAY;;;;;IAKZ,WAAW;;;;;IAKX,oBAAoB;;;;;IAKpB,YAAY;;IAEZ,eAAe;;EAEjB,MAAM;;iBAGQ,4BACd,yBACA,+BAA+B,eAE/B,aAAa,YAAY,YACvB,wBAAwB,iBACxB,oBAAoB,sBACrB,6BAA6B,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, getAddressFromResolvedInstructionAccount } from "@solana/program-client-core";
|
|
5
5
|
//#region src/generated/instructions/closeTreeV2.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 CLOSE_TREE_V2_DISCRIMINATOR = new Uint8Array([
|
|
7
14
|
45,
|
|
8
15
|
172,
|
|
@@ -28,6 +35,13 @@ function getCloseTreeV2InstructionDataDecoder() {
|
|
|
28
35
|
function getCloseTreeV2InstructionDataCodec() {
|
|
29
36
|
return combineCodec(getCloseTreeV2InstructionDataEncoder(), getCloseTreeV2InstructionDataDecoder());
|
|
30
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Closes an empty V2 tree and its `TreeConfig` PDA, reclaiming rent.
|
|
40
|
+
*
|
|
41
|
+
* Only the tree creator or delegate may close a tree, and it must be
|
|
42
|
+
* empty (no un-burned leaves) for the underlying compression program
|
|
43
|
+
* to allow the close.
|
|
44
|
+
*/
|
|
31
45
|
async function getCloseTreeV2InstructionAsync(input, config) {
|
|
32
46
|
const programAddress = config?.programAddress ?? "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
33
47
|
const accounts = {
|
|
@@ -79,6 +93,13 @@ async function getCloseTreeV2InstructionAsync(input, config) {
|
|
|
79
93
|
programAddress
|
|
80
94
|
});
|
|
81
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Closes an empty V2 tree and its `TreeConfig` PDA, reclaiming rent.
|
|
98
|
+
*
|
|
99
|
+
* Only the tree creator or delegate may close a tree, and it must be
|
|
100
|
+
* empty (no un-burned leaves) for the underlying compression program
|
|
101
|
+
* to allow the close.
|
|
102
|
+
*/
|
|
82
103
|
function getCloseTreeV2Instruction(input, config) {
|
|
83
104
|
const programAddress = config?.programAddress ?? "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
84
105
|
const accounts = {
|