From ceb467a541cb331cfdc4dc894f97392de0557988 Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Tue, 9 Jan 2024 17:28:12 +0000 Subject: [PATCH] Add optional identifier to PublicKeyValueNode (#147) --- .changeset/tame-pillows-complain.md | 5 ++++ src/nodes/valueNodes/PublicKeyValueNode.ts | 14 +++++++++-- src/renderers/js/renderInstructionDefaults.ts | 11 +++++++-- src/visitors/getDebugStringVisitor.ts | 5 +++- ...tInstructionAccountDefaultValuesVisitor.ts | 23 +++++++++++++------ .../approveCollectionAuthority.ts | 5 ++-- .../instructions/approveUseAuthority.ts | 9 +++++--- .../js/src/generated/instructions/burn.ts | 5 ++-- .../generated/instructions/burnEditionNft.ts | 5 ++-- .../js/src/generated/instructions/burnNft.ts | 5 ++-- .../instructions/closeEscrowAccount.ts | 4 +++- .../instructions/createEscrowAccount.ts | 4 +++- .../instructions/createFrequencyRule.ts | 5 ++-- .../instructions/createMasterEdition.ts | 8 +++++-- .../instructions/createMasterEditionV3.ts | 9 +++++--- .../instructions/createMetadataAccount.ts | 4 +++- .../instructions/createMetadataAccountV2.ts | 5 ++-- .../instructions/createMetadataAccountV3.ts | 5 ++-- .../instructions/createReservationList.ts | 4 +++- .../generated/instructions/createRuleSet.ts | 5 ++-- .../js/src/generated/instructions/createV1.ts | 8 +++++-- .../js/src/generated/instructions/createV2.ts | 8 +++++-- .../js/src/generated/instructions/delegate.ts | 4 +++- .../deprecatedCreateMasterEdition.ts | 8 +++++-- ...ditionFromMasterEditionViaPrintingToken.ts | 8 +++++-- .../deprecatedMintPrintingTokens.ts | 4 +++- .../deprecatedMintPrintingTokensViaToken.ts | 4 +++- .../instructions/freezeDelegatedAccount.ts | 5 ++-- .../src/generated/instructions/initialize.ts | 9 +++++--- .../js/src/generated/instructions/migrate.ts | 8 +++++-- .../js/src/generated/instructions/mint.ts | 12 +++++++--- .../instructions/mintFromCandyMachine.ts | 13 +++++++---- ...mintNewEditionFromMasterEditionViaToken.ts | 9 +++++--- ...ewEditionFromMasterEditionViaVaultProxy.ts | 9 +++++--- .../js/src/generated/instructions/revoke.ts | 4 +++- .../instructions/revokeUseAuthority.ts | 9 +++++--- .../generated/instructions/setCollection.ts | 9 +++++--- .../instructions/thawDelegatedAccount.ts | 5 ++-- .../js/src/generated/instructions/transfer.ts | 12 +++++++--- .../instructions/transferOutOfEscrow.ts | 12 +++++++--- .../js/src/generated/instructions/updateV1.ts | 4 +++- .../js/src/generated/instructions/useAsset.ts | 13 +++++++---- .../js/src/generated/instructions/utilize.ts | 12 +++++++--- .../js/src/generated/instructions/validate.ts | 5 ++-- .../valueNodes/PublicKeyValueNode.test.ts | 9 ++++++++ 45 files changed, 247 insertions(+), 96 deletions(-) create mode 100644 .changeset/tame-pillows-complain.md diff --git a/.changeset/tame-pillows-complain.md b/.changeset/tame-pillows-complain.md new file mode 100644 index 000000000..3b60e9dac --- /dev/null +++ b/.changeset/tame-pillows-complain.md @@ -0,0 +1,5 @@ +--- +'@metaplex-foundation/kinobi': patch +--- + +Add optional identifier to PublicKeyValueNode diff --git a/src/nodes/valueNodes/PublicKeyValueNode.ts b/src/nodes/valueNodes/PublicKeyValueNode.ts index fa57e4e0e..4a12460f2 100644 --- a/src/nodes/valueNodes/PublicKeyValueNode.ts +++ b/src/nodes/valueNodes/PublicKeyValueNode.ts @@ -1,10 +1,20 @@ +import { MainCaseString, mainCase } from '../../shared/utils'; + export type PublicKeyValueNode = { readonly kind: 'publicKeyValueNode'; // Data. readonly publicKey: string; + readonly identifier?: MainCaseString; }; -export function publicKeyValueNode(publicKey: string): PublicKeyValueNode { - return { kind: 'publicKeyValueNode', publicKey }; +export function publicKeyValueNode( + publicKey: string, + identifier?: string +): PublicKeyValueNode { + return { + kind: 'publicKeyValueNode', + publicKey, + identifier: identifier ? mainCase(identifier) : undefined, + }; } diff --git a/src/renderers/js/renderInstructionDefaults.ts b/src/renderers/js/renderInstructionDefaults.ts index b5bce4cae..e5ba8ea8b 100644 --- a/src/renderers/js/renderInstructionDefaults.ts +++ b/src/renderers/js/renderInstructionDefaults.ts @@ -107,8 +107,15 @@ export function renderInstructionDefaults( } return render(`${pdaFunction}(${pdaArgs.join(', ')})`); case 'publicKeyValueNode': - imports.add('umi', 'publicKey'); - return render(`publicKey('${defaultValue.publicKey}')`); + if (!defaultValue.identifier) { + imports.add('umi', 'publicKey'); + return render(`publicKey('${defaultValue.publicKey}')`); + } + interfaces.add('programs'); + return render( + `context.programs.getPublicKey('${defaultValue.identifier}', '${defaultValue.publicKey}')`, + false + ); case 'programLinkNode': const importFrom = defaultValue.importFrom ?? 'generatedPrograms'; const functionName = `get${pascalCase(defaultValue.name)}ProgramId`; diff --git a/src/visitors/getDebugStringVisitor.ts b/src/visitors/getDebugStringVisitor.ts index 11bb71846..92b2ba530 100644 --- a/src/visitors/getDebugStringVisitor.ts +++ b/src/visitors/getDebugStringVisitor.ts @@ -97,7 +97,10 @@ function getNodeDetails(node: Node): string[] { case 'booleanValueNode': return [node.boolean ? 'true' : 'false']; case 'publicKeyValueNode': - return [node.publicKey]; + return [ + ...(node.identifier ? [`${node.identifier}`] : []), + node.publicKey, + ]; case 'enumValueNode': return [node.variant]; case 'resolverValueNode': diff --git a/src/visitors/setInstructionAccountDefaultValuesVisitor.ts b/src/visitors/setInstructionAccountDefaultValuesVisitor.ts index d0f985b4e..021d3b67c 100644 --- a/src/visitors/setInstructionAccountDefaultValuesVisitor.ts +++ b/src/visitors/setInstructionAccountDefaultValuesVisitor.ts @@ -47,27 +47,33 @@ export const DEFAULT_INSTRUCTION_ACCOUNT_DEFAULT_RULES: InstructionAccountDefaul }, { account: /^systemProgram|splSystemProgram$/, - defaultValue: publicKeyValueNode('11111111111111111111111111111111'), + defaultValue: publicKeyValueNode( + '11111111111111111111111111111111', + 'splSystem' + ), ignoreIfOptional: true, }, { account: /^tokenProgram|splTokenProgram$/, defaultValue: publicKeyValueNode( - 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' + 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', + 'splToken' ), ignoreIfOptional: true, }, { account: /^ataProgram|splAtaProgram$/, defaultValue: publicKeyValueNode( - 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' + 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL', + 'splAssociatedToken' ), ignoreIfOptional: true, }, { account: /^tokenMetadataProgram|mplTokenMetadataProgram$/, defaultValue: publicKeyValueNode( - 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' + 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', + 'mplTokenMetadata' ), ignoreIfOptional: true, }, @@ -75,21 +81,24 @@ export const DEFAULT_INSTRUCTION_ACCOUNT_DEFAULT_RULES: InstructionAccountDefaul account: /^(tokenAuth|mplTokenAuth|authorization|mplAuthorization|auth|mplAuth)RulesProgram$/, defaultValue: publicKeyValueNode( - 'auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg' + 'auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg', + 'mplTokenAuthRules' ), ignoreIfOptional: true, }, { account: /^candyMachineProgram|mplCandyMachineProgram$/, defaultValue: publicKeyValueNode( - 'CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR' + 'CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR', + 'mplCandyMachine' ), ignoreIfOptional: true, }, { account: /^candyGuardProgram|mplCandyGuardProgram$/, defaultValue: publicKeyValueNode( - 'Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g' + 'Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g', + 'mplCandyGuard' ), ignoreIfOptional: true, }, diff --git a/test/packages/js/src/generated/instructions/approveCollectionAuthority.ts b/test/packages/js/src/generated/instructions/approveCollectionAuthority.ts index a30f88573..8a811f6bb 100644 --- a/test/packages/js/src/generated/instructions/approveCollectionAuthority.ts +++ b/test/packages/js/src/generated/instructions/approveCollectionAuthority.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -126,9 +125,11 @@ export function approveCollectionAuthority( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/approveUseAuthority.ts b/test/packages/js/src/generated/instructions/approveUseAuthority.ts index f380c92ec..1b1c55b0f 100644 --- a/test/packages/js/src/generated/instructions/approveUseAuthority.ts +++ b/test/packages/js/src/generated/instructions/approveUseAuthority.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -162,14 +161,18 @@ export function approveUseAuthority( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/burn.ts b/test/packages/js/src/generated/instructions/burn.ts index 95859fd7f..d55e723ca 100644 --- a/test/packages/js/src/generated/instructions/burn.ts +++ b/test/packages/js/src/generated/instructions/burn.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -135,9 +134,11 @@ export function burn( // Default values. if (!resolvedAccounts.splTokenProgram.value) { - resolvedAccounts.splTokenProgram.value = publicKey( + resolvedAccounts.splTokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.splTokenProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/burnEditionNft.ts b/test/packages/js/src/generated/instructions/burnEditionNft.ts index 6e9b82840..67bd3b67b 100644 --- a/test/packages/js/src/generated/instructions/burnEditionNft.ts +++ b/test/packages/js/src/generated/instructions/burnEditionNft.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -142,9 +141,11 @@ export function burnEditionNft( // Default values. if (!resolvedAccounts.splTokenProgram.value) { - resolvedAccounts.splTokenProgram.value = publicKey( + resolvedAccounts.splTokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.splTokenProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/burnNft.ts b/test/packages/js/src/generated/instructions/burnNft.ts index a4a101614..868e9214e 100644 --- a/test/packages/js/src/generated/instructions/burnNft.ts +++ b/test/packages/js/src/generated/instructions/burnNft.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -110,9 +109,11 @@ export function burnNft( // Default values. if (!resolvedAccounts.splTokenProgram.value) { - resolvedAccounts.splTokenProgram.value = publicKey( + resolvedAccounts.splTokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.splTokenProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/closeEscrowAccount.ts b/test/packages/js/src/generated/instructions/closeEscrowAccount.ts index ddb3fd6af..d2525142d 100644 --- a/test/packages/js/src/generated/instructions/closeEscrowAccount.ts +++ b/test/packages/js/src/generated/instructions/closeEscrowAccount.ts @@ -127,9 +127,11 @@ export function closeEscrowAccount( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/createEscrowAccount.ts b/test/packages/js/src/generated/instructions/createEscrowAccount.ts index 70eca5745..b32154b2a 100644 --- a/test/packages/js/src/generated/instructions/createEscrowAccount.ts +++ b/test/packages/js/src/generated/instructions/createEscrowAccount.ts @@ -134,9 +134,11 @@ export function createEscrowAccount( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/createFrequencyRule.ts b/test/packages/js/src/generated/instructions/createFrequencyRule.ts index ae81d8f24..443b9f37a 100644 --- a/test/packages/js/src/generated/instructions/createFrequencyRule.ts +++ b/test/packages/js/src/generated/instructions/createFrequencyRule.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -124,9 +123,11 @@ export function createFrequencyRule( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/createMasterEdition.ts b/test/packages/js/src/generated/instructions/createMasterEdition.ts index fafbfaff7..4aefddf85 100644 --- a/test/packages/js/src/generated/instructions/createMasterEdition.ts +++ b/test/packages/js/src/generated/instructions/createMasterEdition.ts @@ -152,14 +152,18 @@ export function createMasterEdition( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.rent.value) { resolvedAccounts.rent.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/createMasterEditionV3.ts b/test/packages/js/src/generated/instructions/createMasterEditionV3.ts index 7fdec0494..74b279d79 100644 --- a/test/packages/js/src/generated/instructions/createMasterEditionV3.ts +++ b/test/packages/js/src/generated/instructions/createMasterEditionV3.ts @@ -13,7 +13,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -154,14 +153,18 @@ export function createMasterEditionV3( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/createMetadataAccount.ts b/test/packages/js/src/generated/instructions/createMetadataAccount.ts index b4e44e213..ba34fa59c 100644 --- a/test/packages/js/src/generated/instructions/createMetadataAccount.ts +++ b/test/packages/js/src/generated/instructions/createMetadataAccount.ts @@ -180,9 +180,11 @@ export function createMetadataAccount( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.rent.value) { resolvedAccounts.rent.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/createMetadataAccountV2.ts b/test/packages/js/src/generated/instructions/createMetadataAccountV2.ts index 3ebc6b0fa..f73a906ab 100644 --- a/test/packages/js/src/generated/instructions/createMetadataAccountV2.ts +++ b/test/packages/js/src/generated/instructions/createMetadataAccountV2.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -138,9 +137,11 @@ export function createMetadataAccountV2( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/createMetadataAccountV3.ts b/test/packages/js/src/generated/instructions/createMetadataAccountV3.ts index b95b9ed1d..552ac77aa 100644 --- a/test/packages/js/src/generated/instructions/createMetadataAccountV3.ts +++ b/test/packages/js/src/generated/instructions/createMetadataAccountV3.ts @@ -14,7 +14,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -158,9 +157,11 @@ export function createMetadataAccountV3( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/createReservationList.ts b/test/packages/js/src/generated/instructions/createReservationList.ts index c99e71ec4..a902aaa13 100644 --- a/test/packages/js/src/generated/instructions/createReservationList.ts +++ b/test/packages/js/src/generated/instructions/createReservationList.ts @@ -113,9 +113,11 @@ export function createReservationList( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.rent.value) { resolvedAccounts.rent.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/createRuleSet.ts b/test/packages/js/src/generated/instructions/createRuleSet.ts index d47a6f423..28b95a65e 100644 --- a/test/packages/js/src/generated/instructions/createRuleSet.ts +++ b/test/packages/js/src/generated/instructions/createRuleSet.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -124,9 +123,11 @@ export function createRuleSet( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedArgs.ruleSetBump) { resolvedArgs.ruleSetBump = expectPda(resolvedAccounts.ruleSetPda.value)[1]; diff --git a/test/packages/js/src/generated/instructions/createV1.ts b/test/packages/js/src/generated/instructions/createV1.ts index e66c8fe39..3f1353144 100644 --- a/test/packages/js/src/generated/instructions/createV1.ts +++ b/test/packages/js/src/generated/instructions/createV1.ts @@ -159,9 +159,11 @@ export function createV1( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( @@ -169,9 +171,11 @@ export function createV1( ); } if (!resolvedAccounts.splTokenProgram.value) { - resolvedAccounts.splTokenProgram.value = publicKey( + resolvedAccounts.splTokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.splTokenProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/createV2.ts b/test/packages/js/src/generated/instructions/createV2.ts index 2ba9769d0..31d6b74e3 100644 --- a/test/packages/js/src/generated/instructions/createV2.ts +++ b/test/packages/js/src/generated/instructions/createV2.ts @@ -156,9 +156,11 @@ export function createV2( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( @@ -166,9 +168,11 @@ export function createV2( ); } if (!resolvedAccounts.splTokenProgram.value) { - resolvedAccounts.splTokenProgram.value = publicKey( + resolvedAccounts.splTokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.splTokenProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/delegate.ts b/test/packages/js/src/generated/instructions/delegate.ts index 26771b64d..22f25be3f 100644 --- a/test/packages/js/src/generated/instructions/delegate.ts +++ b/test/packages/js/src/generated/instructions/delegate.ts @@ -180,9 +180,11 @@ export function delegate( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/deprecatedCreateMasterEdition.ts b/test/packages/js/src/generated/instructions/deprecatedCreateMasterEdition.ts index 7651794e0..8c055a17a 100644 --- a/test/packages/js/src/generated/instructions/deprecatedCreateMasterEdition.ts +++ b/test/packages/js/src/generated/instructions/deprecatedCreateMasterEdition.ts @@ -186,14 +186,18 @@ export function deprecatedCreateMasterEdition( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.rent.value) { resolvedAccounts.rent.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts b/test/packages/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts index e540f0164..b1f5b8618 100644 --- a/test/packages/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts +++ b/test/packages/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts @@ -190,14 +190,18 @@ export function deprecatedMintNewEditionFromMasterEditionViaPrintingToken( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.rent.value) { resolvedAccounts.rent.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/deprecatedMintPrintingTokens.ts b/test/packages/js/src/generated/instructions/deprecatedMintPrintingTokens.ts index 7c1c877eb..b2b385ee7 100644 --- a/test/packages/js/src/generated/instructions/deprecatedMintPrintingTokens.ts +++ b/test/packages/js/src/generated/instructions/deprecatedMintPrintingTokens.ts @@ -144,9 +144,11 @@ export function deprecatedMintPrintingTokens( // Default values. if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.rent.value) { resolvedAccounts.rent.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/deprecatedMintPrintingTokensViaToken.ts b/test/packages/js/src/generated/instructions/deprecatedMintPrintingTokensViaToken.ts index ad6e52fea..d320eaed5 100644 --- a/test/packages/js/src/generated/instructions/deprecatedMintPrintingTokensViaToken.ts +++ b/test/packages/js/src/generated/instructions/deprecatedMintPrintingTokensViaToken.ts @@ -158,9 +158,11 @@ export function deprecatedMintPrintingTokensViaToken( // Default values. if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.rent.value) { resolvedAccounts.rent.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/freezeDelegatedAccount.ts b/test/packages/js/src/generated/instructions/freezeDelegatedAccount.ts index 15825da1d..e60dd4f87 100644 --- a/test/packages/js/src/generated/instructions/freezeDelegatedAccount.ts +++ b/test/packages/js/src/generated/instructions/freezeDelegatedAccount.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -103,9 +102,11 @@ export function freezeDelegatedAccount( // Default values. if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/initialize.ts b/test/packages/js/src/generated/instructions/initialize.ts index 9b512833b..b69773ebc 100644 --- a/test/packages/js/src/generated/instructions/initialize.ts +++ b/test/packages/js/src/generated/instructions/initialize.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -163,14 +162,18 @@ export function initialize( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.tokenMetadataProgram.value) { - resolvedAccounts.tokenMetadataProgram.value = publicKey( + resolvedAccounts.tokenMetadataProgram.value = context.programs.getPublicKey( + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); + resolvedAccounts.tokenMetadataProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/migrate.ts b/test/packages/js/src/generated/instructions/migrate.ts index a8c587fb4..71fb9e13b 100644 --- a/test/packages/js/src/generated/instructions/migrate.ts +++ b/test/packages/js/src/generated/instructions/migrate.ts @@ -149,14 +149,18 @@ export function migrate( // Default values. if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/mint.ts b/test/packages/js/src/generated/instructions/mint.ts index 962ec1708..fbda47022 100644 --- a/test/packages/js/src/generated/instructions/mint.ts +++ b/test/packages/js/src/generated/instructions/mint.ts @@ -162,9 +162,11 @@ export function mint( resolvedAccounts.authority.value = context.identity; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( @@ -172,14 +174,18 @@ export function mint( ); } if (!resolvedAccounts.splTokenProgram.value) { - resolvedAccounts.splTokenProgram.value = publicKey( + resolvedAccounts.splTokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.splTokenProgram.isWritable = false; } if (!resolvedAccounts.splAtaProgram.value) { - resolvedAccounts.splAtaProgram.value = publicKey( + resolvedAccounts.splAtaProgram.value = context.programs.getPublicKey( + 'splAssociatedToken', 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' ); + resolvedAccounts.splAtaProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/mintFromCandyMachine.ts b/test/packages/js/src/generated/instructions/mintFromCandyMachine.ts index 4b82b9528..50c9e2df0 100644 --- a/test/packages/js/src/generated/instructions/mintFromCandyMachine.ts +++ b/test/packages/js/src/generated/instructions/mintFromCandyMachine.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -187,19 +186,25 @@ export function mintFromCandyMachine( resolvedAccounts.nftMintAuthority.value = context.identity; } if (!resolvedAccounts.tokenMetadataProgram.value) { - resolvedAccounts.tokenMetadataProgram.value = publicKey( + resolvedAccounts.tokenMetadataProgram.value = context.programs.getPublicKey( + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); + resolvedAccounts.tokenMetadataProgram.isWritable = false; } if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts b/test/packages/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts index 3099d781b..7a08123d1 100644 --- a/test/packages/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts +++ b/test/packages/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -200,14 +199,18 @@ export function mintNewEditionFromMasterEditionViaToken( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts b/test/packages/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts index 699ea85de..d8941d375 100644 --- a/test/packages/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts +++ b/test/packages/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -223,14 +222,18 @@ export function mintNewEditionFromMasterEditionViaVaultProxy( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/revoke.ts b/test/packages/js/src/generated/instructions/revoke.ts index 219ca0165..1236528d3 100644 --- a/test/packages/js/src/generated/instructions/revoke.ts +++ b/test/packages/js/src/generated/instructions/revoke.ts @@ -172,9 +172,11 @@ export function revoke( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/revokeUseAuthority.ts b/test/packages/js/src/generated/instructions/revokeUseAuthority.ts index 81cbe0310..4262869cb 100644 --- a/test/packages/js/src/generated/instructions/revokeUseAuthority.ts +++ b/test/packages/js/src/generated/instructions/revokeUseAuthority.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -123,14 +122,18 @@ export function revokeUseAuthority( // Default values. if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/setCollection.ts b/test/packages/js/src/generated/instructions/setCollection.ts index 1e64d3d8d..f50be3239 100644 --- a/test/packages/js/src/generated/instructions/setCollection.ts +++ b/test/packages/js/src/generated/instructions/setCollection.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -167,14 +166,18 @@ export function setCollection( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.tokenMetadataProgram.value) { - resolvedAccounts.tokenMetadataProgram.value = publicKey( + resolvedAccounts.tokenMetadataProgram.value = context.programs.getPublicKey( + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); + resolvedAccounts.tokenMetadataProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/thawDelegatedAccount.ts b/test/packages/js/src/generated/instructions/thawDelegatedAccount.ts index b158ed5c0..66e5d45e6 100644 --- a/test/packages/js/src/generated/instructions/thawDelegatedAccount.ts +++ b/test/packages/js/src/generated/instructions/thawDelegatedAccount.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -103,9 +102,11 @@ export function thawDelegatedAccount( // Default values. if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/transfer.ts b/test/packages/js/src/generated/instructions/transfer.ts index d61d07242..4bf7c5fd3 100644 --- a/test/packages/js/src/generated/instructions/transfer.ts +++ b/test/packages/js/src/generated/instructions/transfer.ts @@ -215,19 +215,25 @@ export function transfer( }; } if (!resolvedAccounts.splTokenProgram.value) { - resolvedAccounts.splTokenProgram.value = publicKey( + resolvedAccounts.splTokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.splTokenProgram.isWritable = false; } if (!resolvedAccounts.splAtaProgram.value) { - resolvedAccounts.splAtaProgram.value = publicKey( + resolvedAccounts.splAtaProgram.value = context.programs.getPublicKey( + 'splAssociatedToken', 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' ); + resolvedAccounts.splAtaProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/transferOutOfEscrow.ts b/test/packages/js/src/generated/instructions/transferOutOfEscrow.ts index 48907eca7..79068339b 100644 --- a/test/packages/js/src/generated/instructions/transferOutOfEscrow.ts +++ b/test/packages/js/src/generated/instructions/transferOutOfEscrow.ts @@ -184,19 +184,25 @@ export function transferOutOfEscrow( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.ataProgram.value) { - resolvedAccounts.ataProgram.value = publicKey( + resolvedAccounts.ataProgram.value = context.programs.getPublicKey( + 'splAssociatedToken', 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' ); + resolvedAccounts.ataProgram.isWritable = false; } if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/updateV1.ts b/test/packages/js/src/generated/instructions/updateV1.ts index d741ade7c..3985fa2f6 100644 --- a/test/packages/js/src/generated/instructions/updateV1.ts +++ b/test/packages/js/src/generated/instructions/updateV1.ts @@ -254,9 +254,11 @@ export function updateV1( resolvedAccounts.authority.value = context.identity; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.sysvarInstructions.value) { resolvedAccounts.sysvarInstructions.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/useAsset.ts b/test/packages/js/src/generated/instructions/useAsset.ts index d9a3d70c4..892d5adf8 100644 --- a/test/packages/js/src/generated/instructions/useAsset.ts +++ b/test/packages/js/src/generated/instructions/useAsset.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -160,19 +159,25 @@ export function useAsset( // Default values. if (!resolvedAccounts.splTokenProgram.value) { - resolvedAccounts.splTokenProgram.value = publicKey( + resolvedAccounts.splTokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.splTokenProgram.isWritable = false; } if (!resolvedAccounts.ataProgram.value) { - resolvedAccounts.ataProgram.value = publicKey( + resolvedAccounts.ataProgram.value = context.programs.getPublicKey( + 'splAssociatedToken', 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' ); + resolvedAccounts.ataProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/packages/js/src/generated/instructions/utilize.ts b/test/packages/js/src/generated/instructions/utilize.ts index bd8f059ac..6fa4f4c7c 100644 --- a/test/packages/js/src/generated/instructions/utilize.ts +++ b/test/packages/js/src/generated/instructions/utilize.ts @@ -148,19 +148,25 @@ export function utilize( // Default values. if (!resolvedAccounts.tokenProgram.value) { - resolvedAccounts.tokenProgram.value = publicKey( + resolvedAccounts.tokenProgram.value = context.programs.getPublicKey( + 'splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ); + resolvedAccounts.tokenProgram.isWritable = false; } if (!resolvedAccounts.ataProgram.value) { - resolvedAccounts.ataProgram.value = publicKey( + resolvedAccounts.ataProgram.value = context.programs.getPublicKey( + 'splAssociatedToken', 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' ); + resolvedAccounts.ataProgram.isWritable = false; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } if (!resolvedAccounts.rent.value) { resolvedAccounts.rent.value = publicKey( diff --git a/test/packages/js/src/generated/instructions/validate.ts b/test/packages/js/src/generated/instructions/validate.ts index 9562011f9..803067c4d 100644 --- a/test/packages/js/src/generated/instructions/validate.ts +++ b/test/packages/js/src/generated/instructions/validate.ts @@ -12,7 +12,6 @@ import { PublicKey, Signer, TransactionBuilder, - publicKey, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -192,9 +191,11 @@ export function validate( resolvedAccounts.payer.value = context.payer; } if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = publicKey( + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', '11111111111111111111111111111111' ); + resolvedAccounts.systemProgram.isWritable = false; } // Accounts in order. diff --git a/test/visitors/nodes/valueNodes/PublicKeyValueNode.test.ts b/test/visitors/nodes/valueNodes/PublicKeyValueNode.test.ts index b4e521b2c..0cb987254 100644 --- a/test/visitors/nodes/valueNodes/PublicKeyValueNode.test.ts +++ b/test/visitors/nodes/valueNodes/PublicKeyValueNode.test.ts @@ -17,3 +17,12 @@ test( node, `publicKeyValueNode [HqJgWgvkn5wMGU8LpzkRw8389N5Suvu2nZcmpya9JyJB]` ); +test( + 'getDebugStringVisitor: with identifier', + getDebugStringVisitorMacro, + publicKeyValueNode( + 'HqJgWgvkn5wMGU8LpzkRw8389N5Suvu2nZcmpya9JyJB', + 'myIdentifier' + ), + `publicKeyValueNode [myIdentifier.HqJgWgvkn5wMGU8LpzkRw8389N5Suvu2nZcmpya9JyJB]` +);