generated from metaplex-foundation/solana-project-template
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update metadata (#44) Original design discussion PR: metaplex-foundation/metaplex-program-library#1121 Original merged PR: #3 --------- * fix protocol conflicts * allow updating creators without new verifications * cleanup * conflicts * conflicts * all tests included * regen solita and fix bugs * small fixes * nit * address code review, without additional test * added creator verification test * Regenerate js client * Rename old_metadata to current_metadata * Use UpdateArgs to group new metadata params * Prevent existing verified creators from being removed Exception: allow verification/unverification during metadata update for the signer of the tx. * Derive Default on UpdateArgs * Fix typo * Regenerate IDL, Rust client and Umi client * Regenerate js-solita * Add canopy to JS Solita test since it uses 2 nodes * Run CI on any PR * Removing SetDecompressableState from pub enum InstructionName * Remove `update_metadata_collection_nft` instruction (#47) * Remove update_metadata_collection_nft ix * Remove unneeded checks and errors * Regenerate IDL and clients * Update Solita test --------- Co-authored-by: Sam Orend <[email protected]> * Avoid inlining UpdateArgs (#50) * Adding LeafSchemaEvent struct to Rust client * Add leaf schema accessors to program and Rust client * Add InstructionName::UpdateMetadata to Rust client * chore: Release mpl-bubblegum version 1.0.1-beta.1 * Add borsh version range (#54) * Add borsh version range * Update lock file * chore: Release mpl-bubblegum version 1.0.1-beta.2 * Remove optional metadata buffer account from update_metadata * Update Rust and Umi JS clients, update IDL * Update js-solita client * Fixing rust client cargo lock after release downgrades it * chore: Release mpl-bubblegum version 1.0.1-beta.3 * Delete and regenerate rust client Cargo.lock after release downgrades borsh 0.10.3 * Add update_metadata_collection_nft * Regenerate clients * Regenerate Solita JS client * update Solita tests * Fix path to js test script * Remove signer req for tree delegate on update_metadata_collection_nft * Regenerate Solita JS client * Add tests for using correct ix based on if item is in collection * Combine update_metadata and update_metadata_collection_nft * Regenerate JS and Rust clients * Regenerate Solita JS client * Update Solita tests * Removed unneeded instruction name * Regenerate IDL * Clean up README and add update_metadata * Add updateArgs and fix links * Remove redundancies and clarify * chore: Release mpl-bubblegum version 1.0.1-beta.4 --------- Co-authored-by: Sam Orend <[email protected]> Co-authored-by: Fernando Otero <[email protected]> Co-authored-by: febo <[email protected]> Co-authored-by: danenbm <[email protected]>
- Loading branch information
1 parent
34cd5cb
commit 1b119a8
Showing
35 changed files
with
5,271 additions
and
518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ on: | |
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
CACHE: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
185 changes: 185 additions & 0 deletions
185
clients/js-solita/src/generated/instructions/updateMetadata.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
/** | ||
* This code was GENERATED using the solita package. | ||
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality. | ||
* | ||
* See: https://github.com/metaplex-foundation/solita | ||
*/ | ||
|
||
import * as beet from '@metaplex-foundation/beet'; | ||
import * as web3 from '@solana/web3.js'; | ||
import { MetadataArgs, metadataArgsBeet } from '../types/MetadataArgs'; | ||
import { UpdateArgs, updateArgsBeet } from '../types/UpdateArgs'; | ||
|
||
/** | ||
* @category Instructions | ||
* @category UpdateMetadata | ||
* @category generated | ||
*/ | ||
export type UpdateMetadataInstructionArgs = { | ||
root: number[] /* size: 32 */; | ||
nonce: beet.bignum; | ||
index: number; | ||
currentMetadata: MetadataArgs; | ||
updateArgs: UpdateArgs; | ||
}; | ||
/** | ||
* @category Instructions | ||
* @category UpdateMetadata | ||
* @category generated | ||
*/ | ||
export const updateMetadataStruct = new beet.FixableBeetArgsStruct< | ||
UpdateMetadataInstructionArgs & { | ||
instructionDiscriminator: number[] /* size: 8 */; | ||
} | ||
>( | ||
[ | ||
['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], | ||
['root', beet.uniformFixedSizeArray(beet.u8, 32)], | ||
['nonce', beet.u64], | ||
['index', beet.u32], | ||
['currentMetadata', metadataArgsBeet], | ||
['updateArgs', updateArgsBeet], | ||
], | ||
'UpdateMetadataInstructionArgs', | ||
); | ||
/** | ||
* Accounts required by the _updateMetadata_ instruction | ||
* | ||
* @property [] treeAuthority | ||
* @property [**signer**] authority | ||
* @property [] collectionMint (optional) | ||
* @property [] collectionMetadata (optional) | ||
* @property [] collectionAuthorityRecordPda (optional) | ||
* @property [] leafOwner | ||
* @property [] leafDelegate | ||
* @property [**signer**] payer | ||
* @property [_writable_] merkleTree | ||
* @property [] logWrapper | ||
* @property [] compressionProgram | ||
* @property [] tokenMetadataProgram | ||
* @category Instructions | ||
* @category UpdateMetadata | ||
* @category generated | ||
*/ | ||
export type UpdateMetadataInstructionAccounts = { | ||
treeAuthority: web3.PublicKey; | ||
authority: web3.PublicKey; | ||
collectionMint?: web3.PublicKey; | ||
collectionMetadata?: web3.PublicKey; | ||
collectionAuthorityRecordPda?: web3.PublicKey; | ||
leafOwner: web3.PublicKey; | ||
leafDelegate: web3.PublicKey; | ||
payer: web3.PublicKey; | ||
merkleTree: web3.PublicKey; | ||
logWrapper: web3.PublicKey; | ||
compressionProgram: web3.PublicKey; | ||
tokenMetadataProgram: web3.PublicKey; | ||
systemProgram?: web3.PublicKey; | ||
anchorRemainingAccounts?: web3.AccountMeta[]; | ||
}; | ||
|
||
export const updateMetadataInstructionDiscriminator = [170, 182, 43, 239, 97, 78, 225, 186]; | ||
|
||
/** | ||
* Creates a _UpdateMetadata_ instruction. | ||
* | ||
* Optional accounts that are not provided default to the program ID since | ||
* this was indicated in the IDL from which this instruction was generated. | ||
* | ||
* @param accounts that will be accessed while the instruction is processed | ||
* @param args to provide as instruction data to the program | ||
* | ||
* @category Instructions | ||
* @category UpdateMetadata | ||
* @category generated | ||
*/ | ||
export function createUpdateMetadataInstruction( | ||
accounts: UpdateMetadataInstructionAccounts, | ||
args: UpdateMetadataInstructionArgs, | ||
programId = new web3.PublicKey('BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY'), | ||
) { | ||
const [data] = updateMetadataStruct.serialize({ | ||
instructionDiscriminator: updateMetadataInstructionDiscriminator, | ||
...args, | ||
}); | ||
const keys: web3.AccountMeta[] = [ | ||
{ | ||
pubkey: accounts.treeAuthority, | ||
isWritable: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
pubkey: accounts.authority, | ||
isWritable: false, | ||
isSigner: true, | ||
}, | ||
{ | ||
pubkey: accounts.collectionMint ?? programId, | ||
isWritable: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
pubkey: accounts.collectionMetadata ?? programId, | ||
isWritable: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
pubkey: accounts.collectionAuthorityRecordPda ?? programId, | ||
isWritable: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
pubkey: accounts.leafOwner, | ||
isWritable: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
pubkey: accounts.leafDelegate, | ||
isWritable: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
pubkey: accounts.payer, | ||
isWritable: false, | ||
isSigner: true, | ||
}, | ||
{ | ||
pubkey: accounts.merkleTree, | ||
isWritable: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
pubkey: accounts.logWrapper, | ||
isWritable: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
pubkey: accounts.compressionProgram, | ||
isWritable: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
pubkey: accounts.tokenMetadataProgram, | ||
isWritable: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
pubkey: accounts.systemProgram ?? web3.SystemProgram.programId, | ||
isWritable: false, | ||
isSigner: false, | ||
}, | ||
]; | ||
|
||
if (accounts.anchorRemainingAccounts != null) { | ||
for (const acc of accounts.anchorRemainingAccounts) { | ||
keys.push(acc); | ||
} | ||
} | ||
|
||
const ix = new web3.TransactionInstruction({ | ||
programId, | ||
keys, | ||
data, | ||
}); | ||
return ix; | ||
} |
Oops, something went wrong.