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,53 @@
1
+ import { PublicKey } 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 types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
+
6
+ export interface ListingPerWalletArgsFields {
7
+ amount: number
8
+ }
9
+
10
+ export interface ListingPerWalletArgsJSON {
11
+ amount: number
12
+ }
13
+
14
+ export class ListingPerWalletArgs {
15
+ readonly amount: number
16
+
17
+ constructor(fields: ListingPerWalletArgsFields) {
18
+ this.amount = fields.amount
19
+ }
20
+
21
+ static layout(property?: string) {
22
+ return borsh.struct([borsh.u16("amount")], property)
23
+ }
24
+
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ static fromDecoded(obj: any) {
27
+ return new ListingPerWalletArgs({
28
+ amount: obj.amount,
29
+ })
30
+ }
31
+
32
+ static toEncodable(fields: ListingPerWalletArgsFields) {
33
+ return {
34
+ amount: fields.amount,
35
+ }
36
+ }
37
+
38
+ toJSON(): ListingPerWalletArgsJSON {
39
+ return {
40
+ amount: this.amount,
41
+ }
42
+ }
43
+
44
+ static fromJSON(obj: ListingPerWalletArgsJSON): ListingPerWalletArgs {
45
+ return new ListingPerWalletArgs({
46
+ amount: obj.amount,
47
+ })
48
+ }
49
+
50
+ toEncodable() {
51
+ return ListingPerWalletArgs.toEncodable(this)
52
+ }
53
+ }
@@ -0,0 +1,64 @@
1
+ import { PublicKey } 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 types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
+
6
+ export interface MemeVaultProofFields {
7
+ amount: BN
8
+ halfCurrencyHash: number
9
+ }
10
+
11
+ export interface MemeVaultProofJSON {
12
+ amount: string
13
+ halfCurrencyHash: number
14
+ }
15
+
16
+ export class MemeVaultProof {
17
+ readonly amount: BN
18
+ readonly halfCurrencyHash: number
19
+
20
+ constructor(fields: MemeVaultProofFields) {
21
+ this.amount = fields.amount
22
+ this.halfCurrencyHash = fields.halfCurrencyHash
23
+ }
24
+
25
+ static layout(property?: string) {
26
+ return borsh.struct(
27
+ [borsh.u64("amount"), borsh.u32("halfCurrencyHash")],
28
+ property
29
+ )
30
+ }
31
+
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ static fromDecoded(obj: any) {
34
+ return new MemeVaultProof({
35
+ amount: obj.amount,
36
+ halfCurrencyHash: obj.halfCurrencyHash,
37
+ })
38
+ }
39
+
40
+ static toEncodable(fields: MemeVaultProofFields) {
41
+ return {
42
+ amount: fields.amount,
43
+ halfCurrencyHash: fields.halfCurrencyHash,
44
+ }
45
+ }
46
+
47
+ toJSON(): MemeVaultProofJSON {
48
+ return {
49
+ amount: this.amount.toString(),
50
+ halfCurrencyHash: this.halfCurrencyHash,
51
+ }
52
+ }
53
+
54
+ static fromJSON(obj: MemeVaultProofJSON): MemeVaultProof {
55
+ return new MemeVaultProof({
56
+ amount: new BN(obj.amount),
57
+ halfCurrencyHash: obj.halfCurrencyHash,
58
+ })
59
+ }
60
+
61
+ toEncodable() {
62
+ return MemeVaultProof.toEncodable(this)
63
+ }
64
+ }
@@ -0,0 +1,207 @@
1
+ import { PublicKey } 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 types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
+
6
+ export interface MetadataArgsFields {
7
+ /** The name of the asset */
8
+ name: string
9
+ /** The symbol for the asset */
10
+ symbol: string
11
+ /** URI pointing to JSON representing the asset */
12
+ uri: string
13
+ /** Royalty basis points that goes to creators in secondary sales (0-10000) */
14
+ sellerFeeBasisPoints: number
15
+ primarySaleHappened: boolean
16
+ isMutable: boolean
17
+ /** nonce for easy calculation of editions, if present */
18
+ editionNonce: number | null
19
+ /** Since we cannot easily change Metadata, we add the new DataV2 fields here at the end. */
20
+ tokenStandard: types.TokenStandardKind | null
21
+ /** Collection */
22
+ collection: types.CollectionFields | null
23
+ /** Uses */
24
+ uses: types.UsesFields | null
25
+ tokenProgramVersion: types.TokenProgramVersionKind
26
+ creators: Array<types.CreatorFields>
27
+ }
28
+
29
+ export interface MetadataArgsJSON {
30
+ /** The name of the asset */
31
+ name: string
32
+ /** The symbol for the asset */
33
+ symbol: string
34
+ /** URI pointing to JSON representing the asset */
35
+ uri: string
36
+ /** Royalty basis points that goes to creators in secondary sales (0-10000) */
37
+ sellerFeeBasisPoints: number
38
+ primarySaleHappened: boolean
39
+ isMutable: boolean
40
+ /** nonce for easy calculation of editions, if present */
41
+ editionNonce: number | null
42
+ /** Since we cannot easily change Metadata, we add the new DataV2 fields here at the end. */
43
+ tokenStandard: types.TokenStandardJSON | null
44
+ /** Collection */
45
+ collection: types.CollectionJSON | null
46
+ /** Uses */
47
+ uses: types.UsesJSON | null
48
+ tokenProgramVersion: types.TokenProgramVersionJSON
49
+ creators: Array<types.CreatorJSON>
50
+ }
51
+
52
+ export class MetadataArgs {
53
+ /** The name of the asset */
54
+ readonly name: string
55
+ /** The symbol for the asset */
56
+ readonly symbol: string
57
+ /** URI pointing to JSON representing the asset */
58
+ readonly uri: string
59
+ /** Royalty basis points that goes to creators in secondary sales (0-10000) */
60
+ readonly sellerFeeBasisPoints: number
61
+ readonly primarySaleHappened: boolean
62
+ readonly isMutable: boolean
63
+ /** nonce for easy calculation of editions, if present */
64
+ readonly editionNonce: number | null
65
+ /** Since we cannot easily change Metadata, we add the new DataV2 fields here at the end. */
66
+ readonly tokenStandard: types.TokenStandardKind | null
67
+ /** Collection */
68
+ readonly collection: types.Collection | null
69
+ /** Uses */
70
+ readonly uses: types.Uses | null
71
+ readonly tokenProgramVersion: types.TokenProgramVersionKind
72
+ readonly creators: Array<types.Creator>
73
+
74
+ constructor(fields: MetadataArgsFields) {
75
+ this.name = fields.name
76
+ this.symbol = fields.symbol
77
+ this.uri = fields.uri
78
+ this.sellerFeeBasisPoints = fields.sellerFeeBasisPoints
79
+ this.primarySaleHappened = fields.primarySaleHappened
80
+ this.isMutable = fields.isMutable
81
+ this.editionNonce = fields.editionNonce
82
+ this.tokenStandard = fields.tokenStandard
83
+ this.collection =
84
+ (fields.collection && new types.Collection({ ...fields.collection })) ||
85
+ null
86
+ this.uses = (fields.uses && new types.Uses({ ...fields.uses })) || null
87
+ this.tokenProgramVersion = fields.tokenProgramVersion
88
+ this.creators = fields.creators.map(
89
+ (item) => new types.Creator({ ...item })
90
+ )
91
+ }
92
+
93
+ static layout(property?: string) {
94
+ return borsh.struct(
95
+ [
96
+ borsh.str("name"),
97
+ borsh.str("symbol"),
98
+ borsh.str("uri"),
99
+ borsh.u16("sellerFeeBasisPoints"),
100
+ borsh.bool("primarySaleHappened"),
101
+ borsh.bool("isMutable"),
102
+ borsh.option(borsh.u8(), "editionNonce"),
103
+ borsh.option(types.TokenStandard.layout(), "tokenStandard"),
104
+ borsh.option(types.Collection.layout(), "collection"),
105
+ borsh.option(types.Uses.layout(), "uses"),
106
+ types.TokenProgramVersion.layout("tokenProgramVersion"),
107
+ borsh.vec(types.Creator.layout(), "creators"),
108
+ ],
109
+ property
110
+ )
111
+ }
112
+
113
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
+ static fromDecoded(obj: any) {
115
+ return new MetadataArgs({
116
+ name: obj.name,
117
+ symbol: obj.symbol,
118
+ uri: obj.uri,
119
+ sellerFeeBasisPoints: obj.sellerFeeBasisPoints,
120
+ primarySaleHappened: obj.primarySaleHappened,
121
+ isMutable: obj.isMutable,
122
+ editionNonce: obj.editionNonce,
123
+ tokenStandard:
124
+ (obj.tokenStandard &&
125
+ types.TokenStandard.fromDecoded(obj.tokenStandard)) ||
126
+ null,
127
+ collection:
128
+ (obj.collection && types.Collection.fromDecoded(obj.collection)) ||
129
+ null,
130
+ uses: (obj.uses && types.Uses.fromDecoded(obj.uses)) || null,
131
+ tokenProgramVersion: types.TokenProgramVersion.fromDecoded(
132
+ obj.tokenProgramVersion
133
+ ),
134
+ creators: obj.creators.map(
135
+ (
136
+ item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
137
+ ) => types.Creator.fromDecoded(item)
138
+ ),
139
+ })
140
+ }
141
+
142
+ static toEncodable(fields: MetadataArgsFields) {
143
+ return {
144
+ name: fields.name,
145
+ symbol: fields.symbol,
146
+ uri: fields.uri,
147
+ sellerFeeBasisPoints: fields.sellerFeeBasisPoints,
148
+ primarySaleHappened: fields.primarySaleHappened,
149
+ isMutable: fields.isMutable,
150
+ editionNonce: fields.editionNonce,
151
+ tokenStandard:
152
+ (fields.tokenStandard && fields.tokenStandard.toEncodable()) || null,
153
+ collection:
154
+ (fields.collection &&
155
+ types.Collection.toEncodable(fields.collection)) ||
156
+ null,
157
+ uses: (fields.uses && types.Uses.toEncodable(fields.uses)) || null,
158
+ tokenProgramVersion: fields.tokenProgramVersion.toEncodable(),
159
+ creators: fields.creators.map((item) => types.Creator.toEncodable(item)),
160
+ }
161
+ }
162
+
163
+ toJSON(): MetadataArgsJSON {
164
+ return {
165
+ name: this.name,
166
+ symbol: this.symbol,
167
+ uri: this.uri,
168
+ sellerFeeBasisPoints: this.sellerFeeBasisPoints,
169
+ primarySaleHappened: this.primarySaleHappened,
170
+ isMutable: this.isMutable,
171
+ editionNonce: this.editionNonce,
172
+ tokenStandard:
173
+ (this.tokenStandard && this.tokenStandard.toJSON()) || null,
174
+ collection: (this.collection && this.collection.toJSON()) || null,
175
+ uses: (this.uses && this.uses.toJSON()) || null,
176
+ tokenProgramVersion: this.tokenProgramVersion.toJSON(),
177
+ creators: this.creators.map((item) => item.toJSON()),
178
+ }
179
+ }
180
+
181
+ static fromJSON(obj: MetadataArgsJSON): MetadataArgs {
182
+ return new MetadataArgs({
183
+ name: obj.name,
184
+ symbol: obj.symbol,
185
+ uri: obj.uri,
186
+ sellerFeeBasisPoints: obj.sellerFeeBasisPoints,
187
+ primarySaleHappened: obj.primarySaleHappened,
188
+ isMutable: obj.isMutable,
189
+ editionNonce: obj.editionNonce,
190
+ tokenStandard:
191
+ (obj.tokenStandard &&
192
+ types.TokenStandard.fromJSON(obj.tokenStandard)) ||
193
+ null,
194
+ collection:
195
+ (obj.collection && types.Collection.fromJSON(obj.collection)) || null,
196
+ uses: (obj.uses && types.Uses.fromJSON(obj.uses)) || null,
197
+ tokenProgramVersion: types.TokenProgramVersion.fromJSON(
198
+ obj.tokenProgramVersion
199
+ ),
200
+ creators: obj.creators.map((item) => types.Creator.fromJSON(item)),
201
+ })
202
+ }
203
+
204
+ toEncodable() {
205
+ return MetadataArgs.toEncodable(this)
206
+ }
207
+ }
@@ -0,0 +1,64 @@
1
+ import { PublicKey } 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 types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
+
6
+ export interface NonFungibleTraitInitFields {
7
+ hash: BN
8
+ values: Array<BN>
9
+ }
10
+
11
+ export interface NonFungibleTraitInitJSON {
12
+ hash: string
13
+ values: Array<string>
14
+ }
15
+
16
+ export class NonFungibleTraitInit {
17
+ readonly hash: BN
18
+ readonly values: Array<BN>
19
+
20
+ constructor(fields: NonFungibleTraitInitFields) {
21
+ this.hash = fields.hash
22
+ this.values = fields.values
23
+ }
24
+
25
+ static layout(property?: string) {
26
+ return borsh.struct(
27
+ [borsh.u64("hash"), borsh.vec(borsh.u64(), "values")],
28
+ property
29
+ )
30
+ }
31
+
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ static fromDecoded(obj: any) {
34
+ return new NonFungibleTraitInit({
35
+ hash: obj.hash,
36
+ values: obj.values,
37
+ })
38
+ }
39
+
40
+ static toEncodable(fields: NonFungibleTraitInitFields) {
41
+ return {
42
+ hash: fields.hash,
43
+ values: fields.values,
44
+ }
45
+ }
46
+
47
+ toJSON(): NonFungibleTraitInitJSON {
48
+ return {
49
+ hash: this.hash.toString(),
50
+ values: this.values.map((item) => item.toString()),
51
+ }
52
+ }
53
+
54
+ static fromJSON(obj: NonFungibleTraitInitJSON): NonFungibleTraitInit {
55
+ return new NonFungibleTraitInit({
56
+ hash: new BN(obj.hash),
57
+ values: obj.values.map((item) => new BN(item)),
58
+ })
59
+ }
60
+
61
+ toEncodable() {
62
+ return NonFungibleTraitInit.toEncodable(this)
63
+ }
64
+ }
@@ -0,0 +1,84 @@
1
+ import { PublicKey } 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 types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
+
6
+ export interface NonFungibleTraitInitMapFields {
7
+ hash: BN
8
+ values: Array<types.FakeTraitValueFields>
9
+ index: number
10
+ }
11
+
12
+ export interface NonFungibleTraitInitMapJSON {
13
+ hash: string
14
+ values: Array<types.FakeTraitValueJSON>
15
+ index: number
16
+ }
17
+
18
+ export class NonFungibleTraitInitMap {
19
+ readonly hash: BN
20
+ readonly values: Array<types.FakeTraitValue>
21
+ readonly index: number
22
+
23
+ constructor(fields: NonFungibleTraitInitMapFields) {
24
+ this.hash = fields.hash
25
+ this.values = fields.values.map(
26
+ (item) => new types.FakeTraitValue({ ...item })
27
+ )
28
+ this.index = fields.index
29
+ }
30
+
31
+ static layout(property?: string) {
32
+ return borsh.struct(
33
+ [
34
+ borsh.u64("hash"),
35
+ borsh.vec(types.FakeTraitValue.layout(), "values"),
36
+ borsh.u32("index"),
37
+ ],
38
+ property
39
+ )
40
+ }
41
+
42
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
43
+ static fromDecoded(obj: any) {
44
+ return new NonFungibleTraitInitMap({
45
+ hash: obj.hash,
46
+ values: obj.values.map(
47
+ (
48
+ item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
49
+ ) => types.FakeTraitValue.fromDecoded(item)
50
+ ),
51
+ index: obj.index,
52
+ })
53
+ }
54
+
55
+ static toEncodable(fields: NonFungibleTraitInitMapFields) {
56
+ return {
57
+ hash: fields.hash,
58
+ values: fields.values.map((item) =>
59
+ types.FakeTraitValue.toEncodable(item)
60
+ ),
61
+ index: fields.index,
62
+ }
63
+ }
64
+
65
+ toJSON(): NonFungibleTraitInitMapJSON {
66
+ return {
67
+ hash: this.hash.toString(),
68
+ values: this.values.map((item) => item.toJSON()),
69
+ index: this.index,
70
+ }
71
+ }
72
+
73
+ static fromJSON(obj: NonFungibleTraitInitMapJSON): NonFungibleTraitInitMap {
74
+ return new NonFungibleTraitInitMap({
75
+ hash: new BN(obj.hash),
76
+ values: obj.values.map((item) => types.FakeTraitValue.fromJSON(item)),
77
+ index: obj.index,
78
+ })
79
+ }
80
+
81
+ toEncodable() {
82
+ return NonFungibleTraitInitMap.toEncodable(this)
83
+ }
84
+ }
@@ -0,0 +1,76 @@
1
+ import { PublicKey } 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 types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
+
6
+ export interface OnlyBetweenTimesArgsFields {
7
+ start: number
8
+ end: number
9
+ rangeType: types.TimeRangeTypeKind
10
+ }
11
+
12
+ export interface OnlyBetweenTimesArgsJSON {
13
+ start: number
14
+ end: number
15
+ rangeType: types.TimeRangeTypeJSON
16
+ }
17
+
18
+ export class OnlyBetweenTimesArgs {
19
+ readonly start: number
20
+ readonly end: number
21
+ readonly rangeType: types.TimeRangeTypeKind
22
+
23
+ constructor(fields: OnlyBetweenTimesArgsFields) {
24
+ this.start = fields.start
25
+ this.end = fields.end
26
+ this.rangeType = fields.rangeType
27
+ }
28
+
29
+ static layout(property?: string) {
30
+ return borsh.struct(
31
+ [
32
+ borsh.u32("start"),
33
+ borsh.u32("end"),
34
+ types.TimeRangeType.layout("rangeType"),
35
+ ],
36
+ property
37
+ )
38
+ }
39
+
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ static fromDecoded(obj: any) {
42
+ return new OnlyBetweenTimesArgs({
43
+ start: obj.start,
44
+ end: obj.end,
45
+ rangeType: types.TimeRangeType.fromDecoded(obj.rangeType),
46
+ })
47
+ }
48
+
49
+ static toEncodable(fields: OnlyBetweenTimesArgsFields) {
50
+ return {
51
+ start: fields.start,
52
+ end: fields.end,
53
+ rangeType: fields.rangeType.toEncodable(),
54
+ }
55
+ }
56
+
57
+ toJSON(): OnlyBetweenTimesArgsJSON {
58
+ return {
59
+ start: this.start,
60
+ end: this.end,
61
+ rangeType: this.rangeType.toJSON(),
62
+ }
63
+ }
64
+
65
+ static fromJSON(obj: OnlyBetweenTimesArgsJSON): OnlyBetweenTimesArgs {
66
+ return new OnlyBetweenTimesArgs({
67
+ start: obj.start,
68
+ end: obj.end,
69
+ rangeType: types.TimeRangeType.fromJSON(obj.rangeType),
70
+ })
71
+ }
72
+
73
+ toEncodable() {
74
+ return OnlyBetweenTimesArgs.toEncodable(this)
75
+ }
76
+ }
@@ -0,0 +1,53 @@
1
+ import { PublicKey } 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 types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
+
6
+ export interface OnlyTheseDOWArgsFields {
7
+ days: number
8
+ }
9
+
10
+ export interface OnlyTheseDOWArgsJSON {
11
+ days: number
12
+ }
13
+
14
+ export class OnlyTheseDOWArgs {
15
+ readonly days: number
16
+
17
+ constructor(fields: OnlyTheseDOWArgsFields) {
18
+ this.days = fields.days
19
+ }
20
+
21
+ static layout(property?: string) {
22
+ return borsh.struct([borsh.u8("days")], property)
23
+ }
24
+
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ static fromDecoded(obj: any) {
27
+ return new OnlyTheseDOWArgs({
28
+ days: obj.days,
29
+ })
30
+ }
31
+
32
+ static toEncodable(fields: OnlyTheseDOWArgsFields) {
33
+ return {
34
+ days: fields.days,
35
+ }
36
+ }
37
+
38
+ toJSON(): OnlyTheseDOWArgsJSON {
39
+ return {
40
+ days: this.days,
41
+ }
42
+ }
43
+
44
+ static fromJSON(obj: OnlyTheseDOWArgsJSON): OnlyTheseDOWArgs {
45
+ return new OnlyTheseDOWArgs({
46
+ days: obj.days,
47
+ })
48
+ }
49
+
50
+ toEncodable() {
51
+ return OnlyTheseDOWArgs.toEncodable(this)
52
+ }
53
+ }
@@ -0,0 +1,98 @@
1
+ import { PublicKey } 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 types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
+
6
+ export interface PackConfigFields {
7
+ amountPerPack: number
8
+ chancesOfEmpty: number
9
+ openAuthority: PublicKey
10
+ packType: types.PackTypeKind
11
+ packRules: Array<types.PackRuleKind>
12
+ }
13
+
14
+ export interface PackConfigJSON {
15
+ amountPerPack: number
16
+ chancesOfEmpty: number
17
+ openAuthority: string
18
+ packType: types.PackTypeJSON
19
+ packRules: Array<types.PackRuleJSON>
20
+ }
21
+
22
+ export class PackConfig {
23
+ readonly amountPerPack: number
24
+ readonly chancesOfEmpty: number
25
+ readonly openAuthority: PublicKey
26
+ readonly packType: types.PackTypeKind
27
+ readonly packRules: Array<types.PackRuleKind>
28
+
29
+ constructor(fields: PackConfigFields) {
30
+ this.amountPerPack = fields.amountPerPack
31
+ this.chancesOfEmpty = fields.chancesOfEmpty
32
+ this.openAuthority = fields.openAuthority
33
+ this.packType = fields.packType
34
+ this.packRules = fields.packRules
35
+ }
36
+
37
+ static layout(property?: string) {
38
+ return borsh.struct(
39
+ [
40
+ borsh.u8("amountPerPack"),
41
+ borsh.u16("chancesOfEmpty"),
42
+ borsh.publicKey("openAuthority"),
43
+ types.PackType.layout("packType"),
44
+ borsh.vec(types.PackRule.layout(), "packRules"),
45
+ ],
46
+ property
47
+ )
48
+ }
49
+
50
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
+ static fromDecoded(obj: any) {
52
+ return new PackConfig({
53
+ amountPerPack: obj.amountPerPack,
54
+ chancesOfEmpty: obj.chancesOfEmpty,
55
+ openAuthority: obj.openAuthority,
56
+ packType: types.PackType.fromDecoded(obj.packType),
57
+ packRules: obj.packRules.map(
58
+ (
59
+ item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
60
+ ) => types.PackRule.fromDecoded(item)
61
+ ),
62
+ })
63
+ }
64
+
65
+ static toEncodable(fields: PackConfigFields) {
66
+ return {
67
+ amountPerPack: fields.amountPerPack,
68
+ chancesOfEmpty: fields.chancesOfEmpty,
69
+ openAuthority: fields.openAuthority,
70
+ packType: fields.packType.toEncodable(),
71
+ packRules: fields.packRules.map((item) => item.toEncodable()),
72
+ }
73
+ }
74
+
75
+ toJSON(): PackConfigJSON {
76
+ return {
77
+ amountPerPack: this.amountPerPack,
78
+ chancesOfEmpty: this.chancesOfEmpty,
79
+ openAuthority: this.openAuthority.toString(),
80
+ packType: this.packType.toJSON(),
81
+ packRules: this.packRules.map((item) => item.toJSON()),
82
+ }
83
+ }
84
+
85
+ static fromJSON(obj: PackConfigJSON): PackConfig {
86
+ return new PackConfig({
87
+ amountPerPack: obj.amountPerPack,
88
+ chancesOfEmpty: obj.chancesOfEmpty,
89
+ openAuthority: new PublicKey(obj.openAuthority),
90
+ packType: types.PackType.fromJSON(obj.packType),
91
+ packRules: obj.packRules.map((item) => types.PackRule.fromJSON(item)),
92
+ })
93
+ }
94
+
95
+ toEncodable() {
96
+ return PackConfig.toEncodable(this)
97
+ }
98
+ }