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,79 @@
|
|
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 OpenPackArgs {
|
8
|
+
root: Array<number>
|
9
|
+
dataHash: Array<number>
|
10
|
+
creatorHash: Array<number>
|
11
|
+
index: number
|
12
|
+
randomBase: BN
|
13
|
+
creatorAuthorityBump: number
|
14
|
+
}
|
15
|
+
|
16
|
+
export interface OpenPackAccounts {
|
17
|
+
treeAuthority: PublicKey
|
18
|
+
merkleTree: PublicKey
|
19
|
+
packAccount: PublicKey
|
20
|
+
packOpenAccount: PublicKey
|
21
|
+
creatorAuthority: PublicKey
|
22
|
+
packContent: PublicKey
|
23
|
+
owner: PublicKey
|
24
|
+
packReceipt: PublicKey
|
25
|
+
payer: PublicKey
|
26
|
+
openAuthority: PublicKey
|
27
|
+
bubblegumProgram: PublicKey
|
28
|
+
logWrapper: PublicKey
|
29
|
+
compressionProgram: PublicKey
|
30
|
+
systemProgram: PublicKey
|
31
|
+
}
|
32
|
+
|
33
|
+
export const layout = borsh.struct([
|
34
|
+
borsh.array(borsh.u8(), 32, "root"),
|
35
|
+
borsh.array(borsh.u8(), 32, "dataHash"),
|
36
|
+
borsh.array(borsh.u8(), 32, "creatorHash"),
|
37
|
+
borsh.u32("index"),
|
38
|
+
borsh.u64("randomBase"),
|
39
|
+
borsh.u8("creatorAuthorityBump"),
|
40
|
+
])
|
41
|
+
|
42
|
+
export function openPack(
|
43
|
+
args: OpenPackArgs,
|
44
|
+
accounts: OpenPackAccounts,
|
45
|
+
programId: PublicKey = PROGRAM_ID
|
46
|
+
) {
|
47
|
+
const keys: Array<AccountMeta> = [
|
48
|
+
{ pubkey: accounts.treeAuthority, isSigner: false, isWritable: false },
|
49
|
+
{ pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
|
50
|
+
{ pubkey: accounts.packAccount, isSigner: false, isWritable: true },
|
51
|
+
{ pubkey: accounts.packOpenAccount, isSigner: false, isWritable: true },
|
52
|
+
{ pubkey: accounts.creatorAuthority, isSigner: false, isWritable: true },
|
53
|
+
{ pubkey: accounts.packContent, isSigner: false, isWritable: true },
|
54
|
+
{ pubkey: accounts.owner, isSigner: false, isWritable: true },
|
55
|
+
{ pubkey: accounts.packReceipt, isSigner: false, isWritable: true },
|
56
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
57
|
+
{ pubkey: accounts.openAuthority, isSigner: true, isWritable: true },
|
58
|
+
{ pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
|
59
|
+
{ pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
|
60
|
+
{ pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
|
61
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
62
|
+
]
|
63
|
+
const identifier = Buffer.from([75, 203, 144, 65, 63, 253, 103, 85])
|
64
|
+
const buffer = Buffer.alloc(1000)
|
65
|
+
const len = layout.encode(
|
66
|
+
{
|
67
|
+
root: args.root,
|
68
|
+
dataHash: args.dataHash,
|
69
|
+
creatorHash: args.creatorHash,
|
70
|
+
index: args.index,
|
71
|
+
randomBase: args.randomBase,
|
72
|
+
creatorAuthorityBump: args.creatorAuthorityBump,
|
73
|
+
},
|
74
|
+
buffer
|
75
|
+
)
|
76
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
77
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
78
|
+
return ix
|
79
|
+
}
|
@@ -0,0 +1,30 @@
|
|
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 PrepareCreatorAccounts {
|
8
|
+
storeAccount: PublicKey
|
9
|
+
creatorAuthority: PublicKey
|
10
|
+
creator: PublicKey
|
11
|
+
payer: PublicKey
|
12
|
+
systemProgram: PublicKey
|
13
|
+
}
|
14
|
+
|
15
|
+
export function prepareCreator(
|
16
|
+
accounts: PrepareCreatorAccounts,
|
17
|
+
programId: PublicKey = PROGRAM_ID
|
18
|
+
) {
|
19
|
+
const keys: Array<AccountMeta> = [
|
20
|
+
{ pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
|
21
|
+
{ pubkey: accounts.creatorAuthority, isSigner: false, isWritable: true },
|
22
|
+
{ pubkey: accounts.creator, isSigner: false, isWritable: false },
|
23
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
24
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
25
|
+
]
|
26
|
+
const identifier = Buffer.from([6, 217, 148, 231, 102, 186, 94, 73])
|
27
|
+
const data = identifier
|
28
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
29
|
+
return ix
|
30
|
+
}
|
@@ -0,0 +1,51 @@
|
|
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 PreparePackArgs {
|
8
|
+
supply: BN
|
9
|
+
identifier: BN
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface PreparePackAccounts {
|
13
|
+
storeAccount: PublicKey
|
14
|
+
packAccount: PublicKey
|
15
|
+
packContent: PublicKey
|
16
|
+
creator: PublicKey
|
17
|
+
payer: PublicKey
|
18
|
+
systemProgram: PublicKey
|
19
|
+
}
|
20
|
+
|
21
|
+
export const layout = borsh.struct([
|
22
|
+
borsh.u64("supply"),
|
23
|
+
borsh.u64("identifier"),
|
24
|
+
])
|
25
|
+
|
26
|
+
export function preparePack(
|
27
|
+
args: PreparePackArgs,
|
28
|
+
accounts: PreparePackAccounts,
|
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.packContent, isSigner: false, isWritable: true },
|
35
|
+
{ pubkey: accounts.creator, isSigner: false, isWritable: false },
|
36
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
37
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
38
|
+
]
|
39
|
+
const identifier = Buffer.from([246, 136, 88, 116, 22, 62, 30, 154])
|
40
|
+
const buffer = Buffer.alloc(1000)
|
41
|
+
const len = layout.encode(
|
42
|
+
{
|
43
|
+
supply: args.supply,
|
44
|
+
identifier: args.identifier,
|
45
|
+
},
|
46
|
+
buffer
|
47
|
+
)
|
48
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
49
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
50
|
+
return ix
|
51
|
+
}
|
@@ -0,0 +1,28 @@
|
|
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 PrepareTraitsAccounts {
|
8
|
+
packAccount: PublicKey
|
9
|
+
packTraits: PublicKey
|
10
|
+
payer: PublicKey
|
11
|
+
systemProgram: PublicKey
|
12
|
+
}
|
13
|
+
|
14
|
+
export function prepareTraits(
|
15
|
+
accounts: PrepareTraitsAccounts,
|
16
|
+
programId: PublicKey = PROGRAM_ID
|
17
|
+
) {
|
18
|
+
const keys: Array<AccountMeta> = [
|
19
|
+
{ pubkey: accounts.packAccount, isSigner: false, isWritable: true },
|
20
|
+
{ pubkey: accounts.packTraits, isSigner: false, isWritable: true },
|
21
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
22
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
23
|
+
]
|
24
|
+
const identifier = Buffer.from([44, 242, 4, 177, 221, 243, 62, 47])
|
25
|
+
const data = identifier
|
26
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
27
|
+
return ix
|
28
|
+
}
|
@@ -0,0 +1,95 @@
|
|
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 PrintPackArgs {
|
8
|
+
proof: types.CurrencyArtistProofFields
|
9
|
+
receiptSlot: BN
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface PrintPackAccounts {
|
13
|
+
treeAuthority: PublicKey
|
14
|
+
creatorAuthority: PublicKey
|
15
|
+
discriminator: PublicKey
|
16
|
+
packAccount: PublicKey
|
17
|
+
merkleTree: PublicKey
|
18
|
+
merkleManager: PublicKey
|
19
|
+
/**
|
20
|
+
* If there is no collecton authority record PDA then
|
21
|
+
* this must be the Bubblegum program address.
|
22
|
+
*/
|
23
|
+
collectionAuthorityRecordPda: PublicKey
|
24
|
+
packReceipt: PublicKey
|
25
|
+
editionAccount: PublicKey
|
26
|
+
collectionMetadata: PublicKey
|
27
|
+
collectionMint: PublicKey
|
28
|
+
storeAccount: PublicKey
|
29
|
+
paymentAccount: PublicKey
|
30
|
+
buytrackAccount: PublicKey
|
31
|
+
bubblegumSigner: PublicKey
|
32
|
+
owner: PublicKey
|
33
|
+
payer: PublicKey
|
34
|
+
logWrapper: PublicKey
|
35
|
+
bubblegumProgram: PublicKey
|
36
|
+
compressionProgram: PublicKey
|
37
|
+
tokenMetadataProgram: PublicKey
|
38
|
+
systemProgram: PublicKey
|
39
|
+
}
|
40
|
+
|
41
|
+
export const layout = borsh.struct([
|
42
|
+
types.CurrencyArtistProof.layout("proof"),
|
43
|
+
borsh.u64("receiptSlot"),
|
44
|
+
])
|
45
|
+
|
46
|
+
export function printPack(
|
47
|
+
args: PrintPackArgs,
|
48
|
+
accounts: PrintPackAccounts,
|
49
|
+
programId: PublicKey = PROGRAM_ID
|
50
|
+
) {
|
51
|
+
const keys: Array<AccountMeta> = [
|
52
|
+
{ pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
|
53
|
+
{ pubkey: accounts.creatorAuthority, isSigner: false, isWritable: false },
|
54
|
+
{ pubkey: accounts.discriminator, isSigner: false, isWritable: false },
|
55
|
+
{ pubkey: accounts.packAccount, isSigner: false, isWritable: true },
|
56
|
+
{ pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
|
57
|
+
{ pubkey: accounts.merkleManager, isSigner: false, isWritable: true },
|
58
|
+
{
|
59
|
+
pubkey: accounts.collectionAuthorityRecordPda,
|
60
|
+
isSigner: false,
|
61
|
+
isWritable: false,
|
62
|
+
},
|
63
|
+
{ pubkey: accounts.packReceipt, isSigner: false, isWritable: true },
|
64
|
+
{ pubkey: accounts.editionAccount, isSigner: false, isWritable: false },
|
65
|
+
{ pubkey: accounts.collectionMetadata, isSigner: false, isWritable: true },
|
66
|
+
{ pubkey: accounts.collectionMint, isSigner: false, isWritable: false },
|
67
|
+
{ pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
|
68
|
+
{ pubkey: accounts.paymentAccount, isSigner: false, isWritable: true },
|
69
|
+
{ pubkey: accounts.buytrackAccount, isSigner: false, isWritable: true },
|
70
|
+
{ pubkey: accounts.bubblegumSigner, isSigner: false, isWritable: false },
|
71
|
+
{ pubkey: accounts.owner, isSigner: false, isWritable: false },
|
72
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
73
|
+
{ pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
|
74
|
+
{ pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
|
75
|
+
{ pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
|
76
|
+
{
|
77
|
+
pubkey: accounts.tokenMetadataProgram,
|
78
|
+
isSigner: false,
|
79
|
+
isWritable: false,
|
80
|
+
},
|
81
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
82
|
+
]
|
83
|
+
const identifier = Buffer.from([25, 136, 10, 50, 193, 77, 147, 120])
|
84
|
+
const buffer = Buffer.alloc(1000)
|
85
|
+
const len = layout.encode(
|
86
|
+
{
|
87
|
+
proof: types.CurrencyArtistProof.toEncodable(args.proof),
|
88
|
+
receiptSlot: args.receiptSlot,
|
89
|
+
},
|
90
|
+
buffer
|
91
|
+
)
|
92
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
93
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
94
|
+
return ix
|
95
|
+
}
|
@@ -0,0 +1,108 @@
|
|
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 PrintSingleArgs {
|
8
|
+
proof: types.CurrencyArtistProofFields | null
|
9
|
+
storeBump: number
|
10
|
+
creatorAuthBump: number
|
11
|
+
itemBump: number
|
12
|
+
treeBump: number
|
13
|
+
extra: types.ExtraParameterKind
|
14
|
+
}
|
15
|
+
|
16
|
+
export interface PrintSingleAccounts {
|
17
|
+
/** CHECK */
|
18
|
+
owner: PublicKey
|
19
|
+
itemAccount: PublicKey
|
20
|
+
treeAuthority: PublicKey
|
21
|
+
storeAccount: PublicKey
|
22
|
+
creatorAuthority: PublicKey
|
23
|
+
paymentAccount: PublicKey
|
24
|
+
merkleTree: PublicKey
|
25
|
+
merkleManager: PublicKey
|
26
|
+
/**
|
27
|
+
* If there is no collecton authority record PDA then
|
28
|
+
* this must be the Bubblegum program address.
|
29
|
+
*/
|
30
|
+
collectionAuthorityRecordPda: PublicKey
|
31
|
+
editionAccount: PublicKey
|
32
|
+
collectionMetadata: PublicKey
|
33
|
+
collectionMint: PublicKey
|
34
|
+
bubblegumSigner: PublicKey
|
35
|
+
buytrackAccount: PublicKey
|
36
|
+
revealForMe: PublicKey
|
37
|
+
payer: PublicKey
|
38
|
+
logWrapper: PublicKey
|
39
|
+
bubblegumProgram: PublicKey
|
40
|
+
compressionProgram: PublicKey
|
41
|
+
tokenMetadataProgram: PublicKey
|
42
|
+
systemProgram: PublicKey
|
43
|
+
}
|
44
|
+
|
45
|
+
export const layout = borsh.struct([
|
46
|
+
borsh.option(types.CurrencyArtistProof.layout(), "proof"),
|
47
|
+
borsh.u8("storeBump"),
|
48
|
+
borsh.u8("creatorAuthBump"),
|
49
|
+
borsh.u8("itemBump"),
|
50
|
+
borsh.u8("treeBump"),
|
51
|
+
types.ExtraParameter.layout("extra"),
|
52
|
+
])
|
53
|
+
|
54
|
+
export function printSingle(
|
55
|
+
args: PrintSingleArgs,
|
56
|
+
accounts: PrintSingleAccounts,
|
57
|
+
programId: PublicKey = PROGRAM_ID
|
58
|
+
) {
|
59
|
+
const keys: Array<AccountMeta> = [
|
60
|
+
{ pubkey: accounts.owner, isSigner: false, isWritable: false },
|
61
|
+
{ pubkey: accounts.itemAccount, isSigner: false, isWritable: true },
|
62
|
+
{ pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
|
63
|
+
{ pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
|
64
|
+
{ pubkey: accounts.creatorAuthority, isSigner: false, isWritable: false },
|
65
|
+
{ pubkey: accounts.paymentAccount, isSigner: false, isWritable: true },
|
66
|
+
{ pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
|
67
|
+
{ pubkey: accounts.merkleManager, isSigner: false, isWritable: true },
|
68
|
+
{
|
69
|
+
pubkey: accounts.collectionAuthorityRecordPda,
|
70
|
+
isSigner: false,
|
71
|
+
isWritable: false,
|
72
|
+
},
|
73
|
+
{ pubkey: accounts.editionAccount, isSigner: false, isWritable: false },
|
74
|
+
{ pubkey: accounts.collectionMetadata, isSigner: false, isWritable: true },
|
75
|
+
{ pubkey: accounts.collectionMint, isSigner: false, isWritable: false },
|
76
|
+
{ pubkey: accounts.bubblegumSigner, isSigner: false, isWritable: false },
|
77
|
+
{ pubkey: accounts.buytrackAccount, isSigner: false, isWritable: true },
|
78
|
+
{ pubkey: accounts.revealForMe, isSigner: false, isWritable: true },
|
79
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
80
|
+
{ pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
|
81
|
+
{ pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
|
82
|
+
{ pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
|
83
|
+
{
|
84
|
+
pubkey: accounts.tokenMetadataProgram,
|
85
|
+
isSigner: false,
|
86
|
+
isWritable: false,
|
87
|
+
},
|
88
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
89
|
+
]
|
90
|
+
const identifier = Buffer.from([105, 204, 23, 32, 170, 121, 225, 133])
|
91
|
+
const buffer = Buffer.alloc(1000)
|
92
|
+
const len = layout.encode(
|
93
|
+
{
|
94
|
+
proof:
|
95
|
+
(args.proof && types.CurrencyArtistProof.toEncodable(args.proof)) ||
|
96
|
+
null,
|
97
|
+
storeBump: args.storeBump,
|
98
|
+
creatorAuthBump: args.creatorAuthBump,
|
99
|
+
itemBump: args.itemBump,
|
100
|
+
treeBump: args.treeBump,
|
101
|
+
extra: args.extra.toEncodable(),
|
102
|
+
},
|
103
|
+
buffer
|
104
|
+
)
|
105
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
106
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
107
|
+
return ix
|
108
|
+
}
|
@@ -0,0 +1,80 @@
|
|
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 RecoverDepositBurnArgs {
|
8
|
+
deposit: types.RecoverDepositFields
|
9
|
+
burn: number
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface RecoverDepositBurnAccounts {
|
13
|
+
burnDeposit: PublicKey
|
14
|
+
artistBurnTrack: PublicKey
|
15
|
+
globalBurnTrack: PublicKey
|
16
|
+
itemAccount: PublicKey
|
17
|
+
packAccount: PublicKey
|
18
|
+
treeAuthority: PublicKey
|
19
|
+
/** CHECK */
|
20
|
+
merkleTree: PublicKey
|
21
|
+
/** CHECK */
|
22
|
+
fromAta: PublicKey
|
23
|
+
/** CHECK */
|
24
|
+
toAta: PublicKey
|
25
|
+
/** CHECK */
|
26
|
+
recoverTo: PublicKey
|
27
|
+
storeAccount: PublicKey
|
28
|
+
/** CHECK */
|
29
|
+
token: PublicKey
|
30
|
+
payer: PublicKey
|
31
|
+
tokenProgram: PublicKey
|
32
|
+
bubblegumProgram: PublicKey
|
33
|
+
logWrapper: PublicKey
|
34
|
+
compressionProgram: PublicKey
|
35
|
+
systemProgram: PublicKey
|
36
|
+
}
|
37
|
+
|
38
|
+
export const layout = borsh.struct([
|
39
|
+
types.RecoverDeposit.layout("deposit"),
|
40
|
+
borsh.u8("burn"),
|
41
|
+
])
|
42
|
+
|
43
|
+
export function recoverDepositBurn(
|
44
|
+
args: RecoverDepositBurnArgs,
|
45
|
+
accounts: RecoverDepositBurnAccounts,
|
46
|
+
programId: PublicKey = PROGRAM_ID
|
47
|
+
) {
|
48
|
+
const keys: Array<AccountMeta> = [
|
49
|
+
{ pubkey: accounts.burnDeposit, isSigner: false, isWritable: true },
|
50
|
+
{ pubkey: accounts.artistBurnTrack, isSigner: false, isWritable: true },
|
51
|
+
{ pubkey: accounts.globalBurnTrack, isSigner: false, isWritable: true },
|
52
|
+
{ pubkey: accounts.itemAccount, isSigner: false, isWritable: false },
|
53
|
+
{ pubkey: accounts.packAccount, isSigner: false, isWritable: false },
|
54
|
+
{ pubkey: accounts.treeAuthority, isSigner: false, isWritable: true },
|
55
|
+
{ pubkey: accounts.merkleTree, isSigner: false, isWritable: true },
|
56
|
+
{ pubkey: accounts.fromAta, isSigner: false, isWritable: true },
|
57
|
+
{ pubkey: accounts.toAta, isSigner: false, isWritable: true },
|
58
|
+
{ pubkey: accounts.recoverTo, isSigner: false, isWritable: true },
|
59
|
+
{ pubkey: accounts.storeAccount, isSigner: false, isWritable: true },
|
60
|
+
{ pubkey: accounts.token, isSigner: false, isWritable: true },
|
61
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
62
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
63
|
+
{ pubkey: accounts.bubblegumProgram, isSigner: false, isWritable: false },
|
64
|
+
{ pubkey: accounts.logWrapper, isSigner: false, isWritable: false },
|
65
|
+
{ pubkey: accounts.compressionProgram, isSigner: false, isWritable: false },
|
66
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
67
|
+
]
|
68
|
+
const identifier = Buffer.from([0, 193, 58, 0, 59, 165, 12, 100])
|
69
|
+
const buffer = Buffer.alloc(1000)
|
70
|
+
const len = layout.encode(
|
71
|
+
{
|
72
|
+
deposit: types.RecoverDeposit.toEncodable(args.deposit),
|
73
|
+
burn: args.burn,
|
74
|
+
},
|
75
|
+
buffer
|
76
|
+
)
|
77
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
78
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
79
|
+
return ix
|
80
|
+
}
|
@@ -0,0 +1,43 @@
|
|
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 RegisterActivityArgs {
|
8
|
+
userActivityBump: number
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface RegisterActivityAccounts {
|
12
|
+
userActivity: PublicKey
|
13
|
+
/** CHECK */
|
14
|
+
store: PublicKey
|
15
|
+
payer: PublicKey
|
16
|
+
systemProgram: PublicKey
|
17
|
+
}
|
18
|
+
|
19
|
+
export const layout = borsh.struct([borsh.u8("userActivityBump")])
|
20
|
+
|
21
|
+
export function registerActivity(
|
22
|
+
args: RegisterActivityArgs,
|
23
|
+
accounts: RegisterActivityAccounts,
|
24
|
+
programId: PublicKey = PROGRAM_ID
|
25
|
+
) {
|
26
|
+
const keys: Array<AccountMeta> = [
|
27
|
+
{ pubkey: accounts.userActivity, isSigner: false, isWritable: true },
|
28
|
+
{ pubkey: accounts.store, isSigner: false, isWritable: false },
|
29
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
30
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
31
|
+
]
|
32
|
+
const identifier = Buffer.from([79, 208, 220, 62, 162, 88, 1, 134])
|
33
|
+
const buffer = Buffer.alloc(1000)
|
34
|
+
const len = layout.encode(
|
35
|
+
{
|
36
|
+
userActivityBump: args.userActivityBump,
|
37
|
+
},
|
38
|
+
buffer
|
39
|
+
)
|
40
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
41
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
42
|
+
return ix
|
43
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import {
|
2
|
+
TransactionInstruction,
|
3
|
+
PublicKey,
|
4
|
+
AccountMeta,
|
5
|
+
} from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars
|
6
|
+
import * as borsh from "@coral-xyz/borsh"; // eslint-disable-line @typescript-eslint/no-unused-vars
|
7
|
+
import { PROGRAM_ID } from "../programId";
|
8
|
+
|
9
|
+
export interface RegisterCollectorArgs {
|
10
|
+
creatorBump: number;
|
11
|
+
activityBump: number;
|
12
|
+
}
|
13
|
+
|
14
|
+
export interface RegisterCollectorAccounts {
|
15
|
+
collectorArtistRegistry: PublicKey;
|
16
|
+
collectorGlobalRegistry: PublicKey;
|
17
|
+
creatorRegistry: PublicKey;
|
18
|
+
userActivity: PublicKey;
|
19
|
+
store: PublicKey;
|
20
|
+
payer: PublicKey;
|
21
|
+
systemProgram: PublicKey;
|
22
|
+
}
|
23
|
+
|
24
|
+
export const layout = borsh.struct([
|
25
|
+
borsh.u8("creatorBump"),
|
26
|
+
borsh.u8("activityBump"),
|
27
|
+
]);
|
28
|
+
|
29
|
+
export function registerCollector(
|
30
|
+
args: RegisterCollectorArgs,
|
31
|
+
accounts: RegisterCollectorAccounts,
|
32
|
+
programId: PublicKey = PROGRAM_ID
|
33
|
+
) {
|
34
|
+
const keys: Array<AccountMeta> = [
|
35
|
+
{
|
36
|
+
pubkey: accounts.collectorArtistRegistry,
|
37
|
+
isSigner: false,
|
38
|
+
isWritable: true,
|
39
|
+
},
|
40
|
+
{
|
41
|
+
pubkey: accounts.collectorGlobalRegistry,
|
42
|
+
isSigner: false,
|
43
|
+
isWritable: true,
|
44
|
+
},
|
45
|
+
{ pubkey: accounts.creatorRegistry, isSigner: false, isWritable: true },
|
46
|
+
{ pubkey: accounts.userActivity, isSigner: false, isWritable: true },
|
47
|
+
{ pubkey: accounts.store, isSigner: false, isWritable: true },
|
48
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
49
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
50
|
+
];
|
51
|
+
const identifier = Buffer.from([105, 124, 61, 206, 8, 95, 112, 16]);
|
52
|
+
const buffer = Buffer.alloc(1000);
|
53
|
+
const len = layout.encode(
|
54
|
+
{
|
55
|
+
creatorBump: args.creatorBump,
|
56
|
+
activityBump: args.activityBump,
|
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,48 @@
|
|
1
|
+
import {
|
2
|
+
TransactionInstruction,
|
3
|
+
PublicKey,
|
4
|
+
AccountMeta,
|
5
|
+
} from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars
|
6
|
+
import * as borsh from "@coral-xyz/borsh"; // eslint-disable-line @typescript-eslint/no-unused-vars
|
7
|
+
import { PROGRAM_ID } from "../programId";
|
8
|
+
|
9
|
+
export interface RegisterCreatorArgs {
|
10
|
+
userActivityBump: number;
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface RegisterCreatorAccounts {
|
14
|
+
creatorRegistry: PublicKey;
|
15
|
+
userActivity: PublicKey;
|
16
|
+
itemAccount: PublicKey;
|
17
|
+
store: PublicKey;
|
18
|
+
payer: PublicKey;
|
19
|
+
systemProgram: PublicKey;
|
20
|
+
}
|
21
|
+
|
22
|
+
export const layout = borsh.struct([borsh.u8("userActivityBump")]);
|
23
|
+
|
24
|
+
export function registerCreator(
|
25
|
+
args: RegisterCreatorArgs,
|
26
|
+
accounts: RegisterCreatorAccounts,
|
27
|
+
programId: PublicKey = PROGRAM_ID
|
28
|
+
) {
|
29
|
+
const keys: Array<AccountMeta> = [
|
30
|
+
{ pubkey: accounts.creatorRegistry, isSigner: false, isWritable: true },
|
31
|
+
{ pubkey: accounts.userActivity, isSigner: false, isWritable: true },
|
32
|
+
{ pubkey: accounts.itemAccount, isSigner: false, isWritable: false },
|
33
|
+
{ pubkey: accounts.store, isSigner: false, isWritable: false },
|
34
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
35
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
36
|
+
];
|
37
|
+
const identifier = Buffer.from([85, 3, 194, 210, 164, 140, 160, 195]);
|
38
|
+
const buffer = Buffer.alloc(1000);
|
39
|
+
const len = layout.encode(
|
40
|
+
{
|
41
|
+
userActivityBump: args.userActivityBump,
|
42
|
+
},
|
43
|
+
buffer
|
44
|
+
);
|
45
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
46
|
+
const ix = new TransactionInstruction({ keys, programId, data });
|
47
|
+
return ix;
|
48
|
+
}
|