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,55 @@
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } 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 borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
6
|
+
|
7
|
+
export interface DepositBurnArgs {
|
8
|
+
deposit: types.DepositFields
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface DepositBurnAccounts {
|
12
|
+
newBurnDeposit: PublicKey
|
13
|
+
existingBurnDeposit: PublicKey
|
14
|
+
/** CHECK */
|
15
|
+
artistBurnTrack: PublicKey
|
16
|
+
/** CHECK */
|
17
|
+
globalBurnTrack: PublicKey
|
18
|
+
itemAccount: PublicKey
|
19
|
+
packAccount: PublicKey
|
20
|
+
/** CHECK */
|
21
|
+
metadataAccount: PublicKey
|
22
|
+
owner: PublicKey
|
23
|
+
systemProgram: PublicKey
|
24
|
+
}
|
25
|
+
|
26
|
+
export const layout = borsh.struct([types.Deposit.layout("deposit")])
|
27
|
+
|
28
|
+
export function depositBurn(
|
29
|
+
args: DepositBurnArgs,
|
30
|
+
accounts: DepositBurnAccounts,
|
31
|
+
programId: PublicKey = PROGRAM_ID
|
32
|
+
) {
|
33
|
+
const keys: Array<AccountMeta> = [
|
34
|
+
{ pubkey: accounts.newBurnDeposit, isSigner: false, isWritable: true },
|
35
|
+
{ pubkey: accounts.existingBurnDeposit, isSigner: false, isWritable: true },
|
36
|
+
{ pubkey: accounts.artistBurnTrack, isSigner: false, isWritable: true },
|
37
|
+
{ pubkey: accounts.globalBurnTrack, isSigner: false, isWritable: true },
|
38
|
+
{ pubkey: accounts.itemAccount, isSigner: false, isWritable: false },
|
39
|
+
{ pubkey: accounts.packAccount, isSigner: false, isWritable: false },
|
40
|
+
{ pubkey: accounts.metadataAccount, isSigner: false, isWritable: false },
|
41
|
+
{ pubkey: accounts.owner, isSigner: true, isWritable: true },
|
42
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
43
|
+
]
|
44
|
+
const identifier = Buffer.from([76, 167, 230, 117, 107, 157, 228, 236])
|
45
|
+
const buffer = Buffer.alloc(1000)
|
46
|
+
const len = layout.encode(
|
47
|
+
{
|
48
|
+
deposit: types.Deposit.toEncodable(args.deposit),
|
49
|
+
},
|
50
|
+
buffer
|
51
|
+
)
|
52
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
53
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
54
|
+
return ix
|
55
|
+
}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } 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 borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
6
|
+
|
7
|
+
export interface DonateUserArgs {
|
8
|
+
epoch: number
|
9
|
+
amount: BN
|
10
|
+
message: string
|
11
|
+
previousRecord: types.PreviousDonationRecordFields | null
|
12
|
+
}
|
13
|
+
|
14
|
+
export interface DonateUserAccounts {
|
15
|
+
donationRegistryNew: PublicKey
|
16
|
+
donationRegistryOld: PublicKey
|
17
|
+
donationRecord: PublicKey
|
18
|
+
currency: PublicKey
|
19
|
+
receiver: PublicKey
|
20
|
+
userActivity: PublicKey
|
21
|
+
storeAccount: PublicKey
|
22
|
+
payer: PublicKey
|
23
|
+
merkleTree: PublicKey
|
24
|
+
treeAuthority: PublicKey
|
25
|
+
merkleManager: PublicKey
|
26
|
+
logWrapper: PublicKey
|
27
|
+
bubblegumProgram: PublicKey
|
28
|
+
compressionProgram: PublicKey
|
29
|
+
tokenMetadataProgram: PublicKey
|
30
|
+
systemProgram: PublicKey
|
31
|
+
}
|
32
|
+
|
33
|
+
export const layout = borsh.struct([
|
34
|
+
borsh.u32("epoch"),
|
35
|
+
borsh.u64("amount"),
|
36
|
+
borsh.str("message"),
|
37
|
+
borsh.option(types.PreviousDonationRecord.layout(), "previousRecord"),
|
38
|
+
])
|
39
|
+
|
40
|
+
export function donateUser(
|
41
|
+
args: DonateUserArgs,
|
42
|
+
accounts: DonateUserAccounts,
|
43
|
+
programId: PublicKey = PROGRAM_ID
|
44
|
+
) {
|
45
|
+
const keys: Array<AccountMeta> = [
|
46
|
+
{ pubkey: accounts.donationRegistryNew, isSigner: false, isWritable: true },
|
47
|
+
{ pubkey: accounts.donationRegistryOld, isSigner: false, isWritable: true },
|
48
|
+
{ pubkey: accounts.donationRecord, isSigner: false, isWritable: true },
|
49
|
+
{ pubkey: accounts.currency, isSigner: false, isWritable: false },
|
50
|
+
{ pubkey: accounts.receiver, isSigner: false, isWritable: true },
|
51
|
+
{ pubkey: accounts.userActivity, isSigner: false, isWritable: true },
|
52
|
+
{ pubkey: accounts.storeAccount, isSigner: false, isWritable: false },
|
53
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
54
|
+
{ pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
|
55
|
+
{ pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
|
56
|
+
{ pubkey: accounts.merkleManager, isSigner: false, isWritable: false },
|
57
|
+
{ pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
|
58
|
+
{ pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
|
59
|
+
{ pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
|
60
|
+
{
|
61
|
+
pubkey: accounts.tokenMetadataProgram,
|
62
|
+
isSigner: false,
|
63
|
+
isWritable: false,
|
64
|
+
},
|
65
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
66
|
+
]
|
67
|
+
const identifier = Buffer.from([223, 130, 137, 211, 80, 182, 163, 3])
|
68
|
+
const buffer = Buffer.alloc(1000)
|
69
|
+
const len = layout.encode(
|
70
|
+
{
|
71
|
+
epoch: args.epoch,
|
72
|
+
amount: args.amount,
|
73
|
+
message: args.message,
|
74
|
+
previousRecord:
|
75
|
+
(args.previousRecord &&
|
76
|
+
types.PreviousDonationRecord.toEncodable(args.previousRecord)) ||
|
77
|
+
null,
|
78
|
+
},
|
79
|
+
buffer
|
80
|
+
)
|
81
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
82
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
83
|
+
return ix
|
84
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } 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 borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
6
|
+
|
7
|
+
export interface FeedPoolArgs {
|
8
|
+
name: string
|
9
|
+
amount: BN
|
10
|
+
decimals: number
|
11
|
+
withdraw: number
|
12
|
+
}
|
13
|
+
|
14
|
+
export interface FeedPoolAccounts {
|
15
|
+
poolVault: PublicKey
|
16
|
+
currency: PublicKey
|
17
|
+
fromAta: PublicKey
|
18
|
+
toAta: PublicKey
|
19
|
+
storeAccount: PublicKey
|
20
|
+
payer: PublicKey
|
21
|
+
tokenProgram: PublicKey
|
22
|
+
systemProgram: PublicKey
|
23
|
+
}
|
24
|
+
|
25
|
+
export const layout = borsh.struct([
|
26
|
+
borsh.str("name"),
|
27
|
+
borsh.u64("amount"),
|
28
|
+
borsh.u8("decimals"),
|
29
|
+
borsh.u8("withdraw"),
|
30
|
+
])
|
31
|
+
|
32
|
+
export function feedPool(
|
33
|
+
args: FeedPoolArgs,
|
34
|
+
accounts: FeedPoolAccounts,
|
35
|
+
programId: PublicKey = PROGRAM_ID
|
36
|
+
) {
|
37
|
+
const keys: Array<AccountMeta> = [
|
38
|
+
{ pubkey: accounts.poolVault, isSigner: false, isWritable: true },
|
39
|
+
{ pubkey: accounts.currency, isSigner: false, isWritable: false },
|
40
|
+
{ pubkey: accounts.fromAta, isSigner: false, isWritable: true },
|
41
|
+
{ pubkey: accounts.toAta, isSigner: false, isWritable: true },
|
42
|
+
{ pubkey: accounts.storeAccount, isSigner: false, isWritable: false },
|
43
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
44
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
45
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
46
|
+
]
|
47
|
+
const identifier = Buffer.from([209, 238, 252, 180, 229, 87, 69, 160])
|
48
|
+
const buffer = Buffer.alloc(1000)
|
49
|
+
const len = layout.encode(
|
50
|
+
{
|
51
|
+
name: args.name,
|
52
|
+
amount: args.amount,
|
53
|
+
decimals: args.decimals,
|
54
|
+
withdraw: args.withdraw,
|
55
|
+
},
|
56
|
+
buffer
|
57
|
+
)
|
58
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
59
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
60
|
+
return ix
|
61
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } 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 borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
6
|
+
|
7
|
+
export interface FeedTraitsArgs {
|
8
|
+
traits: types.FeedingTraitsFields
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface FeedTraitsAccounts {
|
12
|
+
packAccount: PublicKey
|
13
|
+
packTraits: PublicKey
|
14
|
+
packTraitsRegistry: PublicKey
|
15
|
+
payer: PublicKey
|
16
|
+
systemProgram: PublicKey
|
17
|
+
}
|
18
|
+
|
19
|
+
export const layout = borsh.struct([types.FeedingTraits.layout("traits")])
|
20
|
+
|
21
|
+
export function feedTraits(
|
22
|
+
args: FeedTraitsArgs,
|
23
|
+
accounts: FeedTraitsAccounts,
|
24
|
+
programId: PublicKey = PROGRAM_ID
|
25
|
+
) {
|
26
|
+
const keys: Array<AccountMeta> = [
|
27
|
+
{ pubkey: accounts.packAccount, isSigner: false, isWritable: true },
|
28
|
+
{ pubkey: accounts.packTraits, isSigner: false, isWritable: true },
|
29
|
+
{ pubkey: accounts.packTraitsRegistry, isSigner: false, isWritable: true },
|
30
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
31
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
32
|
+
]
|
33
|
+
const identifier = Buffer.from([105, 113, 240, 80, 105, 198, 78, 164])
|
34
|
+
const buffer = Buffer.alloc(1000)
|
35
|
+
const len = layout.encode(
|
36
|
+
{
|
37
|
+
traits: types.FeedingTraits.toEncodable(args.traits),
|
38
|
+
},
|
39
|
+
buffer
|
40
|
+
)
|
41
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
42
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
43
|
+
return ix
|
44
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } 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 borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
6
|
+
|
7
|
+
export interface FeedTreeArgs {
|
8
|
+
managerBump: number
|
9
|
+
maxDepth: number
|
10
|
+
maxBufferSize: number
|
11
|
+
public: boolean | null
|
12
|
+
}
|
13
|
+
|
14
|
+
export interface FeedTreeAccounts {
|
15
|
+
merkleAccount: PublicKey
|
16
|
+
merkleManager: PublicKey
|
17
|
+
lutAccount: PublicKey
|
18
|
+
treeAuthority: PublicKey
|
19
|
+
logWrapper: PublicKey
|
20
|
+
bubblegumProgram: PublicKey
|
21
|
+
compressionProgram: PublicKey
|
22
|
+
payer: PublicKey
|
23
|
+
systemProgram: PublicKey
|
24
|
+
}
|
25
|
+
|
26
|
+
export const layout = borsh.struct([
|
27
|
+
borsh.u8("managerBump"),
|
28
|
+
borsh.u32("maxDepth"),
|
29
|
+
borsh.u32("maxBufferSize"),
|
30
|
+
borsh.option(borsh.bool(), "public"),
|
31
|
+
])
|
32
|
+
|
33
|
+
export function feedTree(
|
34
|
+
args: FeedTreeArgs,
|
35
|
+
accounts: FeedTreeAccounts,
|
36
|
+
programId: PublicKey = PROGRAM_ID
|
37
|
+
) {
|
38
|
+
const keys: Array<AccountMeta> = [
|
39
|
+
{ pubkey: accounts.merkleAccount, isSigner: false, isWritable: true },
|
40
|
+
{ pubkey: accounts.merkleManager, isSigner: false, isWritable: true },
|
41
|
+
{ pubkey: accounts.lutAccount, isSigner: false, isWritable: false },
|
42
|
+
{ pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
|
43
|
+
{ pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
|
44
|
+
{ pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
|
45
|
+
{ pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
|
46
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
47
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
48
|
+
]
|
49
|
+
const identifier = Buffer.from([51, 38, 94, 153, 131, 98, 81, 20])
|
50
|
+
const buffer = Buffer.alloc(1000)
|
51
|
+
const len = layout.encode(
|
52
|
+
{
|
53
|
+
managerBump: args.managerBump,
|
54
|
+
maxDepth: args.maxDepth,
|
55
|
+
maxBufferSize: args.maxBufferSize,
|
56
|
+
public: args.public,
|
57
|
+
},
|
58
|
+
buffer
|
59
|
+
)
|
60
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
61
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
62
|
+
return ix
|
63
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } 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 borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
6
|
+
|
7
|
+
export interface FlagPackArgs {
|
8
|
+
globalState: types.GlobalStateKind | null
|
9
|
+
state: types.ItemStateKind | null
|
10
|
+
serverless: number | null
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface FlagPackAccounts {
|
14
|
+
storeAccount: PublicKey
|
15
|
+
packAccount: PublicKey
|
16
|
+
creator: PublicKey
|
17
|
+
systemProgram: PublicKey
|
18
|
+
}
|
19
|
+
|
20
|
+
export const layout = borsh.struct([
|
21
|
+
borsh.option(types.GlobalState.layout(), "globalState"),
|
22
|
+
borsh.option(types.ItemState.layout(), "state"),
|
23
|
+
borsh.option(borsh.u8(), "serverless"),
|
24
|
+
])
|
25
|
+
|
26
|
+
export function flagPack(
|
27
|
+
args: FlagPackArgs,
|
28
|
+
accounts: FlagPackAccounts,
|
29
|
+
programId: PublicKey = PROGRAM_ID
|
30
|
+
) {
|
31
|
+
const keys: Array<AccountMeta> = [
|
32
|
+
{ pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
|
33
|
+
{ pubkey: accounts.packAccount, isSigner: false, isWritable: true },
|
34
|
+
{ pubkey: accounts.creator, isSigner: true, isWritable: true },
|
35
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
36
|
+
]
|
37
|
+
const identifier = Buffer.from([239, 234, 126, 90, 79, 52, 91, 71])
|
38
|
+
const buffer = Buffer.alloc(1000)
|
39
|
+
const len = layout.encode(
|
40
|
+
{
|
41
|
+
globalState: (args.globalState && args.globalState.toEncodable()) || null,
|
42
|
+
state: (args.state && args.state.toEncodable()) || null,
|
43
|
+
serverless: args.serverless,
|
44
|
+
},
|
45
|
+
buffer
|
46
|
+
)
|
47
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
48
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
49
|
+
return ix
|
50
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } 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 borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
6
|
+
|
7
|
+
export interface FlagSingleArgs {
|
8
|
+
globalState: types.GlobalStateKind
|
9
|
+
state: types.ItemStateKind
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface FlagSingleAccounts {
|
13
|
+
storeAccount: PublicKey
|
14
|
+
itemAccount: PublicKey
|
15
|
+
creator: PublicKey
|
16
|
+
systemProgram: PublicKey
|
17
|
+
}
|
18
|
+
|
19
|
+
export const layout = borsh.struct([
|
20
|
+
types.GlobalState.layout("globalState"),
|
21
|
+
types.ItemState.layout("state"),
|
22
|
+
])
|
23
|
+
|
24
|
+
export function flagSingle(
|
25
|
+
args: FlagSingleArgs,
|
26
|
+
accounts: FlagSingleAccounts,
|
27
|
+
programId: PublicKey = PROGRAM_ID
|
28
|
+
) {
|
29
|
+
const keys: Array<AccountMeta> = [
|
30
|
+
{ pubkey: accounts.storeAccount, isSigner: false, isWritable: false },
|
31
|
+
{ pubkey: accounts.itemAccount, isSigner: false, isWritable: true },
|
32
|
+
{ pubkey: accounts.creator, isSigner: true, isWritable: true },
|
33
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
34
|
+
]
|
35
|
+
const identifier = Buffer.from([8, 218, 103, 215, 236, 37, 163, 190])
|
36
|
+
const buffer = Buffer.alloc(1000)
|
37
|
+
const len = layout.encode(
|
38
|
+
{
|
39
|
+
globalState: args.globalState.toEncodable(),
|
40
|
+
state: args.state.toEncodable(),
|
41
|
+
},
|
42
|
+
buffer
|
43
|
+
)
|
44
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
45
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
46
|
+
return ix
|
47
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } 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 borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
6
|
+
|
7
|
+
export interface GatePayArgs {
|
8
|
+
index: number
|
9
|
+
metadata: types.MetadataArgsFields
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface GatePayAccounts {
|
13
|
+
paymentAccount: PublicKey
|
14
|
+
itemAccount: PublicKey
|
15
|
+
packAccount: PublicKey
|
16
|
+
holderAccount: PublicKey
|
17
|
+
/** CHECK */
|
18
|
+
merkleTree: PublicKey
|
19
|
+
/** CHECK */
|
20
|
+
owner: PublicKey
|
21
|
+
payer: PublicKey
|
22
|
+
bubblegumProgram: PublicKey
|
23
|
+
systemProgram: PublicKey
|
24
|
+
}
|
25
|
+
|
26
|
+
export const layout = borsh.struct([
|
27
|
+
borsh.u32("index"),
|
28
|
+
types.MetadataArgs.layout("metadata"),
|
29
|
+
])
|
30
|
+
|
31
|
+
export function gatePay(
|
32
|
+
args: GatePayArgs,
|
33
|
+
accounts: GatePayAccounts,
|
34
|
+
programId: PublicKey = PROGRAM_ID
|
35
|
+
) {
|
36
|
+
const keys: Array<AccountMeta> = [
|
37
|
+
{ pubkey: accounts.paymentAccount, isSigner: false, isWritable: true },
|
38
|
+
{ pubkey: accounts.itemAccount, isSigner: false, isWritable: false },
|
39
|
+
{ pubkey: accounts.packAccount, isSigner: false, isWritable: false },
|
40
|
+
{ pubkey: accounts.holderAccount, isSigner: false, isWritable: false },
|
41
|
+
{ pubkey: accounts.merkleTree, isSigner: false, isWritable: false },
|
42
|
+
{ pubkey: accounts.owner, isSigner: false, isWritable: false },
|
43
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
44
|
+
{ pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
|
45
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
46
|
+
]
|
47
|
+
const identifier = Buffer.from([10, 221, 234, 101, 181, 180, 75, 191])
|
48
|
+
const buffer = Buffer.alloc(1000)
|
49
|
+
const len = layout.encode(
|
50
|
+
{
|
51
|
+
index: args.index,
|
52
|
+
metadata: types.MetadataArgs.toEncodable(args.metadata),
|
53
|
+
},
|
54
|
+
buffer
|
55
|
+
)
|
56
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
57
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
58
|
+
return ix
|
59
|
+
}
|
@@ -0,0 +1,140 @@
|
|
1
|
+
export { initialize } from "./initialize"
|
2
|
+
export type { InitializeArgs, InitializeAccounts } from "./initialize"
|
3
|
+
export { createCollection } from "./createCollection"
|
4
|
+
export type {
|
5
|
+
CreateCollectionArgs,
|
6
|
+
CreateCollectionAccounts,
|
7
|
+
} from "./createCollection"
|
8
|
+
export { deleteTokenLauncher } from "./deleteTokenLauncher"
|
9
|
+
export type { DeleteTokenLauncherAccounts } from "./deleteTokenLauncher"
|
10
|
+
export { buyToken } from "./buyToken"
|
11
|
+
export type { BuyTokenArgs, BuyTokenAccounts } from "./buyToken"
|
12
|
+
export { createTokenLauncher } from "./createTokenLauncher"
|
13
|
+
export type {
|
14
|
+
CreateTokenLauncherArgs,
|
15
|
+
CreateTokenLauncherAccounts,
|
16
|
+
} from "./createTokenLauncher"
|
17
|
+
export { registerGenericUser } from "./registerGenericUser"
|
18
|
+
export type {
|
19
|
+
RegisterGenericUserArgs,
|
20
|
+
RegisterGenericUserAccounts,
|
21
|
+
} from "./registerGenericUser"
|
22
|
+
export { registerUser } from "./registerUser"
|
23
|
+
export type { RegisterUserArgs, RegisterUserAccounts } from "./registerUser"
|
24
|
+
export { createStore } from "./createStore"
|
25
|
+
export type { CreateStoreArgs, CreateStoreAccounts } from "./createStore"
|
26
|
+
export { updatePack } from "./updatePack"
|
27
|
+
export type { UpdatePackArgs, UpdatePackAccounts } from "./updatePack"
|
28
|
+
export { updateStore } from "./updateStore"
|
29
|
+
export type { UpdateStoreArgs, UpdateStoreAccounts } from "./updateStore"
|
30
|
+
export { prepareCreator } from "./prepareCreator"
|
31
|
+
export type { PrepareCreatorAccounts } from "./prepareCreator"
|
32
|
+
export { prepareTraits } from "./prepareTraits"
|
33
|
+
export type { PrepareTraitsAccounts } from "./prepareTraits"
|
34
|
+
export { preparePack } from "./preparePack"
|
35
|
+
export type { PreparePackArgs, PreparePackAccounts } from "./preparePack"
|
36
|
+
export { createPack } from "./createPack"
|
37
|
+
export type { CreatePackArgs, CreatePackAccounts } from "./createPack"
|
38
|
+
export { flagPack } from "./flagPack"
|
39
|
+
export type { FlagPackArgs, FlagPackAccounts } from "./flagPack"
|
40
|
+
export { flagSingle } from "./flagSingle"
|
41
|
+
export type { FlagSingleArgs, FlagSingleAccounts } from "./flagSingle"
|
42
|
+
export { updateSingle } from "./updateSingle"
|
43
|
+
export type { UpdateSingleArgs, UpdateSingleAccounts } from "./updateSingle"
|
44
|
+
export { updateCard } from "./updateCard"
|
45
|
+
export type { UpdateCardArgs, UpdateCardAccounts } from "./updateCard"
|
46
|
+
export { createCard } from "./createCard"
|
47
|
+
export type { CreateCardArgs, CreateCardAccounts } from "./createCard"
|
48
|
+
export { storeLutFor } from "./storeLutFor"
|
49
|
+
export type { StoreLutForArgs, StoreLutForAccounts } from "./storeLutFor"
|
50
|
+
export { assignPackDelegate } from "./assignPackDelegate"
|
51
|
+
export type { AssignPackDelegateAccounts } from "./assignPackDelegate"
|
52
|
+
export { createZeroCard } from "./createZeroCard"
|
53
|
+
export type {
|
54
|
+
CreateZeroCardArgs,
|
55
|
+
CreateZeroCardAccounts,
|
56
|
+
} from "./createZeroCard"
|
57
|
+
export { createSingle } from "./createSingle"
|
58
|
+
export type { CreateSingleArgs, CreateSingleAccounts } from "./createSingle"
|
59
|
+
export { deleteSingle } from "./deleteSingle"
|
60
|
+
export type { DeleteSingleAccounts } from "./deleteSingle"
|
61
|
+
export { archiveItem } from "./archiveItem"
|
62
|
+
export type { ArchiveItemArgs, ArchiveItemAccounts } from "./archiveItem"
|
63
|
+
export { buyPack } from "./buyPack"
|
64
|
+
export type { BuyPackArgs, BuyPackAccounts } from "./buyPack"
|
65
|
+
export { gatePay } from "./gatePay"
|
66
|
+
export type { GatePayArgs, GatePayAccounts } from "./gatePay"
|
67
|
+
export { closeDepositBurn } from "./closeDepositBurn"
|
68
|
+
export type {
|
69
|
+
CloseDepositBurnArgs,
|
70
|
+
CloseDepositBurnAccounts,
|
71
|
+
} from "./closeDepositBurn"
|
72
|
+
export { unwrapAndDestroy } from "./unwrapAndDestroy"
|
73
|
+
export type {
|
74
|
+
UnwrapAndDestroyArgs,
|
75
|
+
UnwrapAndDestroyAccounts,
|
76
|
+
} from "./unwrapAndDestroy"
|
77
|
+
export { buyPay } from "./buyPay"
|
78
|
+
export type { BuyPayArgs, BuyPayAccounts } from "./buyPay"
|
79
|
+
export { addBurn } from "./addBurn"
|
80
|
+
export type { AddBurnArgs, AddBurnAccounts } from "./addBurn"
|
81
|
+
export { burnPay } from "./burnPay"
|
82
|
+
export type { BurnPayArgs, BurnPayAccounts } from "./burnPay"
|
83
|
+
export { openPack } from "./openPack"
|
84
|
+
export type { OpenPackArgs, OpenPackAccounts } from "./openPack"
|
85
|
+
export { deletePack } from "./deletePack"
|
86
|
+
export type { DeletePackAccounts } from "./deletePack"
|
87
|
+
export { deleteCard } from "./deleteCard"
|
88
|
+
export type { DeleteCardAccounts } from "./deleteCard"
|
89
|
+
export { claimZeroCard } from "./claimZeroCard"
|
90
|
+
export type { ClaimZeroCardArgs, ClaimZeroCardAccounts } from "./claimZeroCard"
|
91
|
+
export { withdrawFromStore } from "./withdrawFromStore"
|
92
|
+
export type { WithdrawFromStoreAccounts } from "./withdrawFromStore"
|
93
|
+
export { registerTraits } from "./registerTraits"
|
94
|
+
export type {
|
95
|
+
RegisterTraitsArgs,
|
96
|
+
RegisterTraitsAccounts,
|
97
|
+
} from "./registerTraits"
|
98
|
+
export { closeRegisterTraits } from "./closeRegisterTraits"
|
99
|
+
export type { CloseRegisterTraitsAccounts } from "./closeRegisterTraits"
|
100
|
+
export { feedTraits } from "./feedTraits"
|
101
|
+
export type { FeedTraitsArgs, FeedTraitsAccounts } from "./feedTraits"
|
102
|
+
export { registerCreator } from "./registerCreator"
|
103
|
+
export type {
|
104
|
+
RegisterCreatorArgs,
|
105
|
+
RegisterCreatorAccounts,
|
106
|
+
} from "./registerCreator"
|
107
|
+
export { feedPool } from "./feedPool"
|
108
|
+
export type { FeedPoolArgs, FeedPoolAccounts } from "./feedPool"
|
109
|
+
export { donateUser } from "./donateUser"
|
110
|
+
export type { DonateUserArgs, DonateUserAccounts } from "./donateUser"
|
111
|
+
export { registerCollector } from "./registerCollector"
|
112
|
+
export type {
|
113
|
+
RegisterCollectorArgs,
|
114
|
+
RegisterCollectorAccounts,
|
115
|
+
} from "./registerCollector"
|
116
|
+
export { registerActivity } from "./registerActivity"
|
117
|
+
export type {
|
118
|
+
RegisterActivityArgs,
|
119
|
+
RegisterActivityAccounts,
|
120
|
+
} from "./registerActivity"
|
121
|
+
export { registerPackUploads } from "./registerPackUploads"
|
122
|
+
export type {
|
123
|
+
RegisterPackUploadsArgs,
|
124
|
+
RegisterPackUploadsAccounts,
|
125
|
+
} from "./registerPackUploads"
|
126
|
+
export { printPack } from "./printPack"
|
127
|
+
export type { PrintPackArgs, PrintPackAccounts } from "./printPack"
|
128
|
+
export { recoverDepositBurn } from "./recoverDepositBurn"
|
129
|
+
export type {
|
130
|
+
RecoverDepositBurnArgs,
|
131
|
+
RecoverDepositBurnAccounts,
|
132
|
+
} from "./recoverDepositBurn"
|
133
|
+
export { adjustDepositBurn } from "./adjustDepositBurn"
|
134
|
+
export type { AdjustDepositBurnAccounts } from "./adjustDepositBurn"
|
135
|
+
export { depositBurn } from "./depositBurn"
|
136
|
+
export type { DepositBurnArgs, DepositBurnAccounts } from "./depositBurn"
|
137
|
+
export { printSingle } from "./printSingle"
|
138
|
+
export type { PrintSingleArgs, PrintSingleAccounts } from "./printSingle"
|
139
|
+
export { feedTree } from "./feedTree"
|
140
|
+
export type { FeedTreeArgs, FeedTreeAccounts } from "./feedTree"
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } 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 borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
6
|
+
|
7
|
+
export interface InitializeArgs {
|
8
|
+
slot: BN
|
9
|
+
globalFee: types.GlobalFeeFields | null
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface InitializeAccounts {
|
13
|
+
holderAccount: PublicKey
|
14
|
+
creator: PublicKey
|
15
|
+
systemProgram: PublicKey
|
16
|
+
}
|
17
|
+
|
18
|
+
export const layout = borsh.struct([
|
19
|
+
borsh.u64("slot"),
|
20
|
+
borsh.option(types.GlobalFee.layout(), "globalFee"),
|
21
|
+
])
|
22
|
+
|
23
|
+
export function initialize(
|
24
|
+
args: InitializeArgs,
|
25
|
+
accounts: InitializeAccounts,
|
26
|
+
programId: PublicKey = PROGRAM_ID
|
27
|
+
) {
|
28
|
+
const keys: Array<AccountMeta> = [
|
29
|
+
{ pubkey: accounts.holderAccount, isSigner: false, isWritable: true },
|
30
|
+
{ pubkey: accounts.creator, isSigner: true, isWritable: true },
|
31
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
32
|
+
]
|
33
|
+
const identifier = Buffer.from([175, 175, 109, 31, 13, 152, 155, 237])
|
34
|
+
const buffer = Buffer.alloc(1000)
|
35
|
+
const len = layout.encode(
|
36
|
+
{
|
37
|
+
slot: args.slot,
|
38
|
+
globalFee:
|
39
|
+
(args.globalFee && types.GlobalFee.toEncodable(args.globalFee)) || null,
|
40
|
+
},
|
41
|
+
buffer
|
42
|
+
)
|
43
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
44
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
45
|
+
return ix
|
46
|
+
}
|