3land_sdk 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. package/README.md +352 -0
  2. package/assets/3land_rebrand.gif +0 -0
  3. package/assets/battle_sol.gif +0 -0
  4. package/assets/ds.jpeg +0 -0
  5. package/assets/future.webp +0 -0
  6. package/assets/music.mp3 +0 -0
  7. package/assets/niicl.gif +0 -0
  8. package/assets/og.png +0 -0
  9. package/assets/phone.glb +0 -0
  10. package/assets/testvid.mp4 +0 -0
  11. package/idl.json +7652 -0
  12. package/package.json +35 -0
  13. package/src/index.ts +89 -0
  14. package/src/library/Irys/irys.ts +412 -0
  15. package/src/library/Store.ts +613 -0
  16. package/src/library/implementation/storeImplementation.ts +385 -0
  17. package/src/library/instructions/store/buySingleEdition.ts +227 -0
  18. package/src/library/instructions/store/createSingleEdition.ts +49 -0
  19. package/src/library/instructions/store/createStore.ts +19 -0
  20. package/src/library/instructions/store/idl.ts +7622 -0
  21. package/src/library/instructions/store/uploadFilesIryis.ts +133 -0
  22. package/src/types/accounts/ArchiveDeposit.ts +207 -0
  23. package/src/types/accounts/Authority.ts +73 -0
  24. package/src/types/accounts/BurnDeposit.ts +111 -0
  25. package/src/types/accounts/BurnProgress.ts +97 -0
  26. package/src/types/accounts/BuyHistory.ts +121 -0
  27. package/src/types/accounts/BuyTrack.ts +94 -0
  28. package/src/types/accounts/Card.ts +185 -0
  29. package/src/types/accounts/CollectionRegistry.ts +145 -0
  30. package/src/types/accounts/CollectorRegistry.ts +145 -0
  31. package/src/types/accounts/CreatorRegistry.ts +153 -0
  32. package/src/types/accounts/CurrencyArtistProof.ts +113 -0
  33. package/src/types/accounts/GenericUser.ts +185 -0
  34. package/src/types/accounts/ItemArchive.ts +223 -0
  35. package/src/types/accounts/ItemReserveList.ts +87 -0
  36. package/src/types/accounts/ItemReserveList2.ts +73 -0
  37. package/src/types/accounts/LutVault.ts +97 -0
  38. package/src/types/accounts/Pack.ts +367 -0
  39. package/src/types/accounts/PackContent.ts +97 -0
  40. package/src/types/accounts/PackOpenHolder.ts +141 -0
  41. package/src/types/accounts/PackReceipt.ts +145 -0
  42. package/src/types/accounts/PackTraits.ts +101 -0
  43. package/src/types/accounts/Payment.ts +97 -0
  44. package/src/types/accounts/PoolVault.ts +177 -0
  45. package/src/types/accounts/RevealForMe.ts +139 -0
  46. package/src/types/accounts/SecureHolder.ts +97 -0
  47. package/src/types/accounts/Single.ts +301 -0
  48. package/src/types/accounts/Store.ts +180 -0
  49. package/src/types/accounts/StoresHolder.ts +131 -0
  50. package/src/types/accounts/ThreeId.ts +189 -0
  51. package/src/types/accounts/TokenManager.ts +217 -0
  52. package/src/types/accounts/ZeroCard.ts +73 -0
  53. package/src/types/accounts/ZeroContent.ts +89 -0
  54. package/src/types/accounts/ZeroOpenHolder.ts +183 -0
  55. package/src/types/accounts/index.ts +84 -0
  56. package/src/types/errors/anchor.ts +773 -0
  57. package/src/types/errors/index.ts +59 -0
  58. package/src/types/implementation/implementationTypes.ts +27 -0
  59. package/src/types/instructions/addBurn.ts +56 -0
  60. package/src/types/instructions/adjustDepositBurn.ts +33 -0
  61. package/src/types/instructions/archiveItem.ts +60 -0
  62. package/src/types/instructions/assignPackDelegate.ts +30 -0
  63. package/src/types/instructions/burnPay.ts +55 -0
  64. package/src/types/instructions/buyPack.ts +69 -0
  65. package/src/types/instructions/buyPay.ts +71 -0
  66. package/src/types/instructions/buyToken.ts +64 -0
  67. package/src/types/instructions/claimZeroCard.ts +106 -0
  68. package/src/types/instructions/closeDepositBurn.ts +47 -0
  69. package/src/types/instructions/closeRegisterTraits.ts +28 -0
  70. package/src/types/instructions/createCard.ts +56 -0
  71. package/src/types/instructions/createCollection.ts +68 -0
  72. package/src/types/instructions/createPack.ts +71 -0
  73. package/src/types/instructions/createSingle.ts +71 -0
  74. package/src/types/instructions/createStore.ts +50 -0
  75. package/src/types/instructions/createTokenLauncher.ts +82 -0
  76. package/src/types/instructions/createZeroCard.ts +76 -0
  77. package/src/types/instructions/deleteCard.ts +32 -0
  78. package/src/types/instructions/deletePack.ts +40 -0
  79. package/src/types/instructions/deleteSingle.ts +36 -0
  80. package/src/types/instructions/deleteTokenLauncher.ts +38 -0
  81. package/src/types/instructions/depositBurn.ts +55 -0
  82. package/src/types/instructions/donateUser.ts +84 -0
  83. package/src/types/instructions/feedPool.ts +61 -0
  84. package/src/types/instructions/feedTraits.ts +44 -0
  85. package/src/types/instructions/feedTree.ts +63 -0
  86. package/src/types/instructions/flagPack.ts +50 -0
  87. package/src/types/instructions/flagSingle.ts +47 -0
  88. package/src/types/instructions/gatePay.ts +59 -0
  89. package/src/types/instructions/index.ts +140 -0
  90. package/src/types/instructions/initialize.ts +46 -0
  91. package/src/types/instructions/openPack.ts +79 -0
  92. package/src/types/instructions/prepareCreator.ts +30 -0
  93. package/src/types/instructions/preparePack.ts +51 -0
  94. package/src/types/instructions/prepareTraits.ts +28 -0
  95. package/src/types/instructions/printPack.ts +95 -0
  96. package/src/types/instructions/printSingle.ts +108 -0
  97. package/src/types/instructions/recoverDepositBurn.ts +80 -0
  98. package/src/types/instructions/registerActivity.ts +43 -0
  99. package/src/types/instructions/registerCollector.ts +63 -0
  100. package/src/types/instructions/registerCreator.ts +48 -0
  101. package/src/types/instructions/registerGenericUser.ts +94 -0
  102. package/src/types/instructions/registerPackUploads.ts +44 -0
  103. package/src/types/instructions/registerTraits.ts +42 -0
  104. package/src/types/instructions/registerUser.ts +50 -0
  105. package/src/types/instructions/storeLutFor.ts +44 -0
  106. package/src/types/instructions/unwrapAndDestroy.ts +56 -0
  107. package/src/types/instructions/updateCard.ts +54 -0
  108. package/src/types/instructions/updatePack.ts +71 -0
  109. package/src/types/instructions/updateSingle.ts +64 -0
  110. package/src/types/instructions/updateStore.ts +47 -0
  111. package/src/types/instructions/withdrawFromStore.ts +26 -0
  112. package/src/types/programId.ts +42 -0
  113. package/src/types/types/AccountClass.ts +868 -0
  114. package/src/types/types/AccountHasher.ts +89 -0
  115. package/src/types/types/ActionAfter.ts +202 -0
  116. package/src/types/types/AllowedCurrencyArgs.ts +53 -0
  117. package/src/types/types/AuthorityGateTypes.ts +90 -0
  118. package/src/types/types/BurnCount.ts +60 -0
  119. package/src/types/types/BurnState.ts +88 -0
  120. package/src/types/types/BurnTrack.ts +64 -0
  121. package/src/types/types/BurnType.ts +118 -0
  122. package/src/types/types/BurnTypeBurn.ts +56 -0
  123. package/src/types/types/BuyHistoryClass.ts +90 -0
  124. package/src/types/types/CardClass.ts +56 -0
  125. package/src/types/types/CardState.ts +238 -0
  126. package/src/types/types/CardTrack.ts +76 -0
  127. package/src/types/types/Category.ts +72 -0
  128. package/src/types/types/CnftData.ts +85 -0
  129. package/src/types/types/CollectTrack.ts +61 -0
  130. package/src/types/types/Collection.ts +64 -0
  131. package/src/types/types/CompactCnftData.ts +76 -0
  132. package/src/types/types/CoolTimePerAmountArgs.ts +72 -0
  133. package/src/types/types/Creator.ts +72 -0
  134. package/src/types/types/CreatorGateArgs.ts +53 -0
  135. package/src/types/types/CurrencyArtistProof.ts +85 -0
  136. package/src/types/types/CurrencyType.ts +259 -0
  137. package/src/types/types/DateTraitInit.ts +61 -0
  138. package/src/types/types/DateTraitInitMap.ts +72 -0
  139. package/src/types/types/Deposit.ts +85 -0
  140. package/src/types/types/DepositFormat.ts +90 -0
  141. package/src/types/types/DepositState.ts +88 -0
  142. package/src/types/types/DepositSubtype.ts +90 -0
  143. package/src/types/types/DepositTrack.ts +69 -0
  144. package/src/types/types/DepositTrackType.ts +120 -0
  145. package/src/types/types/DepositType.ts +245 -0
  146. package/src/types/types/Earnings.ts +37 -0
  147. package/src/types/types/EditionStoreType.ts +120 -0
  148. package/src/types/types/EncryptedPayload.ts +61 -0
  149. package/src/types/types/ExtraParameter.ts +117 -0
  150. package/src/types/types/FakeBurnCount.ts +64 -0
  151. package/src/types/types/FakeDeposit.ts +64 -0
  152. package/src/types/types/FakeTraitPair.ts +61 -0
  153. package/src/types/types/FakeTraitValue.ts +61 -0
  154. package/src/types/types/FakeVolumeTrack.ts +64 -0
  155. package/src/types/types/FeeType.ts +118 -0
  156. package/src/types/types/FeedingTraits.ts +57 -0
  157. package/src/types/types/Filter.ts +64 -0
  158. package/src/types/types/FilterType.ts +56 -0
  159. package/src/types/types/GeneralStore.ts +56 -0
  160. package/src/types/types/GenericStore.ts +64 -0
  161. package/src/types/types/GenericValue.ts +172 -0
  162. package/src/types/types/GlobalFee.ts +85 -0
  163. package/src/types/types/GlobalState.ts +148 -0
  164. package/src/types/types/IndexDate.ts +94 -0
  165. package/src/types/types/IndexDates.ts +64 -0
  166. package/src/types/types/Item.ts +53 -0
  167. package/src/types/types/ItemClass.ts +88 -0
  168. package/src/types/types/ItemState.ts +298 -0
  169. package/src/types/types/ItemTrack.ts +76 -0
  170. package/src/types/types/ListingPerWalletArgs.ts +53 -0
  171. package/src/types/types/MemeVaultProof.ts +64 -0
  172. package/src/types/types/MetadataArgs.ts +207 -0
  173. package/src/types/types/NonFungibleTraitInit.ts +64 -0
  174. package/src/types/types/NonFungibleTraitInitMap.ts +84 -0
  175. package/src/types/types/OnlyBetweenTimesArgs.ts +76 -0
  176. package/src/types/types/OnlyTheseDOWArgs.ts +53 -0
  177. package/src/types/types/PackConfig.ts +98 -0
  178. package/src/types/types/PackOpenHolderState.ts +120 -0
  179. package/src/types/types/PackRule.ts +85 -0
  180. package/src/types/types/PackState.ts +118 -0
  181. package/src/types/types/PackType.ts +118 -0
  182. package/src/types/types/PaymentClass.ts +118 -0
  183. package/src/types/types/PoolAccess.ts +88 -0
  184. package/src/types/types/PoolState.ts +88 -0
  185. package/src/types/types/PoolType.ts +88 -0
  186. package/src/types/types/Popularity.ts +76 -0
  187. package/src/types/types/PopularityState.ts +630 -0
  188. package/src/types/types/PreviousDonationRecord.ts +76 -0
  189. package/src/types/types/Price.ts +64 -0
  190. package/src/types/types/PriceRule.ts +216 -0
  191. package/src/types/types/RecoverDeposit.ts +56 -0
  192. package/src/types/types/Rule.ts +199 -0
  193. package/src/types/types/SaleConfig.ts +102 -0
  194. package/src/types/types/SaleTrack.ts +85 -0
  195. package/src/types/types/SaleType.ts +148 -0
  196. package/src/types/types/Seed.ts +61 -0
  197. package/src/types/types/SelectedCard.ts +61 -0
  198. package/src/types/types/SelectedZeroCard.ts +61 -0
  199. package/src/types/types/SemiFungibleTraitInit.ts +61 -0
  200. package/src/types/types/SemiFungibleTraitInitMap.ts +72 -0
  201. package/src/types/types/ShortCreator.ts +64 -0
  202. package/src/types/types/ShortMetadata.ts +145 -0
  203. package/src/types/types/ShortMetadataArgs.ts +111 -0
  204. package/src/types/types/StoreConfig.ts +98 -0
  205. package/src/types/types/StoreRule.ts +145 -0
  206. package/src/types/types/SuperCategory.ts +61 -0
  207. package/src/types/types/TightCardMetadata.ts +120 -0
  208. package/src/types/types/TimeRangeType.ts +120 -0
  209. package/src/types/types/TimedPerWalletArgs.ts +53 -0
  210. package/src/types/types/TokenMetadata.ts +72 -0
  211. package/src/types/types/TokenProgramVersion.ts +90 -0
  212. package/src/types/types/TokenStandard.ts +150 -0
  213. package/src/types/types/TokenState.ts +88 -0
  214. package/src/types/types/TokenType.ts +88 -0
  215. package/src/types/types/TotalPerTimeArgs.ts +85 -0
  216. package/src/types/types/TotalPerTimeWalletArgs.ts +61 -0
  217. package/src/types/types/TrackRegistry.ts +90 -0
  218. package/src/types/types/TraitInit.ts +210 -0
  219. package/src/types/types/TraitPass.ts +60 -0
  220. package/src/types/types/TraitPassType.ts +225 -0
  221. package/src/types/types/TraitType.ts +267 -0
  222. package/src/types/types/TraitValue.ts +72 -0
  223. package/src/types/types/UnlocksAfter.ts +172 -0
  224. package/src/types/types/UnwrapMetadata.ts +156 -0
  225. package/src/types/types/UseMethod.ts +118 -0
  226. package/src/types/types/Uses.ts +76 -0
  227. package/src/types/types/VerifyCollectionMetadata.ts +109 -0
  228. package/src/types/types/VolumeTrack.ts +61 -0
  229. package/src/types/types/WrappedSource.ts +85 -0
  230. package/src/types/types/ZeroConfig.ts +85 -0
  231. package/src/types/types/index.ts +798 -0
  232. package/src/utility/Connection.ts +9 -0
  233. package/src/utility/Holders.ts +8 -0
  234. package/src/utility/PdaManager.ts +230 -0
  235. package/src/utility/config.ts +32 -0
  236. package/src/utility/utils.ts +191 -0
  237. package/src/utility/validation.ts +229 -0
  238. package/tsconfig.json +12 -0
