@macalinao/clients-mpl-bubblegum 0.2.0 → 0.3.0

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.
Files changed (333) hide show
  1. package/dist/generated/accounts/index.d.ts +2 -10
  2. package/dist/generated/accounts/treeConfig.d.ts +42 -38
  3. package/dist/generated/accounts/treeConfig.d.ts.map +1 -1
  4. package/dist/generated/accounts/treeConfig.js +70 -53
  5. package/dist/generated/accounts/treeConfig.js.map +1 -1
  6. package/dist/generated/accounts/voucher.d.ts +33 -30
  7. package/dist/generated/accounts/voucher.d.ts.map +1 -1
  8. package/dist/generated/accounts/voucher.js +61 -45
  9. package/dist/generated/accounts/voucher.js.map +1 -1
  10. package/dist/generated/errors/bubblegum.d.ts +71 -74
  11. package/dist/generated/errors/bubblegum.d.ts.map +1 -1
  12. package/dist/generated/errors/bubblegum.js +126 -133
  13. package/dist/generated/errors/bubblegum.js.map +1 -1
  14. package/dist/generated/errors/index.d.ts +1 -9
  15. package/dist/generated/index.d.ts +63 -13
  16. package/dist/generated/instructions/burn.d.ts +70 -65
  17. package/dist/generated/instructions/burn.d.ts.map +1 -1
  18. package/dist/generated/instructions/burn.js +168 -98
  19. package/dist/generated/instructions/burn.js.map +1 -1
  20. package/dist/generated/instructions/burnV2.d.ts +107 -96
  21. package/dist/generated/instructions/burnV2.d.ts.map +1 -1
  22. package/dist/generated/instructions/burnV2.js +239 -136
  23. package/dist/generated/instructions/burnV2.js.map +1 -1
  24. package/dist/generated/instructions/cancelRedeem.d.ts +54 -53
  25. package/dist/generated/instructions/cancelRedeem.d.ts.map +1 -1
  26. package/dist/generated/instructions/cancelRedeem.js +154 -90
  27. package/dist/generated/instructions/cancelRedeem.js.map +1 -1
  28. package/dist/generated/instructions/closeTreeV2.d.ts +64 -60
  29. package/dist/generated/instructions/closeTreeV2.d.ts.map +1 -1
  30. package/dist/generated/instructions/closeTreeV2.js +152 -84
  31. package/dist/generated/instructions/closeTreeV2.js.map +1 -1
  32. package/dist/generated/instructions/collectV2.d.ts +28 -35
  33. package/dist/generated/instructions/collectV2.d.ts.map +1 -1
  34. package/dist/generated/instructions/collectV2.js +63 -60
  35. package/dist/generated/instructions/collectV2.js.map +1 -1
  36. package/dist/generated/instructions/compress.d.ts +71 -71
  37. package/dist/generated/instructions/compress.d.ts.map +1 -1
  38. package/dist/generated/instructions/compress.js +233 -116
  39. package/dist/generated/instructions/compress.js.map +1 -1
  40. package/dist/generated/instructions/createTree.d.ts +62 -59
  41. package/dist/generated/instructions/createTree.d.ts.map +1 -1
  42. package/dist/generated/instructions/createTree.js +164 -94
  43. package/dist/generated/instructions/createTree.js.map +1 -1
  44. package/dist/generated/instructions/createTreeV2.d.ts +64 -61
  45. package/dist/generated/instructions/createTreeV2.d.ts.map +1 -1
  46. package/dist/generated/instructions/createTreeV2.js +168 -100
  47. package/dist/generated/instructions/createTreeV2.js.map +1 -1
  48. package/dist/generated/instructions/decompressV1.d.ts +73 -72
  49. package/dist/generated/instructions/decompressV1.d.ts.map +1 -1
  50. package/dist/generated/instructions/decompressV1.js +251 -128
  51. package/dist/generated/instructions/decompressV1.js.map +1 -1
  52. package/dist/generated/instructions/delegate.d.ts +73 -68
  53. package/dist/generated/instructions/delegate.d.ts.map +1 -1
  54. package/dist/generated/instructions/delegate.js +179 -107
  55. package/dist/generated/instructions/delegate.js.map +1 -1
  56. package/dist/generated/instructions/delegateAndFreezeV2.d.ts +92 -84
  57. package/dist/generated/instructions/delegateAndFreezeV2.d.ts.map +1 -1
  58. package/dist/generated/instructions/delegateAndFreezeV2.js +201 -136
  59. package/dist/generated/instructions/delegateAndFreezeV2.js.map +1 -1
  60. package/dist/generated/instructions/delegateV2.d.ts +92 -84
  61. package/dist/generated/instructions/delegateV2.d.ts.map +1 -1
  62. package/dist/generated/instructions/delegateV2.js +200 -134
  63. package/dist/generated/instructions/delegateV2.js.map +1 -1
  64. package/dist/generated/instructions/freezeV2.d.ts +99 -88
  65. package/dist/generated/instructions/freezeV2.d.ts.map +1 -1
  66. package/dist/generated/instructions/freezeV2.js +209 -123
  67. package/dist/generated/instructions/freezeV2.js.map +1 -1
  68. package/dist/generated/instructions/index.d.ts +36 -44
  69. package/dist/generated/instructions/mintToCollectionV1.d.ts +94 -89
  70. package/dist/generated/instructions/mintToCollectionV1.d.ts.map +1 -1
  71. package/dist/generated/instructions/mintToCollectionV1.js +277 -139
  72. package/dist/generated/instructions/mintToCollectionV1.js.map +1 -1
  73. package/dist/generated/instructions/mintV1.d.ts +61 -60
  74. package/dist/generated/instructions/mintV1.d.ts.map +1 -1
  75. package/dist/generated/instructions/mintV1.js +177 -97
  76. package/dist/generated/instructions/mintV1.js.map +1 -1
  77. package/dist/generated/instructions/mintV2.d.ts +86 -82
  78. package/dist/generated/instructions/mintV2.d.ts.map +1 -1
  79. package/dist/generated/instructions/mintV2.js +244 -135
  80. package/dist/generated/instructions/mintV2.js.map +1 -1
  81. package/dist/generated/instructions/redeem.d.ts +73 -68
  82. package/dist/generated/instructions/redeem.d.ts.map +1 -1
  83. package/dist/generated/instructions/redeem.js +179 -101
  84. package/dist/generated/instructions/redeem.js.map +1 -1
  85. package/dist/generated/instructions/setAndVerifyCollection.d.ts +133 -117
  86. package/dist/generated/instructions/setAndVerifyCollection.d.ts.map +1 -1
  87. package/dist/generated/instructions/setAndVerifyCollection.js +295 -151
  88. package/dist/generated/instructions/setAndVerifyCollection.js.map +1 -1
  89. package/dist/generated/instructions/setCollectionV2.d.ts +125 -110
  90. package/dist/generated/instructions/setCollectionV2.d.ts.map +1 -1
  91. package/dist/generated/instructions/setCollectionV2.js +257 -146
  92. package/dist/generated/instructions/setCollectionV2.js.map +1 -1
  93. package/dist/generated/instructions/setDecompressableState.d.ts +32 -39
  94. package/dist/generated/instructions/setDecompressableState.d.ts.map +1 -1
  95. package/dist/generated/instructions/setDecompressableState.js +66 -69
  96. package/dist/generated/instructions/setDecompressableState.js.map +1 -1
  97. package/dist/generated/instructions/setDecompressibleState.d.ts +32 -39
  98. package/dist/generated/instructions/setDecompressibleState.d.ts.map +1 -1
  99. package/dist/generated/instructions/setDecompressibleState.js +66 -69
  100. package/dist/generated/instructions/setDecompressibleState.js.map +1 -1
  101. package/dist/generated/instructions/setNonTransferableV2.d.ts +101 -90
  102. package/dist/generated/instructions/setNonTransferableV2.d.ts.map +1 -1
  103. package/dist/generated/instructions/setNonTransferableV2.js +210 -125
  104. package/dist/generated/instructions/setNonTransferableV2.js.map +1 -1
  105. package/dist/generated/instructions/setTreeDelegate.d.ts +44 -44
  106. package/dist/generated/instructions/setTreeDelegate.d.ts.map +1 -1
  107. package/dist/generated/instructions/setTreeDelegate.js +127 -77
  108. package/dist/generated/instructions/setTreeDelegate.js.map +1 -1
  109. package/dist/generated/instructions/thawAndRevokeV2.d.ts +87 -79
  110. package/dist/generated/instructions/thawAndRevokeV2.d.ts.map +1 -1
  111. package/dist/generated/instructions/thawAndRevokeV2.js +190 -124
  112. package/dist/generated/instructions/thawAndRevokeV2.js.map +1 -1
  113. package/dist/generated/instructions/thawV2.d.ts +99 -88
  114. package/dist/generated/instructions/thawV2.d.ts.map +1 -1
  115. package/dist/generated/instructions/thawV2.js +209 -123
  116. package/dist/generated/instructions/thawV2.js.map +1 -1
  117. package/dist/generated/instructions/transfer.d.ts +73 -68
  118. package/dist/generated/instructions/transfer.d.ts.map +1 -1
  119. package/dist/generated/instructions/transfer.js +179 -101
  120. package/dist/generated/instructions/transfer.js.map +1 -1
  121. package/dist/generated/instructions/transferV2.d.ts +104 -93
  122. package/dist/generated/instructions/transferV2.d.ts.map +1 -1
  123. package/dist/generated/instructions/transferV2.js +220 -126
  124. package/dist/generated/instructions/transferV2.js.map +1 -1
  125. package/dist/generated/instructions/unverifyCollection.d.ts +129 -114
  126. package/dist/generated/instructions/unverifyCollection.d.ts.map +1 -1
  127. package/dist/generated/instructions/unverifyCollection.js +293 -146
  128. package/dist/generated/instructions/unverifyCollection.js.map +1 -1
  129. package/dist/generated/instructions/unverifyCreator.d.ts +81 -75
  130. package/dist/generated/instructions/unverifyCreator.d.ts.map +1 -1
  131. package/dist/generated/instructions/unverifyCreator.js +194 -106
  132. package/dist/generated/instructions/unverifyCreator.js.map +1 -1
  133. package/dist/generated/instructions/unverifyCreatorV2.d.ts +85 -79
  134. package/dist/generated/instructions/unverifyCreatorV2.d.ts.map +1 -1
  135. package/dist/generated/instructions/unverifyCreatorV2.js +198 -118
  136. package/dist/generated/instructions/unverifyCreatorV2.js.map +1 -1
  137. package/dist/generated/instructions/updateAssetDataV2.d.ts +108 -95
  138. package/dist/generated/instructions/updateAssetDataV2.d.ts.map +1 -1
  139. package/dist/generated/instructions/updateAssetDataV2.js +215 -136
  140. package/dist/generated/instructions/updateAssetDataV2.js.map +1 -1
  141. package/dist/generated/instructions/updateMetadata.d.ts +106 -96
  142. package/dist/generated/instructions/updateMetadata.d.ts.map +1 -1
  143. package/dist/generated/instructions/updateMetadata.js +243 -135
  144. package/dist/generated/instructions/updateMetadata.js.map +1 -1
  145. package/dist/generated/instructions/updateMetadataV2.d.ts +103 -91
  146. package/dist/generated/instructions/updateMetadataV2.d.ts.map +1 -1
  147. package/dist/generated/instructions/updateMetadataV2.js +212 -123
  148. package/dist/generated/instructions/updateMetadataV2.js.map +1 -1
  149. package/dist/generated/instructions/verifyCollection.d.ts +129 -114
  150. package/dist/generated/instructions/verifyCollection.d.ts.map +1 -1
  151. package/dist/generated/instructions/verifyCollection.js +293 -146
  152. package/dist/generated/instructions/verifyCollection.js.map +1 -1
  153. package/dist/generated/instructions/verifyCreator.d.ts +81 -75
  154. package/dist/generated/instructions/verifyCreator.d.ts.map +1 -1
  155. package/dist/generated/instructions/verifyCreator.js +193 -107
  156. package/dist/generated/instructions/verifyCreator.js.map +1 -1
  157. package/dist/generated/instructions/verifyCreatorV2.d.ts +85 -79
  158. package/dist/generated/instructions/verifyCreatorV2.d.ts.map +1 -1
  159. package/dist/generated/instructions/verifyCreatorV2.js +198 -118
  160. package/dist/generated/instructions/verifyCreatorV2.js.map +1 -1
  161. package/dist/generated/pdas/assetId.d.ts +16 -0
  162. package/dist/generated/pdas/assetId.d.ts.map +1 -0
  163. package/dist/generated/pdas/assetId.js +18 -0
  164. package/dist/generated/pdas/assetId.js.map +1 -0
  165. package/dist/generated/pdas/bubblegumSigner.d.ts +10 -0
  166. package/dist/generated/pdas/bubblegumSigner.d.ts.map +1 -0
  167. package/dist/generated/pdas/bubblegumSigner.js +14 -0
  168. package/dist/generated/pdas/bubblegumSigner.js.map +1 -0
  169. package/dist/generated/pdas/index.d.ts +7 -0
  170. package/dist/generated/pdas/masterEdition.d.ts +14 -0
  171. package/dist/generated/pdas/masterEdition.d.ts.map +1 -0
  172. package/dist/generated/pdas/masterEdition.js +19 -0
  173. package/dist/generated/pdas/masterEdition.js.map +1 -0
  174. package/dist/generated/pdas/metadata.d.ts +14 -0
  175. package/dist/generated/pdas/metadata.d.ts.map +1 -0
  176. package/dist/generated/pdas/metadata.js +18 -0
  177. package/dist/generated/pdas/metadata.js.map +1 -0
  178. package/dist/generated/pdas/mintAuthority.d.ts +14 -0
  179. package/dist/generated/pdas/mintAuthority.d.ts.map +1 -0
  180. package/dist/generated/pdas/mintAuthority.js +14 -0
  181. package/dist/generated/pdas/mintAuthority.js.map +1 -0
  182. package/dist/generated/pdas/treeConfig.d.ts +14 -0
  183. package/dist/generated/pdas/treeConfig.d.ts.map +1 -0
  184. package/dist/generated/pdas/treeConfig.js +14 -0
  185. package/dist/generated/pdas/treeConfig.js.map +1 -0
  186. package/dist/generated/pdas/voucher.d.ts +16 -0
  187. package/dist/generated/pdas/voucher.d.ts.map +1 -0
  188. package/dist/generated/pdas/voucher.js +18 -0
  189. package/dist/generated/pdas/voucher.js.map +1 -0
  190. package/dist/generated/programs/bubblegum.d.ts +186 -143
  191. package/dist/generated/programs/bubblegum.d.ts.map +1 -1
  192. package/dist/generated/programs/bubblegum.js +839 -561
  193. package/dist/generated/programs/bubblegum.js.map +1 -1
  194. package/dist/generated/programs/index.d.ts +2 -9
  195. package/dist/generated/programs/mplTokenMetadata.d.ts +20 -0
  196. package/dist/generated/programs/mplTokenMetadata.d.ts.map +1 -0
  197. package/dist/generated/programs/mplTokenMetadata.js +17 -0
  198. package/dist/generated/programs/mplTokenMetadata.js.map +1 -0
  199. package/dist/generated/types/assetDataSchema.d.ts +13 -16
  200. package/dist/generated/types/assetDataSchema.d.ts.map +1 -1
  201. package/dist/generated/types/assetDataSchema.js +16 -19
  202. package/dist/generated/types/assetDataSchema.js.map +1 -1
  203. package/dist/generated/types/bubblegumEventType.d.ts +12 -15
  204. package/dist/generated/types/bubblegumEventType.d.ts.map +1 -1
  205. package/dist/generated/types/bubblegumEventType.js +15 -18
  206. package/dist/generated/types/bubblegumEventType.js.map +1 -1
  207. package/dist/generated/types/collection.d.ts +12 -15
  208. package/dist/generated/types/collection.d.ts.map +1 -1
  209. package/dist/generated/types/collection.js +11 -20
  210. package/dist/generated/types/collection.js.map +1 -1
  211. package/dist/generated/types/creator.d.ts +18 -21
  212. package/dist/generated/types/creator.d.ts.map +1 -1
  213. package/dist/generated/types/creator.js +19 -22
  214. package/dist/generated/types/creator.js.map +1 -1
  215. package/dist/generated/types/decompressibleState.d.ts +12 -15
  216. package/dist/generated/types/decompressibleState.d.ts.map +1 -1
  217. package/dist/generated/types/decompressibleState.js +15 -18
  218. package/dist/generated/types/decompressibleState.js.map +1 -1
  219. package/dist/generated/types/index.d.ts +15 -23
  220. package/dist/generated/types/instructionName.d.ts +45 -48
  221. package/dist/generated/types/instructionName.d.ts.map +1 -1
  222. package/dist/generated/types/instructionName.js +48 -51
  223. package/dist/generated/types/instructionName.js.map +1 -1
  224. package/dist/generated/types/leafSchema.d.ts +48 -51
  225. package/dist/generated/types/leafSchema.d.ts.map +1 -1
  226. package/dist/generated/types/leafSchema.js +55 -72
  227. package/dist/generated/types/leafSchema.js.map +1 -1
  228. package/dist/generated/types/metadataArgs.d.ts +59 -58
  229. package/dist/generated/types/metadataArgs.d.ts.map +1 -1
  230. package/dist/generated/types/metadataArgs.js +42 -41
  231. package/dist/generated/types/metadataArgs.js.map +1 -1
  232. package/dist/generated/types/metadataArgsV2.d.ts +48 -50
  233. package/dist/generated/types/metadataArgsV2.d.ts.map +1 -1
  234. package/dist/generated/types/metadataArgsV2.js +33 -35
  235. package/dist/generated/types/metadataArgsV2.js.map +1 -1
  236. package/dist/generated/types/tokenProgramVersion.d.ts +12 -15
  237. package/dist/generated/types/tokenProgramVersion.d.ts.map +1 -1
  238. package/dist/generated/types/tokenProgramVersion.js +15 -18
  239. package/dist/generated/types/tokenProgramVersion.js.map +1 -1
  240. package/dist/generated/types/tokenStandard.d.ts +14 -17
  241. package/dist/generated/types/tokenStandard.d.ts.map +1 -1
  242. package/dist/generated/types/tokenStandard.js +17 -20
  243. package/dist/generated/types/tokenStandard.js.map +1 -1
  244. package/dist/generated/types/updateArgs.d.ts +25 -28
  245. package/dist/generated/types/updateArgs.d.ts.map +1 -1
  246. package/dist/generated/types/updateArgs.js +28 -49
  247. package/dist/generated/types/updateArgs.js.map +1 -1
  248. package/dist/generated/types/useMethod.d.ts +13 -16
  249. package/dist/generated/types/useMethod.d.ts.map +1 -1
  250. package/dist/generated/types/useMethod.js +16 -19
  251. package/dist/generated/types/useMethod.js.map +1 -1
  252. package/dist/generated/types/uses.d.ts +17 -20
  253. package/dist/generated/types/uses.d.ts.map +1 -1
  254. package/dist/generated/types/uses.js +20 -23
  255. package/dist/generated/types/uses.js.map +1 -1
  256. package/dist/generated/types/version.d.ts +12 -15
  257. package/dist/generated/types/version.d.ts.map +1 -1
  258. package/dist/generated/types/version.js +15 -18
  259. package/dist/generated/types/version.js.map +1 -1
  260. package/dist/index.d.ts +64 -8
  261. package/dist/index.js +64 -8
  262. package/package.json +7 -5
  263. package/src/generated/accounts/treeConfig.ts +22 -0
  264. package/src/generated/accounts/voucher.ts +22 -0
  265. package/src/generated/errors/bubblegum.ts +1 -1
  266. package/src/generated/index.ts +1 -0
  267. package/src/generated/instructions/burn.ts +155 -11
  268. package/src/generated/instructions/burnV2.ts +226 -16
  269. package/src/generated/instructions/cancelRedeem.ts +151 -11
  270. package/src/generated/instructions/closeTreeV2.ts +150 -11
  271. package/src/generated/instructions/collectV2.ts +3 -3
  272. package/src/generated/instructions/compress.ts +219 -18
  273. package/src/generated/instructions/createTree.ts +153 -11
  274. package/src/generated/instructions/createTreeV2.ts +154 -11
  275. package/src/generated/instructions/decompressV1.ts +258 -16
  276. package/src/generated/instructions/delegate.ts +170 -12
  277. package/src/generated/instructions/delegateAndFreezeV2.ts +184 -13
  278. package/src/generated/instructions/delegateV2.ts +184 -13
  279. package/src/generated/instructions/freezeV2.ts +188 -14
  280. package/src/generated/instructions/mintToCollectionV1.ts +296 -21
  281. package/src/generated/instructions/mintV1.ts +169 -13
  282. package/src/generated/instructions/mintV2.ts +231 -17
  283. package/src/generated/instructions/redeem.ts +164 -12
  284. package/src/generated/instructions/setAndVerifyCollection.ts +307 -21
  285. package/src/generated/instructions/setCollectionV2.ts +253 -19
  286. package/src/generated/instructions/setDecompressableState.ts +3 -3
  287. package/src/generated/instructions/setDecompressibleState.ts +3 -3
  288. package/src/generated/instructions/setNonTransferableV2.ts +189 -14
  289. package/src/generated/instructions/setTreeDelegate.ts +105 -7
  290. package/src/generated/instructions/thawAndRevokeV2.ts +168 -12
  291. package/src/generated/instructions/thawV2.ts +188 -14
  292. package/src/generated/instructions/transfer.ts +164 -12
  293. package/src/generated/instructions/transferV2.ts +198 -15
  294. package/src/generated/instructions/unverifyCollection.ts +306 -21
  295. package/src/generated/instructions/unverifyCreator.ts +174 -13
  296. package/src/generated/instructions/unverifyCreatorV2.ts +176 -13
  297. package/src/generated/instructions/updateAssetDataV2.ts +190 -14
  298. package/src/generated/instructions/updateMetadata.ts +233 -17
  299. package/src/generated/instructions/updateMetadataV2.ts +189 -14
  300. package/src/generated/instructions/verifyCollection.ts +306 -21
  301. package/src/generated/instructions/verifyCreator.ts +174 -13
  302. package/src/generated/instructions/verifyCreatorV2.ts +176 -13
  303. package/src/generated/pdas/assetId.ts +40 -0
  304. package/src/generated/pdas/bubblegumSigner.ts +23 -0
  305. package/{dist/generated/accounts/index.js → src/generated/pdas/index.ts} +6 -1
  306. package/src/generated/pdas/masterEdition.ts +38 -0
  307. package/src/generated/pdas/metadata.ts +37 -0
  308. package/src/generated/pdas/mintAuthority.ts +29 -0
  309. package/src/generated/pdas/treeConfig.ts +29 -0
  310. package/src/generated/pdas/voucher.ts +40 -0
  311. package/src/generated/programs/bubblegum.ts +208 -165
  312. package/src/generated/programs/index.ts +1 -0
  313. package/src/generated/programs/mplTokenMetadata.ts +42 -0
  314. package/dist/.tsbuildinfo +0 -1
  315. package/dist/generated/accounts/index.d.ts.map +0 -1
  316. package/dist/generated/accounts/index.js.map +0 -1
  317. package/dist/generated/errors/index.d.ts.map +0 -1
  318. package/dist/generated/errors/index.js +0 -9
  319. package/dist/generated/errors/index.js.map +0 -1
  320. package/dist/generated/index.d.ts.map +0 -1
  321. package/dist/generated/index.js +0 -13
  322. package/dist/generated/index.js.map +0 -1
  323. package/dist/generated/instructions/index.d.ts.map +0 -1
  324. package/dist/generated/instructions/index.js +0 -44
  325. package/dist/generated/instructions/index.js.map +0 -1
  326. package/dist/generated/programs/index.d.ts.map +0 -1
  327. package/dist/generated/programs/index.js +0 -9
  328. package/dist/generated/programs/index.js.map +0 -1
  329. package/dist/generated/types/index.d.ts.map +0 -1
  330. package/dist/generated/types/index.js +0 -23
  331. package/dist/generated/types/index.js.map +0 -1
  332. package/dist/index.d.ts.map +0 -1
  333. package/dist/index.js.map +0 -1
