Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(token-metadata): add burn_print_edition handler #684

Merged
merged 27 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
681652d
feat(token-metadata): add burn_print_edition handler
samuelvanderwaal Aug 19, 2022
8cb4b4f
Merge branch 'master' into feat/burn-print-editions
samuelvanderwaal Aug 19, 2022
fed8698
fix(burn-print-edition): clippy lints
samuelvanderwaal Aug 23, 2022
e949d4e
fix: clippy lints
samuelvanderwaal Aug 23, 2022
a20d4fc
tests(token-metadata): add more tests
samuelvanderwaal Aug 23, 2022
5f3d0cb
chore(token-metadata): generate JS code for burn_edition_nft
samuelvanderwaal Aug 23, 2022
8d62056
Merge branch 'master' into feat/burn-print-editions
samuelvanderwaal Aug 24, 2022
ea15701
test(burn_edition_nft): only holder of print edition can burn
samuelvanderwaal Aug 24, 2022
836937a
test(token-metadata/burn_edition_nft): reprint burned nft
samuelvanderwaal Aug 25, 2022
e0fb85e
chore(token-metadata): merge master into branch
samuelvanderwaal Aug 25, 2022
b9a4b0c
test(token-metadata) refactor burn_edition_nft tests a little
samuelvanderwaal Aug 25, 2022
455c745
test(token-metdata): make mask check more complex
samuelvanderwaal Aug 25, 2022
2ec0b82
fix: clippy lints
samuelvanderwaal Aug 25, 2022
ded9c23
refactor: fix supply account; decrement max_supply
samuelvanderwaal Aug 31, 2022
3ffe8a8
chore: merge master into branch
samuelvanderwaal Aug 31, 2022
662c5e7
Merge branch 'master' into feat/burn-print-editions
samuelvanderwaal Sep 8, 2022
4f19f68
finish spec implementation; update tests
samuelvanderwaal Sep 14, 2022
da20c43
Merge branch 'master' into feat/burn-print-editions
samuelvanderwaal Sep 14, 2022
72257b1
refactor: update tests for new supply accounting; remove unused fn
samuelvanderwaal Sep 14, 2022
ce68d7e
chore: generate JS lib for token metadata
samuelvanderwaal Sep 14, 2022
a836cbc
chore: clean up tests
samuelvanderwaal Sep 14, 2022
c657d1c
fix: decrement max supply correctly
samuelvanderwaal Sep 14, 2022
cdfebb8
add missing check; regnerate JS api
samuelvanderwaal Sep 16, 2022
6307d9a
refactor: address review comments
samuelvanderwaal Sep 19, 2022
b92e489
add tests checking invalid master & print derivations
samuelvanderwaal Sep 19, 2022
6aefd85
tests: add a few more tests
samuelvanderwaal Sep 19, 2022
3326dd1
chore(token-metadata/js): generate JS lib
samuelvanderwaal Sep 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: generate JS lib for token metadata
  • Loading branch information
samuelvanderwaal committed Sep 14, 2022
commit ce68d7e6795e588fc6b615702077b47cc079278a
13 changes: 12 additions & 1 deletion token-metadata/js/idl/mpl_token_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,12 @@
"isSigner": false,
"desc": "Token account the print edition NFT is in"
},
{
"name": "originalTokenAccount",
"isMut": false,
"isSigner": false,
"desc": "Token account the Master Edition NFT is in"
},
{
"name": "masterEditionAccount",
"isMut": true,
Expand Down Expand Up @@ -2114,7 +2120,7 @@
"args": [],
"discriminant": {
"type": "u8",
"value": 36
"value": 37
}
}
],
Expand Down Expand Up @@ -3501,6 +3507,11 @@
"code": 117,
"name": "InvalidEditionMarker",
"msg": "Invalid Edition Marker"
},
{
"code": 118,
"name": "ReservationListDeprecated",
"msg": "Reservation List is Deprecated"
}
],
"metadata": {
Expand Down
23 changes: 23 additions & 0 deletions token-metadata/js/src/generated/errors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2542,6 +2542,29 @@ export class InvalidEditionMarkerError extends Error {
createErrorFromCodeLookup.set(0x75, () => new InvalidEditionMarkerError());
createErrorFromNameLookup.set('InvalidEditionMarker', () => new InvalidEditionMarkerError());

/**
* ReservationListDeprecated: 'Reservation List is Deprecated'
*
* @category Errors
* @category generated
*/
export class ReservationListDeprecatedError extends Error {
readonly code: number = 0x76;
readonly name: string = 'ReservationListDeprecated';
constructor() {
super('Reservation List is Deprecated');
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, ReservationListDeprecatedError);
}
}
}

createErrorFromCodeLookup.set(0x76, () => new ReservationListDeprecatedError());
createErrorFromNameLookup.set(
'ReservationListDeprecated',
() => new ReservationListDeprecatedError(),
);

/**
* Attempts to resolve a custom program error from the provided error code.
* @category Errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const BurnEditionNftStruct = new beet.BeetArgsStruct<{ instructionDiscrim
* @property [_writable_] mint Mint of the print edition NFT
* @property [_writable_] originalMint Mint of the original/master NFT
* @property [_writable_] tokenAccount Token account the print edition NFT is in
* @property [] originalTokenAccount Token account the Master Edition NFT is in
* @property [_writable_] masterEditionAccount MasterEdition2 of the original NFT
* @property [_writable_] editionAccount Print Edition account of the NFT
* @property [_writable_] editionMarkerAccount Edition Marker PDA of the NFT
Expand All @@ -39,13 +40,14 @@ export type BurnEditionNftInstructionAccounts = {
mint: web3.PublicKey;
originalMint: web3.PublicKey;
tokenAccount: web3.PublicKey;
originalTokenAccount: web3.PublicKey;
masterEditionAccount: web3.PublicKey;
editionAccount: web3.PublicKey;
editionMarkerAccount: web3.PublicKey;
splTokenProgram: web3.PublicKey;
};

export const burnEditionNftInstructionDiscriminator = 36;
export const burnEditionNftInstructionDiscriminator = 37;

/**
* Creates a _BurnEditionNft_ instruction.
Expand Down Expand Up @@ -88,6 +90,11 @@ export function createBurnEditionNftInstruction(
isWritable: true,
isSigner: false,
},
{
pubkey: accounts.originalTokenAccount,
isWritable: false,
isSigner: false,
},
{
pubkey: accounts.masterEditionAccount,
isWritable: true,
Expand Down