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,85 @@
|
|
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 CnftDataFields {
|
7
|
+
root: Array<number>
|
8
|
+
dataHash: Array<number>
|
9
|
+
creatorHash: Array<number>
|
10
|
+
index: number
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface CnftDataJSON {
|
14
|
+
root: Array<number>
|
15
|
+
dataHash: Array<number>
|
16
|
+
creatorHash: Array<number>
|
17
|
+
index: number
|
18
|
+
}
|
19
|
+
|
20
|
+
export class CnftData {
|
21
|
+
readonly root: Array<number>
|
22
|
+
readonly dataHash: Array<number>
|
23
|
+
readonly creatorHash: Array<number>
|
24
|
+
readonly index: number
|
25
|
+
|
26
|
+
constructor(fields: CnftDataFields) {
|
27
|
+
this.root = fields.root
|
28
|
+
this.dataHash = fields.dataHash
|
29
|
+
this.creatorHash = fields.creatorHash
|
30
|
+
this.index = fields.index
|
31
|
+
}
|
32
|
+
|
33
|
+
static layout(property?: string) {
|
34
|
+
return borsh.struct(
|
35
|
+
[
|
36
|
+
borsh.array(borsh.u8(), 32, "root"),
|
37
|
+
borsh.array(borsh.u8(), 32, "dataHash"),
|
38
|
+
borsh.array(borsh.u8(), 32, "creatorHash"),
|
39
|
+
borsh.u32("index"),
|
40
|
+
],
|
41
|
+
property
|
42
|
+
)
|
43
|
+
}
|
44
|
+
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
46
|
+
static fromDecoded(obj: any) {
|
47
|
+
return new CnftData({
|
48
|
+
root: obj.root,
|
49
|
+
dataHash: obj.dataHash,
|
50
|
+
creatorHash: obj.creatorHash,
|
51
|
+
index: obj.index,
|
52
|
+
})
|
53
|
+
}
|
54
|
+
|
55
|
+
static toEncodable(fields: CnftDataFields) {
|
56
|
+
return {
|
57
|
+
root: fields.root,
|
58
|
+
dataHash: fields.dataHash,
|
59
|
+
creatorHash: fields.creatorHash,
|
60
|
+
index: fields.index,
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
toJSON(): CnftDataJSON {
|
65
|
+
return {
|
66
|
+
root: this.root,
|
67
|
+
dataHash: this.dataHash,
|
68
|
+
creatorHash: this.creatorHash,
|
69
|
+
index: this.index,
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
static fromJSON(obj: CnftDataJSON): CnftData {
|
74
|
+
return new CnftData({
|
75
|
+
root: obj.root,
|
76
|
+
dataHash: obj.dataHash,
|
77
|
+
creatorHash: obj.creatorHash,
|
78
|
+
index: obj.index,
|
79
|
+
})
|
80
|
+
}
|
81
|
+
|
82
|
+
toEncodable() {
|
83
|
+
return CnftData.toEncodable(this)
|
84
|
+
}
|
85
|
+
}
|
@@ -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 CollectTrackFields {
|
7
|
+
collected: BN
|
8
|
+
spent: BN
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface CollectTrackJSON {
|
12
|
+
collected: string
|
13
|
+
spent: string
|
14
|
+
}
|
15
|
+
|
16
|
+
export class CollectTrack {
|
17
|
+
readonly collected: BN
|
18
|
+
readonly spent: BN
|
19
|
+
|
20
|
+
constructor(fields: CollectTrackFields) {
|
21
|
+
this.collected = fields.collected
|
22
|
+
this.spent = fields.spent
|
23
|
+
}
|
24
|
+
|
25
|
+
static layout(property?: string) {
|
26
|
+
return borsh.struct([borsh.u64("collected"), borsh.u64("spent")], property)
|
27
|
+
}
|
28
|
+
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
30
|
+
static fromDecoded(obj: any) {
|
31
|
+
return new CollectTrack({
|
32
|
+
collected: obj.collected,
|
33
|
+
spent: obj.spent,
|
34
|
+
})
|
35
|
+
}
|
36
|
+
|
37
|
+
static toEncodable(fields: CollectTrackFields) {
|
38
|
+
return {
|
39
|
+
collected: fields.collected,
|
40
|
+
spent: fields.spent,
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
toJSON(): CollectTrackJSON {
|
45
|
+
return {
|
46
|
+
collected: this.collected.toString(),
|
47
|
+
spent: this.spent.toString(),
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
static fromJSON(obj: CollectTrackJSON): CollectTrack {
|
52
|
+
return new CollectTrack({
|
53
|
+
collected: new BN(obj.collected),
|
54
|
+
spent: new BN(obj.spent),
|
55
|
+
})
|
56
|
+
}
|
57
|
+
|
58
|
+
toEncodable() {
|
59
|
+
return CollectTrack.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 CollectionFields {
|
7
|
+
verified: boolean
|
8
|
+
key: PublicKey
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface CollectionJSON {
|
12
|
+
verified: boolean
|
13
|
+
key: string
|
14
|
+
}
|
15
|
+
|
16
|
+
export class Collection {
|
17
|
+
readonly verified: boolean
|
18
|
+
readonly key: PublicKey
|
19
|
+
|
20
|
+
constructor(fields: CollectionFields) {
|
21
|
+
this.verified = fields.verified
|
22
|
+
this.key = fields.key
|
23
|
+
}
|
24
|
+
|
25
|
+
static layout(property?: string) {
|
26
|
+
return borsh.struct(
|
27
|
+
[borsh.bool("verified"), borsh.publicKey("key")],
|
28
|
+
property
|
29
|
+
)
|
30
|
+
}
|
31
|
+
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
33
|
+
static fromDecoded(obj: any) {
|
34
|
+
return new Collection({
|
35
|
+
verified: obj.verified,
|
36
|
+
key: obj.key,
|
37
|
+
})
|
38
|
+
}
|
39
|
+
|
40
|
+
static toEncodable(fields: CollectionFields) {
|
41
|
+
return {
|
42
|
+
verified: fields.verified,
|
43
|
+
key: fields.key,
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
toJSON(): CollectionJSON {
|
48
|
+
return {
|
49
|
+
verified: this.verified,
|
50
|
+
key: this.key.toString(),
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
static fromJSON(obj: CollectionJSON): Collection {
|
55
|
+
return new Collection({
|
56
|
+
verified: obj.verified,
|
57
|
+
key: new PublicKey(obj.key),
|
58
|
+
})
|
59
|
+
}
|
60
|
+
|
61
|
+
toEncodable() {
|
62
|
+
return Collection.toEncodable(this)
|
63
|
+
}
|
64
|
+
}
|
@@ -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 CompactCnftDataFields {
|
7
|
+
root: Array<number>
|
8
|
+
arweave: string
|
9
|
+
index: number
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface CompactCnftDataJSON {
|
13
|
+
root: Array<number>
|
14
|
+
arweave: string
|
15
|
+
index: number
|
16
|
+
}
|
17
|
+
|
18
|
+
export class CompactCnftData {
|
19
|
+
readonly root: Array<number>
|
20
|
+
readonly arweave: string
|
21
|
+
readonly index: number
|
22
|
+
|
23
|
+
constructor(fields: CompactCnftDataFields) {
|
24
|
+
this.root = fields.root
|
25
|
+
this.arweave = fields.arweave
|
26
|
+
this.index = fields.index
|
27
|
+
}
|
28
|
+
|
29
|
+
static layout(property?: string) {
|
30
|
+
return borsh.struct(
|
31
|
+
[
|
32
|
+
borsh.array(borsh.u8(), 32, "root"),
|
33
|
+
borsh.str("arweave"),
|
34
|
+
borsh.u32("index"),
|
35
|
+
],
|
36
|
+
property
|
37
|
+
)
|
38
|
+
}
|
39
|
+
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
41
|
+
static fromDecoded(obj: any) {
|
42
|
+
return new CompactCnftData({
|
43
|
+
root: obj.root,
|
44
|
+
arweave: obj.arweave,
|
45
|
+
index: obj.index,
|
46
|
+
})
|
47
|
+
}
|
48
|
+
|
49
|
+
static toEncodable(fields: CompactCnftDataFields) {
|
50
|
+
return {
|
51
|
+
root: fields.root,
|
52
|
+
arweave: fields.arweave,
|
53
|
+
index: fields.index,
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
toJSON(): CompactCnftDataJSON {
|
58
|
+
return {
|
59
|
+
root: this.root,
|
60
|
+
arweave: this.arweave,
|
61
|
+
index: this.index,
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
static fromJSON(obj: CompactCnftDataJSON): CompactCnftData {
|
66
|
+
return new CompactCnftData({
|
67
|
+
root: obj.root,
|
68
|
+
arweave: obj.arweave,
|
69
|
+
index: obj.index,
|
70
|
+
})
|
71
|
+
}
|
72
|
+
|
73
|
+
toEncodable() {
|
74
|
+
return CompactCnftData.toEncodable(this)
|
75
|
+
}
|
76
|
+
}
|
@@ -0,0 +1,72 @@
|
|
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 CoolTimePerAmountArgsFields {
|
7
|
+
count: number
|
8
|
+
amount: number
|
9
|
+
time: number
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface CoolTimePerAmountArgsJSON {
|
13
|
+
count: number
|
14
|
+
amount: number
|
15
|
+
time: number
|
16
|
+
}
|
17
|
+
|
18
|
+
export class CoolTimePerAmountArgs {
|
19
|
+
readonly count: number
|
20
|
+
readonly amount: number
|
21
|
+
readonly time: number
|
22
|
+
|
23
|
+
constructor(fields: CoolTimePerAmountArgsFields) {
|
24
|
+
this.count = fields.count
|
25
|
+
this.amount = fields.amount
|
26
|
+
this.time = fields.time
|
27
|
+
}
|
28
|
+
|
29
|
+
static layout(property?: string) {
|
30
|
+
return borsh.struct(
|
31
|
+
[borsh.u16("count"), borsh.u16("amount"), borsh.u32("time")],
|
32
|
+
property
|
33
|
+
)
|
34
|
+
}
|
35
|
+
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
37
|
+
static fromDecoded(obj: any) {
|
38
|
+
return new CoolTimePerAmountArgs({
|
39
|
+
count: obj.count,
|
40
|
+
amount: obj.amount,
|
41
|
+
time: obj.time,
|
42
|
+
})
|
43
|
+
}
|
44
|
+
|
45
|
+
static toEncodable(fields: CoolTimePerAmountArgsFields) {
|
46
|
+
return {
|
47
|
+
count: fields.count,
|
48
|
+
amount: fields.amount,
|
49
|
+
time: fields.time,
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
toJSON(): CoolTimePerAmountArgsJSON {
|
54
|
+
return {
|
55
|
+
count: this.count,
|
56
|
+
amount: this.amount,
|
57
|
+
time: this.time,
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
static fromJSON(obj: CoolTimePerAmountArgsJSON): CoolTimePerAmountArgs {
|
62
|
+
return new CoolTimePerAmountArgs({
|
63
|
+
count: obj.count,
|
64
|
+
amount: obj.amount,
|
65
|
+
time: obj.time,
|
66
|
+
})
|
67
|
+
}
|
68
|
+
|
69
|
+
toEncodable() {
|
70
|
+
return CoolTimePerAmountArgs.toEncodable(this)
|
71
|
+
}
|
72
|
+
}
|
@@ -0,0 +1,72 @@
|
|
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 CreatorFields {
|
7
|
+
address: PublicKey
|
8
|
+
verified: boolean
|
9
|
+
share: number
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface CreatorJSON {
|
13
|
+
address: string
|
14
|
+
verified: boolean
|
15
|
+
share: number
|
16
|
+
}
|
17
|
+
|
18
|
+
export class Creator {
|
19
|
+
readonly address: PublicKey
|
20
|
+
readonly verified: boolean
|
21
|
+
readonly share: number
|
22
|
+
|
23
|
+
constructor(fields: CreatorFields) {
|
24
|
+
this.address = fields.address
|
25
|
+
this.verified = fields.verified
|
26
|
+
this.share = fields.share
|
27
|
+
}
|
28
|
+
|
29
|
+
static layout(property?: string) {
|
30
|
+
return borsh.struct(
|
31
|
+
[borsh.publicKey("address"), borsh.bool("verified"), borsh.u8("share")],
|
32
|
+
property
|
33
|
+
)
|
34
|
+
}
|
35
|
+
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
37
|
+
static fromDecoded(obj: any) {
|
38
|
+
return new Creator({
|
39
|
+
address: obj.address,
|
40
|
+
verified: obj.verified,
|
41
|
+
share: obj.share,
|
42
|
+
})
|
43
|
+
}
|
44
|
+
|
45
|
+
static toEncodable(fields: CreatorFields) {
|
46
|
+
return {
|
47
|
+
address: fields.address,
|
48
|
+
verified: fields.verified,
|
49
|
+
share: fields.share,
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
toJSON(): CreatorJSON {
|
54
|
+
return {
|
55
|
+
address: this.address.toString(),
|
56
|
+
verified: this.verified,
|
57
|
+
share: this.share,
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
static fromJSON(obj: CreatorJSON): Creator {
|
62
|
+
return new Creator({
|
63
|
+
address: new PublicKey(obj.address),
|
64
|
+
verified: obj.verified,
|
65
|
+
share: obj.share,
|
66
|
+
})
|
67
|
+
}
|
68
|
+
|
69
|
+
toEncodable() {
|
70
|
+
return Creator.toEncodable(this)
|
71
|
+
}
|
72
|
+
}
|
@@ -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 CreatorGateArgsFields {
|
7
|
+
key: PublicKey
|
8
|
+
}
|
9
|
+
|
10
|
+
export interface CreatorGateArgsJSON {
|
11
|
+
key: string
|
12
|
+
}
|
13
|
+
|
14
|
+
export class CreatorGateArgs {
|
15
|
+
readonly key: PublicKey
|
16
|
+
|
17
|
+
constructor(fields: CreatorGateArgsFields) {
|
18
|
+
this.key = fields.key
|
19
|
+
}
|
20
|
+
|
21
|
+
static layout(property?: string) {
|
22
|
+
return borsh.struct([borsh.publicKey("key")], property)
|
23
|
+
}
|
24
|
+
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
26
|
+
static fromDecoded(obj: any) {
|
27
|
+
return new CreatorGateArgs({
|
28
|
+
key: obj.key,
|
29
|
+
})
|
30
|
+
}
|
31
|
+
|
32
|
+
static toEncodable(fields: CreatorGateArgsFields) {
|
33
|
+
return {
|
34
|
+
key: fields.key,
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
toJSON(): CreatorGateArgsJSON {
|
39
|
+
return {
|
40
|
+
key: this.key.toString(),
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
static fromJSON(obj: CreatorGateArgsJSON): CreatorGateArgs {
|
45
|
+
return new CreatorGateArgs({
|
46
|
+
key: new PublicKey(obj.key),
|
47
|
+
})
|
48
|
+
}
|
49
|
+
|
50
|
+
toEncodable() {
|
51
|
+
return CreatorGateArgs.toEncodable(this)
|
52
|
+
}
|
53
|
+
}
|
@@ -0,0 +1,85 @@
|
|
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 CurrencyArtistProofFields {
|
7
|
+
proofHash: BN
|
8
|
+
amount: BN
|
9
|
+
currencyVerifier: BN//number
|
10
|
+
artistVerifier: BN//number
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface CurrencyArtistProofJSON {
|
14
|
+
proofHash: string
|
15
|
+
amount: string
|
16
|
+
currencyVerifier: BN//number
|
17
|
+
artistVerifier: BN//number
|
18
|
+
}
|
19
|
+
|
20
|
+
export class CurrencyArtistProof {
|
21
|
+
readonly proofHash: BN
|
22
|
+
readonly amount: BN
|
23
|
+
readonly currencyVerifier: BN//number
|
24
|
+
readonly artistVerifier: BN//number
|
25
|
+
|
26
|
+
constructor(fields: CurrencyArtistProofFields) {
|
27
|
+
this.proofHash = fields.proofHash
|
28
|
+
this.amount = fields.amount
|
29
|
+
this.currencyVerifier = fields.currencyVerifier
|
30
|
+
this.artistVerifier = fields.artistVerifier
|
31
|
+
}
|
32
|
+
|
33
|
+
static layout(property?: string) {
|
34
|
+
return borsh.struct(
|
35
|
+
[
|
36
|
+
borsh.u64("proofHash"),
|
37
|
+
borsh.u64("amount"),
|
38
|
+
borsh.u32("currencyVerifier"),
|
39
|
+
borsh.u32("artistVerifier"),
|
40
|
+
],
|
41
|
+
property
|
42
|
+
)
|
43
|
+
}
|
44
|
+
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
46
|
+
static fromDecoded(obj: any) {
|
47
|
+
return new CurrencyArtistProof({
|
48
|
+
proofHash: obj.proofHash,
|
49
|
+
amount: obj.amount,
|
50
|
+
currencyVerifier: obj.currencyVerifier,
|
51
|
+
artistVerifier: obj.artistVerifier,
|
52
|
+
})
|
53
|
+
}
|
54
|
+
|
55
|
+
static toEncodable(fields: CurrencyArtistProofFields) {
|
56
|
+
return {
|
57
|
+
proofHash: fields.proofHash,
|
58
|
+
amount: fields.amount,
|
59
|
+
currencyVerifier: fields.currencyVerifier,
|
60
|
+
artistVerifier: fields.artistVerifier,
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
toJSON(): CurrencyArtistProofJSON {
|
65
|
+
return {
|
66
|
+
proofHash: this.proofHash.toString(),
|
67
|
+
amount: this.amount.toString(),
|
68
|
+
currencyVerifier: this.currencyVerifier,
|
69
|
+
artistVerifier: this.artistVerifier,
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
static fromJSON(obj: CurrencyArtistProofJSON): CurrencyArtistProof {
|
74
|
+
return new CurrencyArtistProof({
|
75
|
+
proofHash: new BN(obj.proofHash),
|
76
|
+
amount: new BN(obj.amount),
|
77
|
+
currencyVerifier: obj.currencyVerifier,
|
78
|
+
artistVerifier: obj.artistVerifier,
|
79
|
+
})
|
80
|
+
}
|
81
|
+
|
82
|
+
toEncodable() {
|
83
|
+
return CurrencyArtistProof.toEncodable(this)
|
84
|
+
}
|
85
|
+
}
|