@@ -1,566 +1,844 @@
1
- /**
2
- * This code was AUTOGENERATED using the Codama library.
3
- * Please DO NOT EDIT THIS FILE, instead use visitors
4
- * to add features, then rerun Codama to update it.
5
- *
6
- * @see https://github.com/codama-idl/codama
7
- */
8
- import { assertIsInstructionWithAccounts, containsBytes, extendClient, fixEncoderSize, getBytesEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, SolanaError, } from "@solana/kit";
9
- import { addSelfFetchFunctions, addSelfPlanAndSendFunctions, } from "@solana/program-client-core";
10
- import { getTreeConfigCodec, getVoucherCodec } from "../accounts/index.js";
11
- import { getBurnInstruction, getBurnV2Instruction, getCancelRedeemInstruction, getCloseTreeV2Instruction, getCollectV2Instruction, getCompressInstruction, getCreateTreeInstruction, getCreateTreeV2Instruction, getDecompressV1Instruction, getDelegateAndFreezeV2Instruction, getDelegateInstruction, getDelegateV2Instruction, getFreezeV2Instruction, getMintToCollectionV1Instruction, getMintV1Instruction, getMintV2Instruction, getRedeemInstruction, getSetAndVerifyCollectionInstruction, getSetCollectionV2Instruction, getSetDecompressableStateInstruction, getSetDecompressibleStateInstruction, getSetNonTransferableV2Instruction, getSetTreeDelegateInstruction, getThawAndRevokeV2Instruction, getThawV2Instruction, getTransferInstruction, getTransferV2Instruction, getUnverifyCollectionInstruction, getUnverifyCreatorInstruction, getUnverifyCreatorV2Instruction, getUpdateAssetDataV2Instruction, getUpdateMetadataInstruction, getUpdateMetadataV2Instruction, getVerifyCollectionInstruction, getVerifyCreatorInstruction, getVerifyCreatorV2Instruction, parseBurnInstruction, parseBurnV2Instruction, parseCancelRedeemInstruction, parseCloseTreeV2Instruction, parseCollectV2Instruction, parseCompressInstruction, parseCreateTreeInstruction, parseCreateTreeV2Instruction, parseDecompressV1Instruction, parseDelegateAndFreezeV2Instruction, parseDelegateInstruction, parseDelegateV2Instruction, parseFreezeV2Instruction, parseMintToCollectionV1Instruction, parseMintV1Instruction, parseMintV2Instruction, parseRedeemInstruction, parseSetAndVerifyCollectionInstruction, parseSetCollectionV2Instruction, parseSetDecompressableStateInstruction, parseSetDecompressibleStateInstruction, parseSetNonTransferableV2Instruction, parseSetTreeDelegateInstruction, parseThawAndRevokeV2Instruction, parseThawV2Instruction, parseTransferInstruction, parseTransferV2Instruction, parseUnverifyCollectionInstruction, parseUnverifyCreatorInstruction, parseUnverifyCreatorV2Instruction, parseUpdateAssetDataV2Instruction, parseUpdateMetadataInstruction, parseUpdateMetadataV2Instruction, parseVerifyCollectionInstruction, parseVerifyCreatorInstruction, parseVerifyCreatorV2Instruction, } from "../instructions/index.js";
12
- export const BUBBLEGUM_PROGRAM_ADDRESS = "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
13
- export var BubblegumAccount;
14
- (function (BubblegumAccount) {
15
- BubblegumAccount[BubblegumAccount["TreeConfig"] = 0] = "TreeConfig";
16
- BubblegumAccount[BubblegumAccount["Voucher"] = 1] = "Voucher";
17
- })(BubblegumAccount || (BubblegumAccount = {}));
18
- export function identifyBubblegumAccount(account) {
19
- const data = "data" in account ? account.data : account;
20
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([122, 245, 175, 248, 171, 34, 0, 207])), 0)) {
21
- return BubblegumAccount.TreeConfig;
22
- }
23
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([191, 204, 149, 234, 213, 165, 13, 65])), 0)) {
24
- return BubblegumAccount.Voucher;
25
- }
26
- throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, { accountData: data, programName: "bubblegum" });
1
+ import { findAssetIdPda } from "../pdas/assetId.js";
2
+ import { findBubblegumSignerPda } from "../pdas/bubblegumSigner.js";
3
+ import { findMintAuthorityPda } from "../pdas/mintAuthority.js";
4
+ import { findTreeConfigPda } from "../pdas/treeConfig.js";
5
+ import { findVoucherPda } from "../pdas/voucher.js";
6
+ import { getTreeConfigCodec } from "../accounts/treeConfig.js";
7
+ import { getVoucherCodec } from "../accounts/voucher.js";
8
+ import { getBurnInstructionAsync, parseBurnInstruction } from "../instructions/burn.js";
9
+ import { getBurnV2InstructionAsync, parseBurnV2Instruction } from "../instructions/burnV2.js";
10
+ import { getCancelRedeemInstructionAsync, parseCancelRedeemInstruction } from "../instructions/cancelRedeem.js";
11
+ import { getCloseTreeV2InstructionAsync, parseCloseTreeV2Instruction } from "../instructions/closeTreeV2.js";
12
+ import { getCollectV2Instruction, parseCollectV2Instruction } from "../instructions/collectV2.js";
13
+ import { getCompressInstructionAsync, parseCompressInstruction } from "../instructions/compress.js";
14
+ import { getCreateTreeInstructionAsync, parseCreateTreeInstruction } from "../instructions/createTree.js";
15
+ import { getCreateTreeV2InstructionAsync, parseCreateTreeV2Instruction } from "../instructions/createTreeV2.js";
16
+ import { getDecompressV1InstructionAsync, parseDecompressV1Instruction } from "../instructions/decompressV1.js";
17
+ import { getDelegateInstructionAsync, parseDelegateInstruction } from "../instructions/delegate.js";
18
+ import { getDelegateAndFreezeV2InstructionAsync, parseDelegateAndFreezeV2Instruction } from "../instructions/delegateAndFreezeV2.js";
19
+ import { getDelegateV2InstructionAsync, parseDelegateV2Instruction } from "../instructions/delegateV2.js";
20
+ import { getFreezeV2InstructionAsync, parseFreezeV2Instruction } from "../instructions/freezeV2.js";
21
+ import { getMintToCollectionV1InstructionAsync, parseMintToCollectionV1Instruction } from "../instructions/mintToCollectionV1.js";
22
+ import { getMintV1InstructionAsync, parseMintV1Instruction } from "../instructions/mintV1.js";
23
+ import { getMintV2InstructionAsync, parseMintV2Instruction } from "../instructions/mintV2.js";
24
+ import { getRedeemInstructionAsync, parseRedeemInstruction } from "../instructions/redeem.js";
25
+ import { getSetAndVerifyCollectionInstructionAsync, parseSetAndVerifyCollectionInstruction } from "../instructions/setAndVerifyCollection.js";
26
+ import { getSetCollectionV2InstructionAsync, parseSetCollectionV2Instruction } from "../instructions/setCollectionV2.js";
27
+ import { getSetDecompressableStateInstruction, parseSetDecompressableStateInstruction } from "../instructions/setDecompressableState.js";
28
+ import { getSetDecompressibleStateInstruction, parseSetDecompressibleStateInstruction } from "../instructions/setDecompressibleState.js";
29
+ import { getSetNonTransferableV2InstructionAsync, parseSetNonTransferableV2Instruction } from "../instructions/setNonTransferableV2.js";
30
+ import { getSetTreeDelegateInstructionAsync, parseSetTreeDelegateInstruction } from "../instructions/setTreeDelegate.js";
31
+ import { getThawAndRevokeV2InstructionAsync, parseThawAndRevokeV2Instruction } from "../instructions/thawAndRevokeV2.js";
32
+ import { getThawV2InstructionAsync, parseThawV2Instruction } from "../instructions/thawV2.js";
33
+ import { getTransferInstructionAsync, parseTransferInstruction } from "../instructions/transfer.js";
34
+ import { getTransferV2InstructionAsync, parseTransferV2Instruction } from "../instructions/transferV2.js";
35
+ import { getUnverifyCollectionInstructionAsync, parseUnverifyCollectionInstruction } from "../instructions/unverifyCollection.js";
36
+ import { getUnverifyCreatorInstructionAsync, parseUnverifyCreatorInstruction } from "../instructions/unverifyCreator.js";
37
+ import { getUnverifyCreatorV2InstructionAsync, parseUnverifyCreatorV2Instruction } from "../instructions/unverifyCreatorV2.js";
38
+ import { getUpdateAssetDataV2InstructionAsync, parseUpdateAssetDataV2Instruction } from "../instructions/updateAssetDataV2.js";
39
+ import { getUpdateMetadataInstructionAsync, parseUpdateMetadataInstruction } from "../instructions/updateMetadata.js";
40
+ import { getUpdateMetadataV2InstructionAsync, parseUpdateMetadataV2Instruction } from "../instructions/updateMetadataV2.js";
41
+ import { getVerifyCollectionInstructionAsync, parseVerifyCollectionInstruction } from "../instructions/verifyCollection.js";
42
+ import { getVerifyCreatorInstructionAsync, parseVerifyCreatorInstruction } from "../instructions/verifyCreator.js";
43
+ import { getVerifyCreatorV2InstructionAsync, parseVerifyCreatorV2Instruction } from "../instructions/verifyCreatorV2.js";
44
+ import { SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, SolanaError, assertIsInstructionWithAccounts, containsBytes, extendClient, fixEncoderSize, getBytesEncoder } from "@solana/kit";
45
+ import { addSelfFetchFunctions, addSelfPlanAndSendFunctions } from "@solana/program-client-core";
46
+ //#region src/generated/programs/bubblegum.ts
47
+ const BUBBLEGUM_PROGRAM_ADDRESS = "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
48
+ let BubblegumAccount = /* @__PURE__ */ function(BubblegumAccount) {
49
+ BubblegumAccount[BubblegumAccount["TreeConfig"] = 0] = "TreeConfig";
50
+ BubblegumAccount[BubblegumAccount["Voucher"] = 1] = "Voucher";
51
+ return BubblegumAccount;
52
+ }({});
53
+ function identifyBubblegumAccount(account) {
54
+ const data = "data" in account ? account.data : account;
55
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
56
+ 122,
57
+ 245,
58
+ 175,
59
+ 248,
60
+ 171,
61
+ 34,
62
+ 0,
63
+ 207
64
+ ])), 0)) return 0;
65
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
66
+ 191,
67
+ 204,
68
+ 149,
69
+ 234,
70
+ 213,
71
+ 165,
72
+ 13,
73
+ 65
74
+ ])), 0)) return 1;
75
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, {
76
+ accountData: data,
77
+ programName: "bubblegum"
78
+ });
27
79
  }
