@macalinao/clients-mpl-bubblegum 0.3.1 → 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 +6 -6
- 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 +157 -35
- package/src/generated/instructions/burnV2.ts +197 -52
- package/src/generated/instructions/cancelRedeem.ts +116 -32
- package/src/generated/instructions/closeTreeV2.ts +96 -35
- package/src/generated/instructions/collectV2.ts +34 -23
- package/src/generated/instructions/compress.ts +136 -30
- package/src/generated/instructions/createTree.ts +137 -33
- package/src/generated/instructions/createTreeV2.ts +128 -36
- package/src/generated/instructions/decompressV1.ts +124 -31
- package/src/generated/instructions/delegate.ts +159 -38
- package/src/generated/instructions/delegateAndFreezeV2.ts +191 -51
- package/src/generated/instructions/delegateV2.ts +189 -51
- package/src/generated/instructions/freezeV2.ts +193 -49
- package/src/generated/instructions/mintToCollectionV1.ts +186 -37
- package/src/generated/instructions/mintV1.ts +127 -31
- package/src/generated/instructions/mintV2.ts +184 -45
- package/src/generated/instructions/redeem.ts +172 -38
- package/src/generated/instructions/setAndVerifyCollection.ts +236 -54
- package/src/generated/instructions/setCollectionV2.ts +202 -58
- package/src/generated/instructions/setDecompressableState.ts +59 -31
- package/src/generated/instructions/setDecompressibleState.ts +60 -31
- package/src/generated/instructions/setNonTransferableV2.ts +184 -52
- package/src/generated/instructions/setTreeDelegate.ts +82 -28
- package/src/generated/instructions/thawAndRevokeV2.ts +179 -48
- package/src/generated/instructions/thawV2.ts +185 -49
- package/src/generated/instructions/transfer.ts +156 -35
- package/src/generated/instructions/transferV2.ts +185 -52
- package/src/generated/instructions/unverifyCollection.ts +229 -54
- package/src/generated/instructions/unverifyCreator.ts +181 -39
- package/src/generated/instructions/unverifyCreatorV2.ts +164 -46
- package/src/generated/instructions/updateAssetDataV2.ts +200 -50
- package/src/generated/instructions/updateMetadata.ts +200 -52
- package/src/generated/instructions/updateMetadataV2.ts +183 -54
- package/src/generated/instructions/verifyCollection.ts +229 -54
- package/src/generated/instructions/verifyCreator.ts +181 -39
- package/src/generated/instructions/verifyCreatorV2.ts +164 -46
- 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":"mintV2.d.ts","names":[],"sources":["../../../src/generated/instructions/mintV2.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mintV2.d.ts","names":[],"sources":["../../../src/generated/instructions/mintV2.ts"],"mappings":";;;;;;;cA6Da,uBAAuB;iBAIpB,+BAA+B;KAInC,kBACV,iCAAiC,2BACjC,uCAAuC,8BACvC,+BAA+B,8BAC/B,sCAAsC,8BACtC,6CAA6C,8BAC7C,mCAAmC,8BACnC,sCAAsC,8BACtC,oCAAoC,8BACpC,wCAAwC,8BACxC,0CAA0C,8BAC1C,oCAAoC,qEAEpC,4CAA4C,qEAE5C,wCAAwC,sEAExC,uCAAuC,0DAEvC,oCAAoC,8BAClC,YAAY,YACd,oBAAoB,sBACpB,yBAEI,uCACI,gBAAgB,yBAChB,uBACJ,+BACI,sBAAsB,iBACpB,kBAAkB,iBACpB,eACJ,sCACI,sBAAsB,wBACpB,kBAAkB,wBACpB,sBACJ,6CACI,sBAAsB,+BACpB,kBAAkB,+BACpB,6BACJ,mCACI,gBAAgB,qBAChB,mBACJ,sCACI,gBAAgB,wBAChB,sBACJ,oCACI,gBAAgB,sBAChB,oBACJ,wCACI,gBAAgB,0BAChB,wBACJ,0CACI,gBAAgB,4BAChB,0BACJ,oCACI,gBAAgB,sBAChB,oBACJ,4CACI,gBAAgB,8BAChB,4BACJ,wCACI,gBAAgB,0BAChB,wBACJ,uCACI,gBAAgB,yBAChB,0BACD;KAIG;EACV,eAAe;;EAEf,cAAc;;;;;EAKd,WAAW,OAAO;;;;;EAKlB,iBAAiB,OAAO;;KAGd;;EAEV,cAAc;;;;;EAKd,WAAW,iBAAiB;;;;;EAK5B,iBAAiB,iBAAiB;;iBAGpB,mCAAmC,QAAQ;iBAiB3C,mCAAmC,QAAQ;iBAc3C,iCAAiC,MAC/C,2BACA;KAQU,iBACV,+CACA,uCACA,8CACA,qDACA,2CACA,8CACA,4CACA,gDACA,kDACA,4CACA,oDACA,gDACA;;;;;EAMA,gBAAgB,QAAQ;;EAExB,OAAO,kBAAkB;;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OAAO,YACL,uBACA,eACA,sBACA,6BACA,mBACA,sBACA,oBACA,wBACA,0BACA,oBACA,4BACA,wBACA,wBAEF;EAAW,iBAAiB;IAC3B,kBACD,iBACA,uBACA,eACA,sBACA,6BACA,mBACA,sBACA,oBACA,wBACA,0BACA,oBACA,4BACA,wBACA;KAqGU,wBACV,iCAAiC,2BACjC,+BAA+B,yBAAyB;EAExD,gBAAgB,QAAQ;EACxB;;;;;IAKE,eAAe;;IAEf,OAAO;;IAEP,eAAe;;IAEf,sBAAsB;;IAEtB,WAAW;;;;;IAKX,eAAe;;;;;IAKf,YAAY;;IAEZ,iBAAiB;;;;;IAKjB,mBAAmB;;;;;IAKnB,YAAY;;;;;IAKZ,oBAAoB;;IAEpB,gBAAgB;;IAEhB,eAAe;;EAEjB,MAAM;;iBAGQ,uBACd,yBACA,+BAA+B,eAE/B,aAAa,YAAY,YACvB,wBAAwB,iBACxB,oBAAoB,sBACrB,wBAAwB,UAAU"}
|
|
@@ -5,6 +5,13 @@ import "../programs/bubblegum.js";
|
|
|
5
5
|
import { SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, addDecoderSizePrefix, addEncoderSizePrefix, combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, transformEncoder } from "@solana/kit";
|
|
6
6
|
import { getAccountMetaFactory, getAddressFromResolvedInstructionAccount } from "@solana/program-client-core";
|
|
7
7
|
//#region src/generated/instructions/mintV2.ts
|
|
8
|
+
/**
|
|
9
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
10
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
11
|
+
* to add features, then rerun Codama to update it.
|
|
12
|
+
*
|
|
13
|
+
* @see https://github.com/codama-idl/codama
|
|
14
|
+
*/
|
|
8
15
|
const MINT_V2_DISCRIMINATOR = new Uint8Array([
|
|
9
16
|
120,
|
|
10
17
|
121,
|
|
@@ -40,6 +47,25 @@ function getMintV2InstructionDataDecoder() {
|
|
|
40
47
|
function getMintV2InstructionDataCodec() {
|
|
41
48
|
return combineCodec(getMintV2InstructionDataEncoder(), getMintV2InstructionDataDecoder());
|
|
42
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Mints a new asset using `LeafSchema` V2 and optionally adds it to an
|
|
52
|
+
* MPL Core collection. Requires a tree created with `createTreeV2`.
|
|
53
|
+
*
|
|
54
|
+
* `LeafSchema` V2 enables new functionality over V1 minting:
|
|
55
|
+
*
|
|
56
|
+
* 1. Uses MPL Core collections instead of Token Metadata collections.
|
|
57
|
+
* 2. Uses the streamlined `MetadataArgsV2` arguments, which eliminate
|
|
58
|
+
* the collection verified flag: any collection included is
|
|
59
|
+
* automatically considered verified.
|
|
60
|
+
* 3. Allows plugins such as Royalties or Permanent Burn Delegate on the
|
|
61
|
+
* MPL Core collection to authorize operations on the Bubblegum
|
|
62
|
+
* asset. The `BubblegumV2` plugin must also be present on the MPL
|
|
63
|
+
* Core collection for it to be usable with Bubblegum.
|
|
64
|
+
* 4. Allows freezing/thawing of the asset, as well as marking it
|
|
65
|
+
* permanently non-transferable (soulbound).
|
|
66
|
+
* 5. Reserves (but does not yet use) an optional data blob and schema
|
|
67
|
+
* that can be associated with the asset.
|
|
68
|
+
*/
|
|
43
69
|
async function getMintV2InstructionAsync(input, config) {
|
|
44
70
|
const programAddress = config?.programAddress ?? "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
45
71
|
const accounts = {
|
|
@@ -126,6 +152,25 @@ async function getMintV2InstructionAsync(input, config) {
|
|
|
126
152
|
programAddress
|
|
127
153
|
});
|
|
128
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Mints a new asset using `LeafSchema` V2 and optionally adds it to an
|
|
157
|
+
* MPL Core collection. Requires a tree created with `createTreeV2`.
|
|
158
|
+
*
|
|
159
|
+
* `LeafSchema` V2 enables new functionality over V1 minting:
|
|
160
|
+
*
|
|
161
|
+
* 1. Uses MPL Core collections instead of Token Metadata collections.
|
|
162
|
+
* 2. Uses the streamlined `MetadataArgsV2` arguments, which eliminate
|
|
163
|
+
* the collection verified flag: any collection included is
|
|
164
|
+
* automatically considered verified.
|
|
165
|
+
* 3. Allows plugins such as Royalties or Permanent Burn Delegate on the
|
|
166
|
+
* MPL Core collection to authorize operations on the Bubblegum
|
|
167
|
+
* asset. The `BubblegumV2` plugin must also be present on the MPL
|
|
168
|
+
* Core collection for it to be usable with Bubblegum.
|
|
169
|
+
* 4. Allows freezing/thawing of the asset, as well as marking it
|
|
170
|
+
* permanently non-transferable (soulbound).
|
|
171
|
+
* 5. Reserves (but does not yet use) an optional data blob and schema
|
|
172
|
+
* that can be associated with the asset.
|
|
173
|
+
*/
|
|
129
174
|
function getMintV2Instruction(input, config) {
|
|
130
175
|
const programAddress = config?.programAddress ?? "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
131
176
|
const accounts = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintV2.js","names":[],"sources":["../../../src/generated/instructions/mintV2.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 {\n AssetDataSchema,\n AssetDataSchemaArgs,\n MetadataArgsV2,\n MetadataArgsV2Args,\n} from \"../types/index.js\";\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\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 getAssetDataSchemaDecoder,\n getAssetDataSchemaEncoder,\n getMetadataArgsV2Decoder,\n getMetadataArgsV2Encoder,\n} from \"../types/index.js\";\n\nexport const MINT_V2_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 120, 121, 23, 146, 173, 110, 199, 205,\n]);\n\nexport function getMintV2DiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(MINT_V2_DISCRIMINATOR);\n}\n\nexport type MintV2Instruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountTreeAuthority extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountTreeDelegate extends string | AccountMeta<string> = string,\n TAccountCollectionAuthority 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 TAccountMplCoreCpiSigner extends string | AccountMeta<string> = string,\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 TAccountTreeDelegate extends string\n ? ReadonlySignerAccount<TAccountTreeDelegate> &\n AccountSignerMeta<TAccountTreeDelegate>\n : TAccountTreeDelegate,\n TAccountCollectionAuthority extends string\n ? ReadonlySignerAccount<TAccountCollectionAuthority> &\n AccountSignerMeta<TAccountCollectionAuthority>\n : TAccountCollectionAuthority,\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 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 MintV2InstructionData {\n discriminator: ReadonlyUint8Array;\n metadataArgs: MetadataArgsV2;\n assetData: Option<ReadonlyUint8Array>;\n assetDataSchema: Option<AssetDataSchema>;\n}\n\nexport interface MintV2InstructionDataArgs {\n metadataArgs: MetadataArgsV2Args;\n assetData: OptionOrNullable<ReadonlyUint8Array>;\n assetDataSchema: OptionOrNullable<AssetDataSchemaArgs>;\n}\n\nexport function getMintV2InstructionDataEncoder(): Encoder<MintV2InstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"metadataArgs\", getMetadataArgsV2Encoder()],\n [\n \"assetData\",\n getOptionEncoder(\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ),\n ],\n [\"assetDataSchema\", getOptionEncoder(getAssetDataSchemaEncoder())],\n ]),\n (value) => ({ ...value, discriminator: MINT_V2_DISCRIMINATOR }),\n );\n}\n\nexport function getMintV2InstructionDataDecoder(): Decoder<MintV2InstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"metadataArgs\", getMetadataArgsV2Decoder()],\n [\n \"assetData\",\n getOptionDecoder(\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ),\n ],\n [\"assetDataSchema\", getOptionDecoder(getAssetDataSchemaDecoder())],\n ]);\n}\n\nexport function getMintV2InstructionDataCodec(): Codec<\n MintV2InstructionDataArgs,\n MintV2InstructionData\n> {\n return combineCodec(\n getMintV2InstructionDataEncoder(),\n getMintV2InstructionDataDecoder(),\n );\n}\n\nexport interface MintV2AsyncInput<\n TAccountTreeAuthority extends string = string,\n TAccountPayer extends string = string,\n TAccountTreeDelegate extends string = string,\n TAccountCollectionAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountLeafDelegate extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountCoreCollection 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 /** Optional tree delegate, defaults to `payer` */\n treeDelegate?: TransactionSigner<TAccountTreeDelegate>;\n /** Optional collection authority, defaults to `tree_delegate` */\n collectionAuthority?: TransactionSigner<TAccountCollectionAuthority>;\n leafOwner: Address<TAccountLeafOwner>;\n leafDelegate?: Address<TAccountLeafDelegate>;\n merkleTree: Address<TAccountMerkleTree>;\n coreCollection?: Address<TAccountCoreCollection>;\n mplCoreCpiSigner?: Address<TAccountMplCoreCpiSigner>;\n logWrapper?: Address<TAccountLogWrapper>;\n compressionProgram?: Address<TAccountCompressionProgram>;\n mplCoreProgram?: Address<TAccountMplCoreProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n metadataArgs: MintV2InstructionDataArgs[\"metadataArgs\"];\n assetData: MintV2InstructionDataArgs[\"assetData\"];\n assetDataSchema: MintV2InstructionDataArgs[\"assetDataSchema\"];\n}\n\nexport async function getMintV2InstructionAsync<\n TAccountTreeAuthority extends string,\n TAccountPayer extends string,\n TAccountTreeDelegate extends string,\n TAccountCollectionAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountLeafDelegate extends string,\n TAccountMerkleTree extends string,\n TAccountCoreCollection 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: MintV2AsyncInput<\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n MintV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\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 treeDelegate: { value: input.treeDelegate ?? null, isWritable: false },\n collectionAuthority: {\n value: input.collectionAuthority ?? 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 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 if (accounts.coreCollection.value) {\n accounts.mplCoreCpiSigner.value =\n \"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\" as Address<\"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\">;\n }\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(\"treeDelegate\", accounts.treeDelegate),\n getAccountMeta(\"collectionAuthority\", accounts.collectionAuthority),\n getAccountMeta(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"leafDelegate\", accounts.leafDelegate),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"coreCollection\", accounts.coreCollection),\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: getMintV2InstructionDataEncoder().encode(\n args as MintV2InstructionDataArgs,\n ),\n programAddress,\n } as MintV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >);\n}\n\nexport interface MintV2Input<\n TAccountTreeAuthority extends string = string,\n TAccountPayer extends string = string,\n TAccountTreeDelegate extends string = string,\n TAccountCollectionAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountLeafDelegate extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountCoreCollection 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 /** Optional tree delegate, defaults to `payer` */\n treeDelegate?: TransactionSigner<TAccountTreeDelegate>;\n /** Optional collection authority, defaults to `tree_delegate` */\n collectionAuthority?: TransactionSigner<TAccountCollectionAuthority>;\n leafOwner: Address<TAccountLeafOwner>;\n leafDelegate?: Address<TAccountLeafDelegate>;\n merkleTree: Address<TAccountMerkleTree>;\n coreCollection?: Address<TAccountCoreCollection>;\n mplCoreCpiSigner?: Address<TAccountMplCoreCpiSigner>;\n logWrapper?: Address<TAccountLogWrapper>;\n compressionProgram?: Address<TAccountCompressionProgram>;\n mplCoreProgram?: Address<TAccountMplCoreProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n metadataArgs: MintV2InstructionDataArgs[\"metadataArgs\"];\n assetData: MintV2InstructionDataArgs[\"assetData\"];\n assetDataSchema: MintV2InstructionDataArgs[\"assetDataSchema\"];\n}\n\nexport function getMintV2Instruction<\n TAccountTreeAuthority extends string,\n TAccountPayer extends string,\n TAccountTreeDelegate extends string,\n TAccountCollectionAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountLeafDelegate extends string,\n TAccountMerkleTree extends string,\n TAccountCoreCollection 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: MintV2Input<\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): MintV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\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 treeDelegate: { value: input.treeDelegate ?? null, isWritable: false },\n collectionAuthority: {\n value: input.collectionAuthority ?? 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 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 if (accounts.coreCollection.value) {\n accounts.mplCoreCpiSigner.value =\n \"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\" as Address<\"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\">;\n }\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(\"treeDelegate\", accounts.treeDelegate),\n getAccountMeta(\"collectionAuthority\", accounts.collectionAuthority),\n getAccountMeta(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"leafDelegate\", accounts.leafDelegate),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"coreCollection\", accounts.coreCollection),\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: getMintV2InstructionDataEncoder().encode(\n args as MintV2InstructionDataArgs,\n ),\n programAddress,\n } as MintV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >);\n}\n\nexport interface ParsedMintV2Instruction<\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 /** Optional tree delegate, defaults to `payer` */\n treeDelegate?: TAccountMetas[2] | undefined;\n /** Optional collection authority, defaults to `tree_delegate` */\n collectionAuthority?: TAccountMetas[3] | undefined;\n leafOwner: TAccountMetas[4];\n leafDelegate?: TAccountMetas[5] | undefined;\n merkleTree: TAccountMetas[6];\n coreCollection?: TAccountMetas[7] | undefined;\n mplCoreCpiSigner?: TAccountMetas[8] | undefined;\n logWrapper: TAccountMetas[9];\n compressionProgram: TAccountMetas[10];\n mplCoreProgram: TAccountMetas[11];\n systemProgram: TAccountMetas[12];\n };\n data: MintV2InstructionData;\n}\n\nexport function parseMintV2Instruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedMintV2Instruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 13) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 13,\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 treeDelegate: getNextOptionalAccount(),\n collectionAuthority: getNextOptionalAccount(),\n leafOwner: getNextAccount(),\n leafDelegate: getNextOptionalAccount(),\n merkleTree: getNextAccount(),\n coreCollection: getNextOptionalAccount(),\n mplCoreCpiSigner: getNextOptionalAccount(),\n logWrapper: getNextAccount(),\n compressionProgram: getNextAccount(),\n mplCoreProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getMintV2InstructionDataDecoder().decode(instruction.data),\n };\n}\n"],"mappings":";;;;;;;AAiEA,MAAa,wBAA4C,IAAI,WAAW;CACtE;CAAK;CAAK;CAAI;CAAK;CAAK;CAAK;CAAK;AACpC,CAAC;AAED,SAAgB,8BAAkD;CAChE,OAAO,eAAe,gBAAgB,GAAG,CAAC,CAAC,CAAC,OAAO,qBAAqB;AAC1E;AAqFA,SAAgB,kCAAsE;CACpF,OAAO,iBACL,iBAAiB;EACf,CAAC,i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
|
|
1
|
+
{"version":3,"file":"mintV2.js","names":[],"sources":["../../../src/generated/instructions/mintV2.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 addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\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 getAssetDataSchemaDecoder,\n getAssetDataSchemaEncoder,\n getMetadataArgsV2Decoder,\n getMetadataArgsV2Encoder,\n type AssetDataSchema,\n type AssetDataSchemaArgs,\n type MetadataArgsV2,\n type MetadataArgsV2Args,\n} from \"../types/index.js\";\n\nexport const MINT_V2_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 120, 121, 23, 146, 173, 110, 199, 205,\n]);\n\nexport function getMintV2DiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(MINT_V2_DISCRIMINATOR);\n}\n\nexport type MintV2Instruction<\n TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS,\n TAccountTreeAuthority extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountTreeDelegate extends string | AccountMeta<string> = string,\n TAccountCollectionAuthority 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 TAccountMplCoreCpiSigner extends string | AccountMeta<string> = string,\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 TAccountTreeDelegate extends string\n ? ReadonlySignerAccount<TAccountTreeDelegate> &\n AccountSignerMeta<TAccountTreeDelegate>\n : TAccountTreeDelegate,\n TAccountCollectionAuthority extends string\n ? ReadonlySignerAccount<TAccountCollectionAuthority> &\n AccountSignerMeta<TAccountCollectionAuthority>\n : TAccountCollectionAuthority,\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 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 MintV2InstructionData = {\n discriminator: ReadonlyUint8Array;\n /** Metadata for the newly minted `LeafSchema` V2 asset. */\n metadataArgs: MetadataArgsV2;\n /**\n * Optional raw asset data blob to associate with the newly minted\n * asset. Reserved for future use.\n */\n assetData: Option<ReadonlyUint8Array>;\n /**\n * Schema describing the format of `assetData`. Reserved for future\n * use.\n */\n assetDataSchema: Option<AssetDataSchema>;\n};\n\nexport type MintV2InstructionDataArgs = {\n /** Metadata for the newly minted `LeafSchema` V2 asset. */\n metadataArgs: MetadataArgsV2Args;\n /**\n * Optional raw asset data blob to associate with the newly minted\n * asset. Reserved for future use.\n */\n assetData: OptionOrNullable<ReadonlyUint8Array>;\n /**\n * Schema describing the format of `assetData`. Reserved for future\n * use.\n */\n assetDataSchema: OptionOrNullable<AssetDataSchemaArgs>;\n};\n\nexport function getMintV2InstructionDataEncoder(): Encoder<MintV2InstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"metadataArgs\", getMetadataArgsV2Encoder()],\n [\n \"assetData\",\n getOptionEncoder(\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ),\n ],\n [\"assetDataSchema\", getOptionEncoder(getAssetDataSchemaEncoder())],\n ]),\n (value) => ({ ...value, discriminator: MINT_V2_DISCRIMINATOR }),\n );\n}\n\nexport function getMintV2InstructionDataDecoder(): Decoder<MintV2InstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"metadataArgs\", getMetadataArgsV2Decoder()],\n [\n \"assetData\",\n getOptionDecoder(\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ),\n ],\n [\"assetDataSchema\", getOptionDecoder(getAssetDataSchemaDecoder())],\n ]);\n}\n\nexport function getMintV2InstructionDataCodec(): Codec<\n MintV2InstructionDataArgs,\n MintV2InstructionData\n> {\n return combineCodec(\n getMintV2InstructionDataEncoder(),\n getMintV2InstructionDataDecoder(),\n );\n}\n\nexport type MintV2AsyncInput<\n TAccountTreeAuthority extends string = string,\n TAccountPayer extends string = string,\n TAccountTreeDelegate extends string = string,\n TAccountCollectionAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountLeafDelegate extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountCoreCollection 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 /** Optional tree delegate, defaults to `payer`. */\n treeDelegate?: TransactionSigner<TAccountTreeDelegate>;\n /** Optional collection authority, defaults to `treeDelegate`. */\n collectionAuthority?: TransactionSigner<TAccountCollectionAuthority>;\n /** Owner of the compressed NFT leaf being operated on. */\n leafOwner: Address<TAccountLeafOwner>;\n /**\n * Delegate authority for the leaf; defaults to the leaf owner when no\n * delegate is set.\n */\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 /**\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 metadataArgs: MintV2InstructionDataArgs[\"metadataArgs\"];\n assetData: MintV2InstructionDataArgs[\"assetData\"];\n assetDataSchema: MintV2InstructionDataArgs[\"assetDataSchema\"];\n};\n\n/**\n * Mints a new asset using `LeafSchema` V2 and optionally adds it to an\n * MPL Core collection. Requires a tree created with `createTreeV2`.\n *\n * `LeafSchema` V2 enables new functionality over V1 minting:\n *\n * 1. Uses MPL Core collections instead of Token Metadata collections.\n * 2. Uses the streamlined `MetadataArgsV2` arguments, which eliminate\n * the collection verified flag: any collection included is\n * automatically considered verified.\n * 3. Allows plugins such as Royalties or Permanent Burn Delegate on the\n * MPL Core collection to authorize operations on the Bubblegum\n * asset. The `BubblegumV2` plugin must also be present on the MPL\n * Core collection for it to be usable with Bubblegum.\n * 4. Allows freezing/thawing of the asset, as well as marking it\n * permanently non-transferable (soulbound).\n * 5. Reserves (but does not yet use) an optional data blob and schema\n * that can be associated with the asset.\n */\nexport async function getMintV2InstructionAsync<\n TAccountTreeAuthority extends string,\n TAccountPayer extends string,\n TAccountTreeDelegate extends string,\n TAccountCollectionAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountLeafDelegate extends string,\n TAccountMerkleTree extends string,\n TAccountCoreCollection 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: MintV2AsyncInput<\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n MintV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\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 treeDelegate: { value: input.treeDelegate ?? null, isWritable: false },\n collectionAuthority: {\n value: input.collectionAuthority ?? 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 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 if (accounts.coreCollection.value) {\n accounts.mplCoreCpiSigner.value =\n \"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\" as Address<\"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\">;\n }\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(\"treeDelegate\", accounts.treeDelegate),\n getAccountMeta(\"collectionAuthority\", accounts.collectionAuthority),\n getAccountMeta(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"leafDelegate\", accounts.leafDelegate),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"coreCollection\", accounts.coreCollection),\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: getMintV2InstructionDataEncoder().encode(\n args as MintV2InstructionDataArgs,\n ),\n programAddress,\n } as MintV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type MintV2Input<\n TAccountTreeAuthority extends string = string,\n TAccountPayer extends string = string,\n TAccountTreeDelegate extends string = string,\n TAccountCollectionAuthority extends string = string,\n TAccountLeafOwner extends string = string,\n TAccountLeafDelegate extends string = string,\n TAccountMerkleTree extends string = string,\n TAccountCoreCollection 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 /** Optional tree delegate, defaults to `payer`. */\n treeDelegate?: TransactionSigner<TAccountTreeDelegate>;\n /** Optional collection authority, defaults to `treeDelegate`. */\n collectionAuthority?: TransactionSigner<TAccountCollectionAuthority>;\n /** Owner of the compressed NFT leaf being operated on. */\n leafOwner: Address<TAccountLeafOwner>;\n /**\n * Delegate authority for the leaf; defaults to the leaf owner when no\n * delegate is set.\n */\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 /**\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 metadataArgs: MintV2InstructionDataArgs[\"metadataArgs\"];\n assetData: MintV2InstructionDataArgs[\"assetData\"];\n assetDataSchema: MintV2InstructionDataArgs[\"assetDataSchema\"];\n};\n\n/**\n * Mints a new asset using `LeafSchema` V2 and optionally adds it to an\n * MPL Core collection. Requires a tree created with `createTreeV2`.\n *\n * `LeafSchema` V2 enables new functionality over V1 minting:\n *\n * 1. Uses MPL Core collections instead of Token Metadata collections.\n * 2. Uses the streamlined `MetadataArgsV2` arguments, which eliminate\n * the collection verified flag: any collection included is\n * automatically considered verified.\n * 3. Allows plugins such as Royalties or Permanent Burn Delegate on the\n * MPL Core collection to authorize operations on the Bubblegum\n * asset. The `BubblegumV2` plugin must also be present on the MPL\n * Core collection for it to be usable with Bubblegum.\n * 4. Allows freezing/thawing of the asset, as well as marking it\n * permanently non-transferable (soulbound).\n * 5. Reserves (but does not yet use) an optional data blob and schema\n * that can be associated with the asset.\n */\nexport function getMintV2Instruction<\n TAccountTreeAuthority extends string,\n TAccountPayer extends string,\n TAccountTreeDelegate extends string,\n TAccountCollectionAuthority extends string,\n TAccountLeafOwner extends string,\n TAccountLeafDelegate extends string,\n TAccountMerkleTree extends string,\n TAccountCoreCollection 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: MintV2Input<\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): MintV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\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 treeDelegate: { value: input.treeDelegate ?? null, isWritable: false },\n collectionAuthority: {\n value: input.collectionAuthority ?? 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 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 if (accounts.coreCollection.value) {\n accounts.mplCoreCpiSigner.value =\n \"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\" as Address<\"CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk\">;\n }\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(\"treeDelegate\", accounts.treeDelegate),\n getAccountMeta(\"collectionAuthority\", accounts.collectionAuthority),\n getAccountMeta(\"leafOwner\", accounts.leafOwner),\n getAccountMeta(\"leafDelegate\", accounts.leafDelegate),\n getAccountMeta(\"merkleTree\", accounts.merkleTree),\n getAccountMeta(\"coreCollection\", accounts.coreCollection),\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: getMintV2InstructionDataEncoder().encode(\n args as MintV2InstructionDataArgs,\n ),\n programAddress,\n } as MintV2Instruction<\n TProgramAddress,\n TAccountTreeAuthority,\n TAccountPayer,\n TAccountTreeDelegate,\n TAccountCollectionAuthority,\n TAccountLeafOwner,\n TAccountLeafDelegate,\n TAccountMerkleTree,\n TAccountCoreCollection,\n TAccountMplCoreCpiSigner,\n TAccountLogWrapper,\n TAccountCompressionProgram,\n TAccountMplCoreProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedMintV2Instruction<\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 /** Optional tree delegate, defaults to `payer`. */\n treeDelegate?: TAccountMetas[2] | undefined;\n /** Optional collection authority, defaults to `treeDelegate`. */\n collectionAuthority?: TAccountMetas[3] | undefined;\n /** Owner of the compressed NFT leaf being operated on. */\n leafOwner: TAccountMetas[4];\n /**\n * Delegate authority for the leaf; defaults to the leaf owner when no\n * delegate is set.\n */\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 /**\n * PDA Bubblegum uses to sign CPIs into the MPL Core program on behalf\n * of a core collection.\n */\n mplCoreCpiSigner?: TAccountMetas[8] | undefined;\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[9];\n /**\n * The SPL/MPL Account Compression program that owns and manages the\n * Merkle tree.\n */\n compressionProgram: TAccountMetas[10];\n /** The MPL Core program, invoked for V2 collection CPIs. */\n mplCoreProgram: TAccountMetas[11];\n /** The Solana System program. */\n systemProgram: TAccountMetas[12];\n };\n data: MintV2InstructionData;\n};\n\nexport function parseMintV2Instruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedMintV2Instruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 13) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 13,\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 treeDelegate: getNextOptionalAccount(),\n collectionAuthority: getNextOptionalAccount(),\n leafOwner: getNextAccount(),\n leafDelegate: getNextOptionalAccount(),\n merkleTree: getNextAccount(),\n coreCollection: getNextOptionalAccount(),\n mplCoreCpiSigner: getNextOptionalAccount(),\n logWrapper: getNextAccount(),\n compressionProgram: getNextAccount(),\n mplCoreProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getMintV2InstructionDataDecoder().decode(instruction.data),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AA6DA,MAAa,wBAA4C,IAAI,WAAW;CACtE;CAAK;CAAK;CAAI;CAAK;CAAK;CAAK;CAAK;AACpC,CAAC;AAED,SAAgB,8BAAkD;CAChE,OAAO,eAAe,gBAAgB,GAAG,CAAC,CAAC,CAAC,OAAO,qBAAqB;AAC1E;AAuGA,SAAgB,kCAAsE;CACpF,OAAO,iBACL,iBAAiB;EACf,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC;EACtD,CAAC,gBAAgB,yBAAyB,CAAC;EAC3C,CACE,aACA,iBACE,qBAAqB,gBAAgB,GAAG,cAAc,CAAC,CACzD,CACF;EACA,CAAC,mBAAmB,iBAAiB,0BAA0B,CAAC,CAAC;CACnE,CAAC,IACA,WAAW;EAAE,GAAG;EAAO,eAAe;CAAsB,EAC/D;AACF;AAEA,SAAgB,kCAAkE;CAChF,OAAO,iBAAiB;EACtB,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC;EACtD,CAAC,gBAAgB,yBAAyB,CAAC;EAC3C,CACE,aACA,iBACE,qBAAqB,gBAAgB,GAAG,cAAc,CAAC,CACzD,CACF;EACA,CAAC,mBAAmB,iBAAiB,0BAA0B,CAAC,CAAC;CACnE,CAAC;AACH;AAEA,SAAgB,gCAGd;CACA,OAAO,aACL,gCAA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CAeC;AACH;AAwDA,SAAgB,uBAId,aAGkD;CAClD,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,cAAc,uBAAuB;GACrC,qBAAqB,uBAAuB;GAC5C,WAAW,eAAe;GAC1B,cAAc,uBAAuB;GACrC,YAAY,eAAe;GAC3B,gBAAgB,uBAAuB;GACvC,kBAAkB,uBAAuB;GACzC,YAAY,eAAe;GAC3B,oBAAoB,eAAe;GACnC,gBAAgB,eAAe;GAC/B,eAAe,eAAe;EAChC;EACA,MAAM,gCAAgC,CAAC,CAAC,OAAO,YAAY,IAAI;CACjE;AACF"}
|
|
@@ -1,78 +1,214 @@
|
|
|
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/redeem.d.ts
|
|
5
5
|
declare const REDEEM_DISCRIMINATOR: ReadonlyUint8Array;
|
|
6
6
|
declare function getRedeemDiscriminatorBytes(): ReadonlyUint8Array;
|
|
7
7
|
type RedeemInstruction<TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS, TAccountTreeAuthority extends string | AccountMeta<string> = string, TAccountLeafOwner extends string | AccountMeta<string> = string, TAccountLeafDelegate 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, TAccountLeafDelegate extends string ? ReadonlyAccount<TAccountLeafDelegate> : TAccountLeafDelegate, 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 RedeemInstructionData = {
|
|
9
9
|
discriminator: ReadonlyUint8Array;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Current Merkle root of the tree, used together with the Merkle proof
|
|
12
|
+
* (passed as remaining accounts) to verify the leaf being operated on.
|
|
13
|
+
*/
|
|
14
|
+
root: Array<number>;
|
|
15
|
+
/**
|
|
16
|
+
* Keccak256 hash of the leaf's metadata, used together with `root` to
|
|
17
|
+
* verify the leaf before it is modified.
|
|
18
|
+
*/
|
|
19
|
+
dataHash: Array<number>;
|
|
20
|
+
/**
|
|
21
|
+
* Keccak256 hash of the leaf's creators array, used together with
|
|
22
|
+
* `root` to verify the leaf before it is modified.
|
|
23
|
+
*/
|
|
24
|
+
creatorHash: Array<number>;
|
|
25
|
+
/**
|
|
26
|
+
* Tree-scoped nonce identifying the leaf, equal to the tree's
|
|
27
|
+
* `numMinted` at the time the leaf was minted. Combined with the tree
|
|
28
|
+
* address to derive the leaf's asset id.
|
|
29
|
+
*/
|
|
13
30
|
nonce: bigint;
|
|
31
|
+
/**
|
|
32
|
+
* Position of the leaf within the Merkle tree, used with the Merkle
|
|
33
|
+
* proof to locate and verify the leaf.
|
|
34
|
+
*/
|
|
14
35
|
index: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
36
|
+
};
|
|
37
|
+
type RedeemInstructionDataArgs = {
|
|
38
|
+
/**
|
|
39
|
+
* Current Merkle root of the tree, used together with the Merkle proof
|
|
40
|
+
* (passed as remaining accounts) to verify the leaf being operated on.
|
|
41
|
+
*/
|
|
42
|
+
root: Array<number>;
|
|
43
|
+
/**
|
|
44
|
+
* Keccak256 hash of the leaf's metadata, used together with `root` to
|
|
45
|
+
* verify the leaf before it is modified.
|
|
46
|
+
*/
|
|
47
|
+
dataHash: Array<number>;
|
|
48
|
+
/**
|
|
49
|
+
* Keccak256 hash of the leaf's creators array, used together with
|
|
50
|
+
* `root` to verify the leaf before it is modified.
|
|
51
|
+
*/
|
|
52
|
+
creatorHash: Array<number>;
|
|
53
|
+
/**
|
|
54
|
+
* Tree-scoped nonce identifying the leaf, equal to the tree's
|
|
55
|
+
* `numMinted` at the time the leaf was minted. Combined with the tree
|
|
56
|
+
* address to derive the leaf's asset id.
|
|
57
|
+
*/
|
|
20
58
|
nonce: number | bigint;
|
|
59
|
+
/**
|
|
60
|
+
* Position of the leaf within the Merkle tree, used with the Merkle
|
|
61
|
+
* proof to locate and verify the leaf.
|
|
62
|
+
*/
|
|
21
63
|
index: number;
|
|
22
|
-
}
|
|
64
|
+
};
|
|
23
65
|
declare function getRedeemInstructionDataEncoder(): FixedSizeEncoder<RedeemInstructionDataArgs>;
|
|
24
66
|
declare function getRedeemInstructionDataDecoder(): FixedSizeDecoder<RedeemInstructionData>;
|
|
25
67
|
declare function getRedeemInstructionDataCodec(): FixedSizeCodec<RedeemInstructionDataArgs, RedeemInstructionData>;
|
|
26
|
-
|
|
68
|
+
type RedeemAsyncInput<TAccountTreeAuthority extends string = string, TAccountLeafOwner extends string = string, TAccountLeafDelegate extends string = string, TAccountMerkleTree extends string = string, TAccountVoucher extends string = string, TAccountLogWrapper extends string = string, TAccountCompressionProgram extends string = string, TAccountSystemProgram extends string = string> = {
|
|
69
|
+
/**
|
|
70
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
71
|
+
* as the tree's authority for CPIs into the compression program.
|
|
72
|
+
*/
|
|
27
73
|
treeAuthority?: Address<TAccountTreeAuthority>;
|
|
74
|
+
/** Owner of the compressed NFT leaf being operated on. */
|
|
28
75
|
leafOwner: TransactionSigner<TAccountLeafOwner>;
|
|
76
|
+
/**
|
|
77
|
+
* Delegate authority for the leaf; defaults to the leaf owner when no
|
|
78
|
+
* delegate is set.
|
|
79
|
+
*/
|
|
29
80
|
leafDelegate: Address<TAccountLeafDelegate>;
|
|
81
|
+
/**
|
|
82
|
+
* The concurrent Merkle tree account storing the compressed leaves,
|
|
83
|
+
* owned by the account compression program.
|
|
84
|
+
*/
|
|
30
85
|
merkleTree: Address<TAccountMerkleTree>;
|
|
86
|
+
/**
|
|
87
|
+
* Voucher PDA created by this instruction to record the redeemed
|
|
88
|
+
* leaf's data until it is decompressed or the redeem is cancelled.
|
|
89
|
+
*/
|
|
31
90
|
voucher: Address<TAccountVoucher>;
|
|
91
|
+
/**
|
|
92
|
+
* The SPL/MPL Noop program, used to log leaf data so off-chain indexers
|
|
93
|
+
* can reconstruct the tree.
|
|
94
|
+
*/
|
|
32
95
|
logWrapper?: Address<TAccountLogWrapper>;
|
|
96
|
+
/**
|
|
97
|
+
* The SPL/MPL Account Compression program that owns and manages the
|
|
98
|
+
* Merkle tree.
|
|
99
|
+
*/
|
|
33
100
|
compressionProgram?: Address<TAccountCompressionProgram>;
|
|
101
|
+
/** The Solana System program. */
|
|
34
102
|
systemProgram?: Address<TAccountSystemProgram>;
|
|
35
103
|
root: RedeemInstructionDataArgs["root"];
|
|
36
104
|
dataHash: RedeemInstructionDataArgs["dataHash"];
|
|
37
105
|
creatorHash: RedeemInstructionDataArgs["creatorHash"];
|
|
38
106
|
nonce: RedeemInstructionDataArgs["nonce"];
|
|
39
107
|
index: RedeemInstructionDataArgs["index"];
|
|
40
|
-
}
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Redeems (vouches for) a leaf, removing it from the tree and recording
|
|
111
|
+
* its data in a new `voucher` PDA.
|
|
112
|
+
*
|
|
113
|
+
* This is the first step of decompression: once redeemed, the leaf slot
|
|
114
|
+
* in the tree is emptied and the leaf's data is preserved in `voucher`
|
|
115
|
+
* until `decompressV1` consumes it, or `cancelRedeem` restores it.
|
|
116
|
+
*/
|
|
41
117
|
declare function getRedeemInstructionAsync<TAccountTreeAuthority extends string, TAccountLeafOwner extends string, TAccountLeafDelegate 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: RedeemAsyncInput<TAccountTreeAuthority, TAccountLeafOwner, TAccountLeafDelegate, TAccountMerkleTree, TAccountVoucher, TAccountLogWrapper, TAccountCompressionProgram, TAccountSystemProgram>, config?: {
|
|
42
118
|
programAddress?: TProgramAddress;
|
|
43
119
|
}): Promise<RedeemInstruction<TProgramAddress, TAccountTreeAuthority, TAccountLeafOwner, TAccountLeafDelegate, TAccountMerkleTree, TAccountVoucher, TAccountLogWrapper, TAccountCompressionProgram, TAccountSystemProgram>>;
|
|
44
|
-
|
|
120
|
+
type RedeemInput<TAccountTreeAuthority extends string = string, TAccountLeafOwner extends string = string, TAccountLeafDelegate extends string = string, TAccountMerkleTree extends string = string, TAccountVoucher extends string = string, TAccountLogWrapper extends string = string, TAccountCompressionProgram extends string = string, TAccountSystemProgram extends string = string> = {
|
|
121
|
+
/**
|
|
122
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
123
|
+
* as the tree's authority for CPIs into the compression program.
|
|
124
|
+
*/
|
|
45
125
|
treeAuthority: Address<TAccountTreeAuthority>;
|
|
126
|
+
/** Owner of the compressed NFT leaf being operated on. */
|
|
46
127
|
leafOwner: TransactionSigner<TAccountLeafOwner>;
|
|
128
|
+
/**
|
|
129
|
+
* Delegate authority for the leaf; defaults to the leaf owner when no
|
|
130
|
+
* delegate is set.
|
|
131
|
+
*/
|
|
47
132
|
leafDelegate: Address<TAccountLeafDelegate>;
|
|
133
|
+
/**
|
|
134
|
+
* The concurrent Merkle tree account storing the compressed leaves,
|
|
135
|
+
* owned by the account compression program.
|
|
136
|
+
*/
|
|
48
137
|
merkleTree: Address<TAccountMerkleTree>;
|
|
138
|
+
/**
|
|
139
|
+
* Voucher PDA created by this instruction to record the redeemed
|
|
140
|
+
* leaf's data until it is decompressed or the redeem is cancelled.
|
|
141
|
+
*/
|
|
49
142
|
voucher: Address<TAccountVoucher>;
|
|
143
|
+
/**
|
|
144
|
+
* The SPL/MPL Noop program, used to log leaf data so off-chain indexers
|
|
145
|
+
* can reconstruct the tree.
|
|
146
|
+
*/
|
|
50
147
|
logWrapper?: Address<TAccountLogWrapper>;
|
|
148
|
+
/**
|
|
149
|
+
* The SPL/MPL Account Compression program that owns and manages the
|
|
150
|
+
* Merkle tree.
|
|
151
|
+
*/
|
|
51
152
|
compressionProgram?: Address<TAccountCompressionProgram>;
|
|
153
|
+
/** The Solana System program. */
|
|
52
154
|
systemProgram?: Address<TAccountSystemProgram>;
|
|
53
155
|
root: RedeemInstructionDataArgs["root"];
|
|
54
156
|
dataHash: RedeemInstructionDataArgs["dataHash"];
|
|
55
157
|
creatorHash: RedeemInstructionDataArgs["creatorHash"];
|
|
56
158
|
nonce: RedeemInstructionDataArgs["nonce"];
|
|
57
159
|
index: RedeemInstructionDataArgs["index"];
|
|
58
|
-
}
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Redeems (vouches for) a leaf, removing it from the tree and recording
|
|
163
|
+
* its data in a new `voucher` PDA.
|
|
164
|
+
*
|
|
165
|
+
* This is the first step of decompression: once redeemed, the leaf slot
|
|
166
|
+
* in the tree is emptied and the leaf's data is preserved in `voucher`
|
|
167
|
+
* until `decompressV1` consumes it, or `cancelRedeem` restores it.
|
|
168
|
+
*/
|
|
59
169
|
declare function getRedeemInstruction<TAccountTreeAuthority extends string, TAccountLeafOwner extends string, TAccountLeafDelegate 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: RedeemInput<TAccountTreeAuthority, TAccountLeafOwner, TAccountLeafDelegate, TAccountMerkleTree, TAccountVoucher, TAccountLogWrapper, TAccountCompressionProgram, TAccountSystemProgram>, config?: {
|
|
60
170
|
programAddress?: TProgramAddress;
|
|
61
171
|
}): RedeemInstruction<TProgramAddress, TAccountTreeAuthority, TAccountLeafOwner, TAccountLeafDelegate, TAccountMerkleTree, TAccountVoucher, TAccountLogWrapper, TAccountCompressionProgram, TAccountSystemProgram>;
|
|
62
|
-
|
|
172
|
+
type ParsedRedeemInstruction<TProgram extends string = typeof BUBBLEGUM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
63
173
|
programAddress: Address<TProgram>;
|
|
64
174
|
accounts: {
|
|
175
|
+
/**
|
|
176
|
+
* The tree's `TreeConfig` PDA, which stores its configuration and acts
|
|
177
|
+
* as the tree's authority for CPIs into the compression program.
|
|
178
|
+
*/
|
|
65
179
|
treeAuthority: TAccountMetas[0];
|
|
180
|
+
/** Owner of the compressed NFT leaf being operated on. */
|
|
66
181
|
leafOwner: TAccountMetas[1];
|
|
182
|
+
/**
|
|
183
|
+
* Delegate authority for the leaf; defaults to the leaf owner when no
|
|
184
|
+
* delegate is set.
|
|
185
|
+
*/
|
|
67
186
|
leafDelegate: TAccountMetas[2];
|
|
187
|
+
/**
|
|
188
|
+
* The concurrent Merkle tree account storing the compressed leaves,
|
|
189
|
+
* owned by the account compression program.
|
|
190
|
+
*/
|
|
68
191
|
merkleTree: TAccountMetas[3];
|
|
192
|
+
/**
|
|
193
|
+
* Voucher PDA created by this instruction to record the redeemed
|
|
194
|
+
* leaf's data until it is decompressed or the redeem is cancelled.
|
|
195
|
+
*/
|
|
69
196
|
voucher: TAccountMetas[4];
|
|
197
|
+
/**
|
|
198
|
+
* The SPL/MPL Noop program, used to log leaf data so off-chain indexers
|
|
199
|
+
* can reconstruct the tree.
|
|
200
|
+
*/
|
|
70
201
|
logWrapper: TAccountMetas[5];
|
|
202
|
+
/**
|
|
203
|
+
* The SPL/MPL Account Compression program that owns and manages the
|
|
204
|
+
* Merkle tree.
|
|
205
|
+
*/
|
|
71
206
|
compressionProgram: TAccountMetas[6];
|
|
207
|
+
/** The Solana System program. */
|
|
72
208
|
systemProgram: TAccountMetas[7];
|
|
73
209
|
};
|
|
74
210
|
data: RedeemInstructionData;
|
|
75
|
-
}
|
|
211
|
+
};
|
|
76
212
|
declare function parseRedeemInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedRedeemInstruction<TProgram, TAccountMetas>;
|
|
77
213
|
//#endregion
|
|
78
214
|
export { ParsedRedeemInstruction, REDEEM_DISCRIMINATOR, RedeemAsyncInput, RedeemInput, RedeemInstruction, RedeemInstructionData, RedeemInstructionDataArgs, getRedeemDiscriminatorBytes, getRedeemInstruction, getRedeemInstructionAsync, getRedeemInstructionDataCodec, getRedeemInstructionDataDecoder, getRedeemInstructionDataEncoder, parseRedeemInstruction };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redeem.d.ts","names":[],"sources":["../../../src/generated/instructions/redeem.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"redeem.d.ts","names":[],"sources":["../../../src/generated/instructions/redeem.ts"],"mappings":";;;;cAkDa,sBAAsB;iBAInB,+BAA+B;KAInC,kBACV,iCAAiC,2BACjC,uCAAuC,8BACvC,mCAAmC,8BACnC,sCAAsC,8BACtC,oCAAoC,8BACpC,iCAAiC,8BACjC,oCAAoC,qEAEpC,4CAA4C,qEAE5C,uCAAuC,0DAEvC,oCAAoC,8BAClC,YAAY,YACd,oBAAoB,sBACpB,yBAEI,uCACI,gBAAgB,yBAChB,uBACJ,mCACI,sBAAsB,qBACpB,kBAAkB,qBACpB,mBACJ,sCACI,gBAAgB,wBAChB,sBACJ,oCACI,gBAAgB,sBAChB,oBACJ,iCACI,gBAAgB,mBAChB,iBACJ,oCACI,gBAAgB,sBAChB,oBACJ,4CACI,gBAAgB,8BAChB,4BACJ,uCACI,gBAAgB,yBAChB,0BACD;KAIG;EACV,eAAe;;;;;EAKf,MAAM;;;;;EAKN,UAAU;;;;;EAKV,aAAa;;;;;;EAMb;;;;;EAKA;;KAGU;;;;;EAKV,MAAM;;;;;EAKN,UAAU;;;;;EAKV,aAAa;;;;;;EAMb;;;;;EAKA;;iBAGc,mCAAmC,iBAAiB;iBAcpD,mCAAmC,iBAAiB;iBAWpD,iCAAiC,eAC/C,2BACA;KAQU,iBACV,+CACA,2CACA,8CACA,4CACA,yCACA,4CACA,oDACA;;;;;EAMA,gBAAgB,QAAQ;;EAExB,WAAW,kBAAkB;;;;;EAK7B,cAAc,QAAQ;;;;;EA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ACvB,wBAAwB,iBACxB,oBAAoB,sBACrB,wBAAwB,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, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, transformEncoder } from "@solana/kit";
|
|
4
4
|
import { getAccountMetaFactory, getAddressFromResolvedInstructionAccount } from "@solana/program-client-core";
|
|
5
5
|
//#region src/generated/instructions/redeem.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 REDEEM_DISCRIMINATOR = new Uint8Array([
|
|
7
14
|
184,
|
|
8
15
|
12,
|
|
@@ -42,6 +49,14 @@ function getRedeemInstructionDataDecoder() {
|
|
|
42
49
|
function getRedeemInstructionDataCodec() {
|
|
43
50
|
return combineCodec(getRedeemInstructionDataEncoder(), getRedeemInstructionDataDecoder());
|
|
44
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Redeems (vouches for) a leaf, removing it from the tree and recording
|
|
54
|
+
* its data in a new `voucher` PDA.
|
|
55
|
+
*
|
|
56
|
+
* This is the first step of decompression: once redeemed, the leaf slot
|
|
57
|
+
* in the tree is emptied and the leaf's data is preserved in `voucher`
|
|
58
|
+
* until `decompressV1` consumes it, or `cancelRedeem` restores it.
|
|
59
|
+
*/
|
|
45
60
|
async function getRedeemInstructionAsync(input, config) {
|
|
46
61
|
const programAddress = config?.programAddress ?? "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
47
62
|
const accounts = {
|
|
@@ -99,6 +114,14 @@ async function getRedeemInstructionAsync(input, config) {
|
|
|
99
114
|
programAddress
|
|
100
115
|
});
|
|
101
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Redeems (vouches for) a leaf, removing it from the tree and recording
|
|
119
|
+
* its data in a new `voucher` PDA.
|
|
120
|
+
*
|
|
121
|
+
* This is the first step of decompression: once redeemed, the leaf slot
|
|
122
|
+
* in the tree is emptied and the leaf's data is preserved in `voucher`
|
|
123
|
+
* until `decompressV1` consumes it, or `cancelRedeem` restores it.
|
|
124
|
+
*/
|
|
102
125
|
function getRedeemInstruction(input, config) {
|
|
103
126
|
const programAddress = config?.programAddress ?? "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
104
127
|
const accounts = {
|