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,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 TokenMetadataFields {
|
7
|
+
name: string;
|
8
|
+
symbol: string;
|
9
|
+
arweave: string;
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface TokenMetadataJSON {
|
13
|
+
name: string;
|
14
|
+
symbol: string;
|
15
|
+
arweave: string;
|
16
|
+
}
|
17
|
+
|
18
|
+
export class TokenMetadata {
|
19
|
+
readonly name: string;
|
20
|
+
readonly symbol: string;
|
21
|
+
readonly arweave: string;
|
22
|
+
|
23
|
+
constructor(fields: TokenMetadataFields) {
|
24
|
+
this.name = fields.name;
|
25
|
+
this.symbol = fields.symbol;
|
26
|
+
this.arweave = fields.arweave;
|
27
|
+
}
|
28
|
+
|
29
|
+
static layout(property?: string) {
|
30
|
+
return borsh.struct(
|
31
|
+
[borsh.str("name"), borsh.str("symbol"), borsh.str("arweave")],
|
32
|
+
property
|
33
|
+
);
|
34
|
+
}
|
35
|
+
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
37
|
+
static fromDecoded(obj: any) {
|
38
|
+
return new TokenMetadata({
|
39
|
+
name: obj.name,
|
40
|
+
symbol: obj.symbol,
|
41
|
+
arweave: obj.arweave,
|
42
|
+
});
|
43
|
+
}
|
44
|
+
|
45
|
+
static toEncodable(fields: TokenMetadataFields) {
|
46
|
+
return {
|
47
|
+
name: fields.name,
|
48
|
+
symbol: fields.symbol,
|
49
|
+
arweave: fields.arweave,
|
50
|
+
};
|
51
|
+
}
|
52
|
+
|
53
|
+
toJSON(): TokenMetadataJSON {
|
54
|
+
return {
|
55
|
+
name: this.name,
|
56
|
+
symbol: this.symbol,
|
57
|
+
arweave: this.arweave,
|
58
|
+
};
|
59
|
+
}
|
60
|
+
|
61
|
+
static fromJSON(obj: TokenMetadataJSON): TokenMetadata {
|
62
|
+
return new TokenMetadata({
|
63
|
+
name: obj.name,
|
64
|
+
symbol: obj.symbol,
|
65
|
+
arweave: obj.arweave,
|
66
|
+
});
|
67
|
+
}
|
68
|
+
|
69
|
+
toEncodable() {
|
70
|
+
return TokenMetadata.toEncodable(this);
|
71
|
+
}
|
72
|
+
}
|
@@ -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 OriginalJSON {
|
7
|
+
kind: "Original"
|
8
|
+
}
|
9
|
+
|
10
|
+
export class Original {
|
11
|
+
static readonly discriminator = 0
|
12
|
+
static readonly kind = "Original"
|
13
|
+
readonly discriminator = 0
|
14
|
+
readonly kind = "Original"
|
15
|
+
|
16
|
+
toJSON(): OriginalJSON {
|
17
|
+
return {
|
18
|
+
kind: "Original",
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
toEncodable() {
|
23
|
+
return {
|
24
|
+
Original: {},
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface Token2022JSON {
|
30
|
+
kind: "Token2022"
|
31
|
+
}
|
32
|
+
|
33
|
+
export class Token2022 {
|
34
|
+
static readonly discriminator = 1
|
35
|
+
static readonly kind = "Token2022"
|
36
|
+
readonly discriminator = 1
|
37
|
+
readonly kind = "Token2022"
|
38
|
+
|
39
|
+
toJSON(): Token2022JSON {
|
40
|
+
return {
|
41
|
+
kind: "Token2022",
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
toEncodable() {
|
46
|
+
return {
|
47
|
+
Token2022: {},
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
53
|
+
export function fromDecoded(obj: any): types.TokenProgramVersionKind {
|
54
|
+
if (typeof obj !== "object") {
|
55
|
+
throw new Error("Invalid enum object")
|
56
|
+
}
|
57
|
+
|
58
|
+
if ("Original" in obj) {
|
59
|
+
return new Original()
|
60
|
+
}
|
61
|
+
if ("Token2022" in obj) {
|
62
|
+
return new Token2022()
|
63
|
+
}
|
64
|
+
|
65
|
+
throw new Error("Invalid enum object")
|
66
|
+
}
|
67
|
+
|
68
|
+
export function fromJSON(
|
69
|
+
obj: types.TokenProgramVersionJSON
|
70
|
+
): types.TokenProgramVersionKind {
|
71
|
+
switch (obj.kind) {
|
72
|
+
case "Original": {
|
73
|
+
return new Original()
|
74
|
+
}
|
75
|
+
case "Token2022": {
|
76
|
+
return new Token2022()
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
export function layout(property?: string) {
|
82
|
+
const ret = borsh.rustEnum([
|
83
|
+
borsh.struct([], "Original"),
|
84
|
+
borsh.struct([], "Token2022"),
|
85
|
+
])
|
86
|
+
if (property !== undefined) {
|
87
|
+
return ret.replicate(property)
|
88
|
+
}
|
89
|
+
return ret
|
90
|
+
}
|
@@ -0,0 +1,150 @@
|
|
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 NonFungibleJSON {
|
7
|
+
kind: "NonFungible"
|
8
|
+
}
|
9
|
+
|
10
|
+
export class NonFungible {
|
11
|
+
static readonly discriminator = 0
|
12
|
+
static readonly kind = "NonFungible"
|
13
|
+
readonly discriminator = 0
|
14
|
+
readonly kind = "NonFungible"
|
15
|
+
|
16
|
+
toJSON(): NonFungibleJSON {
|
17
|
+
return {
|
18
|
+
kind: "NonFungible",
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
toEncodable() {
|
23
|
+
return {
|
24
|
+
NonFungible: {},
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface FungibleAssetJSON {
|
30
|
+
kind: "FungibleAsset"
|
31
|
+
}
|
32
|
+
|
33
|
+
export class FungibleAsset {
|
34
|
+
static readonly discriminator = 1
|
35
|
+
static readonly kind = "FungibleAsset"
|
36
|
+
readonly discriminator = 1
|
37
|
+
readonly kind = "FungibleAsset"
|
38
|
+
|
39
|
+
toJSON(): FungibleAssetJSON {
|
40
|
+
return {
|
41
|
+
kind: "FungibleAsset",
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
toEncodable() {
|
46
|
+
return {
|
47
|
+
FungibleAsset: {},
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
export interface FungibleJSON {
|
53
|
+
kind: "Fungible"
|
54
|
+
}
|
55
|
+
|
56
|
+
export class Fungible {
|
57
|
+
static readonly discriminator = 2
|
58
|
+
static readonly kind = "Fungible"
|
59
|
+
readonly discriminator = 2
|
60
|
+
readonly kind = "Fungible"
|
61
|
+
|
62
|
+
toJSON(): FungibleJSON {
|
63
|
+
return {
|
64
|
+
kind: "Fungible",
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
toEncodable() {
|
69
|
+
return {
|
70
|
+
Fungible: {},
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
export interface NonFungibleEditionJSON {
|
76
|
+
kind: "NonFungibleEdition"
|
77
|
+
}
|
78
|
+
|
79
|
+
export class NonFungibleEdition {
|
80
|
+
static readonly discriminator = 3
|
81
|
+
static readonly kind = "NonFungibleEdition"
|
82
|
+
readonly discriminator = 3
|
83
|
+
readonly kind = "NonFungibleEdition"
|
84
|
+
|
85
|
+
toJSON(): NonFungibleEditionJSON {
|
86
|
+
return {
|
87
|
+
kind: "NonFungibleEdition",
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
toEncodable() {
|
92
|
+
return {
|
93
|
+
NonFungibleEdition: {},
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
99
|
+
export function fromDecoded(obj: any): types.TokenStandardKind {
|
100
|
+
if (typeof obj !== "object") {
|
101
|
+
throw new Error("Invalid enum object")
|
102
|
+
}
|
103
|
+
|
104
|
+
if ("NonFungible" in obj) {
|
105
|
+
return new NonFungible()
|
106
|
+
}
|
107
|
+
if ("FungibleAsset" in obj) {
|
108
|
+
return new FungibleAsset()
|
109
|
+
}
|
110
|
+
if ("Fungible" in obj) {
|
111
|
+
return new Fungible()
|
112
|
+
}
|
113
|
+
if ("NonFungibleEdition" in obj) {
|
114
|
+
return new NonFungibleEdition()
|
115
|
+
}
|
116
|
+
|
117
|
+
throw new Error("Invalid enum object")
|
118
|
+
}
|
119
|
+
|
120
|
+
export function fromJSON(
|
121
|
+
obj: types.TokenStandardJSON
|
122
|
+
): types.TokenStandardKind {
|
123
|
+
switch (obj.kind) {
|
124
|
+
case "NonFungible": {
|
125
|
+
return new NonFungible()
|
126
|
+
}
|
127
|
+
case "FungibleAsset": {
|
128
|
+
return new FungibleAsset()
|
129
|
+
}
|
130
|
+
case "Fungible": {
|
131
|
+
return new Fungible()
|
132
|
+
}
|
133
|
+
case "NonFungibleEdition": {
|
134
|
+
return new NonFungibleEdition()
|
135
|
+
}
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
export function layout(property?: string) {
|
140
|
+
const ret = borsh.rustEnum([
|
141
|
+
borsh.struct([], "NonFungible"),
|
142
|
+
borsh.struct([], "FungibleAsset"),
|
143
|
+
borsh.struct([], "Fungible"),
|
144
|
+
borsh.struct([], "NonFungibleEdition"),
|
145
|
+
])
|
146
|
+
if (property !== undefined) {
|
147
|
+
return ret.replicate(property)
|
148
|
+
}
|
149
|
+
return ret
|
150
|
+
}
|
@@ -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 NewJSON {
|
7
|
+
kind: "New"
|
8
|
+
}
|
9
|
+
|
10
|
+
export class New {
|
11
|
+
static readonly discriminator = 0
|
12
|
+
static readonly kind = "New"
|
13
|
+
readonly discriminator = 0
|
14
|
+
readonly kind = "New"
|
15
|
+
|
16
|
+
toJSON(): NewJSON {
|
17
|
+
return {
|
18
|
+
kind: "New",
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
toEncodable() {
|
23
|
+
return {
|
24
|
+
New: {},
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface ActiveJSON {
|
30
|
+
kind: "Active"
|
31
|
+
}
|
32
|
+
|
33
|
+
export class Active {
|
34
|
+
static readonly discriminator = 1
|
35
|
+
static readonly kind = "Active"
|
36
|
+
readonly discriminator = 1
|
37
|
+
readonly kind = "Active"
|
38
|
+
|
39
|
+
toJSON(): ActiveJSON {
|
40
|
+
return {
|
41
|
+
kind: "Active",
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
toEncodable() {
|
46
|
+
return {
|
47
|
+
Active: {},
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
53
|
+
export function fromDecoded(obj: any): types.TokenStateKind {
|
54
|
+
if (typeof obj !== "object") {
|
55
|
+
throw new Error("Invalid enum object")
|
56
|
+
}
|
57
|
+
|
58
|
+
if ("New" in obj) {
|
59
|
+
return new New()
|
60
|
+
}
|
61
|
+
if ("Active" in obj) {
|
62
|
+
return new Active()
|
63
|
+
}
|
64
|
+
|
65
|
+
throw new Error("Invalid enum object")
|
66
|
+
}
|
67
|
+
|
68
|
+
export function fromJSON(obj: types.TokenStateJSON): types.TokenStateKind {
|
69
|
+
switch (obj.kind) {
|
70
|
+
case "New": {
|
71
|
+
return new New()
|
72
|
+
}
|
73
|
+
case "Active": {
|
74
|
+
return new Active()
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
export function layout(property?: string) {
|
80
|
+
const ret = borsh.rustEnum([
|
81
|
+
borsh.struct([], "New"),
|
82
|
+
borsh.struct([], "Active"),
|
83
|
+
])
|
84
|
+
if (property !== undefined) {
|
85
|
+
return ret.replicate(property)
|
86
|
+
}
|
87
|
+
return ret
|
88
|
+
}
|
@@ -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 BasicJSON {
|
7
|
+
kind: "Basic"
|
8
|
+
}
|
9
|
+
|
10
|
+
export class Basic {
|
11
|
+
static readonly discriminator = 0
|
12
|
+
static readonly kind = "Basic"
|
13
|
+
readonly discriminator = 0
|
14
|
+
readonly kind = "Basic"
|
15
|
+
|
16
|
+
toJSON(): BasicJSON {
|
17
|
+
return {
|
18
|
+
kind: "Basic",
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
toEncodable() {
|
23
|
+
return {
|
24
|
+
Basic: {},
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface OnlyUpJSON {
|
30
|
+
kind: "OnlyUp"
|
31
|
+
}
|
32
|
+
|
33
|
+
export class OnlyUp {
|
34
|
+
static readonly discriminator = 1
|
35
|
+
static readonly kind = "OnlyUp"
|
36
|
+
readonly discriminator = 1
|
37
|
+
readonly kind = "OnlyUp"
|
38
|
+
|
39
|
+
toJSON(): OnlyUpJSON {
|
40
|
+
return {
|
41
|
+
kind: "OnlyUp",
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
toEncodable() {
|
46
|
+
return {
|
47
|
+
OnlyUp: {},
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
53
|
+
export function fromDecoded(obj: any): types.TokenTypeKind {
|
54
|
+
if (typeof obj !== "object") {
|
55
|
+
throw new Error("Invalid enum object")
|
56
|
+
}
|
57
|
+
|
58
|
+
if ("Basic" in obj) {
|
59
|
+
return new Basic()
|
60
|
+
}
|
61
|
+
if ("OnlyUp" in obj) {
|
62
|
+
return new OnlyUp()
|
63
|
+
}
|
64
|
+
|
65
|
+
throw new Error("Invalid enum object")
|
66
|
+
}
|
67
|
+
|
68
|
+
export function fromJSON(obj: types.TokenTypeJSON): types.TokenTypeKind {
|
69
|
+
switch (obj.kind) {
|
70
|
+
case "Basic": {
|
71
|
+
return new Basic()
|
72
|
+
}
|
73
|
+
case "OnlyUp": {
|
74
|
+
return new OnlyUp()
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
export function layout(property?: string) {
|
80
|
+
const ret = borsh.rustEnum([
|
81
|
+
borsh.struct([], "Basic"),
|
82
|
+
borsh.struct([], "OnlyUp"),
|
83
|
+
])
|
84
|
+
if (property !== undefined) {
|
85
|
+
return ret.replicate(property)
|
86
|
+
}
|
87
|
+
return ret
|
88
|
+
}
|
@@ -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 TotalPerTimeArgsFields {
|
7
|
+
count: number
|
8
|
+
amount: number
|
9
|
+
time: number
|
10
|
+
lastTimeReset: number
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface TotalPerTimeArgsJSON {
|
14
|
+
count: number
|
15
|
+
amount: number
|
16
|
+
time: number
|
17
|
+
lastTimeReset: number
|
18
|
+
}
|
19
|
+
|
20
|
+
export class TotalPerTimeArgs {
|
21
|
+
readonly count: number
|
22
|
+
readonly amount: number
|
23
|
+
readonly time: number
|
24
|
+
readonly lastTimeReset: number
|
25
|
+
|
26
|
+
constructor(fields: TotalPerTimeArgsFields) {
|
27
|
+
this.count = fields.count
|
28
|
+
this.amount = fields.amount
|
29
|
+
this.time = fields.time
|
30
|
+
this.lastTimeReset = fields.lastTimeReset
|
31
|
+
}
|
32
|
+
|
33
|
+
static layout(property?: string) {
|
34
|
+
return borsh.struct(
|
35
|
+
[
|
36
|
+
borsh.u16("count"),
|
37
|
+
borsh.u16("amount"),
|
38
|
+
borsh.u32("time"),
|
39
|
+
borsh.u32("lastTimeReset"),
|
40
|
+
],
|
41
|
+
property
|
42
|
+
)
|
43
|
+
}
|
44
|
+
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
46
|
+
static fromDecoded(obj: any) {
|
47
|
+
return new TotalPerTimeArgs({
|
48
|
+
count: obj.count,
|
49
|
+
amount: obj.amount,
|
50
|
+
time: obj.time,
|
51
|
+
lastTimeReset: obj.lastTimeReset,
|
52
|
+
})
|
53
|
+
}
|
54
|
+
|
55
|
+
static toEncodable(fields: TotalPerTimeArgsFields) {
|
56
|
+
return {
|
57
|
+
count: fields.count,
|
58
|
+
amount: fields.amount,
|
59
|
+
time: fields.time,
|
60
|
+
lastTimeReset: fields.lastTimeReset,
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
toJSON(): TotalPerTimeArgsJSON {
|
65
|
+
return {
|
66
|
+
count: this.count,
|
67
|
+
amount: this.amount,
|
68
|
+
time: this.time,
|
69
|
+
lastTimeReset: this.lastTimeReset,
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
static fromJSON(obj: TotalPerTimeArgsJSON): TotalPerTimeArgs {
|
74
|
+
return new TotalPerTimeArgs({
|
75
|
+
count: obj.count,
|
76
|
+
amount: obj.amount,
|
77
|
+
time: obj.time,
|
78
|
+
lastTimeReset: obj.lastTimeReset,
|
79
|
+
})
|
80
|
+
}
|
81
|
+
|
82
|
+
toEncodable() {
|
83
|
+
return TotalPerTimeArgs.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 TotalPerTimeWalletArgsFields {
|
7
|
+
amount: number
|
8
|
+
time: number
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface TotalPerTimeWalletArgsJSON {
|
12
|
+
amount: number
|
13
|
+
time: number
|
14
|
+
}
|
15
|
+
|
16
|
+
export class TotalPerTimeWalletArgs {
|
17
|
+
readonly amount: number
|
18
|
+
readonly time: number
|
19
|
+
|
20
|
+
constructor(fields: TotalPerTimeWalletArgsFields) {
|
21
|
+
this.amount = fields.amount
|
22
|
+
this.time = fields.time
|
23
|
+
}
|
24
|
+
|
25
|
+
static layout(property?: string) {
|
26
|
+
return borsh.struct([borsh.u16("amount"), borsh.u32("time")], property)
|
27
|
+
}
|
28
|
+
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
30
|
+
static fromDecoded(obj: any) {
|
31
|
+
return new TotalPerTimeWalletArgs({
|
32
|
+
amount: obj.amount,
|
33
|
+
time: obj.time,
|
34
|
+
})
|
35
|
+
}
|
36
|
+
|
37
|
+
static toEncodable(fields: TotalPerTimeWalletArgsFields) {
|
38
|
+
return {
|
39
|
+
amount: fields.amount,
|
40
|
+
time: fields.time,
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
toJSON(): TotalPerTimeWalletArgsJSON {
|
45
|
+
return {
|
46
|
+
amount: this.amount,
|
47
|
+
time: this.time,
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
static fromJSON(obj: TotalPerTimeWalletArgsJSON): TotalPerTimeWalletArgs {
|
52
|
+
return new TotalPerTimeWalletArgs({
|
53
|
+
amount: obj.amount,
|
54
|
+
time: obj.time,
|
55
|
+
})
|
56
|
+
}
|
57
|
+
|
58
|
+
toEncodable() {
|
59
|
+
return TotalPerTimeWalletArgs.toEncodable(this)
|
60
|
+
}
|
61
|
+
}
|