Skip to content

Commit

Permalink
v0.1.32: everything necessary for tlock.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwu committed Dec 18, 2023
1 parent 845b378 commit 3598bba
Show file tree
Hide file tree
Showing 9 changed files with 420 additions and 210 deletions.
138 changes: 125 additions & 13 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tensor-hq/tensor-tests-common",
"version": "0.1.13",
"version": "0.1.32",
"description": "Common TEST utility methods used by Tensor.",
"sideEffects": false,
"module": "./dist/esm/index.js",
Expand All @@ -22,12 +22,15 @@
"dependencies": {
"@coral-xyz/anchor": "^0.29.0",
"@metaplex-foundation/mpl-bubblegum": "^0.8.0",
"@metaplex-foundation/mpl-token-auth-rules": "^3.0.1",
"@metaplex-foundation/mpl-token-metadata": "^2.13.0",
"@metaplex-foundation/umi": "^0.8.10",
"@msgpack/msgpack": "^3.0.0-beta2",
"@saberhq/solana-contrib": "^1.14.11",
"@solana/spl-account-compression": "^0.2.0",
"@solana/spl-token": "^0.3.9",
"@tensor-hq/tensor-common": "^1.0.3",
"@tensor-hq/tensor-tests-common": "^0.1.30",
"@tensor-hq/tensorswap-ts": "^2.0.2",
"bs58": "^5.0.0",
"chai-as-promised": "^7.1.1",
Expand All @@ -37,7 +40,6 @@
},
"devDependencies": {
"@metaplex-foundation/js": "^0.20.1",
"@metaplex-foundation/mpl-token-auth-rules": "^2.0.0",
"@types/chai": "^4.3.5",
"@types/mocha": "^10.0.1",
"chai": "^4.3.10",
Expand Down
16 changes: 15 additions & 1 deletion src/ata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const createNft = async ({
creators,
setCollSize,
collection,
collectionUA,
collectionVerified = true,
ruleSet = null,
}: {
Expand All @@ -91,6 +92,8 @@ export const createNft = async ({
creators?: CreatorInput[];
setCollSize?: number;
collection?: Keypair;
/** Must pass (if not owner) to verify collection */
collectionUA?: Keypair;
collectionVerified?: boolean;
ruleSet?: PublicKey | null;
}) => {
Expand Down Expand Up @@ -198,7 +201,7 @@ export const createNft = async ({
? [
createVerifyInstruction(
{
authority: owner.publicKey,
authority: collectionUA?.publicKey ?? owner.publicKey,
metadata,
collectionMint: collection.publicKey,
collectionMetadata: findMetadataPda(collection.publicKey)[0],
Expand Down Expand Up @@ -262,6 +265,7 @@ export const createNft = async ({
owner,
mint,
...(creators?.map((c) => c.authority) ?? []),
collectionUA,
]),
(k) => k.publicKey.toBase58(),
),
Expand All @@ -282,6 +286,7 @@ export const createAndFundAta = async ({
royaltyBps,
creators,
collection,
collectionUA,
collectionVerified,
createCollection = true,
programmable = false,
Expand All @@ -295,6 +300,8 @@ export const createAndFundAta = async ({
creators?: CreatorInput[];
collection?: Keypair;
createCollection?: boolean;
/** Must pass (if not owner) to verify collection */
collectionUA?: Keypair;
collectionVerified?: boolean;
programmable?: boolean;
ruleSetAddr?: PublicKey;
Expand Down Expand Up @@ -334,6 +341,7 @@ export const createAndFundAta = async ({
royaltyBps,
creators,
collection,
collectionUA,
collectionVerified,
ruleSet: ruleSetAddr,
tokenStandard: programmable
Expand All @@ -360,6 +368,7 @@ export const makeMintTwoAta = async ({
royaltyBps,
creators,
collection,
collectionUA,
collectionVerified,
createCollection,
programmable,
Expand All @@ -372,6 +381,8 @@ export const makeMintTwoAta = async ({
royaltyBps?: number;
creators?: CreatorInput[];
collection?: Keypair;
/** Must pass (if not owner) to verify collection */
collectionUA?: Keypair;
collectionVerified?: boolean;
createCollection?: boolean;
programmable?: boolean;
Expand All @@ -385,6 +396,7 @@ export const makeMintTwoAta = async ({
royaltyBps,
creators,
collection,
collectionUA,
collectionVerified,
createCollection,
programmable,
Expand All @@ -400,3 +412,5 @@ export const makeMintTwoAta = async ({

return { mint, metadata, ata, otherAta, masterEdition, collectionInfo };
};
1;
export type MintTwoAta = Awaited<ReturnType<typeof makeMintTwoAta>>;
Loading

0 comments on commit 3598bba

Please sign in to comment.