28
- export var BubblegumInstruction;
29
- (function (BubblegumInstruction) {
30
- BubblegumInstruction[BubblegumInstruction["Burn"] = 0] = "Burn";
31
- BubblegumInstruction[BubblegumInstruction["BurnV2"] = 1] = "BurnV2";
32
- BubblegumInstruction[BubblegumInstruction["CancelRedeem"] = 2] = "CancelRedeem";
33
- BubblegumInstruction[BubblegumInstruction["CloseTreeV2"] = 3] = "CloseTreeV2";
34
- BubblegumInstruction[BubblegumInstruction["CollectV2"] = 4] = "CollectV2";
35
- BubblegumInstruction[BubblegumInstruction["Compress"] = 5] = "Compress";
36
- BubblegumInstruction[BubblegumInstruction["CreateTree"] = 6] = "CreateTree";
37
- BubblegumInstruction[BubblegumInstruction["CreateTreeV2"] = 7] = "CreateTreeV2";
38
- BubblegumInstruction[BubblegumInstruction["DecompressV1"] = 8] = "DecompressV1";
39
- BubblegumInstruction[BubblegumInstruction["Delegate"] = 9] = "Delegate";
40
- BubblegumInstruction[BubblegumInstruction["DelegateAndFreezeV2"] = 10] = "DelegateAndFreezeV2";
41
- BubblegumInstruction[BubblegumInstruction["DelegateV2"] = 11] = "DelegateV2";
42
- BubblegumInstruction[BubblegumInstruction["FreezeV2"] = 12] = "FreezeV2";
43
- BubblegumInstruction[BubblegumInstruction["MintToCollectionV1"] = 13] = "MintToCollectionV1";
44
- BubblegumInstruction[BubblegumInstruction["MintV1"] = 14] = "MintV1";
45
- BubblegumInstruction[BubblegumInstruction["MintV2"] = 15] = "MintV2";
46
- BubblegumInstruction[BubblegumInstruction["Redeem"] = 16] = "Redeem";
47
- BubblegumInstruction[BubblegumInstruction["SetAndVerifyCollection"] = 17] = "SetAndVerifyCollection";
48
- BubblegumInstruction[BubblegumInstruction["SetCollectionV2"] = 18] = "SetCollectionV2";
49
- BubblegumInstruction[BubblegumInstruction["SetDecompressableState"] = 19] = "SetDecompressableState";
50
- BubblegumInstruction[BubblegumInstruction["SetDecompressibleState"] = 20] = "SetDecompressibleState";
51
- BubblegumInstruction[BubblegumInstruction["SetNonTransferableV2"] = 21] = "SetNonTransferableV2";
52
- BubblegumInstruction[BubblegumInstruction["SetTreeDelegate"] = 22] = "SetTreeDelegate";
53
- BubblegumInstruction[BubblegumInstruction["ThawAndRevokeV2"] = 23] = "ThawAndRevokeV2";
54
- BubblegumInstruction[BubblegumInstruction["ThawV2"] = 24] = "ThawV2";
55
- BubblegumInstruction[BubblegumInstruction["Transfer"] = 25] = "Transfer";
56
- BubblegumInstruction[BubblegumInstruction["TransferV2"] = 26] = "TransferV2";
57
- BubblegumInstruction[BubblegumInstruction["UnverifyCollection"] = 27] = "UnverifyCollection";
58
- BubblegumInstruction[BubblegumInstruction["UnverifyCreator"] = 28] = "UnverifyCreator";
59
- BubblegumInstruction[BubblegumInstruction["UnverifyCreatorV2"] = 29] = "UnverifyCreatorV2";
60
- BubblegumInstruction[BubblegumInstruction["UpdateAssetDataV2"] = 30] = "UpdateAssetDataV2";
61
- BubblegumInstruction[BubblegumInstruction["UpdateMetadata"] = 31] = "UpdateMetadata";
62
- BubblegumInstruction[BubblegumInstruction["UpdateMetadataV2"] = 32] = "UpdateMetadataV2";
63
- BubblegumInstruction[BubblegumInstruction["VerifyCollection"] = 33] = "VerifyCollection";
64
- BubblegumInstruction[BubblegumInstruction["VerifyCreator"] = 34] = "VerifyCreator";
65
- BubblegumInstruction[BubblegumInstruction["VerifyCreatorV2"] = 35] = "VerifyCreatorV2";
66
- })(BubblegumInstruction || (BubblegumInstruction = {}));
67
- export function identifyBubblegumInstruction(instruction) {
68
- const data = "data" in instruction ? instruction.data : instruction;
69
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([116, 110, 29, 56, 107, 219, 42, 93])), 0)) {
70
- return BubblegumInstruction.Burn;
71
- }
72
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([115, 210, 34, 240, 232, 143, 183, 16])), 0)) {
73
- return BubblegumInstruction.BurnV2;
74
- }
75
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([111, 76, 232, 50, 39, 175, 48, 242])), 0)) {
76
- return BubblegumInstruction.CancelRedeem;
77
- }
78
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([45, 172, 6, 94, 28, 90, 157, 70])), 0)) {
79
- return BubblegumInstruction.CloseTreeV2;
80
- }
81
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([21, 11, 159, 47, 4, 195, 106, 56])), 0)) {
82
- return BubblegumInstruction.CollectV2;
83
- }
84
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([82, 193, 176, 117, 176, 21, 115, 253])), 0)) {
85
- return BubblegumInstruction.Compress;
86
- }
87
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([165, 83, 136, 142, 89, 202, 47, 220])), 0)) {
88
- return BubblegumInstruction.CreateTree;
89
- }
90
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([55, 99, 95, 215, 142, 203, 227, 205])), 0)) {
91
- return BubblegumInstruction.CreateTreeV2;
92
- }
93
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([54, 85, 76, 70, 228, 250, 164, 81])), 0)) {
94
- return BubblegumInstruction.DecompressV1;
95
- }
96
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([90, 147, 75, 178, 85, 88, 4, 137])), 0)) {
97
- return BubblegumInstruction.Delegate;
98
- }
99
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([17, 229, 35, 218, 190, 241, 250, 123])), 0)) {
100
- return BubblegumInstruction.DelegateAndFreezeV2;
101
- }
102
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([95, 87, 125, 140, 181, 131, 128, 227])), 0)) {
103
- return BubblegumInstruction.DelegateV2;
104
- }
105
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([200, 151, 244, 102, 16, 195, 255, 3])), 0)) {
106
- return BubblegumInstruction.FreezeV2;
107
- }
108
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([153, 18, 178, 47, 197, 158, 86, 15])), 0)) {
109
- return BubblegumInstruction.MintToCollectionV1;
110
- }
111
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([145, 98, 192, 118, 184, 147, 118, 104])), 0)) {
112
- return BubblegumInstruction.MintV1;
113
- }
114
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([120, 121, 23, 146, 173, 110, 199, 205])), 0)) {
115
- return BubblegumInstruction.MintV2;
116
- }
117
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([184, 12, 86, 149, 70, 196, 97, 225])), 0)) {
118
- return BubblegumInstruction.Redeem;
119
- }
120
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([235, 242, 121, 216, 158, 234, 180, 234])), 0)) {
121
- return BubblegumInstruction.SetAndVerifyCollection;
122
- }
123
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([229, 35, 61, 91, 15, 14, 99, 160])), 0)) {
124
- return BubblegumInstruction.SetCollectionV2;
125
- }
126
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([18, 135, 238, 168, 246, 195, 61, 115])), 0)) {
127
- return BubblegumInstruction.SetDecompressableState;
128
- }
129
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([82, 104, 152, 6, 149, 111, 100, 13])), 0)) {
130
- return BubblegumInstruction.SetDecompressibleState;
131
- }
132
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([181, 141, 206, 58, 242, 199, 152, 168])), 0)) {
133
- return BubblegumInstruction.SetNonTransferableV2;
134
- }
135
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([253, 118, 66, 37, 190, 49, 154, 102])), 0)) {
136
- return BubblegumInstruction.SetTreeDelegate;
137
- }
138
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([86, 214, 190, 37, 167, 4, 28, 116])), 0)) {
139
- return BubblegumInstruction.ThawAndRevokeV2;
140
- }
141
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([96, 133, 101, 93, 82, 220, 146, 191])), 0)) {
142
- return BubblegumInstruction.ThawV2;
143
- }
144
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([163, 52, 200, 231, 140, 3, 69, 186])), 0)) {
145
- return BubblegumInstruction.Transfer;
146
- }
147
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([119, 40, 6, 235, 234, 221, 248, 49])), 0)) {
148
- return BubblegumInstruction.TransferV2;
149
- }
150
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([250, 251, 42, 106, 41, 137, 186, 168])), 0)) {
151
- return BubblegumInstruction.UnverifyCollection;
152
- }
153
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([107, 178, 57, 39, 105, 115, 112, 152])), 0)) {
154
- return BubblegumInstruction.UnverifyCreator;
155
- }
156
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([174, 112, 29, 142, 230, 100, 239, 7])), 0)) {
157
- return BubblegumInstruction.UnverifyCreatorV2;
158
- }
159
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([59, 56, 111, 43, 95, 14, 11, 61])), 0)) {
160
- return BubblegumInstruction.UpdateAssetDataV2;
161
- }
162
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([170, 182, 43, 239, 97, 78, 225, 186])), 0)) {
163
- return BubblegumInstruction.UpdateMetadata;
164
- }
165
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([43, 103, 89, 42, 121, 242, 62, 72])), 0)) {
166
- return BubblegumInstruction.UpdateMetadataV2;
167
- }
168
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([56, 113, 101, 253, 79, 55, 122, 169])), 0)) {
169
- return BubblegumInstruction.VerifyCollection;
170
- }
171
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([52, 17, 96, 132, 71, 4, 85, 194])), 0)) {
172
- return BubblegumInstruction.VerifyCreator;
173
- }
174
- if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([85, 138, 140, 42, 22, 241, 118, 102])), 0)) {
175
- return BubblegumInstruction.VerifyCreatorV2;
176
- }
177
- throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, { instructionData: data, programName: "bubblegum" });
80
+ let BubblegumInstruction = /* @__PURE__ */ function(BubblegumInstruction) {
81
+ BubblegumInstruction[BubblegumInstruction["Burn"] = 0] = "Burn";
82
+ BubblegumInstruction[BubblegumInstruction["BurnV2"] = 1] = "BurnV2";
83
+ BubblegumInstruction[BubblegumInstruction["CancelRedeem"] = 2] = "CancelRedeem";
84
+ BubblegumInstruction[BubblegumInstruction["CloseTreeV2"] = 3] = "CloseTreeV2";
85
+ BubblegumInstruction[BubblegumInstruction["CollectV2"] = 4] = "CollectV2";
86
+ BubblegumInstruction[BubblegumInstruction["Compress"] = 5] = "Compress";
87
+ BubblegumInstruction[BubblegumInstruction["CreateTree"] = 6] = "CreateTree";
88
+ BubblegumInstruction[BubblegumInstruction["CreateTreeV2"] = 7] = "CreateTreeV2";
89
+ BubblegumInstruction[BubblegumInstruction["DecompressV1"] = 8] = "DecompressV1";
90
+ BubblegumInstruction[BubblegumInstruction["Delegate"] = 9] = "Delegate";
91
+ BubblegumInstruction[BubblegumInstruction["DelegateAndFreezeV2"] = 10] = "DelegateAndFreezeV2";
92
+ BubblegumInstruction[BubblegumInstruction["DelegateV2"] = 11] = "DelegateV2";
93
+ BubblegumInstruction[BubblegumInstruction["FreezeV2"] = 12] = "FreezeV2";
94
+ BubblegumInstruction[BubblegumInstruction["MintToCollectionV1"] = 13] = "MintToCollectionV1";
95
+ BubblegumInstruction[BubblegumInstruction["MintV1"] = 14] = "MintV1";
96
+ BubblegumInstruction[BubblegumInstruction["MintV2"] = 15] = "MintV2";
97
+ BubblegumInstruction[BubblegumInstruction["Redeem"] = 16] = "Redeem";
98
+ BubblegumInstruction[BubblegumInstruction["SetAndVerifyCollection"] = 17] = "SetAndVerifyCollection";
99
+ BubblegumInstruction[BubblegumInstruction["SetCollectionV2"] = 18] = "SetCollectionV2";
100
+ BubblegumInstruction[BubblegumInstruction["SetDecompressableState"] = 19] = "SetDecompressableState";
101
+ BubblegumInstruction[BubblegumInstruction["SetDecompressibleState"] = 20] = "SetDecompressibleState";
102
+ BubblegumInstruction[BubblegumInstruction["SetNonTransferableV2"] = 21] = "SetNonTransferableV2";
103
+ BubblegumInstruction[BubblegumInstruction["SetTreeDelegate"] = 22] = "SetTreeDelegate";
104
+ BubblegumInstruction[BubblegumInstruction["ThawAndRevokeV2"] = 23] = "ThawAndRevokeV2";
105
+ BubblegumInstruction[BubblegumInstruction["ThawV2"] = 24] = "ThawV2";
106
+ BubblegumInstruction[BubblegumInstruction["Transfer"] = 25] = "Transfer";
107
+ BubblegumInstruction[BubblegumInstruction["TransferV2"] = 26] = "TransferV2";
108
+ BubblegumInstruction[BubblegumInstruction["UnverifyCollection"] = 27] = "UnverifyCollection";
109
+ BubblegumInstruction[BubblegumInstruction["UnverifyCreator"] = 28] = "UnverifyCreator";
110
+ BubblegumInstruction[BubblegumInstruction["UnverifyCreatorV2"] = 29] = "UnverifyCreatorV2";
111
+ BubblegumInstruction[BubblegumInstruction["UpdateAssetDataV2"] = 30] = "UpdateAssetDataV2";
112
+ BubblegumInstruction[BubblegumInstruction["UpdateMetadata"] = 31] = "UpdateMetadata";
113
+ BubblegumInstruction[BubblegumInstruction["UpdateMetadataV2"] = 32] = "UpdateMetadataV2";
114
+ BubblegumInstruction[BubblegumInstruction["VerifyCollection"] = 33] = "VerifyCollection";
115
+ BubblegumInstruction[BubblegumInstruction["VerifyCreator"] = 34] = "VerifyCreator";
116
+ BubblegumInstruction[BubblegumInstruction["VerifyCreatorV2"] = 35] = "VerifyCreatorV2";
117
+ return BubblegumInstruction;
118
+ }({});
119
+ function identifyBubblegumInstruction(instruction) {
120
+ const data = "data" in instruction ? instruction.data : instruction;
121
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
122
+ 116,
123
+ 110,
124
+ 29,
125
+ 56,
126
+ 107,
127
+ 219,
128
+ 42,
129
+ 93
130
+ ])), 0)) return 0;
131
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
132
+ 115,
133
+ 210,
134
+ 34,
135
+ 240,
136
+ 232,
137
+ 143,
138
+ 183,
139
+ 16
140
+ ])), 0)) return 1;
141
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
142
+ 111,
143
+ 76,
144
+ 232,
145
+ 50,
146
+ 39,
147
+ 175,
148
+ 48,
149
+ 242
150
+ ])), 0)) return 2;
151
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
152
+ 45,
153
+ 172,
154
+ 6,
155
+ 94,
156
+ 28,
157
+ 90,
158
+ 157,
159
+ 70
160
+ ])), 0)) return 3;
161
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
162
+ 21,
163
+ 11,
164
+ 159,
165
+ 47,
166
+ 4,
167
+ 195,
168
+ 106,
169
+ 56
170
+ ])), 0)) return 4;
171
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
172
+ 82,
173
+ 193,
174
+ 176,
175
+ 117,
176
+ 176,
177
+ 21,
178
+ 115,
179
+ 253
180
+ ])), 0)) return 5;
181
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
182
+ 165,
183
+ 83,
184
+ 136,
185
+ 142,
186
+ 89,
187
+ 202,
188
+ 47,
189
+ 220
190
+ ])), 0)) return 6;
191
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
192
+ 55,
193
+ 99,
194
+ 95,
195
+ 215,
196
+ 142,
197
+ 203,
198
+ 227,
199
+ 205
200
+ ])), 0)) return 7;
201
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
202
+ 54,
203
+ 85,
204
+ 76,
205
+ 70,
206
+ 228,
207
+ 250,
208
+ 164,
209
+ 81
210
+ ])), 0)) return 8;
211
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
212
+ 90,
213
+ 147,
214
+ 75,
215
+ 178,
216
+ 85,
217
+ 88,
218
+ 4,
219
+ 137
220
+ ])), 0)) return 9;
221
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
222
+ 17,
223
+ 229,
224
+ 35,
225
+ 218,
226
+ 190,
227
+ 241,
228
+ 250,
229
+ 123
230
+ ])), 0)) return 10;
231
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
232
+ 95,
233
+ 87,
234
+ 125,
235
+ 140,
236
+ 181,
237
+ 131,
238
+ 128,
239
+ 227
240
+ ])), 0)) return 11;
241
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
242
+ 200,
243
+ 151,
244
+ 244,
245
+ 102,
246
+ 16,
247
+ 195,
248
+ 255,
249
+ 3
250
+ ])), 0)) return 12;
251
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
252
+ 153,
253
+ 18,
254
+ 178,
255
+ 47,
256
+ 197,
257
+ 158,
258
+ 86,
259
+ 15
260
+ ])), 0)) return 13;
261
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
262
+ 145,
263
+ 98,
264
+ 192,
265
+ 118,
266
+ 184,
267
+ 147,
268
+ 118,
269
+ 104
270
+ ])), 0)) return 14;
271
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
272
+ 120,
273
+ 121,
274
+ 23,
275
+ 146,
276
+ 173,
277
+ 110,
278
+ 199,
279
+ 205
280
+ ])), 0)) return 15;
281
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
282
+ 184,
283
+ 12,
284
+ 86,
285
+ 149,
286
+ 70,
287
+ 196,
288
+ 97,
289
+ 225
290
+ ])), 0)) return 16;
291
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
292
+ 235,
293
+ 242,
294
+ 121,
295
+ 216,
296
+ 158,
297
+ 234,
298
+ 180,
299
+ 234
300
+ ])), 0)) return 17;
301
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
302
+ 229,
303
+ 35,
304
+ 61,
305
+ 91,
306
+ 15,
307
+ 14,
308
+ 99,
309
+ 160
310
+ ])), 0)) return 18;
311
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
312
+ 18,
313
+ 135,
314
+ 238,
315
+ 168,
316
+ 246,
317
+ 195,
318
+ 61,
319
+ 115
320
+ ])), 0)) return 19;
321
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
322
+ 82,
323
+ 104,
324
+ 152,
325
+ 6,
326
+ 149,
327
+ 111,
328
+ 100,
329
+ 13
330
+ ])), 0)) return 20;
331
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
332
+ 181,
333
+ 141,
334
+ 206,
335
+ 58,
336
+ 242,
337
+ 199,
338
+ 152,
339
+ 168
340
+ ])), 0)) return 21;
341
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
342
+ 253,
343
+ 118,
344
+ 66,
345
+ 37,
346
+ 190,
347
+ 49,
348
+ 154,
349
+ 102
350
+ ])), 0)) return 22;
351
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
352
+ 86,
353
+ 214,
354
+ 190,
355
+ 37,
356
+ 167,
357
+ 4,
358
+ 28,
359
+ 116
360
+ ])), 0)) return 23;
361
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
362
+ 96,
363
+ 133,
364
+ 101,
365
+ 93,
366
+ 82,
367
+ 220,
368
+ 146,
369
+ 191
370
+ ])), 0)) return 24;
371
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
372
+ 163,
373
+ 52,
374
+ 200,
375
+ 231,
376
+ 140,
377
+ 3,
378
+ 69,
379
+ 186
380
+ ])), 0)) return 25;
381
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
382
+ 119,
383
+ 40,
384
+ 6,
385
+ 235,
386
+ 234,
387
+ 221,
388
+ 248,
389
+ 49
390
+ ])), 0)) return 26;
391
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
392
+ 250,
393
+ 251,
394
+ 42,
395
+ 106,
396
+ 41,
397
+ 137,
398
+ 186,
399
+ 168
400
+ ])), 0)) return 27;
401
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
402
+ 107,
403
+ 178,
404
+ 57,
405
+ 39,
406
+ 105,
407
+ 115,
408
+ 112,
409
+ 152
410
+ ])), 0)) return 28;
411
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
412
+ 174,
413
+ 112,
414
+ 29,
415
+ 142,
416
+ 230,
417
+ 100,
418
+ 239,
419
+ 7
420
+ ])), 0)) return 29;
421
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
422
+ 59,
423
+ 56,
424
+ 111,
425
+ 43,
426
+ 95,
427
+ 14,
428
+ 11,
429
+ 61
430
+ ])), 0)) return 30;
431
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
432
+ 170,
433
+ 182,
434
+ 43,
435
+ 239,
436
+ 97,
437
+ 78,
438
+ 225,
439
+ 186
440
+ ])), 0)) return 31;
441
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
442
+ 43,
443
+ 103,
444
+ 89,
445
+ 42,
446
+ 121,
447
+ 242,
448
+ 62,
449
+ 72
450
+ ])), 0)) return 32;
451
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
452
+ 56,
453
+ 113,
454
+ 101,
455
+ 253,
456
+ 79,
457
+ 55,
458
+ 122,
459
+ 169
460
+ ])), 0)) return 33;
461
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
462
+ 52,
463
+ 17,
464
+ 96,
465
+ 132,
466
+ 71,
467
+ 4,
468
+ 85,
469
+ 194
470
+ ])), 0)) return 34;
471
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
472
+ 85,
473
+ 138,
474
+ 140,
475
+ 42,
476
+ 22,
477
+ 241,
478
+ 118,
479
+ 102
480
+ ])), 0)) return 35;
481
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {
482
+ instructionData: data,
483
+ programName: "bubblegum"
484
+ });
178
485
  }
