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,55 @@
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 DepositBurnArgs {
8
+ deposit: types.DepositFields
9
+ }
10
+
11
+ export interface DepositBurnAccounts {
12
+ newBurnDeposit: PublicKey
13
+ existingBurnDeposit: PublicKey
14
+ /** CHECK */
15
+ artistBurnTrack: PublicKey
16
+ /** CHECK */
17
+ globalBurnTrack: PublicKey
18
+ itemAccount: PublicKey
19
+ packAccount: PublicKey
20
+ /** CHECK */
21
+ metadataAccount: PublicKey
22
+ owner: PublicKey
23
+ systemProgram: PublicKey
24
+ }
25
+
26
+ export const layout = borsh.struct([types.Deposit.layout("deposit")])
27
+
28
+ export function depositBurn(
29
+ args: DepositBurnArgs,
30
+ accounts: DepositBurnAccounts,
31
+ programId: PublicKey = PROGRAM_ID
32
+ ) {
33
+ const keys: Array<AccountMeta> = [
34
+ { pubkey: accounts.newBurnDeposit, isSigner: false, isWritable: true },
35
+ { pubkey: accounts.existingBurnDeposit, isSigner: false, isWritable: true },
36
+ { pubkey: accounts.artistBurnTrack, isSigner: false, isWritable: true },
37
+ { pubkey: accounts.globalBurnTrack, isSigner: false, isWritable: true },
38
+ { pubkey: accounts.itemAccount, isSigner: false, isWritable: false },
39
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: false },
40
+ { pubkey: accounts.metadataAccount, isSigner: false, isWritable: false },
41
+ { pubkey: accounts.owner, isSigner: true, isWritable: true },
42
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
43
+ ]
44
+ const identifier = Buffer.from([76, 167, 230, 117, 107, 157, 228, 236])
45
+ const buffer = Buffer.alloc(1000)
46
+ const len = layout.encode(
47
+ {
48
+ deposit: types.Deposit.toEncodable(args.deposit),
49
+ },
50
+ buffer
51
+ )
52
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
53
+ const ix = new TransactionInstruction({ keys, programId, data })
54
+ return ix
55
+ }
@@ -0,0 +1,84 @@
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 DonateUserArgs {
8
+ epoch: number
9
+ amount: BN
10
+ message: string
11
+ previousRecord: types.PreviousDonationRecordFields | null
12
+ }
13
+
14
+ export interface DonateUserAccounts {
15
+ donationRegistryNew: PublicKey
16
+ donationRegistryOld: PublicKey
17
+ donationRecord: PublicKey
18
+ currency: PublicKey
19
+ receiver: PublicKey
20
+ userActivity: PublicKey
21
+ storeAccount: PublicKey
22
+ payer: PublicKey
23
+ merkleTree: PublicKey
24
+ treeAuthority: PublicKey
25
+ merkleManager: PublicKey
26
+ logWrapper: PublicKey
27
+ bubblegumProgram: PublicKey
28
+ compressionProgram: PublicKey
29
+ tokenMetadataProgram: PublicKey
30
+ systemProgram: PublicKey
31
+ }
32
+
33
+ export const layout = borsh.struct([
34
+ borsh.u32("epoch"),
35
+ borsh.u64("amount"),
36
+ borsh.str("message"),
37
+ borsh.option(types.PreviousDonationRecord.layout(), "previousRecord"),
38
+ ])
39
+
40
+ export function donateUser(
41
+ args: DonateUserArgs,
42
+ accounts: DonateUserAccounts,
43
+ programId: PublicKey = PROGRAM_ID
44
+ ) {
45
+ const keys: Array<AccountMeta> = [
46
+ { pubkey: accounts.donationRegistryNew, isSigner: false, isWritable: true },
47
+ { pubkey: accounts.donationRegistryOld, isSigner: false, isWritable: true },
48
+ { pubkey: accounts.donationRecord, isSigner: false, isWritable: true },
49
+ { pubkey: accounts.currency, isSigner: false, isWritable: false },
50
+ { pubkey: accounts.receiver, isSigner: false, isWritable: true },
51
+ { pubkey: accounts.userActivity, isSigner: false, isWritable: true },
52
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: false },
53
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
54
+ { pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
55
+ { pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
56
+ { pubkey: accounts.merkleManager, isSigner: false, isWritable: false },
57
+ { pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
58
+ { pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
59
+ { pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
60
+ {
61
+ pubkey: accounts.tokenMetadataProgram,
62
+ isSigner: false,
63
+ isWritable: false,
64
+ },
65
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
66
+ ]
67
+ const identifier = Buffer.from([223, 130, 137, 211, 80, 182, 163, 3])
68
+ const buffer = Buffer.alloc(1000)
69
+ const len = layout.encode(
70
+ {
71
+ epoch: args.epoch,
72
+ amount: args.amount,
73
+ message: args.message,
74
+ previousRecord:
75
+ (args.previousRecord &&
76
+ types.PreviousDonationRecord.toEncodable(args.previousRecord)) ||
77
+ null,
78
+ },
79
+ buffer
80
+ )
81
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
82
+ const ix = new TransactionInstruction({ keys, programId, data })
83
+ return ix
84
+ }
@@ -0,0 +1,61 @@
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 FeedPoolArgs {
8
+ name: string
9
+ amount: BN
10
+ decimals: number
11
+ withdraw: number
12
+ }
13
+
14
+ export interface FeedPoolAccounts {
15
+ poolVault: PublicKey
16
+ currency: PublicKey
17
+ fromAta: PublicKey
18
+ toAta: PublicKey
19
+ storeAccount: PublicKey
20
+ payer: PublicKey
21
+ tokenProgram: PublicKey
22
+ systemProgram: PublicKey
23
+ }
24
+
25
+ export const layout = borsh.struct([
26
+ borsh.str("name"),
27
+ borsh.u64("amount"),
28
+ borsh.u8("decimals"),
29
+ borsh.u8("withdraw"),
30
+ ])
31
+
32
+ export function feedPool(
33
+ args: FeedPoolArgs,
34
+ accounts: FeedPoolAccounts,
35
+ programId: PublicKey = PROGRAM_ID
36
+ ) {
37
+ const keys: Array<AccountMeta> = [
38
+ { pubkey: accounts.poolVault, isSigner: false, isWritable: true },
39
+ { pubkey: accounts.currency, isSigner: false, isWritable: false },
40
+ { pubkey: accounts.fromAta, isSigner: false, isWritable: true },
41
+ { pubkey: accounts.toAta, isSigner: false, isWritable: true },
42
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: false },
43
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
44
+ { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
45
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
46
+ ]
47
+ const identifier = Buffer.from([209, 238, 252, 180, 229, 87, 69, 160])
48
+ const buffer = Buffer.alloc(1000)
49
+ const len = layout.encode(
50
+ {
51
+ name: args.name,
52
+ amount: args.amount,
53
+ decimals: args.decimals,
54
+ withdraw: args.withdraw,
55
+ },
56
+ buffer
57
+ )
58
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
59
+ const ix = new TransactionInstruction({ keys, programId, data })
60
+ return ix
61
+ }
@@ -0,0 +1,44 @@
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 FeedTraitsArgs {
8
+ traits: types.FeedingTraitsFields
9
+ }
10
+
11
+ export interface FeedTraitsAccounts {
12
+ packAccount: PublicKey
13
+ packTraits: PublicKey
14
+ packTraitsRegistry: PublicKey
15
+ payer: PublicKey
16
+ systemProgram: PublicKey
17
+ }
18
+
19
+ export const layout = borsh.struct([types.FeedingTraits.layout("traits")])
20
+
21
+ export function feedTraits(
22
+ args: FeedTraitsArgs,
23
+ accounts: FeedTraitsAccounts,
24
+ programId: PublicKey = PROGRAM_ID
25
+ ) {
26
+ const keys: Array<AccountMeta> = [
27
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
28
+ { pubkey: accounts.packTraits, isSigner: false, isWritable: true },
29
+ { pubkey: accounts.packTraitsRegistry, isSigner: false, isWritable: true },
30
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
31
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
32
+ ]
33
+ const identifier = Buffer.from([105, 113, 240, 80, 105, 198, 78, 164])
34
+ const buffer = Buffer.alloc(1000)
35
+ const len = layout.encode(
36
+ {
37
+ traits: types.FeedingTraits.toEncodable(args.traits),
38
+ },
39
+ buffer
40
+ )
41
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
42
+ const ix = new TransactionInstruction({ keys, programId, data })
43
+ return ix
44
+ }
@@ -0,0 +1,63 @@
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 FeedTreeArgs {
8
+ managerBump: number
9
+ maxDepth: number
10
+ maxBufferSize: number
11
+ public: boolean | null
12
+ }
13
+
14
+ export interface FeedTreeAccounts {
15
+ merkleAccount: PublicKey
16
+ merkleManager: PublicKey
17
+ lutAccount: PublicKey
18
+ treeAuthority: PublicKey
19
+ logWrapper: PublicKey
20
+ bubblegumProgram: PublicKey
21
+ compressionProgram: PublicKey
22
+ payer: PublicKey
23
+ systemProgram: PublicKey
24
+ }
25
+
26
+ export const layout = borsh.struct([
27
+ borsh.u8("managerBump"),
28
+ borsh.u32("maxDepth"),
29
+ borsh.u32("maxBufferSize"),
30
+ borsh.option(borsh.bool(), "public"),
31
+ ])
32
+
33
+ export function feedTree(
34
+ args: FeedTreeArgs,
35
+ accounts: FeedTreeAccounts,
36
+ programId: PublicKey = PROGRAM_ID
37
+ ) {
38
+ const keys: Array<AccountMeta> = [
39
+ { pubkey: accounts.merkleAccount, isSigner: false, isWritable: true },
40
+ { pubkey: accounts.merkleManager, isSigner: false, isWritable: true },
41
+ { pubkey: accounts.lutAccount, isSigner: false, isWritable: false },
42
+ { pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
43
+ { pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
44
+ { pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
45
+ { pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
46
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
47
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
48
+ ]
49
+ const identifier = Buffer.from([51, 38, 94, 153, 131, 98, 81, 20])
50
+ const buffer = Buffer.alloc(1000)
51
+ const len = layout.encode(
52
+ {
53
+ managerBump: args.managerBump,
54
+ maxDepth: args.maxDepth,
55
+ maxBufferSize: args.maxBufferSize,
56
+ public: args.public,
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,50 @@
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 FlagPackArgs {
8
+ globalState: types.GlobalStateKind | null
9
+ state: types.ItemStateKind | null
10
+ serverless: number | null
11
+ }
12
+
13
+ export interface FlagPackAccounts {
14
+ storeAccount: PublicKey
15
+ packAccount: PublicKey
16
+ creator: PublicKey
17
+ systemProgram: PublicKey
18
+ }
19
+
20
+ export const layout = borsh.struct([
21
+ borsh.option(types.GlobalState.layout(), "globalState"),
22
+ borsh.option(types.ItemState.layout(), "state"),
23
+ borsh.option(borsh.u8(), "serverless"),
24
+ ])
25
+
26
+ export function flagPack(
27
+ args: FlagPackArgs,
28
+ accounts: FlagPackAccounts,
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.creator, isSigner: true, isWritable: true },
35
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
36
+ ]
37
+ const identifier = Buffer.from([239, 234, 126, 90, 79, 52, 91, 71])
38
+ const buffer = Buffer.alloc(1000)
39
+ const len = layout.encode(
40
+ {
41
+ globalState: (args.globalState && args.globalState.toEncodable()) || null,
42
+ state: (args.state && args.state.toEncodable()) || null,
43
+ serverless: args.serverless,
44
+ },
45
+ buffer
46
+ )
47
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
48
+ const ix = new TransactionInstruction({ keys, programId, data })
49
+ return ix
50
+ }
@@ -0,0 +1,47 @@
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 FlagSingleArgs {
8
+ globalState: types.GlobalStateKind
9
+ state: types.ItemStateKind
10
+ }
11
+
12
+ export interface FlagSingleAccounts {
13
+ storeAccount: PublicKey
14
+ itemAccount: PublicKey
15
+ creator: PublicKey
16
+ systemProgram: PublicKey
17
+ }
18
+
19
+ export const layout = borsh.struct([
20
+ types.GlobalState.layout("globalState"),
21
+ types.ItemState.layout("state"),
22
+ ])
23
+
24
+ export function flagSingle(
25
+ args: FlagSingleArgs,
26
+ accounts: FlagSingleAccounts,
27
+ programId: PublicKey = PROGRAM_ID
28
+ ) {
29
+ const keys: Array<AccountMeta> = [
30
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: false },
31
+ { pubkey: accounts.itemAccount, isSigner: false, isWritable: true },
32
+ { pubkey: accounts.creator, isSigner: true, isWritable: true },
33
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
34
+ ]
35
+ const identifier = Buffer.from([8, 218, 103, 215, 236, 37, 163, 190])
36
+ const buffer = Buffer.alloc(1000)
37
+ const len = layout.encode(
38
+ {
39
+ globalState: args.globalState.toEncodable(),
40
+ state: args.state.toEncodable(),
41
+ },
42
+ buffer
43
+ )
44
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
45
+ const ix = new TransactionInstruction({ keys, programId, data })
46
+ return ix
47
+ }
@@ -0,0 +1,59 @@
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 GatePayArgs {
8
+ index: number
9
+ metadata: types.MetadataArgsFields
10
+ }
11
+
12
+ export interface GatePayAccounts {
13
+ paymentAccount: PublicKey
14
+ itemAccount: PublicKey
15
+ packAccount: PublicKey
16
+ holderAccount: PublicKey
17
+ /** CHECK */
18
+ merkleTree: PublicKey
19
+ /** CHECK */
20
+ owner: PublicKey
21
+ payer: PublicKey
22
+ bubblegumProgram: PublicKey
23
+ systemProgram: PublicKey
24
+ }
25
+
26
+ export const layout = borsh.struct([
27
+ borsh.u32("index"),
28
+ types.MetadataArgs.layout("metadata"),
29
+ ])
30
+
31
+ export function gatePay(
32
+ args: GatePayArgs,
33
+ accounts: GatePayAccounts,
34
+ programId: PublicKey = PROGRAM_ID
35
+ ) {
36
+ const keys: Array<AccountMeta> = [
37
+ { pubkey: accounts.paymentAccount, isSigner: false, isWritable: true },
38
+ { pubkey: accounts.itemAccount, isSigner: false, isWritable: false },
39
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: false },
40
+ { pubkey: accounts.holderAccount, isSigner: false, isWritable: false },
41
+ { pubkey: accounts.merkleTree, isSigner: false, isWritable: false },
42
+ { pubkey: accounts.owner, isSigner: false, isWritable: false },
43
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
44
+ { pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
45
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
46
+ ]
47
+ const identifier = Buffer.from([10, 221, 234, 101, 181, 180, 75, 191])
48
+ const buffer = Buffer.alloc(1000)
49
+ const len = layout.encode(
50
+ {
51
+ index: args.index,
52
+ metadata: types.MetadataArgs.toEncodable(args.metadata),
53
+ },
54
+ buffer
55
+ )
56
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
57
+ const ix = new TransactionInstruction({ keys, programId, data })
58
+ return ix
59
+ }
@@ -0,0 +1,140 @@
1
+ export { initialize } from "./initialize"
2
+ export type { InitializeArgs, InitializeAccounts } from "./initialize"
3
+ export { createCollection } from "./createCollection"
4
+ export type {
5
+ CreateCollectionArgs,
6
+ CreateCollectionAccounts,
7
+ } from "./createCollection"
8
+ export { deleteTokenLauncher } from "./deleteTokenLauncher"
9
+ export type { DeleteTokenLauncherAccounts } from "./deleteTokenLauncher"
10
+ export { buyToken } from "./buyToken"
11
+ export type { BuyTokenArgs, BuyTokenAccounts } from "./buyToken"
12
+ export { createTokenLauncher } from "./createTokenLauncher"
13
+ export type {
14
+ CreateTokenLauncherArgs,
15
+ CreateTokenLauncherAccounts,
16
+ } from "./createTokenLauncher"
17
+ export { registerGenericUser } from "./registerGenericUser"
18
+ export type {
19
+ RegisterGenericUserArgs,
20
+ RegisterGenericUserAccounts,
21
+ } from "./registerGenericUser"
22
+ export { registerUser } from "./registerUser"
23
+ export type { RegisterUserArgs, RegisterUserAccounts } from "./registerUser"
24
+ export { createStore } from "./createStore"
25
+ export type { CreateStoreArgs, CreateStoreAccounts } from "./createStore"
26
+ export { updatePack } from "./updatePack"
27
+ export type { UpdatePackArgs, UpdatePackAccounts } from "./updatePack"
28
+ export { updateStore } from "./updateStore"
29
+ export type { UpdateStoreArgs, UpdateStoreAccounts } from "./updateStore"
30
+ export { prepareCreator } from "./prepareCreator"
31
+ export type { PrepareCreatorAccounts } from "./prepareCreator"
32
+ export { prepareTraits } from "./prepareTraits"
33
+ export type { PrepareTraitsAccounts } from "./prepareTraits"
34
+ export { preparePack } from "./preparePack"
35
+ export type { PreparePackArgs, PreparePackAccounts } from "./preparePack"
36
+ export { createPack } from "./createPack"
37
+ export type { CreatePackArgs, CreatePackAccounts } from "./createPack"
38
+ export { flagPack } from "./flagPack"
39
+ export type { FlagPackArgs, FlagPackAccounts } from "./flagPack"
40
+ export { flagSingle } from "./flagSingle"
41
+ export type { FlagSingleArgs, FlagSingleAccounts } from "./flagSingle"
42
+ export { updateSingle } from "./updateSingle"
43
+ export type { UpdateSingleArgs, UpdateSingleAccounts } from "./updateSingle"
44
+ export { updateCard } from "./updateCard"
45
+ export type { UpdateCardArgs, UpdateCardAccounts } from "./updateCard"
46
+ export { createCard } from "./createCard"
47
+ export type { CreateCardArgs, CreateCardAccounts } from "./createCard"
48
+ export { storeLutFor } from "./storeLutFor"
49
+ export type { StoreLutForArgs, StoreLutForAccounts } from "./storeLutFor"
50
+ export { assignPackDelegate } from "./assignPackDelegate"
51
+ export type { AssignPackDelegateAccounts } from "./assignPackDelegate"
52
+ export { createZeroCard } from "./createZeroCard"
53
+ export type {
54
+ CreateZeroCardArgs,
55
+ CreateZeroCardAccounts,
56
+ } from "./createZeroCard"
57
+ export { createSingle } from "./createSingle"
58
+ export type { CreateSingleArgs, CreateSingleAccounts } from "./createSingle"
59
+ export { deleteSingle } from "./deleteSingle"
60
+ export type { DeleteSingleAccounts } from "./deleteSingle"
61
+ export { archiveItem } from "./archiveItem"
62
+ export type { ArchiveItemArgs, ArchiveItemAccounts } from "./archiveItem"
63
+ export { buyPack } from "./buyPack"
64
+ export type { BuyPackArgs, BuyPackAccounts } from "./buyPack"
65
+ export { gatePay } from "./gatePay"
66
+ export type { GatePayArgs, GatePayAccounts } from "./gatePay"
67
+ export { closeDepositBurn } from "./closeDepositBurn"
68
+ export type {
69
+ CloseDepositBurnArgs,
70
+ CloseDepositBurnAccounts,
71
+ } from "./closeDepositBurn"
72
+ export { unwrapAndDestroy } from "./unwrapAndDestroy"
73
+ export type {
74
+ UnwrapAndDestroyArgs,
75
+ UnwrapAndDestroyAccounts,
76
+ } from "./unwrapAndDestroy"
77
+ export { buyPay } from "./buyPay"
78
+ export type { BuyPayArgs, BuyPayAccounts } from "./buyPay"
79
+ export { addBurn } from "./addBurn"
80
+ export type { AddBurnArgs, AddBurnAccounts } from "./addBurn"
81
+ export { burnPay } from "./burnPay"
82
+ export type { BurnPayArgs, BurnPayAccounts } from "./burnPay"
83
+ export { openPack } from "./openPack"
84
+ export type { OpenPackArgs, OpenPackAccounts } from "./openPack"
85
+ export { deletePack } from "./deletePack"
86
+ export type { DeletePackAccounts } from "./deletePack"
87
+ export { deleteCard } from "./deleteCard"
88
+ export type { DeleteCardAccounts } from "./deleteCard"
89
+ export { claimZeroCard } from "./claimZeroCard"
90
+ export type { ClaimZeroCardArgs, ClaimZeroCardAccounts } from "./claimZeroCard"
91
+ export { withdrawFromStore } from "./withdrawFromStore"
92
+ export type { WithdrawFromStoreAccounts } from "./withdrawFromStore"
93
+ export { registerTraits } from "./registerTraits"
94
+ export type {
95
+ RegisterTraitsArgs,
96
+ RegisterTraitsAccounts,
97
+ } from "./registerTraits"
98
+ export { closeRegisterTraits } from "./closeRegisterTraits"
99
+ export type { CloseRegisterTraitsAccounts } from "./closeRegisterTraits"
100
+ export { feedTraits } from "./feedTraits"
101
+ export type { FeedTraitsArgs, FeedTraitsAccounts } from "./feedTraits"
102
+ export { registerCreator } from "./registerCreator"
103
+ export type {
104
+ RegisterCreatorArgs,
105
+ RegisterCreatorAccounts,
106
+ } from "./registerCreator"
107
+ export { feedPool } from "./feedPool"
108
+ export type { FeedPoolArgs, FeedPoolAccounts } from "./feedPool"
109
+ export { donateUser } from "./donateUser"
110
+ export type { DonateUserArgs, DonateUserAccounts } from "./donateUser"
111
+ export { registerCollector } from "./registerCollector"
112
+ export type {
113
+ RegisterCollectorArgs,
114
+ RegisterCollectorAccounts,
115
+ } from "./registerCollector"
116
+ export { registerActivity } from "./registerActivity"
117
+ export type {
118
+ RegisterActivityArgs,
119
+ RegisterActivityAccounts,
120
+ } from "./registerActivity"
121
+ export { registerPackUploads } from "./registerPackUploads"
122
+ export type {
123
+ RegisterPackUploadsArgs,
124
+ RegisterPackUploadsAccounts,
125
+ } from "./registerPackUploads"
126
+ export { printPack } from "./printPack"
127
+ export type { PrintPackArgs, PrintPackAccounts } from "./printPack"
128
+ export { recoverDepositBurn } from "./recoverDepositBurn"
129
+ export type {
130
+ RecoverDepositBurnArgs,
131
+ RecoverDepositBurnAccounts,
132
+ } from "./recoverDepositBurn"
133
+ export { adjustDepositBurn } from "./adjustDepositBurn"
134
+ export type { AdjustDepositBurnAccounts } from "./adjustDepositBurn"
135
+ export { depositBurn } from "./depositBurn"
136
+ export type { DepositBurnArgs, DepositBurnAccounts } from "./depositBurn"
137
+ export { printSingle } from "./printSingle"
138
+ export type { PrintSingleArgs, PrintSingleAccounts } from "./printSingle"
139
+ export { feedTree } from "./feedTree"
140
+ export type { FeedTreeArgs, FeedTreeAccounts } from "./feedTree"
@@ -0,0 +1,46 @@
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 InitializeArgs {
8
+ slot: BN
9
+ globalFee: types.GlobalFeeFields | null
10
+ }
11
+
12
+ export interface InitializeAccounts {
13
+ holderAccount: PublicKey
14
+ creator: PublicKey
15
+ systemProgram: PublicKey
16
+ }
17
+
18
+ export const layout = borsh.struct([
19
+ borsh.u64("slot"),
20
+ borsh.option(types.GlobalFee.layout(), "globalFee"),
21
+ ])
22
+
23
+ export function initialize(
24
+ args: InitializeArgs,
25
+ accounts: InitializeAccounts,
26
+ programId: PublicKey = PROGRAM_ID
27
+ ) {
28
+ const keys: Array<AccountMeta> = [
29
+ { pubkey: accounts.holderAccount, isSigner: false, isWritable: true },
30
+ { pubkey: accounts.creator, isSigner: true, isWritable: true },
31
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
32
+ ]
33
+ const identifier = Buffer.from([175, 175, 109, 31, 13, 152, 155, 237])
34
+ const buffer = Buffer.alloc(1000)
35
+ const len = layout.encode(
36
+ {
37
+ slot: args.slot,
38
+ globalFee:
39
+ (args.globalFee && types.GlobalFee.toEncodable(args.globalFee)) || null,
40
+ },
41
+ buffer
42
+ )
43
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
44
+ const ix = new TransactionInstruction({ keys, programId, data })
45
+ return ix
46
+ }