|
@@ -32,19 +32,20 @@ import {
|
|
|
} from '@metaplex-foundation/umi';
|
|
} from '@metaplex-foundation/umi';
|
|
|
|
|
|
|
|
const assetWithProof = await getAssetWithProof(umi, assetId, {truncateCanopy: true});
|
|
const assetWithProof = await getAssetWithProof(umi, assetId, {truncateCanopy: true});
|
|
|
- const metadata: MetadataArgsV2Args = {
|
|
|
|
|
- name: assetWithProof.metadata.name,
|
|
|
|
|
- uri: assetWithProof.metadata.uri,
|
|
|
|
|
- sellerFeeBasisPoints: assetWithProof.metadata.sellerFeeBasisPoints,
|
|
|
|
|
- collection: none(),
|
|
|
|
|
- creators: assetWithProof.metadata.creators,
|
|
|
|
|
- };
|
|
|
|
|
- await setCollectionV2(umi, {
|
|
|
|
|
- ...assetWithProof,
|
|
|
|
|
- newCollectionAuthority: newCollectionUpdateAuthority,
|
|
|
|
|
- metadata,
|
|
|
|
|
- newCoreCollection: newCoreCollection.publicKey,
|
|
|
|
|
- }).sendAndConfirm(umi);
|
|
|
|
|
|
|
+
|
|
|
|
|
+const collection = unwrapOption(assetWithProof.metadata.collection)
|
|
|
|
|
+
|
|
|
|
|
+const metadata: MetadataArgsV2Args = {
|
|
|
|
|
+ ...assetWithProof.metadata,
|
|
|
|
|
+ collection: collection?.key ?? null,
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const signature = await setCollectionV2(umi, {
|
|
|
|
|
+ ...assetWithProof,
|
|
|
|
|
+ newCollectionAuthority: newCollectionUpdateAuthority,
|
|
|
|
|
+ metadata,
|
|
|
|
|
+ newCoreCollection: newCoreCollection.publicKey,
|
|
|
|
|
+}).sendAndConfirm(umi);
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
{% /totem %}
|
|
{% /totem %}
|
|
@@ -70,17 +71,13 @@ import {
|
|
|
} from '@metaplex-foundation/umi';
|
|
} from '@metaplex-foundation/umi';
|
|
|
|
|
|
|
|
const assetWithProof = await getAssetWithProof(umi, assetId, {truncateCanopy: true});
|
|
const assetWithProof = await getAssetWithProof(umi, assetId, {truncateCanopy: true});
|
|
|
-const metadata: MetadataArgsV2Args = {
|
|
|
|
|
- name: assetWithProof.metadata.name,
|
|
|
|
|
- uri: assetWithProof.metadata.uri,
|
|
|
|
|
- sellerFeeBasisPoints: assetWithProof.metadata.sellerFeeBasisPoints,
|
|
|
|
|
- collection: unwrapOption(assetWithProof.metadata.collection)!.key,
|
|
|
|
|
- creators: assetWithProof.metadata.creators,
|
|
|
|
|
-};
|
|
|
|
|
-await setCollectionV2(umi, {
|
|
|
|
|
|
|
+
|
|
|
|
|
+const collection = unwrapOption(assetWithProof.metadata.collection)
|
|
|
|
|
+
|
|
|
|
|
+const signature = await setCollectionV2(umi, {
|
|
|
...assetWithProof,
|
|
...assetWithProof,
|
|
|
authority: collectionAuthoritySigner,
|
|
authority: collectionAuthoritySigner,
|
|
|
- metadata: metadata,
|
|
|
|
|
|
|
+ coreCollection: collection!.key
|
|
|
}).sendAndConfirm(umi);
|
|
}).sendAndConfirm(umi);
|
|
|
```
|
|
```
|
|
|
|
|
|