@metaplex-foundation/mpl-toolbox
Advanced tools
Comparing version 0.9.2 to 0.9.4
@@ -43,2 +43,6 @@ "use strict"; | ||
} | ||
if (!resolvedAccounts.tokenProgram.value) { | ||
resolvedAccounts.tokenProgram.value = context.programs.getPublicKey('splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'); | ||
resolvedAccounts.tokenProgram.isWritable = false; | ||
} | ||
if (!resolvedAccounts.ata.value) { | ||
@@ -48,2 +52,3 @@ resolvedAccounts.ata.value = (0, hooked_1.findAssociatedTokenPda)(context, { | ||
mint: (0, shared_1.expectPublicKey)(resolvedAccounts.mint.value), | ||
tokenProgramId: (0, shared_1.expectPublicKey)(resolvedAccounts.tokenProgram.value), | ||
}); | ||
@@ -55,6 +60,2 @@ } | ||
} | ||
if (!resolvedAccounts.tokenProgram.value) { | ||
resolvedAccounts.tokenProgram.value = context.programs.getPublicKey('splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'); | ||
resolvedAccounts.tokenProgram.isWritable = false; | ||
} | ||
// Accounts in order. | ||
@@ -61,0 +62,0 @@ const orderedAccounts = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index); |
@@ -55,2 +55,6 @@ "use strict"; | ||
} | ||
if (!resolvedAccounts.tokenProgram.value) { | ||
resolvedAccounts.tokenProgram.value = context.programs.getPublicKey('splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'); | ||
resolvedAccounts.tokenProgram.isWritable = false; | ||
} | ||
if (!resolvedAccounts.ata.value) { | ||
@@ -60,2 +64,3 @@ resolvedAccounts.ata.value = (0, hooked_1.findAssociatedTokenPda)(context, { | ||
mint: (0, shared_1.expectPublicKey)(resolvedAccounts.mint.value), | ||
tokenProgramId: (0, shared_1.expectPublicKey)(resolvedAccounts.tokenProgram.value), | ||
}); | ||
@@ -70,6 +75,2 @@ } | ||
} | ||
if (!resolvedAccounts.tokenProgram.value) { | ||
resolvedAccounts.tokenProgram.value = context.programs.getPublicKey('splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'); | ||
resolvedAccounts.tokenProgram.isWritable = false; | ||
} | ||
if (!resolvedAccounts.ataProgram.value) { | ||
@@ -76,0 +77,0 @@ resolvedAccounts.ataProgram.value = context.programs.getPublicKey('splAssociatedToken', 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'); |
@@ -7,2 +7,4 @@ import { Context, Pda, PublicKey } from '@metaplex-foundation/umi'; | ||
owner: PublicKey; | ||
/** The Token or Token2022 Program id */ | ||
tokenProgramId?: PublicKey; | ||
}): Pda; |
@@ -7,6 +7,6 @@ "use strict"; | ||
const associatedTokenProgramId = context.programs.getPublicKey('splAssociatedToken'); | ||
const tokenProgramId = context.programs.getPublicKey('splToken'); | ||
const tokenProgramIdResolved = seeds.tokenProgramId ?? context.programs.getPublicKey('splToken'); | ||
return context.eddsa.findPda(associatedTokenProgramId, [ | ||
(0, serializers_1.publicKey)().serialize(seeds.owner), | ||
(0, serializers_1.publicKey)().serialize(tokenProgramId), | ||
(0, serializers_1.publicKey)().serialize(tokenProgramIdResolved), | ||
(0, serializers_1.publicKey)().serialize(seeds.mint), | ||
@@ -13,0 +13,0 @@ ]); |
{ | ||
"name": "@metaplex-foundation/mpl-toolbox", | ||
"version": "0.9.2", | ||
"version": "0.9.4", | ||
"description": "Auto-generated essential Solana and Metaplex programs", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
403767
5912
0