3land_sdk 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +352 -0
- package/assets/3land_rebrand.gif +0 -0
- package/assets/battle_sol.gif +0 -0
- package/assets/ds.jpeg +0 -0
- package/assets/future.webp +0 -0
- package/assets/music.mp3 +0 -0
- package/assets/niicl.gif +0 -0
- package/assets/og.png +0 -0
- package/assets/phone.glb +0 -0
- package/assets/testvid.mp4 +0 -0
- package/idl.json +7652 -0
- package/package.json +35 -0
- package/src/index.ts +89 -0
- package/src/library/Irys/irys.ts +412 -0
- package/src/library/Store.ts +613 -0
- package/src/library/implementation/storeImplementation.ts +385 -0
- package/src/library/instructions/store/buySingleEdition.ts +227 -0
- package/src/library/instructions/store/createSingleEdition.ts +49 -0
- package/src/library/instructions/store/createStore.ts +19 -0
- package/src/library/instructions/store/idl.ts +7622 -0
- package/src/library/instructions/store/uploadFilesIryis.ts +133 -0
- package/src/types/accounts/ArchiveDeposit.ts +207 -0
- package/src/types/accounts/Authority.ts +73 -0
- package/src/types/accounts/BurnDeposit.ts +111 -0
- package/src/types/accounts/BurnProgress.ts +97 -0
- package/src/types/accounts/BuyHistory.ts +121 -0
- package/src/types/accounts/BuyTrack.ts +94 -0
- package/src/types/accounts/Card.ts +185 -0
- package/src/types/accounts/CollectionRegistry.ts +145 -0
- package/src/types/accounts/CollectorRegistry.ts +145 -0
- package/src/types/accounts/CreatorRegistry.ts +153 -0
- package/src/types/accounts/CurrencyArtistProof.ts +113 -0
- package/src/types/accounts/GenericUser.ts +185 -0
- package/src/types/accounts/ItemArchive.ts +223 -0
- package/src/types/accounts/ItemReserveList.ts +87 -0
- package/src/types/accounts/ItemReserveList2.ts +73 -0
- package/src/types/accounts/LutVault.ts +97 -0
- package/src/types/accounts/Pack.ts +367 -0
- package/src/types/accounts/PackContent.ts +97 -0
- package/src/types/accounts/PackOpenHolder.ts +141 -0
- package/src/types/accounts/PackReceipt.ts +145 -0
- package/src/types/accounts/PackTraits.ts +101 -0
- package/src/types/accounts/Payment.ts +97 -0
- package/src/types/accounts/PoolVault.ts +177 -0
- package/src/types/accounts/RevealForMe.ts +139 -0
- package/src/types/accounts/SecureHolder.ts +97 -0
- package/src/types/accounts/Single.ts +301 -0
- package/src/types/accounts/Store.ts +180 -0
- package/src/types/accounts/StoresHolder.ts +131 -0
- package/src/types/accounts/ThreeId.ts +189 -0
- package/src/types/accounts/TokenManager.ts +217 -0
- package/src/types/accounts/ZeroCard.ts +73 -0
- package/src/types/accounts/ZeroContent.ts +89 -0
- package/src/types/accounts/ZeroOpenHolder.ts +183 -0
- package/src/types/accounts/index.ts +84 -0
- package/src/types/errors/anchor.ts +773 -0
- package/src/types/errors/index.ts +59 -0
- package/src/types/implementation/implementationTypes.ts +27 -0
- package/src/types/instructions/addBurn.ts +56 -0
- package/src/types/instructions/adjustDepositBurn.ts +33 -0
- package/src/types/instructions/archiveItem.ts +60 -0
- package/src/types/instructions/assignPackDelegate.ts +30 -0
- package/src/types/instructions/burnPay.ts +55 -0
- package/src/types/instructions/buyPack.ts +69 -0
- package/src/types/instructions/buyPay.ts +71 -0
- package/src/types/instructions/buyToken.ts +64 -0
- package/src/types/instructions/claimZeroCard.ts +106 -0
- package/src/types/instructions/closeDepositBurn.ts +47 -0
- package/src/types/instructions/closeRegisterTraits.ts +28 -0
- package/src/types/instructions/createCard.ts +56 -0
- package/src/types/instructions/createCollection.ts +68 -0
- package/src/types/instructions/createPack.ts +71 -0
- package/src/types/instructions/createSingle.ts +71 -0
- package/src/types/instructions/createStore.ts +50 -0
- package/src/types/instructions/createTokenLauncher.ts +82 -0
- package/src/types/instructions/createZeroCard.ts +76 -0
- package/src/types/instructions/deleteCard.ts +32 -0
- package/src/types/instructions/deletePack.ts +40 -0
- package/src/types/instructions/deleteSingle.ts +36 -0
- package/src/types/instructions/deleteTokenLauncher.ts +38 -0
- package/src/types/instructions/depositBurn.ts +55 -0
- package/src/types/instructions/donateUser.ts +84 -0
- package/src/types/instructions/feedPool.ts +61 -0
- package/src/types/instructions/feedTraits.ts +44 -0
- package/src/types/instructions/feedTree.ts +63 -0
- package/src/types/instructions/flagPack.ts +50 -0
- package/src/types/instructions/flagSingle.ts +47 -0
- package/src/types/instructions/gatePay.ts +59 -0
- package/src/types/instructions/index.ts +140 -0
- package/src/types/instructions/initialize.ts +46 -0
- package/src/types/instructions/openPack.ts +79 -0
- package/src/types/instructions/prepareCreator.ts +30 -0
- package/src/types/instructions/preparePack.ts +51 -0
- package/src/types/instructions/prepareTraits.ts +28 -0
- package/src/types/instructions/printPack.ts +95 -0
- package/src/types/instructions/printSingle.ts +108 -0
- package/src/types/instructions/recoverDepositBurn.ts +80 -0
- package/src/types/instructions/registerActivity.ts +43 -0
- package/src/types/instructions/registerCollector.ts +63 -0
- package/src/types/instructions/registerCreator.ts +48 -0
- package/src/types/instructions/registerGenericUser.ts +94 -0
- package/src/types/instructions/registerPackUploads.ts +44 -0
- package/src/types/instructions/registerTraits.ts +42 -0
- package/src/types/instructions/registerUser.ts +50 -0
- package/src/types/instructions/storeLutFor.ts +44 -0
- package/src/types/instructions/unwrapAndDestroy.ts +56 -0
- package/src/types/instructions/updateCard.ts +54 -0
- package/src/types/instructions/updatePack.ts +71 -0
- package/src/types/instructions/updateSingle.ts +64 -0
- package/src/types/instructions/updateStore.ts +47 -0
- package/src/types/instructions/withdrawFromStore.ts +26 -0
- package/src/types/programId.ts +42 -0
- package/src/types/types/AccountClass.ts +868 -0
- package/src/types/types/AccountHasher.ts +89 -0
- package/src/types/types/ActionAfter.ts +202 -0
- package/src/types/types/AllowedCurrencyArgs.ts +53 -0
- package/src/types/types/AuthorityGateTypes.ts +90 -0
- package/src/types/types/BurnCount.ts +60 -0
- package/src/types/types/BurnState.ts +88 -0
- package/src/types/types/BurnTrack.ts +64 -0
- package/src/types/types/BurnType.ts +118 -0
- package/src/types/types/BurnTypeBurn.ts +56 -0
- package/src/types/types/BuyHistoryClass.ts +90 -0
- package/src/types/types/CardClass.ts +56 -0
- package/src/types/types/CardState.ts +238 -0
- package/src/types/types/CardTrack.ts +76 -0
- package/src/types/types/Category.ts +72 -0
- package/src/types/types/CnftData.ts +85 -0
- package/src/types/types/CollectTrack.ts +61 -0
- package/src/types/types/Collection.ts +64 -0
- package/src/types/types/CompactCnftData.ts +76 -0
- package/src/types/types/CoolTimePerAmountArgs.ts +72 -0
- package/src/types/types/Creator.ts +72 -0
- package/src/types/types/CreatorGateArgs.ts +53 -0
- package/src/types/types/CurrencyArtistProof.ts +85 -0
- package/src/types/types/CurrencyType.ts +259 -0
- package/src/types/types/DateTraitInit.ts +61 -0
- package/src/types/types/DateTraitInitMap.ts +72 -0
- package/src/types/types/Deposit.ts +85 -0
- package/src/types/types/DepositFormat.ts +90 -0
- package/src/types/types/DepositState.ts +88 -0
- package/src/types/types/DepositSubtype.ts +90 -0
- package/src/types/types/DepositTrack.ts +69 -0
- package/src/types/types/DepositTrackType.ts +120 -0
- package/src/types/types/DepositType.ts +245 -0
- package/src/types/types/Earnings.ts +37 -0
- package/src/types/types/EditionStoreType.ts +120 -0
- package/src/types/types/EncryptedPayload.ts +61 -0
- package/src/types/types/ExtraParameter.ts +117 -0
- package/src/types/types/FakeBurnCount.ts +64 -0
- package/src/types/types/FakeDeposit.ts +64 -0
- package/src/types/types/FakeTraitPair.ts +61 -0
- package/src/types/types/FakeTraitValue.ts +61 -0
- package/src/types/types/FakeVolumeTrack.ts +64 -0
- package/src/types/types/FeeType.ts +118 -0
- package/src/types/types/FeedingTraits.ts +57 -0
- package/src/types/types/Filter.ts +64 -0
- package/src/types/types/FilterType.ts +56 -0
- package/src/types/types/GeneralStore.ts +56 -0
- package/src/types/types/GenericStore.ts +64 -0
- package/src/types/types/GenericValue.ts +172 -0
- package/src/types/types/GlobalFee.ts +85 -0
- package/src/types/types/GlobalState.ts +148 -0
- package/src/types/types/IndexDate.ts +94 -0
- package/src/types/types/IndexDates.ts +64 -0
- package/src/types/types/Item.ts +53 -0
- package/src/types/types/ItemClass.ts +88 -0
- package/src/types/types/ItemState.ts +298 -0
- package/src/types/types/ItemTrack.ts +76 -0
- package/src/types/types/ListingPerWalletArgs.ts +53 -0
- package/src/types/types/MemeVaultProof.ts +64 -0
- package/src/types/types/MetadataArgs.ts +207 -0
- package/src/types/types/NonFungibleTraitInit.ts +64 -0
- package/src/types/types/NonFungibleTraitInitMap.ts +84 -0
- package/src/types/types/OnlyBetweenTimesArgs.ts +76 -0
- package/src/types/types/OnlyTheseDOWArgs.ts +53 -0
- package/src/types/types/PackConfig.ts +98 -0
- package/src/types/types/PackOpenHolderState.ts +120 -0
- package/src/types/types/PackRule.ts +85 -0
- package/src/types/types/PackState.ts +118 -0
- package/src/types/types/PackType.ts +118 -0
- package/src/types/types/PaymentClass.ts +118 -0
- package/src/types/types/PoolAccess.ts +88 -0
- package/src/types/types/PoolState.ts +88 -0
- package/src/types/types/PoolType.ts +88 -0
- package/src/types/types/Popularity.ts +76 -0
- package/src/types/types/PopularityState.ts +630 -0
- package/src/types/types/PreviousDonationRecord.ts +76 -0
- package/src/types/types/Price.ts +64 -0
- package/src/types/types/PriceRule.ts +216 -0
- package/src/types/types/RecoverDeposit.ts +56 -0
- package/src/types/types/Rule.ts +199 -0
- package/src/types/types/SaleConfig.ts +102 -0
- package/src/types/types/SaleTrack.ts +85 -0
- package/src/types/types/SaleType.ts +148 -0
- package/src/types/types/Seed.ts +61 -0
- package/src/types/types/SelectedCard.ts +61 -0
- package/src/types/types/SelectedZeroCard.ts +61 -0
- package/src/types/types/SemiFungibleTraitInit.ts +61 -0
- package/src/types/types/SemiFungibleTraitInitMap.ts +72 -0
- package/src/types/types/ShortCreator.ts +64 -0
- package/src/types/types/ShortMetadata.ts +145 -0
- package/src/types/types/ShortMetadataArgs.ts +111 -0
- package/src/types/types/StoreConfig.ts +98 -0
- package/src/types/types/StoreRule.ts +145 -0
- package/src/types/types/SuperCategory.ts +61 -0
- package/src/types/types/TightCardMetadata.ts +120 -0
- package/src/types/types/TimeRangeType.ts +120 -0
- package/src/types/types/TimedPerWalletArgs.ts +53 -0
- package/src/types/types/TokenMetadata.ts +72 -0
- package/src/types/types/TokenProgramVersion.ts +90 -0
- package/src/types/types/TokenStandard.ts +150 -0
- package/src/types/types/TokenState.ts +88 -0
- package/src/types/types/TokenType.ts +88 -0
- package/src/types/types/TotalPerTimeArgs.ts +85 -0
- package/src/types/types/TotalPerTimeWalletArgs.ts +61 -0
- package/src/types/types/TrackRegistry.ts +90 -0
- package/src/types/types/TraitInit.ts +210 -0
- package/src/types/types/TraitPass.ts +60 -0
- package/src/types/types/TraitPassType.ts +225 -0
- package/src/types/types/TraitType.ts +267 -0
- package/src/types/types/TraitValue.ts +72 -0
- package/src/types/types/UnlocksAfter.ts +172 -0
- package/src/types/types/UnwrapMetadata.ts +156 -0
- package/src/types/types/UseMethod.ts +118 -0
- package/src/types/types/Uses.ts +76 -0
- package/src/types/types/VerifyCollectionMetadata.ts +109 -0
- package/src/types/types/VolumeTrack.ts +61 -0
- package/src/types/types/WrappedSource.ts +85 -0
- package/src/types/types/ZeroConfig.ts +85 -0
- package/src/types/types/index.ts +798 -0
- package/src/utility/Connection.ts +9 -0
- package/src/utility/Holders.ts +8 -0
- package/src/utility/PdaManager.ts +230 -0
- package/src/utility/config.ts +32 -0
- package/src/utility/utils.ts +191 -0
- package/src/utility/validation.ts +229 -0
- package/tsconfig.json +12 -0
@@ -0,0 +1,89 @@
|
|
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 AccountHasherFields {
|
7
|
+
seeds: Array<types.SeedFields>
|
8
|
+
insertAt: number
|
9
|
+
program: PublicKey
|
10
|
+
bump: number
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface AccountHasherJSON {
|
14
|
+
seeds: Array<types.SeedJSON>
|
15
|
+
insertAt: number
|
16
|
+
program: string
|
17
|
+
bump: number
|
18
|
+
}
|
19
|
+
|
20
|
+
export class AccountHasher {
|
21
|
+
readonly seeds: Array<types.Seed>
|
22
|
+
readonly insertAt: number
|
23
|
+
readonly program: PublicKey
|
24
|
+
readonly bump: number
|
25
|
+
|
26
|
+
constructor(fields: AccountHasherFields) {
|
27
|
+
this.seeds = fields.seeds.map((item) => new types.Seed({ ...item }))
|
28
|
+
this.insertAt = fields.insertAt
|
29
|
+
this.program = fields.program
|
30
|
+
this.bump = fields.bump
|
31
|
+
}
|
32
|
+
|
33
|
+
static layout(property?: string) {
|
34
|
+
return borsh.struct(
|
35
|
+
[
|
36
|
+
borsh.vec(types.Seed.layout(), "seeds"),
|
37
|
+
borsh.u8("insertAt"),
|
38
|
+
borsh.publicKey("program"),
|
39
|
+
borsh.u8("bump"),
|
40
|
+
],
|
41
|
+
property
|
42
|
+
)
|
43
|
+
}
|
44
|
+
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
46
|
+
static fromDecoded(obj: any) {
|
47
|
+
return new AccountHasher({
|
48
|
+
seeds: obj.seeds.map(
|
49
|
+
(
|
50
|
+
item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
51
|
+
) => types.Seed.fromDecoded(item)
|
52
|
+
),
|
53
|
+
insertAt: obj.insertAt,
|
54
|
+
program: obj.program,
|
55
|
+
bump: obj.bump,
|
56
|
+
})
|
57
|
+
}
|
58
|
+
|
59
|
+
static toEncodable(fields: AccountHasherFields) {
|
60
|
+
return {
|
61
|
+
seeds: fields.seeds.map((item) => types.Seed.toEncodable(item)),
|
62
|
+
insertAt: fields.insertAt,
|
63
|
+
program: fields.program,
|
64
|
+
bump: fields.bump,
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
toJSON(): AccountHasherJSON {
|
69
|
+
return {
|
70
|
+
seeds: this.seeds.map((item) => item.toJSON()),
|
71
|
+
insertAt: this.insertAt,
|
72
|
+
program: this.program.toString(),
|
73
|
+
bump: this.bump,
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
static fromJSON(obj: AccountHasherJSON): AccountHasher {
|
78
|
+
return new AccountHasher({
|
79
|
+
seeds: obj.seeds.map((item) => types.Seed.fromJSON(item)),
|
80
|
+
insertAt: obj.insertAt,
|
81
|
+
program: new PublicKey(obj.program),
|
82
|
+
bump: obj.bump,
|
83
|
+
})
|
84
|
+
}
|
85
|
+
|
86
|
+
toEncodable() {
|
87
|
+
return AccountHasher.toEncodable(this)
|
88
|
+
}
|
89
|
+
}
|
@@ -0,0 +1,202 @@
|
|
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 MintingOutJSON {
|
7
|
+
kind: "MintingOut"
|
8
|
+
}
|
9
|
+
|
10
|
+
export class MintingOut {
|
11
|
+
static readonly discriminator = 0
|
12
|
+
static readonly kind = "MintingOut"
|
13
|
+
readonly discriminator = 0
|
14
|
+
readonly kind = "MintingOut"
|
15
|
+
|
16
|
+
toJSON(): MintingOutJSON {
|
17
|
+
return {
|
18
|
+
kind: "MintingOut",
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
toEncodable() {
|
23
|
+
return {
|
24
|
+
MintingOut: {},
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export type SupplyFields = {
|
30
|
+
limit: number
|
31
|
+
}
|
32
|
+
export type SupplyValue = {
|
33
|
+
limit: number
|
34
|
+
}
|
35
|
+
|
36
|
+
export interface SupplyJSON {
|
37
|
+
kind: "Supply"
|
38
|
+
value: {
|
39
|
+
limit: number
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
export class Supply {
|
44
|
+
static readonly discriminator = 1
|
45
|
+
static readonly kind = "Supply"
|
46
|
+
readonly discriminator = 1
|
47
|
+
readonly kind = "Supply"
|
48
|
+
readonly value: SupplyValue
|
49
|
+
|
50
|
+
constructor(value: SupplyFields) {
|
51
|
+
this.value = {
|
52
|
+
limit: value.limit,
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
toJSON(): SupplyJSON {
|
57
|
+
return {
|
58
|
+
kind: "Supply",
|
59
|
+
value: {
|
60
|
+
limit: this.value.limit,
|
61
|
+
},
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
toEncodable() {
|
66
|
+
return {
|
67
|
+
Supply: {
|
68
|
+
limit: this.value.limit,
|
69
|
+
},
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
export type HoursFields = {
|
75
|
+
hours: number
|
76
|
+
}
|
77
|
+
export type HoursValue = {
|
78
|
+
hours: number
|
79
|
+
}
|
80
|
+
|
81
|
+
export interface HoursJSON {
|
82
|
+
kind: "Hours"
|
83
|
+
value: {
|
84
|
+
hours: number
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
export class Hours {
|
89
|
+
static readonly discriminator = 2
|
90
|
+
static readonly kind = "Hours"
|
91
|
+
readonly discriminator = 2
|
92
|
+
readonly kind = "Hours"
|
93
|
+
readonly value: HoursValue
|
94
|
+
|
95
|
+
constructor(value: HoursFields) {
|
96
|
+
this.value = {
|
97
|
+
hours: value.hours,
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
toJSON(): HoursJSON {
|
102
|
+
return {
|
103
|
+
kind: "Hours",
|
104
|
+
value: {
|
105
|
+
hours: this.value.hours,
|
106
|
+
},
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
toEncodable() {
|
111
|
+
return {
|
112
|
+
Hours: {
|
113
|
+
hours: this.value.hours,
|
114
|
+
},
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
export interface SellingOutJSON {
|
120
|
+
kind: "SellingOut"
|
121
|
+
}
|
122
|
+
|
123
|
+
export class SellingOut {
|
124
|
+
static readonly discriminator = 3
|
125
|
+
static readonly kind = "SellingOut"
|
126
|
+
readonly discriminator = 3
|
127
|
+
readonly kind = "SellingOut"
|
128
|
+
|
129
|
+
toJSON(): SellingOutJSON {
|
130
|
+
return {
|
131
|
+
kind: "SellingOut",
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
toEncodable() {
|
136
|
+
return {
|
137
|
+
SellingOut: {},
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
143
|
+
export function fromDecoded(obj: any): types.ActionAfterKind {
|
144
|
+
if (typeof obj !== "object") {
|
145
|
+
throw new Error("Invalid enum object")
|
146
|
+
}
|
147
|
+
|
148
|
+
if ("MintingOut" in obj) {
|
149
|
+
return new MintingOut()
|
150
|
+
}
|
151
|
+
if ("Supply" in obj) {
|
152
|
+
const val = obj["Supply"]
|
153
|
+
return new Supply({
|
154
|
+
limit: val["limit"],
|
155
|
+
})
|
156
|
+
}
|
157
|
+
if ("Hours" in obj) {
|
158
|
+
const val = obj["Hours"]
|
159
|
+
return new Hours({
|
160
|
+
hours: val["hours"],
|
161
|
+
})
|
162
|
+
}
|
163
|
+
if ("SellingOut" in obj) {
|
164
|
+
return new SellingOut()
|
165
|
+
}
|
166
|
+
|
167
|
+
throw new Error("Invalid enum object")
|
168
|
+
}
|
169
|
+
|
170
|
+
export function fromJSON(obj: types.ActionAfterJSON): types.ActionAfterKind {
|
171
|
+
switch (obj.kind) {
|
172
|
+
case "MintingOut": {
|
173
|
+
return new MintingOut()
|
174
|
+
}
|
175
|
+
case "Supply": {
|
176
|
+
return new Supply({
|
177
|
+
limit: obj.value.limit,
|
178
|
+
})
|
179
|
+
}
|
180
|
+
case "Hours": {
|
181
|
+
return new Hours({
|
182
|
+
hours: obj.value.hours,
|
183
|
+
})
|
184
|
+
}
|
185
|
+
case "SellingOut": {
|
186
|
+
return new SellingOut()
|
187
|
+
}
|
188
|
+
}
|
189
|
+
}
|
190
|
+
|
191
|
+
export function layout(property?: string) {
|
192
|
+
const ret = borsh.rustEnum([
|
193
|
+
borsh.struct([], "MintingOut"),
|
194
|
+
borsh.struct([borsh.u32("limit")], "Supply"),
|
195
|
+
borsh.struct([borsh.u16("hours")], "Hours"),
|
196
|
+
borsh.struct([], "SellingOut"),
|
197
|
+
])
|
198
|
+
if (property !== undefined) {
|
199
|
+
return ret.replicate(property)
|
200
|
+
}
|
201
|
+
return ret
|
202
|
+
}
|
@@ -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 AllowedCurrencyArgsFields {
|
7
|
+
id: number
|
8
|
+
}
|
9
|
+
|
10
|
+
export interface AllowedCurrencyArgsJSON {
|
11
|
+
id: number
|
12
|
+
}
|
13
|
+
|
14
|
+
export class AllowedCurrencyArgs {
|
15
|
+
readonly id: number
|
16
|
+
|
17
|
+
constructor(fields: AllowedCurrencyArgsFields) {
|
18
|
+
this.id = fields.id
|
19
|
+
}
|
20
|
+
|
21
|
+
static layout(property?: string) {
|
22
|
+
return borsh.struct([borsh.u16("id")], property)
|
23
|
+
}
|
24
|
+
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
26
|
+
static fromDecoded(obj: any) {
|
27
|
+
return new AllowedCurrencyArgs({
|
28
|
+
id: obj.id,
|
29
|
+
})
|
30
|
+
}
|
31
|
+
|
32
|
+
static toEncodable(fields: AllowedCurrencyArgsFields) {
|
33
|
+
return {
|
34
|
+
id: fields.id,
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
toJSON(): AllowedCurrencyArgsJSON {
|
39
|
+
return {
|
40
|
+
id: this.id,
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
static fromJSON(obj: AllowedCurrencyArgsJSON): AllowedCurrencyArgs {
|
45
|
+
return new AllowedCurrencyArgs({
|
46
|
+
id: obj.id,
|
47
|
+
})
|
48
|
+
}
|
49
|
+
|
50
|
+
toEncodable() {
|
51
|
+
return AllowedCurrencyArgs.toEncodable(this)
|
52
|
+
}
|
53
|
+
}
|
@@ -0,0 +1,90 @@
|
|
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 IPGateJSON {
|
7
|
+
kind: "IPGate"
|
8
|
+
}
|
9
|
+
|
10
|
+
export class IPGate {
|
11
|
+
static readonly discriminator = 0
|
12
|
+
static readonly kind = "IPGate"
|
13
|
+
readonly discriminator = 0
|
14
|
+
readonly kind = "IPGate"
|
15
|
+
|
16
|
+
toJSON(): IPGateJSON {
|
17
|
+
return {
|
18
|
+
kind: "IPGate",
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
toEncodable() {
|
23
|
+
return {
|
24
|
+
IPGate: {},
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface BiometricsGateJSON {
|
30
|
+
kind: "BiometricsGate"
|
31
|
+
}
|
32
|
+
|
33
|
+
export class BiometricsGate {
|
34
|
+
static readonly discriminator = 1
|
35
|
+
static readonly kind = "BiometricsGate"
|
36
|
+
readonly discriminator = 1
|
37
|
+
readonly kind = "BiometricsGate"
|
38
|
+
|
39
|
+
toJSON(): BiometricsGateJSON {
|
40
|
+
return {
|
41
|
+
kind: "BiometricsGate",
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
toEncodable() {
|
46
|
+
return {
|
47
|
+
BiometricsGate: {},
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
53
|
+
export function fromDecoded(obj: any): types.AuthorityGateTypesKind {
|
54
|
+
if (typeof obj !== "object") {
|
55
|
+
throw new Error("Invalid enum object")
|
56
|
+
}
|
57
|
+
|
58
|
+
if ("IPGate" in obj) {
|
59
|
+
return new IPGate()
|
60
|
+
}
|
61
|
+
if ("BiometricsGate" in obj) {
|
62
|
+
return new BiometricsGate()
|
63
|
+
}
|
64
|
+
|
65
|
+
throw new Error("Invalid enum object")
|
66
|
+
}
|
67
|
+
|
68
|
+
export function fromJSON(
|
69
|
+
obj: types.AuthorityGateTypesJSON
|
70
|
+
): types.AuthorityGateTypesKind {
|
71
|
+
switch (obj.kind) {
|
72
|
+
case "IPGate": {
|
73
|
+
return new IPGate()
|
74
|
+
}
|
75
|
+
case "BiometricsGate": {
|
76
|
+
return new BiometricsGate()
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
export function layout(property?: string) {
|
82
|
+
const ret = borsh.rustEnum([
|
83
|
+
borsh.struct([], "IPGate"),
|
84
|
+
borsh.struct([], "BiometricsGate"),
|
85
|
+
])
|
86
|
+
if (property !== undefined) {
|
87
|
+
return ret.replicate(property)
|
88
|
+
}
|
89
|
+
return ret
|
90
|
+
}
|
@@ -0,0 +1,60 @@
|
|
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 BurnCountFields {
|
7
|
+
list: Array<types.FakeBurnCountFields>
|
8
|
+
}
|
9
|
+
|
10
|
+
export interface BurnCountJSON {
|
11
|
+
list: Array<types.FakeBurnCountJSON>
|
12
|
+
}
|
13
|
+
|
14
|
+
export class BurnCount {
|
15
|
+
readonly list: Array<types.FakeBurnCount>
|
16
|
+
|
17
|
+
constructor(fields: BurnCountFields) {
|
18
|
+
this.list = fields.list.map((item) => new types.FakeBurnCount({ ...item }))
|
19
|
+
}
|
20
|
+
|
21
|
+
static layout(property?: string) {
|
22
|
+
return borsh.struct(
|
23
|
+
[borsh.vec(types.FakeBurnCount.layout(), "list")],
|
24
|
+
property
|
25
|
+
)
|
26
|
+
}
|
27
|
+
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
29
|
+
static fromDecoded(obj: any) {
|
30
|
+
return new BurnCount({
|
31
|
+
list: obj.list.map(
|
32
|
+
(
|
33
|
+
item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
34
|
+
) => types.FakeBurnCount.fromDecoded(item)
|
35
|
+
),
|
36
|
+
})
|
37
|
+
}
|
38
|
+
|
39
|
+
static toEncodable(fields: BurnCountFields) {
|
40
|
+
return {
|
41
|
+
list: fields.list.map((item) => types.FakeBurnCount.toEncodable(item)),
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
toJSON(): BurnCountJSON {
|
46
|
+
return {
|
47
|
+
list: this.list.map((item) => item.toJSON()),
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
static fromJSON(obj: BurnCountJSON): BurnCount {
|
52
|
+
return new BurnCount({
|
53
|
+
list: obj.list.map((item) => types.FakeBurnCount.fromJSON(item)),
|
54
|
+
})
|
55
|
+
}
|
56
|
+
|
57
|
+
toEncodable() {
|
58
|
+
return BurnCount.toEncodable(this)
|
59
|
+
}
|
60
|
+
}
|
@@ -0,0 +1,88 @@
|
|
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 NonPendingJSON {
|
7
|
+
kind: "NonPending"
|
8
|
+
}
|
9
|
+
|
10
|
+
export class NonPending {
|
11
|
+
static readonly discriminator = 0
|
12
|
+
static readonly kind = "NonPending"
|
13
|
+
readonly discriminator = 0
|
14
|
+
readonly kind = "NonPending"
|
15
|
+
|
16
|
+
toJSON(): NonPendingJSON {
|
17
|
+
return {
|
18
|
+
kind: "NonPending",
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
toEncodable() {
|
23
|
+
return {
|
24
|
+
NonPending: {},
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface PendingJSON {
|
30
|
+
kind: "Pending"
|
31
|
+
}
|
32
|
+
|
33
|
+
export class Pending {
|
34
|
+
static readonly discriminator = 1
|
35
|
+
static readonly kind = "Pending"
|
36
|
+
readonly discriminator = 1
|
37
|
+
readonly kind = "Pending"
|
38
|
+
|
39
|
+
toJSON(): PendingJSON {
|
40
|
+
return {
|
41
|
+
kind: "Pending",
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
toEncodable() {
|
46
|
+
return {
|
47
|
+
Pending: {},
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
53
|
+
export function fromDecoded(obj: any): types.BurnStateKind {
|
54
|
+
if (typeof obj !== "object") {
|
55
|
+
throw new Error("Invalid enum object")
|
56
|
+
}
|
57
|
+
|
58
|
+
if ("NonPending" in obj) {
|
59
|
+
return new NonPending()
|
60
|
+
}
|
61
|
+
if ("Pending" in obj) {
|
62
|
+
return new Pending()
|
63
|
+
}
|
64
|
+
|
65
|
+
throw new Error("Invalid enum object")
|
66
|
+
}
|
67
|
+
|
68
|
+
export function fromJSON(obj: types.BurnStateJSON): types.BurnStateKind {
|
69
|
+
switch (obj.kind) {
|
70
|
+
case "NonPending": {
|
71
|
+
return new NonPending()
|
72
|
+
}
|
73
|
+
case "Pending": {
|
74
|
+
return new Pending()
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
export function layout(property?: string) {
|
80
|
+
const ret = borsh.rustEnum([
|
81
|
+
borsh.struct([], "NonPending"),
|
82
|
+
borsh.struct([], "Pending"),
|
83
|
+
])
|
84
|
+
if (property !== undefined) {
|
85
|
+
return ret.replicate(property)
|
86
|
+
}
|
87
|
+
return ret
|
88
|
+
}
|
@@ -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 BurnTrackFields {
|
7
|
+
amount: number
|
8
|
+
burnType: types.BurnTypeBurnKind
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface BurnTrackJSON {
|
12
|
+
amount: number
|
13
|
+
burnType: types.BurnTypeBurnJSON
|
14
|
+
}
|
15
|
+
|
16
|
+
export class BurnTrack {
|
17
|
+
readonly amount: number
|
18
|
+
readonly burnType: types.BurnTypeBurnKind
|
19
|
+
|
20
|
+
constructor(fields: BurnTrackFields) {
|
21
|
+
this.amount = fields.amount
|
22
|
+
this.burnType = fields.burnType
|
23
|
+
}
|
24
|
+
|
25
|
+
static layout(property?: string) {
|
26
|
+
return borsh.struct(
|
27
|
+
[borsh.u16("amount"), types.BurnTypeBurn.layout("burnType")],
|
28
|
+
property
|
29
|
+
)
|
30
|
+
}
|
31
|
+
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
33
|
+
static fromDecoded(obj: any) {
|
34
|
+
return new BurnTrack({
|
35
|
+
amount: obj.amount,
|
36
|
+
burnType: types.BurnTypeBurn.fromDecoded(obj.burnType),
|
37
|
+
})
|
38
|
+
}
|
39
|
+
|
40
|
+
static toEncodable(fields: BurnTrackFields) {
|
41
|
+
return {
|
42
|
+
amount: fields.amount,
|
43
|
+
burnType: fields.burnType.toEncodable(),
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
toJSON(): BurnTrackJSON {
|
48
|
+
return {
|
49
|
+
amount: this.amount,
|
50
|
+
burnType: this.burnType.toJSON(),
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
static fromJSON(obj: BurnTrackJSON): BurnTrack {
|
55
|
+
return new BurnTrack({
|
56
|
+
amount: obj.amount,
|
57
|
+
burnType: types.BurnTypeBurn.fromJSON(obj.burnType),
|
58
|
+
})
|
59
|
+
}
|
60
|
+
|
61
|
+
toEncodable() {
|
62
|
+
return BurnTrack.toEncodable(this)
|
63
|
+
}
|
64
|
+
}
|