Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit c752015

Browse files
authored
Add oldCollectionAuthority input to update NFT (#433)
1 parent 6d74717 commit c752015

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.changeset/ten-cougars-end.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@metaplex-foundation/js': patch
3+
---
4+
5+
Add oldCollectionAuthority input to update NFT operation

packages/js/src/plugins/nftModule/operations/updateNft.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,16 @@ export type UpdateNftInput = {
186186
collectionIsSized?: boolean;
187187

188188
/**
189-
* Whether or not the current asset's collection is a sized collection
189+
* The authority of the asset's current collection.
190+
* This may be required if the current collection is being removed
191+
* or updated and needs to be unverified before doing so.
192+
*
193+
* @defaultValue `updateAuthority`
194+
*/
195+
oldCollectionAuthority?: Signer;
196+
197+
/**
198+
* Whether or not the asset's current collection is a sized collection
190199
* and not a legacy collection.
191200
*
192201
* @defaultValue `true`
@@ -314,7 +323,8 @@ export const updateNftBuilder = (
314323
mintAddress: nftOrSft.address,
315324
collectionMintAddress: nftOrSft.collection
316325
?.address as PublicKey,
317-
collectionAuthority: updateAuthority,
326+
collectionAuthority:
327+
params.oldCollectionAuthority ?? updateAuthority,
318328
isSizedCollection: params.oldCollectionIsSized ?? true,
319329
},
320330
{ programs, payer }

0 commit comments

Comments
 (0)