179
- export function parseBubblegumInstruction(instruction) {
180
- const instructionType = identifyBubblegumInstruction(instruction);
181
- switch (instructionType) {
182
- case BubblegumInstruction.Burn: {
183
- assertIsInstructionWithAccounts(instruction);
184
- return {
185
- instructionType: BubblegumInstruction.Burn,
186
- ...parseBurnInstruction(instruction),
187
- };
188
- }
189
- case BubblegumInstruction.BurnV2: {
190
- assertIsInstructionWithAccounts(instruction);
191
- return {
192
- instructionType: BubblegumInstruction.BurnV2,
193
- ...parseBurnV2Instruction(instruction),
194
- };
195
- }
196
- case BubblegumInstruction.CancelRedeem: {
197
- assertIsInstructionWithAccounts(instruction);
198
- return {
199
- instructionType: BubblegumInstruction.CancelRedeem,
200
- ...parseCancelRedeemInstruction(instruction),
201
- };
202
- }
203
- case BubblegumInstruction.CloseTreeV2: {
204
- assertIsInstructionWithAccounts(instruction);
205
- return {
206
- instructionType: BubblegumInstruction.CloseTreeV2,
207
- ...parseCloseTreeV2Instruction(instruction),
208
- };
209
- }
210
- case BubblegumInstruction.CollectV2: {
211
- assertIsInstructionWithAccounts(instruction);
212
- return {
213
- instructionType: BubblegumInstruction.CollectV2,
214
- ...parseCollectV2Instruction(instruction),
215
- };
216
- }
217
- case BubblegumInstruction.Compress: {
218
- assertIsInstructionWithAccounts(instruction);
219
- return {
220
- instructionType: BubblegumInstruction.Compress,
221
- ...parseCompressInstruction(instruction),
222
- };
223
- }
224
- case BubblegumInstruction.CreateTree: {
225
- assertIsInstructionWithAccounts(instruction);
226
- return {
227
- instructionType: BubblegumInstruction.CreateTree,
228
- ...parseCreateTreeInstruction(instruction),
229
- };
230
- }
231
- case BubblegumInstruction.CreateTreeV2: {
232
- assertIsInstructionWithAccounts(instruction);
233
- return {
234
- instructionType: BubblegumInstruction.CreateTreeV2,
235
- ...parseCreateTreeV2Instruction(instruction),
236
- };
237
- }
238
- case BubblegumInstruction.DecompressV1: {
239
- assertIsInstructionWithAccounts(instruction);
240
- return {
241
- instructionType: BubblegumInstruction.DecompressV1,
242
- ...parseDecompressV1Instruction(instruction),
243
- };
244
- }
245
- case BubblegumInstruction.Delegate: {
246
- assertIsInstructionWithAccounts(instruction);
247
- return {
248
- instructionType: BubblegumInstruction.Delegate,
249
- ...parseDelegateInstruction(instruction),
250
- };
251
- }
252
- case BubblegumInstruction.DelegateAndFreezeV2: {
253
- assertIsInstructionWithAccounts(instruction);
254
- return {
255
- instructionType: BubblegumInstruction.DelegateAndFreezeV2,
256
- ...parseDelegateAndFreezeV2Instruction(instruction),
257
- };
258
- }
259
- case BubblegumInstruction.DelegateV2: {
260
- assertIsInstructionWithAccounts(instruction);
261
- return {
262
- instructionType: BubblegumInstruction.DelegateV2,
263
- ...parseDelegateV2Instruction(instruction),
264
- };
265
- }
266
- case BubblegumInstruction.FreezeV2: {
267
- assertIsInstructionWithAccounts(instruction);
268
- return {
269
- instructionType: BubblegumInstruction.FreezeV2,
270
- ...parseFreezeV2Instruction(instruction),
271
- };
272
- }
273
- case BubblegumInstruction.MintToCollectionV1: {
274
- assertIsInstructionWithAccounts(instruction);
275
- return {
276
- instructionType: BubblegumInstruction.MintToCollectionV1,
277
- ...parseMintToCollectionV1Instruction(instruction),
278
- };
279
- }
280
- case BubblegumInstruction.MintV1: {
281
- assertIsInstructionWithAccounts(instruction);
282
- return {
283
- instructionType: BubblegumInstruction.MintV1,
284
- ...parseMintV1Instruction(instruction),
285
- };
286
- }
287
- case BubblegumInstruction.MintV2: {
288
- assertIsInstructionWithAccounts(instruction);
289
- return {
290
- instructionType: BubblegumInstruction.MintV2,
291
- ...parseMintV2Instruction(instruction),
292
- };
293
- }
294
- case BubblegumInstruction.Redeem: {
295
- assertIsInstructionWithAccounts(instruction);
296
- return {
297
- instructionType: BubblegumInstruction.Redeem,
298
- ...parseRedeemInstruction(instruction),
299
- };
300
- }
301
- case BubblegumInstruction.SetAndVerifyCollection: {
302
- assertIsInstructionWithAccounts(instruction);
303
- return {
304
- instructionType: BubblegumInstruction.SetAndVerifyCollection,
305
- ...parseSetAndVerifyCollectionInstruction(instruction),
306
- };
307
- }
308
- case BubblegumInstruction.SetCollectionV2: {
309
- assertIsInstructionWithAccounts(instruction);
310
- return {
311
- instructionType: BubblegumInstruction.SetCollectionV2,
312
- ...parseSetCollectionV2Instruction(instruction),
313
- };
314
- }
315
- case BubblegumInstruction.SetDecompressableState: {
316
- assertIsInstructionWithAccounts(instruction);
317
- return {
318
- instructionType: BubblegumInstruction.SetDecompressableState,
319
- ...parseSetDecompressableStateInstruction(instruction),
320
- };
321
- }
322
- case BubblegumInstruction.SetDecompressibleState: {
323
- assertIsInstructionWithAccounts(instruction);
324
- return {
325
- instructionType: BubblegumInstruction.SetDecompressibleState,
326
- ...parseSetDecompressibleStateInstruction(instruction),
327
- };
328
- }
329
- case BubblegumInstruction.SetNonTransferableV2: {
330
- assertIsInstructionWithAccounts(instruction);
331
- return {
332
- instructionType: BubblegumInstruction.SetNonTransferableV2,
333
- ...parseSetNonTransferableV2Instruction(instruction),
334
- };
335
- }
336
- case BubblegumInstruction.SetTreeDelegate: {
337
- assertIsInstructionWithAccounts(instruction);
338
- return {
339
- instructionType: BubblegumInstruction.SetTreeDelegate,
340
- ...parseSetTreeDelegateInstruction(instruction),
341
- };
342
- }
343
- case BubblegumInstruction.ThawAndRevokeV2: {
344
- assertIsInstructionWithAccounts(instruction);
345
- return {
346
- instructionType: BubblegumInstruction.ThawAndRevokeV2,
347
- ...parseThawAndRevokeV2Instruction(instruction),
348
- };
349
- }
350
- case BubblegumInstruction.ThawV2: {
351
- assertIsInstructionWithAccounts(instruction);
352
- return {
353
- instructionType: BubblegumInstruction.ThawV2,
354
- ...parseThawV2Instruction(instruction),
355
- };
356
- }
357
- case BubblegumInstruction.Transfer: {
358
- assertIsInstructionWithAccounts(instruction);
359
- return {
360
- instructionType: BubblegumInstruction.Transfer,
361
- ...parseTransferInstruction(instruction),
362
- };
363
- }
364
- case BubblegumInstruction.TransferV2: {
365
- assertIsInstructionWithAccounts(instruction);
366
- return {
367
- instructionType: BubblegumInstruction.TransferV2,
368
- ...parseTransferV2Instruction(instruction),
369
- };
370
- }
371
- case BubblegumInstruction.UnverifyCollection: {
372
- assertIsInstructionWithAccounts(instruction);
373
- return {
374
- instructionType: BubblegumInstruction.UnverifyCollection,
375
- ...parseUnverifyCollectionInstruction(instruction),
376
- };
377
- }
378
- case BubblegumInstruction.UnverifyCreator: {
379
- assertIsInstructionWithAccounts(instruction);
380
- return {
381
- instructionType: BubblegumInstruction.UnverifyCreator,
382
- ...parseUnverifyCreatorInstruction(instruction),
383
- };
384
- }
385
- case BubblegumInstruction.UnverifyCreatorV2: {
386
- assertIsInstructionWithAccounts(instruction);
387
- return {
388
- instructionType: BubblegumInstruction.UnverifyCreatorV2,
389
- ...parseUnverifyCreatorV2Instruction(instruction),
390
- };
391
- }
392
- case BubblegumInstruction.UpdateAssetDataV2: {
393
- assertIsInstructionWithAccounts(instruction);
394
- return {
395
- instructionType: BubblegumInstruction.UpdateAssetDataV2,
396
- ...parseUpdateAssetDataV2Instruction(instruction),
397
- };
398
- }
399
- case BubblegumInstruction.UpdateMetadata: {
400
- assertIsInstructionWithAccounts(instruction);
401
- return {
402
- instructionType: BubblegumInstruction.UpdateMetadata,
403
- ...parseUpdateMetadataInstruction(instruction),
404
- };
405
- }
406
- case BubblegumInstruction.UpdateMetadataV2: {
407
- assertIsInstructionWithAccounts(instruction);
408
- return {
409
- instructionType: BubblegumInstruction.UpdateMetadataV2,
410
- ...parseUpdateMetadataV2Instruction(instruction),
411
- };
412
- }
413
- case BubblegumInstruction.VerifyCollection: {
414
- assertIsInstructionWithAccounts(instruction);
415
- return {
416
- instructionType: BubblegumInstruction.VerifyCollection,
417
- ...parseVerifyCollectionInstruction(instruction),
418
- };
419
- }
420
- case BubblegumInstruction.VerifyCreator: {
421
- assertIsInstructionWithAccounts(instruction);
422
- return {
423
- instructionType: BubblegumInstruction.VerifyCreator,
424
- ...parseVerifyCreatorInstruction(instruction),
425
- };
426
- }
427
- case BubblegumInstruction.VerifyCreatorV2: {
428
- assertIsInstructionWithAccounts(instruction);
429
- return {
430
- instructionType: BubblegumInstruction.VerifyCreatorV2,
431
- ...parseVerifyCreatorV2Instruction(instruction),
432
- };
433
- }
434
- default:
435
- throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
436
- instructionType: instructionType,
437
- programName: "bubblegum",
438
- });
439
- }
486
+ function parseBubblegumInstruction(instruction) {
487
+ const instructionType = identifyBubblegumInstruction(instruction);
488
+ switch (instructionType) {
489
+ case 0:
490
+ assertIsInstructionWithAccounts(instruction);
491
+ return {
492
+ instructionType: 0,
493
+ ...parseBurnInstruction(instruction)
494
+ };
495
+ case 1:
496
+ assertIsInstructionWithAccounts(instruction);
497
+ return {
498
+ instructionType: 1,
499
+ ...parseBurnV2Instruction(instruction)
500
+ };
501
+ case 2:
502
+ assertIsInstructionWithAccounts(instruction);
503
+ return {
504
+ instructionType: 2,
505
+ ...parseCancelRedeemInstruction(instruction)
506
+ };
507
+ case 3:
508
+ assertIsInstructionWithAccounts(instruction);
509
+ return {
510
+ instructionType: 3,
511
+ ...parseCloseTreeV2Instruction(instruction)
512
+ };
513
+ case 4:
514
+ assertIsInstructionWithAccounts(instruction);
515
+ return {
516
+ instructionType: 4,
517
+ ...parseCollectV2Instruction(instruction)
518
+ };
519
+ case 5:
520
+ assertIsInstructionWithAccounts(instruction);
521
+ return {
522
+ instructionType: 5,
523
+ ...parseCompressInstruction(instruction)
524
+ };
525
+ case 6:
526
+ assertIsInstructionWithAccounts(instruction);
527
+ return {
528
+ instructionType: 6,
529
+ ...parseCreateTreeInstruction(instruction)
530
+ };
531
+ case 7:
532
+ assertIsInstructionWithAccounts(instruction);
533
+ return {
534
+ instructionType: 7,
535
+ ...parseCreateTreeV2Instruction(instruction)
536
+ };
537
+ case 8:
538
+ assertIsInstructionWithAccounts(instruction);
539
+ return {
540
+ instructionType: 8,
541
+ ...parseDecompressV1Instruction(instruction)
542
+ };
543
+ case 9:
544
+ assertIsInstructionWithAccounts(instruction);
545
+ return {
546
+ instructionType: 9,
547
+ ...parseDelegateInstruction(instruction)
548
+ };
549
+ case 10:
550
+ assertIsInstructionWithAccounts(instruction);
551
+ return {
552
+ instructionType: 10,
553
+ ...parseDelegateAndFreezeV2Instruction(instruction)
554
+ };
555
+ case 11:
556
+ assertIsInstructionWithAccounts(instruction);
557
+ return {
558
+ instructionType: 11,
559
+ ...parseDelegateV2Instruction(instruction)
560
+ };
561
+ case 12:
562
+ assertIsInstructionWithAccounts(instruction);
563
+ return {
564
+ instructionType: 12,
565
+ ...parseFreezeV2Instruction(instruction)
566
+ };
567
+ case 13:
568
+ assertIsInstructionWithAccounts(instruction);
569
+ return {
570
+ instructionType: 13,
571
+ ...parseMintToCollectionV1Instruction(instruction)
572
+ };
573
+ case 14:
574
+ assertIsInstructionWithAccounts(instruction);
575
+ return {
576
+ instructionType: 14,
577
+ ...parseMintV1Instruction(instruction)
578
+ };
579
+ case 15:
580
+ assertIsInstructionWithAccounts(instruction);
581
+ return {
582
+ instructionType: 15,
583
+ ...parseMintV2Instruction(instruction)
584
+ };
585
+ case 16:
586
+ assertIsInstructionWithAccounts(instruction);
587
+ return {
588
+ instructionType: 16,
589
+ ...parseRedeemInstruction(instruction)
590
+ };
591
+ case 17:
592
+ assertIsInstructionWithAccounts(instruction);
593
+ return {
594
+ instructionType: 17,
595
+ ...parseSetAndVerifyCollectionInstruction(instruction)
596
+ };
597
+ case 18:
598
+ assertIsInstructionWithAccounts(instruction);
599
+ return {
600
+ instructionType: 18,
601
+ ...parseSetCollectionV2Instruction(instruction)
602
+ };
603
+ case 19:
604
+ assertIsInstructionWithAccounts(instruction);
605
+ return {
606
+ instructionType: 19,
607
+ ...parseSetDecompressableStateInstruction(instruction)
608
+ };
609
+ case 20:
610
+ assertIsInstructionWithAccounts(instruction);
611
+ return {
612
+ instructionType: 20,
613
+ ...parseSetDecompressibleStateInstruction(instruction)
614
+ };
615
+ case 21:
616
+ assertIsInstructionWithAccounts(instruction);
617
+ return {
618
+ instructionType: 21,
619
+ ...parseSetNonTransferableV2Instruction(instruction)
620
+ };
621
+ case 22:
622
+ assertIsInstructionWithAccounts(instruction);
623
+ return {
624
+ instructionType: 22,
625
+ ...parseSetTreeDelegateInstruction(instruction)
626
+ };
627
+ case 23:
628
+ assertIsInstructionWithAccounts(instruction);
629
+ return {
630
+ instructionType: 23,
631
+ ...parseThawAndRevokeV2Instruction(instruction)
632
+ };
633
+ case 24:
634
+ assertIsInstructionWithAccounts(instruction);
635
+ return {
636
+ instructionType: 24,
637
+ ...parseThawV2Instruction(instruction)
638
+ };
639
+ case 25:
640
+ assertIsInstructionWithAccounts(instruction);
641
+ return {
642
+ instructionType: 25,
643
+ ...parseTransferInstruction(instruction)
644
+ };
645
+ case 26:
646
+ assertIsInstructionWithAccounts(instruction);
647
+ return {
648
+ instructionType: 26,
649
+ ...parseTransferV2Instruction(instruction)
650
+ };
651
+ case 27:
652
+ assertIsInstructionWithAccounts(instruction);
653
+ return {
654
+ instructionType: 27,
655
+ ...parseUnverifyCollectionInstruction(instruction)
656
+ };
657
+ case 28:
658
+ assertIsInstructionWithAccounts(instruction);
659
+ return {
660
+ instructionType: 28,
661
+ ...parseUnverifyCreatorInstruction(instruction)
662
+ };
663
+ case 29:
664
+ assertIsInstructionWithAccounts(instruction);
665
+ return {
666
+ instructionType: 29,
667
+ ...parseUnverifyCreatorV2Instruction(instruction)
668
+ };
669
+ case 30:
670
+ assertIsInstructionWithAccounts(instruction);
671
+ return {
672
+ instructionType: 30,
673
+ ...parseUpdateAssetDataV2Instruction(instruction)
674
+ };
675
+ case 31:
676
+ assertIsInstructionWithAccounts(instruction);
677
+ return {
678
+ instructionType: 31,
679
+ ...parseUpdateMetadataInstruction(instruction)
680
+ };
681
+ case 32:
682
+ assertIsInstructionWithAccounts(instruction);
683
+ return {
684
+ instructionType: 32,
685
+ ...parseUpdateMetadataV2Instruction(instruction)
686
+ };
687
+ case 33:
688
+ assertIsInstructionWithAccounts(instruction);
689
+ return {
690
+ instructionType: 33,
691
+ ...parseVerifyCollectionInstruction(instruction)
692
+ };
693
+ case 34:
694
+ assertIsInstructionWithAccounts(instruction);
695
+ return {
696
+ instructionType: 34,
697
+ ...parseVerifyCreatorInstruction(instruction)
698
+ };
699
+ case 35:
700
+ assertIsInstructionWithAccounts(instruction);
701
+ return {
702
+ instructionType: 35,
703
+ ...parseVerifyCreatorV2Instruction(instruction)
704
+ };
705
+ default: throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
706
+ instructionType,
707
+ programName: "bubblegum"
708
+ });
709
+ }
440
710
  }
