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,61 @@
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 EncryptedPayloadFields {
7
+ encType: number
8
+ arweave: string
9
+ }
10
+
11
+ export interface EncryptedPayloadJSON {
12
+ encType: number
13
+ arweave: string
14
+ }
15
+
16
+ export class EncryptedPayload {
17
+ readonly encType: number
18
+ readonly arweave: string
19
+
20
+ constructor(fields: EncryptedPayloadFields) {
21
+ this.encType = fields.encType
22
+ this.arweave = fields.arweave
23
+ }
24
+
25
+ static layout(property?: string) {
26
+ return borsh.struct([borsh.u8("encType"), borsh.str("arweave")], property)
27
+ }
28
+
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ static fromDecoded(obj: any) {
31
+ return new EncryptedPayload({
32
+ encType: obj.encType,
33
+ arweave: obj.arweave,
34
+ })
35
+ }
36
+
37
+ static toEncodable(fields: EncryptedPayloadFields) {
38
+ return {
39
+ encType: fields.encType,
40
+ arweave: fields.arweave,
41
+ }
42
+ }
43
+
44
+ toJSON(): EncryptedPayloadJSON {
45
+ return {
46
+ encType: this.encType,
47
+ arweave: this.arweave,
48
+ }
49
+ }
50
+
51
+ static fromJSON(obj: EncryptedPayloadJSON): EncryptedPayload {
52
+ return new EncryptedPayload({
53
+ encType: obj.encType,
54
+ arweave: obj.arweave,
55
+ })
56
+ }
57
+
58
+ toEncodable() {
59
+ return EncryptedPayload.toEncodable(this)
60
+ }
61
+ }
@@ -0,0 +1,117 @@
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 NoneJSON {
7
+ kind: "None"
8
+ }
9
+
10
+ export class None {
11
+ static readonly discriminator = 0
12
+ static readonly kind = "None"
13
+ readonly discriminator = 0
14
+ readonly kind = "None"
15
+
16
+ toJSON(): NoneJSON {
17
+ return {
18
+ kind: "None",
19
+ }
20
+ }
21
+
22
+ toEncodable() {
23
+ return {
24
+ None: {},
25
+ }
26
+ }
27
+ }
28
+
29
+ export type RevealerFields = {
30
+ random: number
31
+ }
32
+ export type RevealerValue = {
33
+ random: number
34
+ }
35
+
36
+ export interface RevealerJSON {
37
+ kind: "Revealer"
38
+ value: {
39
+ random: number
40
+ }
41
+ }
42
+
43
+ export class Revealer {
44
+ static readonly discriminator = 1
45
+ static readonly kind = "Revealer"
46
+ readonly discriminator = 1
47
+ readonly kind = "Revealer"
48
+ readonly value: RevealerValue
49
+
50
+ constructor(value: RevealerFields) {
51
+ this.value = {
52
+ random: value.random,
53
+ }
54
+ }
55
+
56
+ toJSON(): RevealerJSON {
57
+ return {
58
+ kind: "Revealer",
59
+ value: {
60
+ random: this.value.random,
61
+ },
62
+ }
63
+ }
64
+
65
+ toEncodable() {
66
+ return {
67
+ Revealer: {
68
+ random: this.value.random,
69
+ },
70
+ }
71
+ }
72
+ }
73
+
74
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
75
+ export function fromDecoded(obj: any): types.ExtraParameterKind {
76
+ if (typeof obj !== "object") {
77
+ throw new Error("Invalid enum object")
78
+ }
79
+
80
+ if ("None" in obj) {
81
+ return new None()
82
+ }
83
+ if ("Revealer" in obj) {
84
+ const val = obj["Revealer"]
85
+ return new Revealer({
86
+ random: val["random"],
87
+ })
88
+ }
89
+
90
+ throw new Error("Invalid enum object")
91
+ }
92
+
93
+ export function fromJSON(
94
+ obj: types.ExtraParameterJSON
95
+ ): types.ExtraParameterKind {
96
+ switch (obj.kind) {
97
+ case "None": {
98
+ return new None()
99
+ }
100
+ case "Revealer": {
101
+ return new Revealer({
102
+ random: obj.value.random,
103
+ })
104
+ }
105
+ }
106
+ }
107
+
108
+ export function layout(property?: string) {
109
+ const ret = borsh.rustEnum([
110
+ borsh.struct([], "None"),
111
+ borsh.struct([borsh.u16("random")], "Revealer"),
112
+ ])
113
+ if (property !== undefined) {
114
+ return ret.replicate(property)
115
+ }
116
+ return ret
117
+ }
@@ -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 FakeBurnCountFields {
7
+ key: BN
8
+ track: types.DepositTrackFields
9
+ }
10
+
11
+ export interface FakeBurnCountJSON {
12
+ key: string
13
+ track: types.DepositTrackJSON
14
+ }
15
+
16
+ export class FakeBurnCount {
17
+ readonly key: BN
18
+ readonly track: types.DepositTrack
19
+
20
+ constructor(fields: FakeBurnCountFields) {
21
+ this.key = fields.key
22
+ this.track = new types.DepositTrack({ ...fields.track })
23
+ }
24
+
25
+ static layout(property?: string) {
26
+ return borsh.struct(
27
+ [borsh.u64("key"), types.DepositTrack.layout("track")],
28
+ property
29
+ )
30
+ }
31
+
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ static fromDecoded(obj: any) {
34
+ return new FakeBurnCount({
35
+ key: obj.key,
36
+ track: types.DepositTrack.fromDecoded(obj.track),
37
+ })
38
+ }
39
+
40
+ static toEncodable(fields: FakeBurnCountFields) {
41
+ return {
42
+ key: fields.key,
43
+ track: types.DepositTrack.toEncodable(fields.track),
44
+ }
45
+ }
46
+
47
+ toJSON(): FakeBurnCountJSON {
48
+ return {
49
+ key: this.key.toString(),
50
+ track: this.track.toJSON(),
51
+ }
52
+ }
53
+
54
+ static fromJSON(obj: FakeBurnCountJSON): FakeBurnCount {
55
+ return new FakeBurnCount({
56
+ key: new BN(obj.key),
57
+ track: types.DepositTrack.fromJSON(obj.track),
58
+ })
59
+ }
60
+
61
+ toEncodable() {
62
+ return FakeBurnCount.toEncodable(this)
63
+ }
64
+ }
@@ -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 FakeDepositFields {
7
+ key: BN
8
+ track: types.BurnCountFields
9
+ }
10
+
11
+ export interface FakeDepositJSON {
12
+ key: string
13
+ track: types.BurnCountJSON
14
+ }
15
+
16
+ export class FakeDeposit {
17
+ readonly key: BN
18
+ readonly track: types.BurnCount
19
+
20
+ constructor(fields: FakeDepositFields) {
21
+ this.key = fields.key
22
+ this.track = new types.BurnCount({ ...fields.track })
23
+ }
24
+
25
+ static layout(property?: string) {
26
+ return borsh.struct(
27
+ [borsh.u64("key"), types.BurnCount.layout("track")],
28
+ property
29
+ )
30
+ }
31
+
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ static fromDecoded(obj: any) {
34
+ return new FakeDeposit({
35
+ key: obj.key,
36
+ track: types.BurnCount.fromDecoded(obj.track),
37
+ })
38
+ }
39
+
40
+ static toEncodable(fields: FakeDepositFields) {
41
+ return {
42
+ key: fields.key,
43
+ track: types.BurnCount.toEncodable(fields.track),
44
+ }
45
+ }
46
+
47
+ toJSON(): FakeDepositJSON {
48
+ return {
49
+ key: this.key.toString(),
50
+ track: this.track.toJSON(),
51
+ }
52
+ }
53
+
54
+ static fromJSON(obj: FakeDepositJSON): FakeDeposit {
55
+ return new FakeDeposit({
56
+ key: new BN(obj.key),
57
+ track: types.BurnCount.fromJSON(obj.track),
58
+ })
59
+ }
60
+
61
+ toEncodable() {
62
+ return FakeDeposit.toEncodable(this)
63
+ }
64
+ }
@@ -0,0 +1,61 @@
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 FakeTraitPairFields {
7
+ trait_type: string
8
+ value: string
9
+ }
10
+
11
+ export interface FakeTraitPairJSON {
12
+ trait_type: string
13
+ value: string
14
+ }
15
+
16
+ export class FakeTraitPair {
17
+ readonly trait_type: string
18
+ readonly value: string
19
+
20
+ constructor(fields: FakeTraitPairFields) {
21
+ this.trait_type = fields.trait_type
22
+ this.value = fields.value
23
+ }
24
+
25
+ static layout(property?: string) {
26
+ return borsh.struct([borsh.str("trait_type"), borsh.str("value")], property)
27
+ }
28
+
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ static fromDecoded(obj: any) {
31
+ return new FakeTraitPair({
32
+ trait_type: obj.trait_type,
33
+ value: obj.value,
34
+ })
35
+ }
36
+
37
+ static toEncodable(fields: FakeTraitPairFields) {
38
+ return {
39
+ trait_type: fields.trait_type,
40
+ value: fields.value,
41
+ }
42
+ }
43
+
44
+ toJSON(): FakeTraitPairJSON {
45
+ return {
46
+ trait_type: this.trait_type,
47
+ value: this.value,
48
+ }
49
+ }
50
+
51
+ static fromJSON(obj: FakeTraitPairJSON): FakeTraitPair {
52
+ return new FakeTraitPair({
53
+ trait_type: obj.trait_type,
54
+ value: obj.value,
55
+ })
56
+ }
57
+
58
+ toEncodable() {
59
+ return FakeTraitPair.toEncodable(this)
60
+ }
61
+ }
@@ -0,0 +1,61 @@
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 FakeTraitValueFields {
7
+ trait_value: BN
8
+ state: number
9
+ }
10
+
11
+ export interface FakeTraitValueJSON {
12
+ trait_value: string
13
+ state: number
14
+ }
15
+
16
+ export class FakeTraitValue {
17
+ readonly trait_value: BN
18
+ readonly state: number
19
+
20
+ constructor(fields: FakeTraitValueFields) {
21
+ this.trait_value = fields.trait_value
22
+ this.state = fields.state
23
+ }
24
+
25
+ static layout(property?: string) {
26
+ return borsh.struct([borsh.u64("trait_value"), borsh.u8("state")], property)
27
+ }
28
+
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ static fromDecoded(obj: any) {
31
+ return new FakeTraitValue({
32
+ trait_value: obj.trait_value,
33
+ state: obj.state,
34
+ })
35
+ }
36
+
37
+ static toEncodable(fields: FakeTraitValueFields) {
38
+ return {
39
+ trait_value: fields.trait_value,
40
+ state: fields.state,
41
+ }
42
+ }
43
+
44
+ toJSON(): FakeTraitValueJSON {
45
+ return {
46
+ trait_value: this.trait_value.toString(),
47
+ state: this.state,
48
+ }
49
+ }
50
+
51
+ static fromJSON(obj: FakeTraitValueJSON): FakeTraitValue {
52
+ return new FakeTraitValue({
53
+ trait_value: new BN(obj.trait_value),
54
+ state: obj.state,
55
+ })
56
+ }
57
+
58
+ toEncodable() {
59
+ return FakeTraitValue.toEncodable(this)
60
+ }
61
+ }
@@ -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 FakeVolumeTrackFields {
7
+ key: PublicKey
8
+ track: types.VolumeTrackFields
9
+ }
10
+
11
+ export interface FakeVolumeTrackJSON {
12
+ key: string
13
+ track: types.VolumeTrackJSON
14
+ }
15
+
16
+ export class FakeVolumeTrack {
17
+ readonly key: PublicKey
18
+ readonly track: types.VolumeTrack
19
+
20
+ constructor(fields: FakeVolumeTrackFields) {
21
+ this.key = fields.key
22
+ this.track = new types.VolumeTrack({ ...fields.track })
23
+ }
24
+
25
+ static layout(property?: string) {
26
+ return borsh.struct(
27
+ [borsh.publicKey("key"), types.VolumeTrack.layout("track")],
28
+ property
29
+ )
30
+ }
31
+
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ static fromDecoded(obj: any) {
34
+ return new FakeVolumeTrack({
35
+ key: obj.key,
36
+ track: types.VolumeTrack.fromDecoded(obj.track),
37
+ })
38
+ }
39
+
40
+ static toEncodable(fields: FakeVolumeTrackFields) {
41
+ return {
42
+ key: fields.key,
43
+ track: types.VolumeTrack.toEncodable(fields.track),
44
+ }
45
+ }
46
+
47
+ toJSON(): FakeVolumeTrackJSON {
48
+ return {
49
+ key: this.key.toString(),
50
+ track: this.track.toJSON(),
51
+ }
52
+ }
53
+
54
+ static fromJSON(obj: FakeVolumeTrackJSON): FakeVolumeTrack {
55
+ return new FakeVolumeTrack({
56
+ key: new PublicKey(obj.key),
57
+ track: types.VolumeTrack.fromJSON(obj.track),
58
+ })
59
+ }
60
+
61
+ toEncodable() {
62
+ return FakeVolumeTrack.toEncodable(this)
63
+ }
64
+ }
@@ -0,0 +1,118 @@
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 AllMintsJSON {
7
+ kind: "AllMints"
8
+ }
9
+
10
+ export class AllMints {
11
+ static readonly discriminator = 0
12
+ static readonly kind = "AllMints"
13
+ readonly discriminator = 0
14
+ readonly kind = "AllMints"
15
+
16
+ toJSON(): AllMintsJSON {
17
+ return {
18
+ kind: "AllMints",
19
+ }
20
+ }
21
+
22
+ toEncodable() {
23
+ return {
24
+ AllMints: {},
25
+ }
26
+ }
27
+ }
28
+
29
+ export interface PricedMintsOnlyJSON {
30
+ kind: "PricedMintsOnly"
31
+ }
32
+
33
+ export class PricedMintsOnly {
34
+ static readonly discriminator = 1
35
+ static readonly kind = "PricedMintsOnly"
36
+ readonly discriminator = 1
37
+ readonly kind = "PricedMintsOnly"
38
+
39
+ toJSON(): PricedMintsOnlyJSON {
40
+ return {
41
+ kind: "PricedMintsOnly",
42
+ }
43
+ }
44
+
45
+ toEncodable() {
46
+ return {
47
+ PricedMintsOnly: {},
48
+ }
49
+ }
50
+ }
51
+
52
+ export interface SkipBurnMintsJSON {
53
+ kind: "SkipBurnMints"
54
+ }
55
+
56
+ export class SkipBurnMints {
57
+ static readonly discriminator = 2
58
+ static readonly kind = "SkipBurnMints"
59
+ readonly discriminator = 2
60
+ readonly kind = "SkipBurnMints"
61
+
62
+ toJSON(): SkipBurnMintsJSON {
63
+ return {
64
+ kind: "SkipBurnMints",
65
+ }
66
+ }
67
+
68
+ toEncodable() {
69
+ return {
70
+ SkipBurnMints: {},
71
+ }
72
+ }
73
+ }
74
+
75
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
+ export function fromDecoded(obj: any): types.FeeTypeKind {
77
+ if (typeof obj !== "object") {
78
+ throw new Error("Invalid enum object")
79
+ }
80
+
81
+ if ("AllMints" in obj) {
82
+ return new AllMints()
83
+ }
84
+ if ("PricedMintsOnly" in obj) {
85
+ return new PricedMintsOnly()
86
+ }
87
+ if ("SkipBurnMints" in obj) {
88
+ return new SkipBurnMints()
89
+ }
90
+
91
+ throw new Error("Invalid enum object")
92
+ }
93
+
94
+ export function fromJSON(obj: types.FeeTypeJSON): types.FeeTypeKind {
95
+ switch (obj.kind) {
96
+ case "AllMints": {
97
+ return new AllMints()
98
+ }
99
+ case "PricedMintsOnly": {
100
+ return new PricedMintsOnly()
101
+ }
102
+ case "SkipBurnMints": {
103
+ return new SkipBurnMints()
104
+ }
105
+ }
106
+ }
107
+
108
+ export function layout(property?: string) {
109
+ const ret = borsh.rustEnum([
110
+ borsh.struct([], "AllMints"),
111
+ borsh.struct([], "PricedMintsOnly"),
112
+ borsh.struct([], "SkipBurnMints"),
113
+ ])
114
+ if (property !== undefined) {
115
+ return ret.replicate(property)
116
+ }
117
+ return ret
118
+ }
@@ -0,0 +1,57 @@
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 FeedingTraitsFields {
7
+ list: Array<types.TraitInitKind>
8
+ }
9
+
10
+ export interface FeedingTraitsJSON {
11
+ list: Array<types.TraitInitJSON>
12
+ }
13
+
14
+ export class FeedingTraits {
15
+ readonly list: Array<types.TraitInitKind>
16
+
17
+ constructor(fields: FeedingTraitsFields) {
18
+ this.list = fields.list
19
+ }
20
+
21
+ static layout(property?: string) {
22
+ return borsh.struct([borsh.vec(types.TraitInit.layout(), "list")], property)
23
+ }
24
+
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ static fromDecoded(obj: any) {
27
+ return new FeedingTraits({
28
+ list: obj.list.map(
29
+ (
30
+ item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
31
+ ) => types.TraitInit.fromDecoded(item)
32
+ ),
33
+ })
34
+ }
35
+
36
+ static toEncodable(fields: FeedingTraitsFields) {
37
+ return {
38
+ list: fields.list.map((item) => item.toEncodable()),
39
+ }
40
+ }
41
+
42
+ toJSON(): FeedingTraitsJSON {
43
+ return {
44
+ list: this.list.map((item) => item.toJSON()),
45
+ }
46
+ }
47
+
48
+ static fromJSON(obj: FeedingTraitsJSON): FeedingTraits {
49
+ return new FeedingTraits({
50
+ list: obj.list.map((item) => types.TraitInit.fromJSON(item)),
51
+ })
52
+ }
53
+
54
+ toEncodable() {
55
+ return FeedingTraits.toEncodable(this)
56
+ }
57
+ }