@@ -0,0 +1,79 @@
1
+ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ import { PROGRAM_ID } from "../programId"
6
+
7
+ export interface OpenPackArgs {
8
+ root: Array<number>
9
+ dataHash: Array<number>
10
+ creatorHash: Array<number>
11
+ index: number
12
+ randomBase: BN
13
+ creatorAuthorityBump: number
14
+ }
15
+
16
+ export interface OpenPackAccounts {
17
+ treeAuthority: PublicKey
18
+ merkleTree: PublicKey
19
+ packAccount: PublicKey
20
+ packOpenAccount: PublicKey
21
+ creatorAuthority: PublicKey
22
+ packContent: PublicKey
23
+ owner: PublicKey
24
+ packReceipt: PublicKey
25
+ payer: PublicKey
26
+ openAuthority: PublicKey
27
+ bubblegumProgram: PublicKey
28
+ logWrapper: PublicKey
29
+ compressionProgram: PublicKey
30
+ systemProgram: PublicKey
31
+ }
32
+
33
+ export const layout = borsh.struct([
34
+ borsh.array(borsh.u8(), 32, "root"),
35
+ borsh.array(borsh.u8(), 32, "dataHash"),
36
+ borsh.array(borsh.u8(), 32, "creatorHash"),
37
+ borsh.u32("index"),
38
+ borsh.u64("randomBase"),
39
+ borsh.u8("creatorAuthorityBump"),
40
+ ])
41
+
42
+ export function openPack(
43
+ args: OpenPackArgs,
44
+ accounts: OpenPackAccounts,
45
+ programId: PublicKey = PROGRAM_ID
46
+ ) {
47
+ const keys: Array<AccountMeta> = [
48
+ { pubkey: accounts.treeAuthority, isSigner: false, isWritable: false },
49
+ { pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
50
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
51
+ { pubkey: accounts.packOpenAccount, isSigner: false, isWritable: true },
52
+ { pubkey: accounts.creatorAuthority, isSigner: false, isWritable: true },
53
+ { pubkey: accounts.packContent, isSigner: false, isWritable: true },
54
+ { pubkey: accounts.owner, isSigner: false, isWritable: true },
55
+ { pubkey: accounts.packReceipt, isSigner: false, isWritable: true },
56
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
57
+ { pubkey: accounts.openAuthority, isSigner: true, isWritable: true },
58
+ { pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
59
+ { pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
60
+ { pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
61
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
62
+ ]
63
+ const identifier = Buffer.from([75, 203, 144, 65, 63, 253, 103, 85])
64
+ const buffer = Buffer.alloc(1000)
65
+ const len = layout.encode(
66
+ {
67
+ root: args.root,
68
+ dataHash: args.dataHash,
69
+ creatorHash: args.creatorHash,
70
+ index: args.index,
71
+ randomBase: args.randomBase,
72
+ creatorAuthorityBump: args.creatorAuthorityBump,
73
+ },
74
+ buffer
75
+ )
76
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
77
+ const ix = new TransactionInstruction({ keys, programId, data })
78
+ return ix
79
+ }
@@ -0,0 +1,30 @@
1
+ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ import { PROGRAM_ID } from "../programId"
6
+
7
+ export interface PrepareCreatorAccounts {
8
+ storeAccount: PublicKey
9
+ creatorAuthority: PublicKey
10
+ creator: PublicKey
11
+ payer: PublicKey
12
+ systemProgram: PublicKey
13
+ }
14
+
15
+ export function prepareCreator(
16
+ accounts: PrepareCreatorAccounts,
17
+ programId: PublicKey = PROGRAM_ID
18
+ ) {
19
+ const keys: Array<AccountMeta> = [
20
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
21
+ { pubkey: accounts.creatorAuthority, isSigner: false, isWritable: true },
22
+ { pubkey: accounts.creator, isSigner: false, isWritable: false },
23
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
24
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
25
+ ]
26
+ const identifier = Buffer.from([6, 217, 148, 231, 102, 186, 94, 73])
27
+ const data = identifier
28
+ const ix = new TransactionInstruction({ keys, programId, data })
29
+ return ix
30
+ }
@@ -0,0 +1,51 @@
1
+ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ import { PROGRAM_ID } from "../programId"
6
+
7
+ export interface PreparePackArgs {
8
+ supply: BN
9
+ identifier: BN
10
+ }
11
+
12
+ export interface PreparePackAccounts {
13
+ storeAccount: PublicKey
14
+ packAccount: PublicKey
15
+ packContent: PublicKey
16
+ creator: PublicKey
17
+ payer: PublicKey
18
+ systemProgram: PublicKey
19
+ }
20
+
21
+ export const layout = borsh.struct([
22
+ borsh.u64("supply"),
23
+ borsh.u64("identifier"),
24
+ ])
25
+
26
+ export function preparePack(
27
+ args: PreparePackArgs,
28
+ accounts: PreparePackAccounts,
29
+ programId: PublicKey = PROGRAM_ID
30
+ ) {
31
+ const keys: Array<AccountMeta> = [
32
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
33
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
34
+ { pubkey: accounts.packContent, isSigner: false, isWritable: true },
35
+ { pubkey: accounts.creator, isSigner: false, isWritable: false },
36
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
37
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
38
+ ]
39
+ const identifier = Buffer.from([246, 136, 88, 116, 22, 62, 30, 154])
40
+ const buffer = Buffer.alloc(1000)
41
+ const len = layout.encode(
42
+ {
43
+ supply: args.supply,
44
+ identifier: args.identifier,
45
+ },
46
+ buffer
47
+ )
48
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
49
+ const ix = new TransactionInstruction({ keys, programId, data })
50
+ return ix
51
+ }
@@ -0,0 +1,28 @@
1
+ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ import { PROGRAM_ID } from "../programId"
6
+
7
+ export interface PrepareTraitsAccounts {
8
+ packAccount: PublicKey
9
+ packTraits: PublicKey
10
+ payer: PublicKey
11
+ systemProgram: PublicKey
12
+ }
13
+
14
+ export function prepareTraits(
15
+ accounts: PrepareTraitsAccounts,
16
+ programId: PublicKey = PROGRAM_ID
17
+ ) {
18
+ const keys: Array<AccountMeta> = [
19
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
20
+ { pubkey: accounts.packTraits, isSigner: false, isWritable: true },
21
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
22
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
23
+ ]
24
+ const identifier = Buffer.from([44, 242, 4, 177, 221, 243, 62, 47])
25
+ const data = identifier
26
+ const ix = new TransactionInstruction({ keys, programId, data })
27
+ return ix
28
+ }
@@ -0,0 +1,95 @@
1
+ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ import { PROGRAM_ID } from "../programId"
6
+
7
+ export interface PrintPackArgs {
8
+ proof: types.CurrencyArtistProofFields
9
+ receiptSlot: BN
10
+ }
11
+
12
+ export interface PrintPackAccounts {
13
+ treeAuthority: PublicKey
14
+ creatorAuthority: PublicKey
15
+ discriminator: PublicKey
16
+ packAccount: PublicKey
17
+ merkleTree: PublicKey
18
+ merkleManager: PublicKey
19
+ /**
20
+ * If there is no collecton authority record PDA then
21
+ * this must be the Bubblegum program address.
22
+ */
23
+ collectionAuthorityRecordPda: PublicKey
24
+ packReceipt: PublicKey
25
+ editionAccount: PublicKey
26
+ collectionMetadata: PublicKey
27
+ collectionMint: PublicKey
28
+ storeAccount: PublicKey
29
+ paymentAccount: PublicKey
30
+ buytrackAccount: PublicKey
31
+ bubblegumSigner: PublicKey
32
+ owner: PublicKey
33
+ payer: PublicKey
34
+ logWrapper: PublicKey
35
+ bubblegumProgram: PublicKey
36
+ compressionProgram: PublicKey
37
+ tokenMetadataProgram: PublicKey
38
+ systemProgram: PublicKey
39
+ }
40
+
41
+ export const layout = borsh.struct([
42
+ types.CurrencyArtistProof.layout("proof"),
43
+ borsh.u64("receiptSlot"),
44
+ ])
45
+
46
+ export function printPack(
47
+ args: PrintPackArgs,
48
+ accounts: PrintPackAccounts,
49
+ programId: PublicKey = PROGRAM_ID
50
+ ) {
51
+ const keys: Array<AccountMeta> = [
52
+ { pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
53
+ { pubkey: accounts.creatorAuthority, isSigner: false, isWritable: false },
54
+ { pubkey: accounts.discriminator, isSigner: false, isWritable: false },
55
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
56
+ { pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
57
+ { pubkey: accounts.merkleManager, isSigner: false, isWritable: true },
58
+ {
59
+ pubkey: accounts.collectionAuthorityRecordPda,
60
+ isSigner: false,
61
+ isWritable: false,
62
+ },
63
+ { pubkey: accounts.packReceipt, isSigner: false, isWritable: true },
64
+ { pubkey: accounts.editionAccount, isSigner: false, isWritable: false },
65
+ { pubkey: accounts.collectionMetadata, isSigner: false, isWritable: true },
66
+ { pubkey: accounts.collectionMint, isSigner: false, isWritable: false },
67
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
68
+ { pubkey: accounts.paymentAccount, isSigner: false, isWritable: true },
69
+ { pubkey: accounts.buytrackAccount, isSigner: false, isWritable: true },
70
+ { pubkey: accounts.bubblegumSigner, isSigner: false, isWritable: false },
71
+ { pubkey: accounts.owner, isSigner: false, isWritable: false },
72
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
73
+ { pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
74
+ { pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
75
+ { pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
76
+ {
77
+ pubkey: accounts.tokenMetadataProgram,
78
+ isSigner: false,
79
+ isWritable: false,
80
+ },
81
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
82
+ ]
83
+ const identifier = Buffer.from([25, 136, 10, 50, 193, 77, 147, 120])
84
+ const buffer = Buffer.alloc(1000)
85
+ const len = layout.encode(
86
+ {
87
+ proof: types.CurrencyArtistProof.toEncodable(args.proof),
88
+ receiptSlot: args.receiptSlot,
89
+ },
90
+ buffer
91
+ )
92
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
93
+ const ix = new TransactionInstruction({ keys, programId, data })
94
+ return ix
95
+ }
@@ -0,0 +1,108 @@
1
+ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ import { PROGRAM_ID } from "../programId"
6
+
7
+ export interface PrintSingleArgs {
8
+ proof: types.CurrencyArtistProofFields | null
9
+ storeBump: number
10
+ creatorAuthBump: number
11
+ itemBump: number
12
+ treeBump: number
13
+ extra: types.ExtraParameterKind
14
+ }
15
+
16
+ export interface PrintSingleAccounts {
17
+ /** CHECK */
18
+ owner: PublicKey
19
+ itemAccount: PublicKey
20
+ treeAuthority: PublicKey
21
+ storeAccount: PublicKey
22
+ creatorAuthority: PublicKey
23
+ paymentAccount: PublicKey
24
+ merkleTree: PublicKey
25
+ merkleManager: PublicKey
26
+ /**
27
+ * If there is no collecton authority record PDA then
28
+ * this must be the Bubblegum program address.
29
+ */
30
+ collectionAuthorityRecordPda: PublicKey
31
+ editionAccount: PublicKey
32
+ collectionMetadata: PublicKey
33
+ collectionMint: PublicKey
34
+ bubblegumSigner: PublicKey
35
+ buytrackAccount: PublicKey
36
+ revealForMe: PublicKey
37
+ payer: PublicKey
38
+ logWrapper: PublicKey
39
+ bubblegumProgram: PublicKey
40
+ compressionProgram: PublicKey
41
+ tokenMetadataProgram: PublicKey
42
+ systemProgram: PublicKey
43
+ }
44
+
45
+ export const layout = borsh.struct([
46
+ borsh.option(types.CurrencyArtistProof.layout(), "proof"),
47
+ borsh.u8("storeBump"),
48
+ borsh.u8("creatorAuthBump"),
49
+ borsh.u8("itemBump"),
50
+ borsh.u8("treeBump"),
51
+ types.ExtraParameter.layout("extra"),
52
+ ])
53
+
54
+ export function printSingle(
55
+ args: PrintSingleArgs,
56
+ accounts: PrintSingleAccounts,
57
+ programId: PublicKey = PROGRAM_ID
58
+ ) {
59
+ const keys: Array<AccountMeta> = [
60
+ { pubkey: accounts.owner, isSigner: false, isWritable: false },
61
+ { pubkey: accounts.itemAccount, isSigner: false, isWritable: true },
62
+ { pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
63
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
64
+ { pubkey: accounts.creatorAuthority, isSigner: false, isWritable: false },
65
+ { pubkey: accounts.paymentAccount, isSigner: false, isWritable: true },
66
+ { pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
67
+ { pubkey: accounts.merkleManager, isSigner: false, isWritable: true },
68
+ {
69
+ pubkey: accounts.collectionAuthorityRecordPda,
70
+ isSigner: false,
71
+ isWritable: false,
72
+ },
73
+ { pubkey: accounts.editionAccount, isSigner: false, isWritable: false },
74
+ { pubkey: accounts.collectionMetadata, isSigner: false, isWritable: true },
75
+ { pubkey: accounts.collectionMint, isSigner: false, isWritable: false },
76
+ { pubkey: accounts.bubblegumSigner, isSigner: false, isWritable: false },
77
+ { pubkey: accounts.buytrackAccount, isSigner: false, isWritable: true },
78
+ { pubkey: accounts.revealForMe, isSigner: false, isWritable: true },
79
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
80
+ { pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
81
+ { pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
82
+ { pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
83
+ {
84
+ pubkey: accounts.tokenMetadataProgram,
85
+ isSigner: false,
86
+ isWritable: false,
87
+ },
88
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
89
+ ]
90
+ const identifier = Buffer.from([105, 204, 23, 32, 170, 121, 225, 133])
91
+ const buffer = Buffer.alloc(1000)
92
+ const len = layout.encode(
93
+ {
94
+ proof:
95
+ (args.proof && types.CurrencyArtistProof.toEncodable(args.proof)) ||
96
+ null,
97
+ storeBump: args.storeBump,
98
+ creatorAuthBump: args.creatorAuthBump,
99
+ itemBump: args.itemBump,
100
+ treeBump: args.treeBump,
101
+ extra: args.extra.toEncodable(),
102
+ },
103
+ buffer
104
+ )
105
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
106
+ const ix = new TransactionInstruction({ keys, programId, data })
107
+ return ix
108
+ }
@@ -0,0 +1,80 @@
1
+ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ import { PROGRAM_ID } from "../programId"
6
+
7
+ export interface RecoverDepositBurnArgs {
8
+ deposit: types.RecoverDepositFields
9
+ burn: number
10
+ }
11
+
12
+ export interface RecoverDepositBurnAccounts {
13
+ burnDeposit: PublicKey
14
+ artistBurnTrack: PublicKey
15
+ globalBurnTrack: PublicKey
16
+ itemAccount: PublicKey
17
+ packAccount: PublicKey
18
+ treeAuthority: PublicKey
19
+ /** CHECK */
20
+ merkleTree: PublicKey
21
+ /** CHECK */
22
+ fromAta: PublicKey
23
+ /** CHECK */
24
+ toAta: PublicKey
25
+ /** CHECK */
26
+ recoverTo: PublicKey
27
+ storeAccount: PublicKey
28
+ /** CHECK */
29
+ token: PublicKey
30
+ payer: PublicKey
31
+ tokenProgram: PublicKey
32
+ bubblegumProgram: PublicKey
33
+ logWrapper: PublicKey
34
+ compressionProgram: PublicKey
35
+ systemProgram: PublicKey
36
+ }
37
+
38
+ export const layout = borsh.struct([
39
+ types.RecoverDeposit.layout("deposit"),
40
+ borsh.u8("burn"),
41
+ ])
42
+
43
+ export function recoverDepositBurn(
44
+ args: RecoverDepositBurnArgs,
45
+ accounts: RecoverDepositBurnAccounts,
46
+ programId: PublicKey = PROGRAM_ID
47
+ ) {
48
+ const keys: Array<AccountMeta> = [
49
+ { pubkey: accounts.burnDeposit, isSigner: false, isWritable: true },
50
+ { pubkey: accounts.artistBurnTrack, isSigner: false, isWritable: true },
51
+ { pubkey: accounts.globalBurnTrack, isSigner: false, isWritable: true },
52
+ { pubkey: accounts.itemAccount, isSigner: false, isWritable: false },
53
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: false },
54
+ { pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
55
+ { pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
56
+ { pubkey: accounts.fromAta, isSigner: false, isWritable: true },
57
+ { pubkey: accounts.toAta, isSigner: false, isWritable: true },
58
+ { pubkey: accounts.recoverTo, isSigner: false, isWritable: true },
59
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
60
+ { pubkey: accounts.token, isSigner: false, isWritable: true },
61
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
62
+ { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
63
+ { pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
64
+ { pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
65
+ { pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
66
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
67
+ ]
68
+ const identifier = Buffer.from([0, 193, 58, 0, 59, 165, 12, 100])
69
+ const buffer = Buffer.alloc(1000)
70
+ const len = layout.encode(
71
+ {
72
+ deposit: types.RecoverDeposit.toEncodable(args.deposit),
73
+ burn: args.burn,
74
+ },
75
+ buffer
76
+ )
77
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
78
+ const ix = new TransactionInstruction({ keys, programId, data })
79
+ return ix
80
+ }
@@ -0,0 +1,43 @@
1
+ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ import { PROGRAM_ID } from "../programId"
6
+
7
+ export interface RegisterActivityArgs {
8
+ userActivityBump: number
9
+ }
10
+
11
+ export interface RegisterActivityAccounts {
12
+ userActivity: PublicKey
13
+ /** CHECK */
14
+ store: PublicKey
15
+ payer: PublicKey
16
+ systemProgram: PublicKey
17
+ }
18
+
19
+ export const layout = borsh.struct([borsh.u8("userActivityBump")])
20
+
21
+ export function registerActivity(
22
+ args: RegisterActivityArgs,
23
+ accounts: RegisterActivityAccounts,
24
+ programId: PublicKey = PROGRAM_ID
25
+ ) {
26
+ const keys: Array<AccountMeta> = [
27
+ { pubkey: accounts.userActivity, isSigner: false, isWritable: true },
28
+ { pubkey: accounts.store, isSigner: false, isWritable: false },
29
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
30
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
31
+ ]
32
+ const identifier = Buffer.from([79, 208, 220, 62, 162, 88, 1, 134])
33
+ const buffer = Buffer.alloc(1000)
34
+ const len = layout.encode(
35
+ {
36
+ userActivityBump: args.userActivityBump,
37
+ },
38
+ buffer
39
+ )
40
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
41
+ const ix = new TransactionInstruction({ keys, programId, data })
42
+ return ix
43
+ }
@@ -0,0 +1,63 @@
1
+ import {
2
+ TransactionInstruction,
3
+ PublicKey,
4
+ AccountMeta,
5
+ } from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars
6
+ import * as borsh from "@coral-xyz/borsh"; // eslint-disable-line @typescript-eslint/no-unused-vars
7
+ import { PROGRAM_ID } from "../programId";
8
+
9
+ export interface RegisterCollectorArgs {
10
+ creatorBump: number;
11
+ activityBump: number;
12
+ }
13
+
14
+ export interface RegisterCollectorAccounts {
15
+ collectorArtistRegistry: PublicKey;
16
+ collectorGlobalRegistry: PublicKey;
17
+ creatorRegistry: PublicKey;
18
+ userActivity: PublicKey;
19
+ store: PublicKey;
20
+ payer: PublicKey;
21
+ systemProgram: PublicKey;
22
+ }
23
+
24
+ export const layout = borsh.struct([
25
+ borsh.u8("creatorBump"),
26
+ borsh.u8("activityBump"),
27
+ ]);
28
+
29
+ export function registerCollector(
30
+ args: RegisterCollectorArgs,
31
+ accounts: RegisterCollectorAccounts,
32
+ programId: PublicKey = PROGRAM_ID
33
+ ) {
34
+ const keys: Array<AccountMeta> = [
35
+ {
36
+ pubkey: accounts.collectorArtistRegistry,
37
+ isSigner: false,
38
+ isWritable: true,
39
+ },
40
+ {
41
+ pubkey: accounts.collectorGlobalRegistry,
42
+ isSigner: false,
43
+ isWritable: true,
44
+ },
45
+ { pubkey: accounts.creatorRegistry, isSigner: false, isWritable: true },
46
+ { pubkey: accounts.userActivity, isSigner: false, isWritable: true },
47
+ { pubkey: accounts.store, isSigner: false, isWritable: true },
48
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
49
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
50
+ ];
51
+ const identifier = Buffer.from([105, 124, 61, 206, 8, 95, 112, 16]);
52
+ const buffer = Buffer.alloc(1000);
53
+ const len = layout.encode(
54
+ {
55
+ creatorBump: args.creatorBump,
56
+ activityBump: args.activityBump,
57
+ },
58
+ buffer
59
+ );
60
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
61
+ const ix = new TransactionInstruction({ keys, programId, data });
62
+ return ix;
63
+ }
@@ -0,0 +1,48 @@
1
+ import {
2
+ TransactionInstruction,
3
+ PublicKey,
4
+ AccountMeta,
5
+ } from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars
6
+ import * as borsh from "@coral-xyz/borsh"; // eslint-disable-line @typescript-eslint/no-unused-vars
7
+ import { PROGRAM_ID } from "../programId";
8
+
9
+ export interface RegisterCreatorArgs {
10
+ userActivityBump: number;
11
+ }
12
+
13
+ export interface RegisterCreatorAccounts {
14
+ creatorRegistry: PublicKey;
15
+ userActivity: PublicKey;
16
+ itemAccount: PublicKey;
17
+ store: PublicKey;
18
+ payer: PublicKey;
19
+ systemProgram: PublicKey;
20
+ }
21
+
22
+ export const layout = borsh.struct([borsh.u8("userActivityBump")]);
23
+
24
+ export function registerCreator(
25
+ args: RegisterCreatorArgs,
26
+ accounts: RegisterCreatorAccounts,
27
+ programId: PublicKey = PROGRAM_ID
28
+ ) {
29
+ const keys: Array<AccountMeta> = [
30
+ { pubkey: accounts.creatorRegistry, isSigner: false, isWritable: true },
31
+ { pubkey: accounts.userActivity, isSigner: false, isWritable: true },
32
+ { pubkey: accounts.itemAccount, isSigner: false, isWritable: false },
33
+ { pubkey: accounts.store, isSigner: false, isWritable: false },
34
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
35
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
36
+ ];
37
+ const identifier = Buffer.from([85, 3, 194, 210, 164, 140, 160, 195]);
38
+ const buffer = Buffer.alloc(1000);
39
+ const len = layout.encode(
40
+ {
41
+ userActivityBump: args.userActivityBump,
42
+ },
43
+ buffer
44
+ );
45
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
46
+ const ix = new TransactionInstruction({ keys, programId, data });
47
+ return ix;
48
+ }