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,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 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 interface ThreeJSON {
|
30
|
+
kind: "Three"
|
31
|
+
}
|
32
|
+
|
33
|
+
export class Three {
|
34
|
+
static readonly discriminator = 1
|
35
|
+
static readonly kind = "Three"
|
36
|
+
readonly discriminator = 1
|
37
|
+
readonly kind = "Three"
|
38
|
+
|
39
|
+
toJSON(): ThreeJSON {
|
40
|
+
return {
|
41
|
+
kind: "Three",
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
toEncodable() {
|
46
|
+
return {
|
47
|
+
Three: {},
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
53
|
+
export function fromDecoded(obj: any): types.DepositSubtypeKind {
|
54
|
+
if (typeof obj !== "object") {
|
55
|
+
throw new Error("Invalid enum object")
|
56
|
+
}
|
57
|
+
|
58
|
+
if ("None" in obj) {
|
59
|
+
return new None()
|
60
|
+
}
|
61
|
+
if ("Three" in obj) {
|
62
|
+
return new Three()
|
63
|
+
}
|
64
|
+
|
65
|
+
throw new Error("Invalid enum object")
|
66
|
+
}
|
67
|
+
|
68
|
+
export function fromJSON(
|
69
|
+
obj: types.DepositSubtypeJSON
|
70
|
+
): types.DepositSubtypeKind {
|
71
|
+
switch (obj.kind) {
|
72
|
+
case "None": {
|
73
|
+
return new None()
|
74
|
+
}
|
75
|
+
case "Three": {
|
76
|
+
return new Three()
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
export function layout(property?: string) {
|
82
|
+
const ret = borsh.rustEnum([
|
83
|
+
borsh.struct([], "None"),
|
84
|
+
borsh.struct([], "Three"),
|
85
|
+
])
|
86
|
+
if (property !== undefined) {
|
87
|
+
return ret.replicate(property)
|
88
|
+
}
|
89
|
+
return ret
|
90
|
+
}
|
@@ -0,0 +1,69 @@
|
|
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 DepositTrackFields {
|
7
|
+
depositTrackType: types.DepositTrackTypeKind
|
8
|
+
depositState: types.DepositStateKind
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface DepositTrackJSON {
|
12
|
+
depositTrackType: types.DepositTrackTypeJSON
|
13
|
+
depositState: types.DepositStateJSON
|
14
|
+
}
|
15
|
+
|
16
|
+
export class DepositTrack {
|
17
|
+
readonly depositTrackType: types.DepositTrackTypeKind
|
18
|
+
readonly depositState: types.DepositStateKind
|
19
|
+
|
20
|
+
constructor(fields: DepositTrackFields) {
|
21
|
+
this.depositTrackType = fields.depositTrackType
|
22
|
+
this.depositState = fields.depositState
|
23
|
+
}
|
24
|
+
|
25
|
+
static layout(property?: string) {
|
26
|
+
return borsh.struct(
|
27
|
+
[
|
28
|
+
types.DepositTrackType.layout("depositTrackType"),
|
29
|
+
types.DepositState.layout("depositState"),
|
30
|
+
],
|
31
|
+
property
|
32
|
+
)
|
33
|
+
}
|
34
|
+
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
36
|
+
static fromDecoded(obj: any) {
|
37
|
+
return new DepositTrack({
|
38
|
+
depositTrackType: types.DepositTrackType.fromDecoded(
|
39
|
+
obj.depositTrackType
|
40
|
+
),
|
41
|
+
depositState: types.DepositState.fromDecoded(obj.depositState),
|
42
|
+
})
|
43
|
+
}
|
44
|
+
|
45
|
+
static toEncodable(fields: DepositTrackFields) {
|
46
|
+
return {
|
47
|
+
depositTrackType: fields.depositTrackType.toEncodable(),
|
48
|
+
depositState: fields.depositState.toEncodable(),
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
toJSON(): DepositTrackJSON {
|
53
|
+
return {
|
54
|
+
depositTrackType: this.depositTrackType.toJSON(),
|
55
|
+
depositState: this.depositState.toJSON(),
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
static fromJSON(obj: DepositTrackJSON): DepositTrack {
|
60
|
+
return new DepositTrack({
|
61
|
+
depositTrackType: types.DepositTrackType.fromJSON(obj.depositTrackType),
|
62
|
+
depositState: types.DepositState.fromJSON(obj.depositState),
|
63
|
+
})
|
64
|
+
}
|
65
|
+
|
66
|
+
toEncodable() {
|
67
|
+
return DepositTrack.toEncodable(this)
|
68
|
+
}
|
69
|
+
}
|
@@ -0,0 +1,120 @@
|
|
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 CreatorJSON {
|
7
|
+
kind: "Creator"
|
8
|
+
}
|
9
|
+
|
10
|
+
export class Creator {
|
11
|
+
static readonly discriminator = 0
|
12
|
+
static readonly kind = "Creator"
|
13
|
+
readonly discriminator = 0
|
14
|
+
readonly kind = "Creator"
|
15
|
+
|
16
|
+
toJSON(): CreatorJSON {
|
17
|
+
return {
|
18
|
+
kind: "Creator",
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
toEncodable() {
|
23
|
+
return {
|
24
|
+
Creator: {},
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface PdaCreatorJSON {
|
30
|
+
kind: "PdaCreator"
|
31
|
+
}
|
32
|
+
|
33
|
+
export class PdaCreator {
|
34
|
+
static readonly discriminator = 1
|
35
|
+
static readonly kind = "PdaCreator"
|
36
|
+
readonly discriminator = 1
|
37
|
+
readonly kind = "PdaCreator"
|
38
|
+
|
39
|
+
toJSON(): PdaCreatorJSON {
|
40
|
+
return {
|
41
|
+
kind: "PdaCreator",
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
toEncodable() {
|
46
|
+
return {
|
47
|
+
PdaCreator: {},
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
export interface CollectionJSON {
|
53
|
+
kind: "Collection"
|
54
|
+
}
|
55
|
+
|
56
|
+
export class Collection {
|
57
|
+
static readonly discriminator = 2
|
58
|
+
static readonly kind = "Collection"
|
59
|
+
readonly discriminator = 2
|
60
|
+
readonly kind = "Collection"
|
61
|
+
|
62
|
+
toJSON(): CollectionJSON {
|
63
|
+
return {
|
64
|
+
kind: "Collection",
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
toEncodable() {
|
69
|
+
return {
|
70
|
+
Collection: {},
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
76
|
+
export function fromDecoded(obj: any): types.DepositTrackTypeKind {
|
77
|
+
if (typeof obj !== "object") {
|
78
|
+
throw new Error("Invalid enum object")
|
79
|
+
}
|
80
|
+
|
81
|
+
if ("Creator" in obj) {
|
82
|
+
return new Creator()
|
83
|
+
}
|
84
|
+
if ("PdaCreator" in obj) {
|
85
|
+
return new PdaCreator()
|
86
|
+
}
|
87
|
+
if ("Collection" in obj) {
|
88
|
+
return new Collection()
|
89
|
+
}
|
90
|
+
|
91
|
+
throw new Error("Invalid enum object")
|
92
|
+
}
|
93
|
+
|
94
|
+
export function fromJSON(
|
95
|
+
obj: types.DepositTrackTypeJSON
|
96
|
+
): types.DepositTrackTypeKind {
|
97
|
+
switch (obj.kind) {
|
98
|
+
case "Creator": {
|
99
|
+
return new Creator()
|
100
|
+
}
|
101
|
+
case "PdaCreator": {
|
102
|
+
return new PdaCreator()
|
103
|
+
}
|
104
|
+
case "Collection": {
|
105
|
+
return new Collection()
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
export function layout(property?: string) {
|
111
|
+
const ret = borsh.rustEnum([
|
112
|
+
borsh.struct([], "Creator"),
|
113
|
+
borsh.struct([], "PdaCreator"),
|
114
|
+
borsh.struct([], "Collection"),
|
115
|
+
])
|
116
|
+
if (property !== undefined) {
|
117
|
+
return ret.replicate(property)
|
118
|
+
}
|
119
|
+
return ret
|
120
|
+
}
|
@@ -0,0 +1,245 @@
|
|
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 type CreatorFields = {
|
7
|
+
creators: Array<types.CreatorFields>
|
8
|
+
}
|
9
|
+
export type CreatorValue = {
|
10
|
+
creators: Array<types.Creator>
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface CreatorJSON {
|
14
|
+
kind: "Creator"
|
15
|
+
value: {
|
16
|
+
creators: Array<types.CreatorJSON>
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
export class Creator {
|
21
|
+
static readonly discriminator = 0
|
22
|
+
static readonly kind = "Creator"
|
23
|
+
readonly discriminator = 0
|
24
|
+
readonly kind = "Creator"
|
25
|
+
readonly value: CreatorValue
|
26
|
+
|
27
|
+
constructor(value: CreatorFields) {
|
28
|
+
this.value = {
|
29
|
+
creators: value.creators.map((item) => new types.Creator({ ...item })),
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
toJSON(): CreatorJSON {
|
34
|
+
return {
|
35
|
+
kind: "Creator",
|
36
|
+
value: {
|
37
|
+
creators: this.value.creators.map((item) => item.toJSON()),
|
38
|
+
},
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
toEncodable() {
|
43
|
+
return {
|
44
|
+
Creator: {
|
45
|
+
creators: this.value.creators.map((item) =>
|
46
|
+
types.Creator.toEncodable(item)
|
47
|
+
),
|
48
|
+
},
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
export type PdaCreatorFields = {
|
54
|
+
creators: Array<types.CreatorFields>
|
55
|
+
hasher: types.AccountHasherFields
|
56
|
+
}
|
57
|
+
export type PdaCreatorValue = {
|
58
|
+
creators: Array<types.Creator>
|
59
|
+
hasher: types.AccountHasher
|
60
|
+
}
|
61
|
+
|
62
|
+
export interface PdaCreatorJSON {
|
63
|
+
kind: "PdaCreator"
|
64
|
+
value: {
|
65
|
+
creators: Array<types.CreatorJSON>
|
66
|
+
hasher: types.AccountHasherJSON
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
export class PdaCreator {
|
71
|
+
static readonly discriminator = 1
|
72
|
+
static readonly kind = "PdaCreator"
|
73
|
+
readonly discriminator = 1
|
74
|
+
readonly kind = "PdaCreator"
|
75
|
+
readonly value: PdaCreatorValue
|
76
|
+
|
77
|
+
constructor(value: PdaCreatorFields) {
|
78
|
+
this.value = {
|
79
|
+
creators: value.creators.map((item) => new types.Creator({ ...item })),
|
80
|
+
hasher: new types.AccountHasher({ ...value.hasher }),
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
toJSON(): PdaCreatorJSON {
|
85
|
+
return {
|
86
|
+
kind: "PdaCreator",
|
87
|
+
value: {
|
88
|
+
creators: this.value.creators.map((item) => item.toJSON()),
|
89
|
+
hasher: this.value.hasher.toJSON(),
|
90
|
+
},
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
toEncodable() {
|
95
|
+
return {
|
96
|
+
PdaCreator: {
|
97
|
+
creators: this.value.creators.map((item) =>
|
98
|
+
types.Creator.toEncodable(item)
|
99
|
+
),
|
100
|
+
hasher: types.AccountHasher.toEncodable(this.value.hasher),
|
101
|
+
},
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
export type CollectionFields = {
|
107
|
+
metadata: types.VerifyCollectionMetadataFields
|
108
|
+
subtype: types.DepositSubtypeKind
|
109
|
+
}
|
110
|
+
export type CollectionValue = {
|
111
|
+
metadata: types.VerifyCollectionMetadata
|
112
|
+
subtype: types.DepositSubtypeKind
|
113
|
+
}
|
114
|
+
|
115
|
+
export interface CollectionJSON {
|
116
|
+
kind: "Collection"
|
117
|
+
value: {
|
118
|
+
metadata: types.VerifyCollectionMetadataJSON
|
119
|
+
subtype: types.DepositSubtypeJSON
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
export class Collection {
|
124
|
+
static readonly discriminator = 2
|
125
|
+
static readonly kind = "Collection"
|
126
|
+
readonly discriminator = 2
|
127
|
+
readonly kind = "Collection"
|
128
|
+
readonly value: CollectionValue
|
129
|
+
|
130
|
+
constructor(value: CollectionFields) {
|
131
|
+
this.value = {
|
132
|
+
metadata: new types.VerifyCollectionMetadata({ ...value.metadata }),
|
133
|
+
subtype: value.subtype,
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
toJSON(): CollectionJSON {
|
138
|
+
return {
|
139
|
+
kind: "Collection",
|
140
|
+
value: {
|
141
|
+
metadata: this.value.metadata.toJSON(),
|
142
|
+
subtype: this.value.subtype.toJSON(),
|
143
|
+
},
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
toEncodable() {
|
148
|
+
return {
|
149
|
+
Collection: {
|
150
|
+
metadata: types.VerifyCollectionMetadata.toEncodable(
|
151
|
+
this.value.metadata
|
152
|
+
),
|
153
|
+
subtype: this.value.subtype.toEncodable(),
|
154
|
+
},
|
155
|
+
}
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
159
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
160
|
+
export function fromDecoded(obj: any): types.DepositTypeKind {
|
161
|
+
if (typeof obj !== "object") {
|
162
|
+
throw new Error("Invalid enum object")
|
163
|
+
}
|
164
|
+
|
165
|
+
if ("Creator" in obj) {
|
166
|
+
const val = obj["Creator"]
|
167
|
+
return new Creator({
|
168
|
+
creators: val["creators"].map(
|
169
|
+
(
|
170
|
+
item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
171
|
+
) => types.Creator.fromDecoded(item)
|
172
|
+
),
|
173
|
+
})
|
174
|
+
}
|
175
|
+
if ("PdaCreator" in obj) {
|
176
|
+
const val = obj["PdaCreator"]
|
177
|
+
return new PdaCreator({
|
178
|
+
creators: val["creators"].map(
|
179
|
+
(
|
180
|
+
item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
181
|
+
) => types.Creator.fromDecoded(item)
|
182
|
+
),
|
183
|
+
hasher: types.AccountHasher.fromDecoded(val["hasher"]),
|
184
|
+
})
|
185
|
+
}
|
186
|
+
if ("Collection" in obj) {
|
187
|
+
const val = obj["Collection"]
|
188
|
+
return new Collection({
|
189
|
+
metadata: types.VerifyCollectionMetadata.fromDecoded(val["metadata"]),
|
190
|
+
subtype: types.DepositSubtype.fromDecoded(val["subtype"]),
|
191
|
+
})
|
192
|
+
}
|
193
|
+
|
194
|
+
throw new Error("Invalid enum object")
|
195
|
+
}
|
196
|
+
|
197
|
+
export function fromJSON(obj: types.DepositTypeJSON): types.DepositTypeKind {
|
198
|
+
switch (obj.kind) {
|
199
|
+
case "Creator": {
|
200
|
+
return new Creator({
|
201
|
+
creators: obj.value.creators.map((item) =>
|
202
|
+
types.Creator.fromJSON(item)
|
203
|
+
),
|
204
|
+
})
|
205
|
+
}
|
206
|
+
case "PdaCreator": {
|
207
|
+
return new PdaCreator({
|
208
|
+
creators: obj.value.creators.map((item) =>
|
209
|
+
types.Creator.fromJSON(item)
|
210
|
+
),
|
211
|
+
hasher: types.AccountHasher.fromJSON(obj.value.hasher),
|
212
|
+
})
|
213
|
+
}
|
214
|
+
case "Collection": {
|
215
|
+
return new Collection({
|
216
|
+
metadata: types.VerifyCollectionMetadata.fromJSON(obj.value.metadata),
|
217
|
+
subtype: types.DepositSubtype.fromJSON(obj.value.subtype),
|
218
|
+
})
|
219
|
+
}
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
export function layout(property?: string) {
|
224
|
+
const ret = borsh.rustEnum([
|
225
|
+
borsh.struct([borsh.vec(types.Creator.layout(), "creators")], "Creator"),
|
226
|
+
borsh.struct(
|
227
|
+
[
|
228
|
+
borsh.vec(types.Creator.layout(), "creators"),
|
229
|
+
types.AccountHasher.layout("hasher"),
|
230
|
+
],
|
231
|
+
"PdaCreator"
|
232
|
+
),
|
233
|
+
borsh.struct(
|
234
|
+
[
|
235
|
+
types.VerifyCollectionMetadata.layout("metadata"),
|
236
|
+
types.DepositSubtype.layout("subtype"),
|
237
|
+
],
|
238
|
+
"Collection"
|
239
|
+
),
|
240
|
+
])
|
241
|
+
if (property !== undefined) {
|
242
|
+
return ret.replicate(property)
|
243
|
+
}
|
244
|
+
return ret
|
245
|
+
}
|
@@ -0,0 +1,37 @@
|
|
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 EarningsFields {}
|
7
|
+
|
8
|
+
export interface EarningsJSON {}
|
9
|
+
|
10
|
+
export class Earnings {
|
11
|
+
constructor(fields: EarningsFields) {}
|
12
|
+
|
13
|
+
static layout(property?: string) {
|
14
|
+
return borsh.struct([], property)
|
15
|
+
}
|
16
|
+
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
18
|
+
static fromDecoded(obj: any) {
|
19
|
+
return new Earnings({})
|
20
|
+
}
|
21
|
+
|
22
|
+
static toEncodable(fields: EarningsFields) {
|
23
|
+
return {}
|
24
|
+
}
|
25
|
+
|
26
|
+
toJSON(): EarningsJSON {
|
27
|
+
return {}
|
28
|
+
}
|
29
|
+
|
30
|
+
static fromJSON(obj: EarningsJSON): Earnings {
|
31
|
+
return new Earnings({})
|
32
|
+
}
|
33
|
+
|
34
|
+
toEncodable() {
|
35
|
+
return Earnings.toEncodable(this)
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,120 @@
|
|
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 interface NameJSON {
|
30
|
+
kind: "Name"
|
31
|
+
}
|
32
|
+
|
33
|
+
export class Name {
|
34
|
+
static readonly discriminator = 1
|
35
|
+
static readonly kind = "Name"
|
36
|
+
readonly discriminator = 1
|
37
|
+
readonly kind = "Name"
|
38
|
+
|
39
|
+
toJSON(): NameJSON {
|
40
|
+
return {
|
41
|
+
kind: "Name",
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
toEncodable() {
|
46
|
+
return {
|
47
|
+
Name: {},
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
export interface UrlJSON {
|
53
|
+
kind: "Url"
|
54
|
+
}
|
55
|
+
|
56
|
+
export class Url {
|
57
|
+
static readonly discriminator = 2
|
58
|
+
static readonly kind = "Url"
|
59
|
+
readonly discriminator = 2
|
60
|
+
readonly kind = "Url"
|
61
|
+
|
62
|
+
toJSON(): UrlJSON {
|
63
|
+
return {
|
64
|
+
kind: "Url",
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
toEncodable() {
|
69
|
+
return {
|
70
|
+
Url: {},
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
76
|
+
export function fromDecoded(obj: any): types.EditionStoreTypeKind {
|
77
|
+
if (typeof obj !== "object") {
|
78
|
+
throw new Error("Invalid enum object")
|
79
|
+
}
|
80
|
+
|
81
|
+
if ("None" in obj) {
|
82
|
+
return new None()
|
83
|
+
}
|
84
|
+
if ("Name" in obj) {
|
85
|
+
return new Name()
|
86
|
+
}
|
87
|
+
if ("Url" in obj) {
|
88
|
+
return new Url()
|
89
|
+
}
|
90
|
+
|
91
|
+
throw new Error("Invalid enum object")
|
92
|
+
}
|
93
|
+
|
94
|
+
export function fromJSON(
|
95
|
+
obj: types.EditionStoreTypeJSON
|
96
|
+
): types.EditionStoreTypeKind {
|
97
|
+
switch (obj.kind) {
|
98
|
+
case "None": {
|
99
|
+
return new None()
|
100
|
+
}
|
101
|
+
case "Name": {
|
102
|
+
return new Name()
|
103
|
+
}
|
104
|
+
case "Url": {
|
105
|
+
return new Url()
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
export function layout(property?: string) {
|
111
|
+
const ret = borsh.rustEnum([
|
112
|
+
borsh.struct([], "None"),
|
113
|
+
borsh.struct([], "Name"),
|
114
|
+
borsh.struct([], "Url"),
|
115
|
+
])
|
116
|
+
if (property !== undefined) {
|
117
|
+
return ret.replicate(property)
|
118
|
+
}
|
119
|
+
return ret
|
120
|
+
}
|