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,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 CloseRegisterTraitsAccounts {
8
+ packAccount: PublicKey
9
+ packTraitsRegistry: PublicKey
10
+ payer: PublicKey
11
+ systemProgram: PublicKey
12
+ }
13
+
14
+ export function closeRegisterTraits(
15
+ accounts: CloseRegisterTraitsAccounts,
16
+ programId: PublicKey = PROGRAM_ID
17
+ ) {
18
+ const keys: Array<AccountMeta> = [
19
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
20
+ { pubkey: accounts.packTraitsRegistry, 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([54, 231, 126, 219, 139, 144, 251, 143])
25
+ const data = identifier
26
+ const ix = new TransactionInstruction({ keys, programId, data })
27
+ return ix
28
+ }
@@ -0,0 +1,56 @@
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 CreateCardArgs {
8
+ supply: number
9
+ index: number
10
+ metadata: types.MetadataArgsFields
11
+ }
12
+
13
+ export interface CreateCardAccounts {
14
+ packAccount: PublicKey
15
+ cardAccount: PublicKey
16
+ creatorAuthority: PublicKey
17
+ packContent: PublicKey
18
+ creator: PublicKey
19
+ payer: PublicKey
20
+ systemProgram: PublicKey
21
+ }
22
+
23
+ export const layout = borsh.struct([
24
+ borsh.u32("supply"),
25
+ borsh.u16("index"),
26
+ types.MetadataArgs.layout("metadata"),
27
+ ])
28
+
29
+ export function createCard(
30
+ args: CreateCardArgs,
31
+ accounts: CreateCardAccounts,
32
+ programId: PublicKey = PROGRAM_ID
33
+ ) {
34
+ const keys: Array<AccountMeta> = [
35
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
36
+ { pubkey: accounts.cardAccount, isSigner: false, isWritable: true },
37
+ { pubkey: accounts.creatorAuthority, isSigner: false, isWritable: true },
38
+ { pubkey: accounts.packContent, isSigner: false, isWritable: true },
39
+ { pubkey: accounts.creator, isSigner: false, isWritable: false },
40
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
41
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
42
+ ]
43
+ const identifier = Buffer.from([29, 242, 127, 8, 241, 109, 219, 100])
44
+ const buffer = Buffer.alloc(1000)
45
+ const len = layout.encode(
46
+ {
47
+ supply: args.supply,
48
+ index: args.index,
49
+ metadata: types.MetadataArgs.toEncodable(args.metadata),
50
+ },
51
+ buffer
52
+ )
53
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
54
+ const ix = new TransactionInstruction({ keys, programId, data })
55
+ return ix
56
+ }
@@ -0,0 +1,68 @@
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 CreateCollectionArgs {
8
+ tokenMetadata: types.TokenMetadataFields
9
+ }
10
+
11
+ export interface CreateCollectionAccounts {
12
+ creatorAuthority: PublicKey
13
+ metadata: PublicKey
14
+ edition: PublicKey
15
+ mint: PublicKey
16
+ tokenAccount: PublicKey
17
+ storeAccount: PublicKey
18
+ payer: PublicKey
19
+ tokenProgram: PublicKey
20
+ tokenMetadataProgram: PublicKey
21
+ associatedTokenProgram: PublicKey
22
+ rent: PublicKey
23
+ systemProgram: PublicKey
24
+ }
25
+
26
+ export const layout = borsh.struct([
27
+ types.TokenMetadata.layout("tokenMetadata"),
28
+ ])
29
+
30
+ export function createCollection(
31
+ args: CreateCollectionArgs,
32
+ accounts: CreateCollectionAccounts,
33
+ programId: PublicKey = PROGRAM_ID
34
+ ) {
35
+ const keys: Array<AccountMeta> = [
36
+ { pubkey: accounts.creatorAuthority, isSigner: false, isWritable: true },
37
+ { pubkey: accounts.metadata, isSigner: false, isWritable: true },
38
+ { pubkey: accounts.edition, isSigner: false, isWritable: true },
39
+ { pubkey: accounts.mint, isSigner: false, isWritable: true },
40
+ { pubkey: accounts.tokenAccount, isSigner: false, isWritable: true },
41
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: false },
42
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
43
+ { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
44
+ {
45
+ pubkey: accounts.tokenMetadataProgram,
46
+ isSigner: false,
47
+ isWritable: false,
48
+ },
49
+ {
50
+ pubkey: accounts.associatedTokenProgram,
51
+ isSigner: false,
52
+ isWritable: false,
53
+ },
54
+ { pubkey: accounts.rent, isSigner: false, isWritable: false },
55
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
56
+ ]
57
+ const identifier = Buffer.from([156, 251, 92, 54, 233, 2, 16, 82])
58
+ const buffer = Buffer.alloc(1000)
59
+ const len = layout.encode(
60
+ {
61
+ tokenMetadata: types.TokenMetadata.toEncodable(args.tokenMetadata),
62
+ },
63
+ buffer
64
+ )
65
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
66
+ const ix = new TransactionInstruction({ keys, programId, data })
67
+ return ix
68
+ }
@@ -0,0 +1,71 @@
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 CreatePackArgs {
8
+ metadata: types.MetadataArgsFields
9
+ saleConfig: types.SaleConfigFields
10
+ identifier: BN
11
+ category: Array<number>
12
+ superCategory: Array<number>
13
+ eventCategory: number
14
+ hashTraits: BN
15
+ packConfig: types.PackConfigFields
16
+ }
17
+
18
+ export interface CreatePackAccounts {
19
+ storeAccount: PublicKey
20
+ creatorAuthority: PublicKey
21
+ packAccount: PublicKey
22
+ packReserveList: PublicKey
23
+ creator: PublicKey
24
+ payer: PublicKey
25
+ systemProgram: PublicKey
26
+ }
27
+
28
+ export const layout = borsh.struct([
29
+ types.MetadataArgs.layout("metadata"),
30
+ types.SaleConfig.layout("saleConfig"),
31
+ borsh.u64("identifier"),
32
+ borsh.array(borsh.u16(), 3, "category"),
33
+ borsh.array(borsh.u8(), 2, "superCategory"),
34
+ borsh.u16("eventCategory"),
35
+ borsh.u64("hashTraits"),
36
+ types.PackConfig.layout("packConfig"),
37
+ ])
38
+
39
+ export function createPack(
40
+ args: CreatePackArgs,
41
+ accounts: CreatePackAccounts,
42
+ programId: PublicKey = PROGRAM_ID
43
+ ) {
44
+ const keys: Array<AccountMeta> = [
45
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
46
+ { pubkey: accounts.creatorAuthority, isSigner: false, isWritable: true },
47
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
48
+ { pubkey: accounts.packReserveList, isSigner: false, isWritable: true },
49
+ { pubkey: accounts.creator, isSigner: false, isWritable: false },
50
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
51
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
52
+ ]
53
+ const identifier = Buffer.from([44, 61, 245, 51, 98, 247, 57, 174])
54
+ const buffer = Buffer.alloc(1000)
55
+ const len = layout.encode(
56
+ {
57
+ metadata: types.MetadataArgs.toEncodable(args.metadata),
58
+ saleConfig: types.SaleConfig.toEncodable(args.saleConfig),
59
+ identifier: args.identifier,
60
+ category: args.category,
61
+ superCategory: args.superCategory,
62
+ eventCategory: args.eventCategory,
63
+ hashTraits: args.hashTraits,
64
+ packConfig: types.PackConfig.toEncodable(args.packConfig),
65
+ },
66
+ buffer
67
+ )
68
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
69
+ const ix = new TransactionInstruction({ keys, programId, data })
70
+ return ix
71
+ }
@@ -0,0 +1,71 @@
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 CreateSingleArgs {
8
+ supply: BN
9
+ shortMetadata: types.ShortMetadataArgsFields
10
+ saleConfig: types.SaleConfigFields
11
+ identifier: BN
12
+ category: Array<number>
13
+ superCategory: Array<number>
14
+ eventCategory: number
15
+ hashTraits: BN
16
+ }
17
+
18
+ export interface CreateSingleAccounts {
19
+ storeAccount: PublicKey
20
+ itemAccount: PublicKey
21
+ creatorAuthority: PublicKey
22
+ itemReserveList: PublicKey
23
+ creator: PublicKey
24
+ payer: PublicKey
25
+ systemProgram: PublicKey
26
+ }
27
+
28
+ export const layout = borsh.struct([
29
+ borsh.u64("supply"),
30
+ types.ShortMetadataArgs.layout("shortMetadata"),
31
+ types.SaleConfig.layout("saleConfig"),
32
+ borsh.u64("identifier"),
33
+ borsh.array(borsh.u16(), 3, "category"),
34
+ borsh.array(borsh.u8(), 2, "superCategory"),
35
+ borsh.u16("eventCategory"),
36
+ borsh.u64("hashTraits"),
37
+ ])
38
+
39
+ export function createSingle(
40
+ args: CreateSingleArgs,
41
+ accounts: CreateSingleAccounts,
42
+ programId: PublicKey = PROGRAM_ID
43
+ ) {
44
+ const keys: Array<AccountMeta> = [
45
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
46
+ { pubkey: accounts.itemAccount, isSigner: false, isWritable: true },
47
+ { pubkey: accounts.creatorAuthority, isSigner: false, isWritable: true },
48
+ { pubkey: accounts.itemReserveList, isSigner: false, isWritable: true },
49
+ { pubkey: accounts.creator, isSigner: false, isWritable: false },
50
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
51
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
52
+ ]
53
+ const identifier = Buffer.from([148, 238, 14, 208, 161, 59, 195, 11])
54
+ const buffer = Buffer.alloc(1000)
55
+ const len = layout.encode(
56
+ {
57
+ supply: args.supply,
58
+ shortMetadata: types.ShortMetadataArgs.toEncodable(args.shortMetadata),
59
+ saleConfig: types.SaleConfig.toEncodable(args.saleConfig),
60
+ identifier: args.identifier,
61
+ category: args.category,
62
+ superCategory: args.superCategory,
63
+ eventCategory: args.eventCategory,
64
+ hashTraits: args.hashTraits,
65
+ },
66
+ buffer
67
+ )
68
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
69
+ const ix = new TransactionInstruction({ keys, programId, data })
70
+ return ix
71
+ }
@@ -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 CreateStoreArgs {
8
+ name: string
9
+ storeConfig: types.StoreConfigFields
10
+ storeId: number
11
+ }
12
+
13
+ export interface CreateStoreAccounts {
14
+ holderAccount: PublicKey
15
+ storeAccount: PublicKey
16
+ creator: PublicKey
17
+ systemProgram: PublicKey
18
+ }
19
+
20
+ export const layout = borsh.struct([
21
+ borsh.str("name"),
22
+ types.StoreConfig.layout("storeConfig"),
23
+ borsh.u16("storeId"),
24
+ ])
25
+
26
+ export function createStore(
27
+ args: CreateStoreArgs,
28
+ accounts: CreateStoreAccounts,
29
+ programId: PublicKey = PROGRAM_ID
30
+ ) {
31
+ const keys: Array<AccountMeta> = [
32
+ { pubkey: accounts.holderAccount, isSigner: false, isWritable: true },
33
+ { pubkey: accounts.storeAccount, 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([132, 152, 9, 27, 112, 19, 95, 83])
38
+ const buffer = Buffer.alloc(1000)
39
+ const len = layout.encode(
40
+ {
41
+ name: args.name,
42
+ storeConfig: types.StoreConfig.toEncodable(args.storeConfig),
43
+ storeId: args.storeId,
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,82 @@
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 CreateTokenLauncherArgs {
8
+ price: BN
9
+ decimals: number
10
+ tokenMetadata: types.TokenMetadataFields
11
+ share: number
12
+ tokenType: types.TokenTypeKind
13
+ }
14
+
15
+ export interface CreateTokenLauncherAccounts {
16
+ tokenManager: PublicKey
17
+ metadata: PublicKey
18
+ mint: PublicKey
19
+ tokenAccount: PublicKey
20
+ storeTokenAccount: PublicKey
21
+ genericUser: PublicKey
22
+ storeAccount: PublicKey
23
+ payer: PublicKey
24
+ tokenProgram: PublicKey
25
+ associatedTokenProgram: PublicKey
26
+ tokenMetadataProgram: PublicKey
27
+ rent: PublicKey
28
+ systemProgram: PublicKey
29
+ }
30
+
31
+ export const layout = borsh.struct([
32
+ borsh.u64("price"),
33
+ borsh.u8("decimals"),
34
+ types.TokenMetadata.layout("tokenMetadata"),
35
+ borsh.u16("share"),
36
+ types.TokenType.layout("tokenType"),
37
+ ])
38
+
39
+ export function createTokenLauncher(
40
+ args: CreateTokenLauncherArgs,
41
+ accounts: CreateTokenLauncherAccounts,
42
+ programId: PublicKey = PROGRAM_ID
43
+ ) {
44
+ const keys: Array<AccountMeta> = [
45
+ { pubkey: accounts.tokenManager, isSigner: false, isWritable: true },
46
+ { pubkey: accounts.metadata, isSigner: false, isWritable: true },
47
+ { pubkey: accounts.mint, isSigner: false, isWritable: true },
48
+ { pubkey: accounts.tokenAccount, isSigner: false, isWritable: true },
49
+ { pubkey: accounts.storeTokenAccount, isSigner: false, isWritable: true },
50
+ { pubkey: accounts.genericUser, isSigner: false, isWritable: true },
51
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: false },
52
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
53
+ { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
54
+ {
55
+ pubkey: accounts.associatedTokenProgram,
56
+ isSigner: false,
57
+ isWritable: false,
58
+ },
59
+ {
60
+ pubkey: accounts.tokenMetadataProgram,
61
+ isSigner: false,
62
+ isWritable: false,
63
+ },
64
+ { pubkey: accounts.rent, isSigner: false, isWritable: false },
65
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
66
+ ]
67
+ const identifier = Buffer.from([190, 234, 150, 230, 47, 143, 184, 87])
68
+ const buffer = Buffer.alloc(1000)
69
+ const len = layout.encode(
70
+ {
71
+ price: args.price,
72
+ decimals: args.decimals,
73
+ tokenMetadata: types.TokenMetadata.toEncodable(args.tokenMetadata),
74
+ share: args.share,
75
+ tokenType: args.tokenType.toEncodable(),
76
+ },
77
+ buffer
78
+ )
79
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
80
+ const ix = new TransactionInstruction({ keys, programId, data })
81
+ return ix
82
+ }
@@ -0,0 +1,76 @@
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 CreateZeroCardArgs {
8
+ metadatas: Array<types.ShortMetadataFields>
9
+ bumps: Array<number>
10
+ extras: Array<number>
11
+ config: types.ZeroConfigFields | null
12
+ }
13
+
14
+ export interface CreateZeroCardAccounts {
15
+ packAccount: PublicKey
16
+ packTraits: PublicKey
17
+ merkleTree: PublicKey
18
+ merkleManager: PublicKey
19
+ packContent: PublicKey
20
+ treeAuthority: PublicKey
21
+ logWrapper: PublicKey
22
+ bubblegumProgram: PublicKey
23
+ compressionProgram: PublicKey
24
+ tokenMetadataProgram: PublicKey
25
+ payer: PublicKey
26
+ systemProgram: PublicKey
27
+ }
28
+
29
+ export const layout = borsh.struct([
30
+ borsh.vec(types.ShortMetadata.layout(), "metadatas"),
31
+ borsh.array(borsh.u8(), 6, "bumps"),
32
+ borsh.array(borsh.u8(), 3, "extras"),
33
+ borsh.option(types.ZeroConfig.layout(), "config"),
34
+ ])
35
+
36
+ export function createZeroCard(
37
+ args: CreateZeroCardArgs,
38
+ accounts: CreateZeroCardAccounts,
39
+ programId: PublicKey = PROGRAM_ID
40
+ ) {
41
+ const keys: Array<AccountMeta> = [
42
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
43
+ { pubkey: accounts.packTraits, isSigner: false, isWritable: true },
44
+ { pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
45
+ { pubkey: accounts.merkleManager, isSigner: false, isWritable: true },
46
+ { pubkey: accounts.packContent, isSigner: false, isWritable: true },
47
+ { pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
48
+ { pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
49
+ { pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
50
+ { pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
51
+ {
52
+ pubkey: accounts.tokenMetadataProgram,
53
+ isSigner: false,
54
+ isWritable: false,
55
+ },
56
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
57
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
58
+ ]
59
+ const identifier = Buffer.from([202, 18, 212, 68, 22, 33, 133, 66])
60
+ const buffer = Buffer.alloc(1000)
61
+ const len = layout.encode(
62
+ {
63
+ metadatas: args.metadatas.map((item) =>
64
+ types.ShortMetadata.toEncodable(item)
65
+ ),
66
+ bumps: args.bumps,
67
+ extras: args.extras,
68
+ config:
69
+ (args.config && types.ZeroConfig.toEncodable(args.config)) || null,
70
+ },
71
+ buffer
72
+ )
73
+ const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
74
+ const ix = new TransactionInstruction({ keys, programId, data })
75
+ return ix
76
+ }
@@ -0,0 +1,32 @@
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 DeleteCardAccounts {
8
+ packAccount: PublicKey
9
+ packContent: PublicKey
10
+ cardAccount: PublicKey
11
+ manager: PublicKey
12
+ payer: PublicKey
13
+ systemProgram: PublicKey
14
+ }
15
+
16
+ export function deleteCard(
17
+ accounts: DeleteCardAccounts,
18
+ programId: PublicKey = PROGRAM_ID
19
+ ) {
20
+ const keys: Array<AccountMeta> = [
21
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
22
+ { pubkey: accounts.packContent, isSigner: false, isWritable: true },
23
+ { pubkey: accounts.cardAccount, isSigner: false, isWritable: true },
24
+ { pubkey: accounts.manager, isSigner: false, isWritable: true },
25
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
26
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
27
+ ]
28
+ const identifier = Buffer.from([199, 58, 181, 228, 23, 155, 200, 173])
29
+ const data = identifier
30
+ const ix = new TransactionInstruction({ keys, programId, data })
31
+ return ix
32
+ }
@@ -0,0 +1,40 @@
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 DeletePackAccounts {
8
+ storeAccount: PublicKey
9
+ packAccount: PublicKey
10
+ packContent: PublicKey
11
+ packTraits: PublicKey
12
+ itemReserveList: PublicKey
13
+ archiveDeposit: PublicKey
14
+ creatorRegistry: PublicKey
15
+ manager: PublicKey
16
+ payer: PublicKey
17
+ systemProgram: PublicKey
18
+ }
19
+
20
+ export function deletePack(
21
+ accounts: DeletePackAccounts,
22
+ programId: PublicKey = PROGRAM_ID
23
+ ) {
24
+ const keys: Array<AccountMeta> = [
25
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
26
+ { pubkey: accounts.packAccount, isSigner: false, isWritable: true },
27
+ { pubkey: accounts.packContent, isSigner: false, isWritable: true },
28
+ { pubkey: accounts.packTraits, isSigner: false, isWritable: true },
29
+ { pubkey: accounts.itemReserveList, isSigner: false, isWritable: true },
30
+ { pubkey: accounts.archiveDeposit, isSigner: false, isWritable: true },
31
+ { pubkey: accounts.creatorRegistry, isSigner: false, isWritable: true },
32
+ { pubkey: accounts.manager, isSigner: false, isWritable: false },
33
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
34
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
35
+ ]
36
+ const identifier = Buffer.from([201, 182, 234, 209, 161, 107, 194, 55])
37
+ const data = identifier
38
+ const ix = new TransactionInstruction({ keys, programId, data })
39
+ return ix
40
+ }
@@ -0,0 +1,36 @@
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 DeleteSingleAccounts {
8
+ storeAccount: PublicKey
9
+ itemAccount: PublicKey
10
+ itemReserveList: PublicKey
11
+ archiveDeposit: PublicKey
12
+ creatorRegistry: PublicKey
13
+ manager: PublicKey
14
+ payer: PublicKey
15
+ systemProgram: PublicKey
16
+ }
17
+
18
+ export function deleteSingle(
19
+ accounts: DeleteSingleAccounts,
20
+ programId: PublicKey = PROGRAM_ID
21
+ ) {
22
+ const keys: Array<AccountMeta> = [
23
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
24
+ { pubkey: accounts.itemAccount, isSigner: false, isWritable: true },
25
+ { pubkey: accounts.itemReserveList, isSigner: false, isWritable: true },
26
+ { pubkey: accounts.archiveDeposit, isSigner: false, isWritable: true },
27
+ { pubkey: accounts.creatorRegistry, isSigner: false, isWritable: true },
28
+ { pubkey: accounts.manager, 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([232, 115, 78, 51, 158, 23, 191, 54])
33
+ const data = identifier
34
+ const ix = new TransactionInstruction({ keys, programId, data })
35
+ return ix
36
+ }
@@ -0,0 +1,38 @@
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 DeleteTokenLauncherAccounts {
8
+ tokenManager: PublicKey
9
+ mint: PublicKey
10
+ storeAccount: PublicKey
11
+ payer: PublicKey
12
+ tokenProgram: PublicKey
13
+ tokenMetadataProgram: PublicKey
14
+ systemProgram: PublicKey
15
+ }
16
+
17
+ export function deleteTokenLauncher(
18
+ accounts: DeleteTokenLauncherAccounts,
19
+ programId: PublicKey = PROGRAM_ID
20
+ ) {
21
+ const keys: Array<AccountMeta> = [
22
+ { pubkey: accounts.tokenManager, isSigner: false, isWritable: true },
23
+ { pubkey: accounts.mint, isSigner: false, isWritable: false },
24
+ { pubkey: accounts.storeAccount, isSigner: false, isWritable: false },
25
+ { pubkey: accounts.payer, isSigner: true, isWritable: true },
26
+ { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
27
+ {
28
+ pubkey: accounts.tokenMetadataProgram,
29
+ isSigner: false,
30
+ isWritable: false,
31
+ },
32
+ { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
33
+ ]
34
+ const identifier = Buffer.from([103, 202, 101, 237, 114, 9, 41, 221])
35
+ const data = identifier
36
+ const ix = new TransactionInstruction({ keys, programId, data })
37
+ return ix
38
+ }