Skip to content

Commit 3598bba

Browse files
committed
v0.1.32: everything necessary for tlock.
1 parent 845b378 commit 3598bba

File tree

9 files changed

+420
-210
lines changed

9 files changed

+420
-210
lines changed

.pnp.cjs

Lines changed: 125 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tensor-hq/tensor-tests-common",
3-
"version": "0.1.13",
3+
"version": "0.1.32",
44
"description": "Common TEST utility methods used by Tensor.",
55
"sideEffects": false,
66
"module": "./dist/esm/index.js",
@@ -22,12 +22,15 @@
2222
"dependencies": {
2323
"@coral-xyz/anchor": "^0.29.0",
2424
"@metaplex-foundation/mpl-bubblegum": "^0.8.0",
25+
"@metaplex-foundation/mpl-token-auth-rules": "^3.0.1",
2526
"@metaplex-foundation/mpl-token-metadata": "^2.13.0",
27+
"@metaplex-foundation/umi": "^0.8.10",
2628
"@msgpack/msgpack": "^3.0.0-beta2",
2729
"@saberhq/solana-contrib": "^1.14.11",
2830
"@solana/spl-account-compression": "^0.2.0",
2931
"@solana/spl-token": "^0.3.9",
3032
"@tensor-hq/tensor-common": "^1.0.3",
33+
"@tensor-hq/tensor-tests-common": "^0.1.30",
3134
"@tensor-hq/tensorswap-ts": "^2.0.2",
3235
"bs58": "^5.0.0",
3336
"chai-as-promised": "^7.1.1",
@@ -37,7 +40,6 @@
3740
},
3841
"devDependencies": {
3942
"@metaplex-foundation/js": "^0.20.1",
40-
"@metaplex-foundation/mpl-token-auth-rules": "^2.0.0",
4143
"@types/chai": "^4.3.5",
4244
"@types/mocha": "^10.0.1",
4345
"chai": "^4.3.10",

src/ata.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export const createNft = async ({
7979
creators,
8080
setCollSize,
8181
collection,
82+
collectionUA,
8283
collectionVerified = true,
8384
ruleSet = null,
8485
}: {
@@ -91,6 +92,8 @@ export const createNft = async ({
9192
creators?: CreatorInput[];
9293
setCollSize?: number;
9394
collection?: Keypair;
95+
/** Must pass (if not owner) to verify collection */
96+
collectionUA?: Keypair;
9497
collectionVerified?: boolean;
9598
ruleSet?: PublicKey | null;
9699
}) => {
@@ -198,7 +201,7 @@ export const createNft = async ({
198201
? [
199202
createVerifyInstruction(
200203
{
201-
authority: owner.publicKey,
204+
authority: collectionUA?.publicKey ?? owner.publicKey,
202205
metadata,
203206
collectionMint: collection.publicKey,
204207
collectionMetadata: findMetadataPda(collection.publicKey)[0],
@@ -262,6 +265,7 @@ export const createNft = async ({
262265
owner,
263266
mint,
264267
...(creators?.map((c) => c.authority) ?? []),
268+
collectionUA,
265269
]),
266270
(k) => k.publicKey.toBase58(),
267271
),
@@ -282,6 +286,7 @@ export const createAndFundAta = async ({
282286
royaltyBps,
283287
creators,
284288
collection,
289+
collectionUA,
285290
collectionVerified,
286291
createCollection = true,
287292
programmable = false,
@@ -295,6 +300,8 @@ export const createAndFundAta = async ({
295300
creators?: CreatorInput[];
296301
collection?: Keypair;
297302
createCollection?: boolean;
303+
/** Must pass (if not owner) to verify collection */
304+
collectionUA?: Keypair;
298305
collectionVerified?: boolean;
299306
programmable?: boolean;
300307
ruleSetAddr?: PublicKey;
@@ -334,6 +341,7 @@ export const createAndFundAta = async ({
334341
royaltyBps,
335342
creators,
336343
collection,
344+
collectionUA,
337345
collectionVerified,
338346
ruleSet: ruleSetAddr,
339347
tokenStandard: programmable
@@ -360,6 +368,7 @@ export const makeMintTwoAta = async ({
360368
royaltyBps,
361369
creators,
362370
collection,
371+
collectionUA,
363372
collectionVerified,
364373
createCollection,
365374
programmable,
@@ -372,6 +381,8 @@ export const makeMintTwoAta = async ({
372381
royaltyBps?: number;
373382
creators?: CreatorInput[];
374383
collection?: Keypair;
384+
/** Must pass (if not owner) to verify collection */
385+
collectionUA?: Keypair;
375386
collectionVerified?: boolean;
376387
createCollection?: boolean;
377388
programmable?: boolean;
@@ -385,6 +396,7 @@ export const makeMintTwoAta = async ({
385396
royaltyBps,
386397
creators,
387398
collection,
399+
collectionUA,
388400
collectionVerified,
389401
createCollection,
390402
programmable,
@@ -400,3 +412,5 @@ export const makeMintTwoAta = async ({
400412

401413
return { mint, metadata, ata, otherAta, masterEdition, collectionInfo };
402414
};
415+
1;
416+
export type MintTwoAta = Awaited<ReturnType<typeof makeMintTwoAta>>;

0 commit comments

Comments
 (0)