441
- export function bubblegumProgram() {
442
- return (client) => {
443
- return extendClient(client, {
444
- bubblegum: {
445
- accounts: {
446
- treeConfig: addSelfFetchFunctions(client, getTreeConfigCodec()),
447
- voucher: addSelfFetchFunctions(client, getVoucherCodec()),
448
- },
449
- instructions: {
450
- burn: (input) => addSelfPlanAndSendFunctions(client, getBurnInstruction(input)),
451
- burnV2: (input) => addSelfPlanAndSendFunctions(client, getBurnV2Instruction({
452
- ...input,
453
- payer: input.payer ?? client.payer,
454
- })),
455
- cancelRedeem: (input) => addSelfPlanAndSendFunctions(client, getCancelRedeemInstruction(input)),
456
- closeTreeV2: (input) => addSelfPlanAndSendFunctions(client, getCloseTreeV2Instruction(input)),
457
- collectV2: (input) => addSelfPlanAndSendFunctions(client, getCollectV2Instruction(input)),
458
- compress: (input) => addSelfPlanAndSendFunctions(client, getCompressInstruction({
459
- ...input,
460
- payer: input.payer ?? client.payer,
461
- })),
462
- createTree: (input) => addSelfPlanAndSendFunctions(client, getCreateTreeInstruction({
463
- ...input,
464
- payer: input.payer ?? client.payer,
465
- })),
466
- createTreeV2: (input) => addSelfPlanAndSendFunctions(client, getCreateTreeV2Instruction({
467
- ...input,
468
- payer: input.payer ?? client.payer,
469
- })),
470
- decompressV1: (input) => addSelfPlanAndSendFunctions(client, getDecompressV1Instruction(input)),
471
- delegate: (input) => addSelfPlanAndSendFunctions(client, getDelegateInstruction(input)),
472
- delegateAndFreezeV2: (input) => addSelfPlanAndSendFunctions(client, getDelegateAndFreezeV2Instruction({
473
- ...input,
474
- payer: input.payer ?? client.payer,
475
- })),
476
- delegateV2: (input) => addSelfPlanAndSendFunctions(client, getDelegateV2Instruction({
477
- ...input,
478
- payer: input.payer ?? client.payer,
479
- })),
480
- freezeV2: (input) => addSelfPlanAndSendFunctions(client, getFreezeV2Instruction({
481
- ...input,
482
- payer: input.payer ?? client.payer,
483
- })),
484
- mintToCollectionV1: (input) => addSelfPlanAndSendFunctions(client, getMintToCollectionV1Instruction({
485
- ...input,
486
- payer: input.payer ?? client.payer,
487
- })),
488
- mintV1: (input) => addSelfPlanAndSendFunctions(client, getMintV1Instruction({
489
- ...input,
490
- payer: input.payer ?? client.payer,
491
- })),
492
- mintV2: (input) => addSelfPlanAndSendFunctions(client, getMintV2Instruction({
493
- ...input,
494
- payer: input.payer ?? client.payer,
495
- })),
496
- redeem: (input) => addSelfPlanAndSendFunctions(client, getRedeemInstruction(input)),
497
- setAndVerifyCollection: (input) => addSelfPlanAndSendFunctions(client, getSetAndVerifyCollectionInstruction({
498
- ...input,
499
- payer: input.payer ?? client.payer,
500
- })),
501
- setCollectionV2: (input) => addSelfPlanAndSendFunctions(client, getSetCollectionV2Instruction({
502
- ...input,
503
- payer: input.payer ?? client.payer,
504
- })),
505
- setDecompressableState: (input) => addSelfPlanAndSendFunctions(client, getSetDecompressableStateInstruction(input)),
506
- setDecompressibleState: (input) => addSelfPlanAndSendFunctions(client, getSetDecompressibleStateInstruction(input)),
507
- setNonTransferableV2: (input) => addSelfPlanAndSendFunctions(client, getSetNonTransferableV2Instruction({
508
- ...input,
509
- payer: input.payer ?? client.payer,
510
- })),
511
- setTreeDelegate: (input) => addSelfPlanAndSendFunctions(client, getSetTreeDelegateInstruction(input)),
512
- thawAndRevokeV2: (input) => addSelfPlanAndSendFunctions(client, getThawAndRevokeV2Instruction({
513
- ...input,
514
- payer: input.payer ?? client.payer,
515
- })),
516
- thawV2: (input) => addSelfPlanAndSendFunctions(client, getThawV2Instruction({
517
- ...input,
518
- payer: input.payer ?? client.payer,
519
- })),
520
- transfer: (input) => addSelfPlanAndSendFunctions(client, getTransferInstruction(input)),
521
- transferV2: (input) => addSelfPlanAndSendFunctions(client, getTransferV2Instruction({
522
- ...input,
523
- payer: input.payer ?? client.payer,
524
- })),
525
- unverifyCollection: (input) => addSelfPlanAndSendFunctions(client, getUnverifyCollectionInstruction({
526
- ...input,
527
- payer: input.payer ?? client.payer,
528
- })),
529
- unverifyCreator: (input) => addSelfPlanAndSendFunctions(client, getUnverifyCreatorInstruction({
530
- ...input,
531
- payer: input.payer ?? client.payer,
532
- })),
533
- unverifyCreatorV2: (input) => addSelfPlanAndSendFunctions(client, getUnverifyCreatorV2Instruction({
534
- ...input,
535
- payer: input.payer ?? client.payer,
536
- })),
537
- updateAssetDataV2: (input) => addSelfPlanAndSendFunctions(client, getUpdateAssetDataV2Instruction({
538
- ...input,
539
- payer: input.payer ?? client.payer,
540
- })),
541
- updateMetadata: (input) => addSelfPlanAndSendFunctions(client, getUpdateMetadataInstruction({
542
- ...input,
543
- payer: input.payer ?? client.payer,
544
- })),
545
- updateMetadataV2: (input) => addSelfPlanAndSendFunctions(client, getUpdateMetadataV2Instruction({
546
- ...input,
547
- payer: input.payer ?? client.payer,
548
- })),
549
- verifyCollection: (input) => addSelfPlanAndSendFunctions(client, getVerifyCollectionInstruction({
550
- ...input,
551
- payer: input.payer ?? client.payer,
552
- })),
553
- verifyCreator: (input) => addSelfPlanAndSendFunctions(client, getVerifyCreatorInstruction({
554
- ...input,
555
- payer: input.payer ?? client.payer,
556
- })),
557
- verifyCreatorV2: (input) => addSelfPlanAndSendFunctions(client, getVerifyCreatorV2Instruction({
558
- ...input,
559
- payer: input.payer ?? client.payer,
560
- })),
561
- },
562
- },
563
- });
564
- };
711
+ function bubblegumProgram() {
712
+ return (client) => {
713
+ return extendClient(client, { bubblegum: {
714
+ accounts: {
715
+ treeConfig: addSelfFetchFunctions(client, getTreeConfigCodec()),
716
+ voucher: addSelfFetchFunctions(client, getVoucherCodec())
717
+ },
718
+ instructions: {
719
+ burn: (input) => addSelfPlanAndSendFunctions(client, getBurnInstructionAsync(input)),
720
+ burnV2: (input) => addSelfPlanAndSendFunctions(client, getBurnV2InstructionAsync({
721
+ ...input,
722
+ payer: input.payer ?? client.payer
723
+ })),
724
+ cancelRedeem: (input) => addSelfPlanAndSendFunctions(client, getCancelRedeemInstructionAsync(input)),
725
+ closeTreeV2: (input) => addSelfPlanAndSendFunctions(client, getCloseTreeV2InstructionAsync(input)),
726
+ collectV2: (input) => addSelfPlanAndSendFunctions(client, getCollectV2Instruction(input)),
727
+ compress: (input) => addSelfPlanAndSendFunctions(client, getCompressInstructionAsync({
728
+ ...input,
729
+ payer: input.payer ?? client.payer
730
+ })),
731
+ createTree: (input) => addSelfPlanAndSendFunctions(client, getCreateTreeInstructionAsync({
732
+ ...input,
733
+ payer: input.payer ?? client.payer
734
+ })),
735
+ createTreeV2: (input) => addSelfPlanAndSendFunctions(client, getCreateTreeV2InstructionAsync({
736
+ ...input,
737
+ payer: input.payer ?? client.payer
738
+ })),
739
+ decompressV1: (input) => addSelfPlanAndSendFunctions(client, getDecompressV1InstructionAsync(input)),
740
+ delegate: (input) => addSelfPlanAndSendFunctions(client, getDelegateInstructionAsync(input)),
741
+ delegateAndFreezeV2: (input) => addSelfPlanAndSendFunctions(client, getDelegateAndFreezeV2InstructionAsync({
742
+ ...input,
743
+ payer: input.payer ?? client.payer
744
+ })),
745
+ delegateV2: (input) => addSelfPlanAndSendFunctions(client, getDelegateV2InstructionAsync({
746
+ ...input,
747
+ payer: input.payer ?? client.payer
748
+ })),
749
+ freezeV2: (input) => addSelfPlanAndSendFunctions(client, getFreezeV2InstructionAsync({
750
+ ...input,
751
+ payer: input.payer ?? client.payer
752
+ })),
753
+ mintToCollectionV1: (input) => addSelfPlanAndSendFunctions(client, getMintToCollectionV1InstructionAsync({
754
+ ...input,
755
+ payer: input.payer ?? client.payer
756
+ })),
757
+ mintV1: (input) => addSelfPlanAndSendFunctions(client, getMintV1InstructionAsync({
758
+ ...input,
759
+ payer: input.payer ?? client.payer
760
+ })),
761
+ mintV2: (input) => addSelfPlanAndSendFunctions(client, getMintV2InstructionAsync({
762
+ ...input,
763
+ payer: input.payer ?? client.payer
764
+ })),
765
+ redeem: (input) => addSelfPlanAndSendFunctions(client, getRedeemInstructionAsync(input)),
766
+ setAndVerifyCollection: (input) => addSelfPlanAndSendFunctions(client, getSetAndVerifyCollectionInstructionAsync({
767
+ ...input,
768
+ payer: input.payer ?? client.payer
769
+ })),
770
+ setCollectionV2: (input) => addSelfPlanAndSendFunctions(client, getSetCollectionV2InstructionAsync({
771
+ ...input,
772
+ payer: input.payer ?? client.payer
773
+ })),
774
+ setDecompressableState: (input) => addSelfPlanAndSendFunctions(client, getSetDecompressableStateInstruction(input)),
775
+ setDecompressibleState: (input) => addSelfPlanAndSendFunctions(client, getSetDecompressibleStateInstruction(input)),
776
+ setNonTransferableV2: (input) => addSelfPlanAndSendFunctions(client, getSetNonTransferableV2InstructionAsync({
777
+ ...input,
778
+ payer: input.payer ?? client.payer
779
+ })),
780
+ setTreeDelegate: (input) => addSelfPlanAndSendFunctions(client, getSetTreeDelegateInstructionAsync(input)),
781
+ thawAndRevokeV2: (input) => addSelfPlanAndSendFunctions(client, getThawAndRevokeV2InstructionAsync({
782
+ ...input,
783
+ payer: input.payer ?? client.payer
784
+ })),
785
+ thawV2: (input) => addSelfPlanAndSendFunctions(client, getThawV2InstructionAsync({
786
+ ...input,
787
+ payer: input.payer ?? client.payer
788
+ })),
789
+ transfer: (input) => addSelfPlanAndSendFunctions(client, getTransferInstructionAsync(input)),
790
+ transferV2: (input) => addSelfPlanAndSendFunctions(client, getTransferV2InstructionAsync({
791
+ ...input,
792
+ payer: input.payer ?? client.payer
793
+ })),
794
+ unverifyCollection: (input) => addSelfPlanAndSendFunctions(client, getUnverifyCollectionInstructionAsync({
795
+ ...input,
796
+ payer: input.payer ?? client.payer
797
+ })),
798
+ unverifyCreator: (input) => addSelfPlanAndSendFunctions(client, getUnverifyCreatorInstructionAsync({
799
+ ...input,
800
+ payer: input.payer ?? client.payer
801
+ })),
802
+ unverifyCreatorV2: (input) => addSelfPlanAndSendFunctions(client, getUnverifyCreatorV2InstructionAsync({
803
+ ...input,
804
+ payer: input.payer ?? client.payer
805
+ })),
806
+ updateAssetDataV2: (input) => addSelfPlanAndSendFunctions(client, getUpdateAssetDataV2InstructionAsync({
807
+ ...input,
808
+ payer: input.payer ?? client.payer
809
+ })),
810
+ updateMetadata: (input) => addSelfPlanAndSendFunctions(client, getUpdateMetadataInstructionAsync({
811
+ ...input,
812
+ payer: input.payer ?? client.payer
813
+ })),
814
+ updateMetadataV2: (input) => addSelfPlanAndSendFunctions(client, getUpdateMetadataV2InstructionAsync({
815
+ ...input,
816
+ payer: input.payer ?? client.payer
817
+ })),
818
+ verifyCollection: (input) => addSelfPlanAndSendFunctions(client, getVerifyCollectionInstructionAsync({
819
+ ...input,
820
+ payer: input.payer ?? client.payer
821
+ })),
822
+ verifyCreator: (input) => addSelfPlanAndSendFunctions(client, getVerifyCreatorInstructionAsync({
823
+ ...input,
824
+ payer: input.payer ?? client.payer
825
+ })),
826
+ verifyCreatorV2: (input) => addSelfPlanAndSendFunctions(client, getVerifyCreatorV2InstructionAsync({
827
+ ...input,
828
+ payer: input.payer ?? client.payer
829
+ }))
830
+ },
831
+ pdas: {
832
+ treeConfig: findTreeConfigPda,
833
+ voucher: findVoucherPda,
834
+ assetId: findAssetIdPda,
835
+ bubblegumSigner: findBubblegumSignerPda,
836
+ mintAuthority: findMintAuthorityPda
837
+ }
838
+ } });
839
+ };
565
840
  }
841
+ //#endregion
842
+ export { BUBBLEGUM_PROGRAM_ADDRESS, BubblegumAccount, BubblegumInstruction, bubblegumProgram, identifyBubblegumAccount, identifyBubblegumInstruction, parseBubblegumInstruction };
843
+
566
844
  //# sourceMappingURL=bubblegum.js.map