Socket
Socket
Sign inDemoInstall

@solana/spl-token

Package Overview
Dependencies
Maintainers
14
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/spl-token - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

lib/esm/actions/approve.js

12

lib/cjs/actions/approve.js

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const approve_js_1 = require("../instructions/approve.js");
const internal_js_1 = require("./internal.js");
/**

@@ -33,6 +33,6 @@ * Approve a delegate to transfer up to a maximum number of tokens from an account

*/
function approve(connection, payer, account, delegate, owner, amount, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function approve(connection, payer, account, delegate, owner, amount, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [ownerPublicKey, signers] = (0, internal_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createApproveInstruction)(account, delegate, ownerPublicKey, amount, multiSigners, programId));
const [ownerPublicKey, signers] = (0, internal_js_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, approve_js_1.createApproveInstruction)(account, delegate, ownerPublicKey, amount, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -39,0 +39,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const approveChecked_js_1 = require("../instructions/approveChecked.js");
const internal_js_1 = require("./internal.js");
/**

@@ -35,6 +35,6 @@ * Approve a delegate to transfer up to a maximum number of tokens from an account, asserting the token mint and

*/
function approveChecked(connection, payer, mint, account, delegate, owner, amount, decimals, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function approveChecked(connection, payer, mint, account, delegate, owner, amount, decimals, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [ownerPublicKey, signers] = (0, internal_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createApproveCheckedInstruction)(account, mint, delegate, ownerPublicKey, amount, decimals, multiSigners, programId));
const [ownerPublicKey, signers] = (0, internal_js_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, approveChecked_js_1.createApproveCheckedInstruction)(account, mint, delegate, ownerPublicKey, amount, decimals, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -41,0 +41,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const burn_js_1 = require("../instructions/burn.js");
const internal_js_1 = require("./internal.js");
/**

@@ -33,6 +33,6 @@ * Burn tokens from an account

*/
function burn(connection, payer, account, mint, owner, amount, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function burn(connection, payer, account, mint, owner, amount, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [ownerPublicKey, signers] = (0, internal_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createBurnInstruction)(account, mint, ownerPublicKey, amount, multiSigners, programId));
const [ownerPublicKey, signers] = (0, internal_js_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, burn_js_1.createBurnInstruction)(account, mint, ownerPublicKey, amount, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -39,0 +39,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const burnChecked_js_1 = require("../instructions/burnChecked.js");
const internal_js_1 = require("./internal.js");
/**

@@ -34,6 +34,6 @@ * Burn tokens from an account, asserting the token mint and decimals

*/
function burnChecked(connection, payer, account, mint, owner, amount, decimals, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function burnChecked(connection, payer, account, mint, owner, amount, decimals, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [ownerPublicKey, signers] = (0, internal_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createBurnCheckedInstruction)(account, mint, ownerPublicKey, amount, decimals, multiSigners, programId));
const [ownerPublicKey, signers] = (0, internal_js_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, burnChecked_js_1.createBurnCheckedInstruction)(account, mint, ownerPublicKey, amount, decimals, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -40,0 +40,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const closeAccount_js_1 = require("../instructions/closeAccount.js");
const internal_js_1 = require("./internal.js");
/**

@@ -32,6 +32,6 @@ * Close a token account

*/
function closeAccount(connection, payer, account, destination, authority, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function closeAccount(connection, payer, account, destination, authority, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [authorityPublicKey, signers] = (0, internal_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createCloseAccountInstruction)(account, destination, authorityPublicKey, multiSigners, programId));
const [authorityPublicKey, signers] = (0, internal_js_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, closeAccount_js_1.createCloseAccountInstruction)(account, destination, authorityPublicKey, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -38,0 +38,0 @@ });

@@ -14,7 +14,7 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const index_2 = require("../state/index");
const createAssociatedTokenAccount_1 = require("./createAssociatedTokenAccount");
const extensionType_1 = require("../extensions/extensionType");
const constants_js_1 = require("../constants.js");
const extensionType_js_1 = require("../extensions/extensionType.js");
const initializeAccount_js_1 = require("../instructions/initializeAccount.js");
const mint_js_1 = require("../state/mint.js");
const createAssociatedTokenAccount_js_1 = require("./createAssociatedTokenAccount.js");
/**

@@ -33,10 +33,10 @@ * Create and initialize a new token account

*/
function createAccount(connection, payer, mint, owner, keypair, confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function createAccount(connection, payer, mint, owner, keypair, confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
// If a keypair isn't provided, create the associated token account and return its address
if (!keypair)
return yield (0, createAssociatedTokenAccount_1.createAssociatedTokenAccount)(connection, payer, mint, owner, confirmOptions, programId);
return yield (0, createAssociatedTokenAccount_js_1.createAssociatedTokenAccount)(connection, payer, mint, owner, confirmOptions, programId);
// Otherwise, create the account with the provided keypair and return its public key
const mintState = yield (0, index_2.getMint)(connection, mint, confirmOptions === null || confirmOptions === void 0 ? void 0 : confirmOptions.commitment, programId);
const space = (0, extensionType_1.getAccountLenForMint)(mintState);
const mintState = yield (0, mint_js_1.getMint)(connection, mint, confirmOptions === null || confirmOptions === void 0 ? void 0 : confirmOptions.commitment, programId);
const space = (0, extensionType_js_1.getAccountLenForMint)(mintState);
const lamports = yield connection.getMinimumBalanceForRentExemption(space);

@@ -49,3 +49,3 @@ const transaction = new web3_js_1.Transaction().add(web3_js_1.SystemProgram.createAccount({

programId,
}), (0, index_1.createInitializeAccountInstruction)(keypair.publicKey, mint, owner, programId));
}), (0, initializeAccount_js_1.createInitializeAccountInstruction)(keypair.publicKey, mint, owner, programId));
yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, keypair], confirmOptions);

@@ -52,0 +52,0 @@ return keypair.publicKey;

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const index_2 = require("../state/index");
const constants_js_1 = require("../constants.js");
const associatedTokenAccount_js_1 = require("../instructions/associatedTokenAccount.js");
const mint_js_1 = require("../state/mint.js");
/**

@@ -31,6 +31,6 @@ * Create and initialize a new associated token account

*/
function createAssociatedTokenAccount(connection, payer, mint, owner, confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID, associatedTokenProgramId = constants_1.ASSOCIATED_TOKEN_PROGRAM_ID) {
function createAssociatedTokenAccount(connection, payer, mint, owner, confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID, associatedTokenProgramId = constants_js_1.ASSOCIATED_TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const associatedToken = yield (0, index_2.getAssociatedTokenAddress)(mint, owner, false, programId, associatedTokenProgramId);
const transaction = new web3_js_1.Transaction().add((0, index_1.createAssociatedTokenAccountInstruction)(payer.publicKey, associatedToken, owner, mint, programId, associatedTokenProgramId));
const associatedToken = yield (0, mint_js_1.getAssociatedTokenAddress)(mint, owner, false, programId, associatedTokenProgramId);
const transaction = new web3_js_1.Transaction().add((0, associatedTokenAccount_js_1.createAssociatedTokenAccountInstruction)(payer.publicKey, associatedToken, owner, mint, programId, associatedTokenProgramId));
yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer], confirmOptions);

@@ -37,0 +37,0 @@ return associatedToken;

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const index_2 = require("../state/index");
const constants_js_1 = require("../constants.js");
const initializeMint_js_1 = require("../instructions/initializeMint.js");
const mint_js_1 = require("../state/mint.js");
/**

@@ -32,12 +32,12 @@ * Create and initialize a new mint

*/
function createMint(connection, payer, mintAuthority, freezeAuthority, decimals, keypair = web3_js_1.Keypair.generate(), confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function createMint(connection, payer, mintAuthority, freezeAuthority, decimals, keypair = web3_js_1.Keypair.generate(), confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const lamports = yield (0, index_2.getMinimumBalanceForRentExemptMint)(connection);
const lamports = yield (0, mint_js_1.getMinimumBalanceForRentExemptMint)(connection);
const transaction = new web3_js_1.Transaction().add(web3_js_1.SystemProgram.createAccount({
fromPubkey: payer.publicKey,
newAccountPubkey: keypair.publicKey,
space: index_2.MINT_SIZE,
space: mint_js_1.MINT_SIZE,
lamports,
programId,
}), (0, index_1.createInitializeMintInstruction)(keypair.publicKey, decimals, mintAuthority, freezeAuthority, programId));
}), (0, initializeMint_js_1.createInitializeMintInstruction)(keypair.publicKey, decimals, mintAuthority, freezeAuthority, programId));
yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, keypair], confirmOptions);

@@ -44,0 +44,0 @@ return keypair.publicKey;

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const index_2 = require("../state/index");
const constants_js_1 = require("../constants.js");
const initializeMultisig_js_1 = require("../instructions/initializeMultisig.js");
const multisig_js_1 = require("../state/multisig.js");
/**

@@ -31,12 +31,12 @@ * Create and initialize a new multisig

*/
function createMultisig(connection, payer, signers, m, keypair = web3_js_1.Keypair.generate(), confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function createMultisig(connection, payer, signers, m, keypair = web3_js_1.Keypair.generate(), confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const lamports = yield (0, index_2.getMinimumBalanceForRentExemptMultisig)(connection);
const lamports = yield (0, multisig_js_1.getMinimumBalanceForRentExemptMultisig)(connection);
const transaction = new web3_js_1.Transaction().add(web3_js_1.SystemProgram.createAccount({
fromPubkey: payer.publicKey,
newAccountPubkey: keypair.publicKey,
space: index_2.MULTISIG_SIZE,
space: multisig_js_1.MULTISIG_SIZE,
lamports,
programId,
}), (0, index_1.createInitializeMultisigInstruction)(keypair.publicKey, signers, m, programId));
}), (0, initializeMultisig_js_1.createInitializeMultisigInstruction)(keypair.publicKey, signers, m, programId));
yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, keypair], confirmOptions);

@@ -43,0 +43,0 @@ return keypair.publicKey;

@@ -14,4 +14,4 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const constants_js_1 = require("../constants.js");
const createNativeMint_js_1 = require("../instructions/createNativeMint.js");
/**

@@ -26,5 +26,5 @@ * Create native mint

*/
function createNativeMint(connection, payer, confirmOptions, nativeMint = constants_1.NATIVE_MINT_2022, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function createNativeMint(connection, payer, confirmOptions, nativeMint = constants_js_1.NATIVE_MINT_2022, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const transaction = new web3_js_1.Transaction().add((0, index_1.createCreateNativeMintInstruction)(payer.publicKey, nativeMint, programId));
const transaction = new web3_js_1.Transaction().add((0, createNativeMint_js_1.createCreateNativeMintInstruction)(payer.publicKey, nativeMint, programId));
yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer], confirmOptions);

@@ -31,0 +31,0 @@ });

@@ -14,6 +14,9 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const index_2 = require("../state/index");
const createAccount_1 = require("./createAccount");
const constants_js_1 = require("../constants.js");
const associatedTokenAccount_js_1 = require("../instructions/associatedTokenAccount.js");
const initializeAccount_js_1 = require("../instructions/initializeAccount.js");
const syncNative_js_1 = require("../instructions/syncNative.js");
const account_js_1 = require("../state/account.js");
const mint_js_1 = require("../state/mint.js");
const createAccount_js_1 = require("./createAccount.js");
/**

@@ -32,15 +35,15 @@ * Create, initialize, and fund a new wrapped native SOL account

*/
function createWrappedNativeAccount(connection, payer, owner, amount, keypair, confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID, nativeMint = constants_1.NATIVE_MINT) {
function createWrappedNativeAccount(connection, payer, owner, amount, keypair, confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID, nativeMint = constants_js_1.NATIVE_MINT) {
return __awaiter(this, void 0, void 0, function* () {
// If the amount provided is explicitly 0 or NaN, just create the account without funding it
if (!amount)
return yield (0, createAccount_1.createAccount)(connection, payer, nativeMint, owner, keypair, confirmOptions, programId);
return yield (0, createAccount_js_1.createAccount)(connection, payer, nativeMint, owner, keypair, confirmOptions, programId);
// If a keypair isn't provided, create the account at the owner's ATA for the native mint and return its address
if (!keypair) {
const associatedToken = yield (0, index_2.getAssociatedTokenAddress)(nativeMint, owner, false, programId, constants_1.ASSOCIATED_TOKEN_PROGRAM_ID);
const transaction = new web3_js_1.Transaction().add((0, index_1.createAssociatedTokenAccountInstruction)(payer.publicKey, associatedToken, owner, nativeMint, programId, constants_1.ASSOCIATED_TOKEN_PROGRAM_ID), web3_js_1.SystemProgram.transfer({
const associatedToken = yield (0, mint_js_1.getAssociatedTokenAddress)(nativeMint, owner, false, programId, constants_js_1.ASSOCIATED_TOKEN_PROGRAM_ID);
const transaction = new web3_js_1.Transaction().add((0, associatedTokenAccount_js_1.createAssociatedTokenAccountInstruction)(payer.publicKey, associatedToken, owner, nativeMint, programId, constants_js_1.ASSOCIATED_TOKEN_PROGRAM_ID), web3_js_1.SystemProgram.transfer({
fromPubkey: payer.publicKey,
toPubkey: associatedToken,
lamports: amount,
}), (0, index_1.createSyncNativeInstruction)(associatedToken, programId));
}), (0, syncNative_js_1.createSyncNativeInstruction)(associatedToken, programId));
yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer], confirmOptions);

@@ -50,7 +53,7 @@ return associatedToken;

// Otherwise, create the account with the provided keypair and return its public key
const lamports = yield (0, index_2.getMinimumBalanceForRentExemptAccount)(connection);
const lamports = yield (0, account_js_1.getMinimumBalanceForRentExemptAccount)(connection);
const transaction = new web3_js_1.Transaction().add(web3_js_1.SystemProgram.createAccount({
fromPubkey: payer.publicKey,
newAccountPubkey: keypair.publicKey,
space: index_2.ACCOUNT_SIZE,
space: account_js_1.ACCOUNT_SIZE,
lamports,

@@ -62,3 +65,3 @@ programId,

lamports: amount,
}), (0, index_1.createInitializeAccountInstruction)(keypair.publicKey, nativeMint, owner, programId));
}), (0, initializeAccount_js_1.createInitializeAccountInstruction)(keypair.publicKey, nativeMint, owner, programId));
yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, keypair], confirmOptions);

@@ -65,0 +68,0 @@ return keypair.publicKey;

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const freezeAccount_js_1 = require("../instructions/freezeAccount.js");
const internal_js_1 = require("./internal.js");
/**

@@ -32,6 +32,6 @@ * Freeze a token account

*/
function freezeAccount(connection, payer, account, mint, authority, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function freezeAccount(connection, payer, account, mint, authority, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [authorityPublicKey, signers] = (0, internal_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createFreezeAccountInstruction)(account, mint, authorityPublicKey, multiSigners, programId));
const [authorityPublicKey, signers] = (0, internal_js_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, freezeAccount_js_1.createFreezeAccountInstruction)(account, mint, authorityPublicKey, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -38,0 +38,0 @@ });

@@ -14,6 +14,7 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const index_1 = require("../instructions/index");
const index_2 = require("../state/index");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const associatedTokenAccount_js_1 = require("../instructions/associatedTokenAccount.js");
const account_js_1 = require("../state/account.js");
const mint_js_1 = require("../state/mint.js");
/**

@@ -34,5 +35,5 @@ * Retrieve the associated token account, or create it if it doesn't exist

*/
function getOrCreateAssociatedTokenAccount(connection, payer, mint, owner, allowOwnerOffCurve = false, commitment, confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID, associatedTokenProgramId = constants_1.ASSOCIATED_TOKEN_PROGRAM_ID) {
function getOrCreateAssociatedTokenAccount(connection, payer, mint, owner, allowOwnerOffCurve = false, commitment, confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID, associatedTokenProgramId = constants_js_1.ASSOCIATED_TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const associatedToken = yield (0, index_2.getAssociatedTokenAddress)(mint, owner, allowOwnerOffCurve, programId, associatedTokenProgramId);
const associatedToken = yield (0, mint_js_1.getAssociatedTokenAddress)(mint, owner, allowOwnerOffCurve, programId, associatedTokenProgramId);
// This is the optimal logic, considering TX fee, client-side computation, RPC roundtrips and guaranteed idempotent.

@@ -42,3 +43,3 @@ // Sadly we can't do this atomically.

try {
account = yield (0, index_2.getAccount)(connection, associatedToken, commitment, programId);
account = yield (0, account_js_1.getAccount)(connection, associatedToken, commitment, programId);
}

@@ -49,6 +50,6 @@ catch (error) {

// TokenInvalidAccountOwnerError in this code path.
if (error instanceof errors_1.TokenAccountNotFoundError || error instanceof errors_1.TokenInvalidAccountOwnerError) {
if (error instanceof errors_js_1.TokenAccountNotFoundError || error instanceof errors_js_1.TokenInvalidAccountOwnerError) {
// As this isn't atomic, it's possible others can create associated accounts meanwhile.
try {
const transaction = new web3_js_1.Transaction().add((0, index_1.createAssociatedTokenAccountInstruction)(payer.publicKey, associatedToken, owner, mint, programId, associatedTokenProgramId));
const transaction = new web3_js_1.Transaction().add((0, associatedTokenAccount_js_1.createAssociatedTokenAccountInstruction)(payer.publicKey, associatedToken, owner, mint, programId, associatedTokenProgramId));
yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer], confirmOptions);

@@ -61,3 +62,3 @@ }

// Now this should always succeed
account = yield (0, index_2.getAccount)(connection, associatedToken, commitment, programId);
account = yield (0, account_js_1.getAccount)(connection, associatedToken, commitment, programId);
}

@@ -69,5 +70,5 @@ else {

if (!account.mint.equals(mint))
throw new errors_1.TokenInvalidMintError();
throw new errors_js_1.TokenInvalidMintError();
if (!account.owner.equals(owner))
throw new errors_1.TokenInvalidOwnerError();
throw new errors_js_1.TokenInvalidOwnerError();
return account;

@@ -74,0 +75,0 @@ });

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,23 +17,23 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./createMint"), exports);
__exportStar(require("./createNativeMint"), exports);
__exportStar(require("./createAccount"), exports);
__exportStar(require("./createWrappedNativeAccount"), exports);
__exportStar(require("./createMultisig"), exports);
__exportStar(require("./transfer"), exports);
__exportStar(require("./approve"), exports);
__exportStar(require("./revoke"), exports);
__exportStar(require("./setAuthority"), exports);
__exportStar(require("./mintTo"), exports);
__exportStar(require("./burn"), exports);
__exportStar(require("./closeAccount"), exports);
__exportStar(require("./freezeAccount"), exports);
__exportStar(require("./thawAccount"), exports);
__exportStar(require("./transferChecked"), exports);
__exportStar(require("./approveChecked"), exports);
__exportStar(require("./mintToChecked"), exports);
__exportStar(require("./burnChecked"), exports);
__exportStar(require("./syncNative"), exports);
__exportStar(require("./createAssociatedTokenAccount"), exports);
__exportStar(require("./getOrCreateAssociatedTokenAccount"), exports);
__exportStar(require("./createMint.js"), exports);
__exportStar(require("./createNativeMint.js"), exports);
__exportStar(require("./createAccount.js"), exports);
__exportStar(require("./createWrappedNativeAccount.js"), exports);
__exportStar(require("./createMultisig.js"), exports);
__exportStar(require("./transfer.js"), exports);
__exportStar(require("./approve.js"), exports);
__exportStar(require("./revoke.js"), exports);
__exportStar(require("./setAuthority.js"), exports);
__exportStar(require("./mintTo.js"), exports);
__exportStar(require("./burn.js"), exports);
__exportStar(require("./closeAccount.js"), exports);
__exportStar(require("./freezeAccount.js"), exports);
__exportStar(require("./thawAccount.js"), exports);
__exportStar(require("./transferChecked.js"), exports);
__exportStar(require("./approveChecked.js"), exports);
__exportStar(require("./mintToChecked.js"), exports);
__exportStar(require("./burnChecked.js"), exports);
__exportStar(require("./syncNative.js"), exports);
__exportStar(require("./createAssociatedTokenAccount.js"), exports);
__exportStar(require("./getOrCreateAssociatedTokenAccount.js"), exports);
//# sourceMappingURL=index.js.map

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const mintTo_js_1 = require("../instructions/mintTo.js");
const internal_js_1 = require("./internal.js");
/**

@@ -33,6 +33,6 @@ * Mint tokens to an account

*/
function mintTo(connection, payer, mint, destination, authority, amount, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function mintTo(connection, payer, mint, destination, authority, amount, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [authorityPublicKey, signers] = (0, internal_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createMintToInstruction)(mint, destination, authorityPublicKey, amount, multiSigners, programId));
const [authorityPublicKey, signers] = (0, internal_js_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, mintTo_js_1.createMintToInstruction)(mint, destination, authorityPublicKey, amount, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -39,0 +39,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const mintToChecked_js_1 = require("../instructions/mintToChecked.js");
const internal_js_1 = require("./internal.js");
/**

@@ -34,6 +34,6 @@ * Mint tokens to an account, asserting the token mint and decimals

*/
function mintToChecked(connection, payer, mint, destination, authority, amount, decimals, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function mintToChecked(connection, payer, mint, destination, authority, amount, decimals, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [authorityPublicKey, signers] = (0, internal_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createMintToCheckedInstruction)(mint, destination, authorityPublicKey, amount, decimals, multiSigners, programId));
const [authorityPublicKey, signers] = (0, internal_js_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, mintToChecked_js_1.createMintToCheckedInstruction)(mint, destination, authorityPublicKey, amount, decimals, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -40,0 +40,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const revoke_js_1 = require("../instructions/revoke.js");
const internal_js_1 = require("./internal.js");
/**

@@ -31,6 +31,6 @@ * Revoke approval for the transfer of tokens from an account

*/
function revoke(connection, payer, account, owner, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function revoke(connection, payer, account, owner, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [ownerPublicKey, signers] = (0, internal_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createRevokeInstruction)(account, ownerPublicKey, multiSigners, programId));
const [ownerPublicKey, signers] = (0, internal_js_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, revoke_js_1.createRevokeInstruction)(account, ownerPublicKey, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -37,0 +37,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const setAuthority_js_1 = require("../instructions/setAuthority.js");
const internal_js_1 = require("./internal.js");
/**

@@ -33,6 +33,6 @@ * Assign a new authority to the account

*/
function setAuthority(connection, payer, account, currentAuthority, authorityType, newAuthority, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function setAuthority(connection, payer, account, currentAuthority, authorityType, newAuthority, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [currentAuthorityPublicKey, signers] = (0, internal_1.getSigners)(currentAuthority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createSetAuthorityInstruction)(account, currentAuthorityPublicKey, authorityType, newAuthority, multiSigners, programId));
const [currentAuthorityPublicKey, signers] = (0, internal_js_1.getSigners)(currentAuthority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, setAuthority_js_1.createSetAuthorityInstruction)(account, currentAuthorityPublicKey, authorityType, newAuthority, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -39,0 +39,0 @@ });

@@ -14,4 +14,4 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const constants_js_1 = require("../constants.js");
const syncNative_js_1 = require("../instructions/syncNative.js");
/**

@@ -28,5 +28,5 @@ * Sync the balance of a native SPL token account to the underlying system account's lamports

*/
function syncNative(connection, payer, account, confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function syncNative(connection, payer, account, confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const transaction = new web3_js_1.Transaction().add((0, index_1.createSyncNativeInstruction)(account, programId));
const transaction = new web3_js_1.Transaction().add((0, syncNative_js_1.createSyncNativeInstruction)(account, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer], confirmOptions);

@@ -33,0 +33,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const thawAccount_js_1 = require("../instructions/thawAccount.js");
const internal_js_1 = require("./internal.js");
/**

@@ -32,6 +32,6 @@ * Thaw (unfreeze) a token account

*/
function thawAccount(connection, payer, account, mint, authority, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function thawAccount(connection, payer, account, mint, authority, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [authorityPublicKey, signers] = (0, internal_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createThawAccountInstruction)(account, mint, authorityPublicKey, multiSigners, programId));
const [authorityPublicKey, signers] = (0, internal_js_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, thawAccount_js_1.createThawAccountInstruction)(account, mint, authorityPublicKey, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -38,0 +38,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const transfer_js_1 = require("../instructions/transfer.js");
const internal_js_1 = require("./internal.js");
/**

@@ -33,6 +33,6 @@ * Transfer tokens from one account to another

*/
function transfer(connection, payer, source, destination, owner, amount, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function transfer(connection, payer, source, destination, owner, amount, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [ownerPublicKey, signers] = (0, internal_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createTransferInstruction)(source, destination, ownerPublicKey, amount, multiSigners, programId));
const [ownerPublicKey, signers] = (0, internal_js_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, transfer_js_1.createTransferInstruction)(source, destination, ownerPublicKey, amount, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -39,0 +39,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const index_1 = require("../instructions/index");
const internal_1 = require("./internal");
const constants_js_1 = require("../constants.js");
const transferChecked_js_1 = require("../instructions/transferChecked.js");
const internal_js_1 = require("./internal.js");
/**

@@ -35,6 +35,6 @@ * Transfer tokens from one account to another, asserting the token mint and decimals

*/
function transferChecked(connection, payer, source, mint, destination, owner, amount, decimals, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_PROGRAM_ID) {
function transferChecked(connection, payer, source, mint, destination, owner, amount, decimals, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [ownerPublicKey, signers] = (0, internal_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, index_1.createTransferCheckedInstruction)(source, mint, destination, ownerPublicKey, amount, decimals, multiSigners, programId));
const [ownerPublicKey, signers] = (0, internal_js_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, transferChecked_js_1.createTransferCheckedInstruction)(source, mint, destination, ownerPublicKey, amount, decimals, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -41,0 +41,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../../constants");
const instructions_1 = require("./instructions");
const internal_1 = require("../../actions/internal");
const internal_js_1 = require("../../actions/internal.js");
const constants_js_1 = require("../../constants.js");
const instructions_js_1 = require("./instructions.js");
/**

@@ -30,5 +30,5 @@ * Initialize a default account state on a mint

*/
function initializeDefaultAccountState(connection, payer, mint, state, confirmOptions, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function initializeDefaultAccountState(connection, payer, mint, state, confirmOptions, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const transaction = new web3_js_1.Transaction().add((0, instructions_1.createInitializeDefaultAccountStateInstruction)(mint, state, programId));
const transaction = new web3_js_1.Transaction().add((0, instructions_js_1.createInitializeDefaultAccountStateInstruction)(mint, state, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer], confirmOptions);

@@ -52,6 +52,6 @@ });

*/
function updateDefaultAccountState(connection, payer, mint, state, freezeAuthority, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function updateDefaultAccountState(connection, payer, mint, state, freezeAuthority, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [freezeAuthorityPublicKey, signers] = (0, internal_1.getSigners)(freezeAuthority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_1.createUpdateDefaultAccountStateInstruction)(mint, state, freezeAuthorityPublicKey, signers, programId));
const [freezeAuthorityPublicKey, signers] = (0, internal_js_1.getSigners)(freezeAuthority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_js_1.createUpdateDefaultAccountStateInstruction)(mint, state, freezeAuthorityPublicKey, signers, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -58,0 +58,0 @@ });

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,5 +17,5 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./actions"), exports);
__exportStar(require("./instructions"), exports);
__exportStar(require("./state"), exports);
__exportStar(require("./actions.js"), exports);
__exportStar(require("./instructions.js"), exports);
__exportStar(require("./state.js"), exports);
//# sourceMappingURL=index.js.map

@@ -6,5 +6,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const types_1 = require("../../instructions/types");
const constants_1 = require("../../constants");
const errors_1 = require("../../errors");
const constants_js_1 = require("../../constants.js");
const errors_js_1 = require("../../errors.js");
const types_js_1 = require("../../instructions/types.js");
var DefaultAccountStateInstruction;

@@ -30,5 +30,5 @@ (function (DefaultAccountStateInstruction) {

*/
function createInitializeDefaultAccountStateInstruction(mint, accountState, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
function createInitializeDefaultAccountStateInstruction(mint, accountState, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}

@@ -38,3 +38,3 @@ const keys = [{ pubkey: mint, isSigner: false, isWritable: true }];

exports.defaultAccountStateInstructionData.encode({
instruction: types_1.TokenInstruction.DefaultAccountStateExtension,
instruction: types_js_1.TokenInstruction.DefaultAccountStateExtension,
defaultAccountStateInstruction: DefaultAccountStateInstruction.Initialize,

@@ -57,5 +57,5 @@ accountState,

*/
function createUpdateDefaultAccountStateInstruction(mint, accountState, freezeAuthority, multiSigners = [], programId = constants_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
function createUpdateDefaultAccountStateInstruction(mint, accountState, freezeAuthority, multiSigners = [], programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}

@@ -69,3 +69,3 @@ const keys = [{ pubkey: mint, isSigner: false, isWritable: true }];

exports.defaultAccountStateInstructionData.encode({
instruction: types_1.TokenInstruction.DefaultAccountStateExtension,
instruction: types_js_1.TokenInstruction.DefaultAccountStateExtension,
defaultAccountStateInstruction: DefaultAccountStateInstruction.Update,

@@ -72,0 +72,0 @@ accountState,

@@ -5,3 +5,3 @@ "use strict";

const buffer_layout_1 = require("@solana/buffer-layout");
const extensionType_1 = require("../extensionType");
const extensionType_js_1 = require("../extensionType.js");
/** Buffer layout for de/serializing a transfer fee config extension */

@@ -11,3 +11,3 @@ exports.DefaultAccountStateLayout = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('state')]);

function getDefaultAccountState(mint) {
const extensionData = (0, extensionType_1.getExtensionData)(extensionType_1.ExtensionType.DefaultAccountState, mint.tlvData);
const extensionData = (0, extensionType_js_1.getExtensionData)(extensionType_js_1.ExtensionType.DefaultAccountState, mint.tlvData);
if (extensionData !== null) {

@@ -14,0 +14,0 @@ return exports.DefaultAccountStateLayout.decode(extensionData);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAccountLenForMint = exports.getExtensionTypes = exports.getExtensionData = exports.getAccountLen = exports.getMintLen = exports.getAccountTypeOfMintType = exports.getTypeLen = exports.LENGTH_SIZE = exports.TYPE_SIZE = exports.ExtensionType = void 0;
const account_1 = require("../state/account");
const mint_1 = require("../state/mint");
const multisig_1 = require("../state/multisig");
const accountType_1 = require("./accountType");
const memoTransfer_1 = require("./memoTransfer");
const defaultAccountState_1 = require("./defaultAccountState");
const mintCloseAuthority_1 = require("./mintCloseAuthority");
const immutableOwner_1 = require("./immutableOwner");
const transferFee_1 = require("./transferFee");
const nonTransferable_1 = require("./nonTransferable");
const state_1 = require("./interestBearingMint/state");
const account_js_1 = require("../state/account.js");
const mint_js_1 = require("../state/mint.js");
const multisig_js_1 = require("../state/multisig.js");
const accountType_js_1 = require("./accountType.js");
const index_js_1 = require("./defaultAccountState/index.js");
const immutableOwner_js_1 = require("./immutableOwner.js");
const state_js_1 = require("./interestBearingMint/state.js");
const index_js_2 = require("./memoTransfer/index.js");
const mintCloseAuthority_js_1 = require("./mintCloseAuthority.js");
const nonTransferable_js_1 = require("./nonTransferable.js");
const index_js_3 = require("./transferFee/index.js");
var ExtensionType;

@@ -38,7 +38,7 @@ (function (ExtensionType) {

case ExtensionType.TransferFeeConfig:
return transferFee_1.TRANSFER_FEE_CONFIG_SIZE;
return index_js_3.TRANSFER_FEE_CONFIG_SIZE;
case ExtensionType.TransferFeeAmount:
return transferFee_1.TRANSFER_FEE_AMOUNT_SIZE;
return index_js_3.TRANSFER_FEE_AMOUNT_SIZE;
case ExtensionType.MintCloseAuthority:
return mintCloseAuthority_1.MINT_CLOSE_AUTHORITY_SIZE;
return mintCloseAuthority_js_1.MINT_CLOSE_AUTHORITY_SIZE;
case ExtensionType.ConfidentialTransferMint:

@@ -49,11 +49,11 @@ return 97;

case ExtensionType.DefaultAccountState:
return defaultAccountState_1.DEFAULT_ACCOUNT_STATE_SIZE;
return index_js_1.DEFAULT_ACCOUNT_STATE_SIZE;
case ExtensionType.ImmutableOwner:
return immutableOwner_1.IMMUTABLE_OWNER_SIZE;
return immutableOwner_js_1.IMMUTABLE_OWNER_SIZE;
case ExtensionType.MemoTransfer:
return memoTransfer_1.MEMO_TRANSFER_SIZE;
return index_js_2.MEMO_TRANSFER_SIZE;
case ExtensionType.NonTransferable:
return nonTransferable_1.NON_TRANSFERABLE_SIZE;
return nonTransferable_js_1.NON_TRANSFERABLE_SIZE;
case ExtensionType.InterestBearingMint:
return state_1.INTEREST_BEARING_MINT_CONFIG_STATE_SIZE;
return state_js_1.INTEREST_BEARING_MINT_CONFIG_STATE_SIZE;
default:

@@ -88,4 +88,4 @@ throw Error(`Unknown extension type: ${e}`);

else {
const accountLength = account_1.ACCOUNT_SIZE +
accountType_1.ACCOUNT_TYPE_SIZE +
const accountLength = account_js_1.ACCOUNT_SIZE +
accountType_js_1.ACCOUNT_TYPE_SIZE +
extensionTypes

@@ -95,3 +95,3 @@ .filter((element, i) => i === extensionTypes.indexOf(element))

.reduce((a, b) => a + b);
if (accountLength === multisig_1.MULTISIG_SIZE) {
if (accountLength === multisig_js_1.MULTISIG_SIZE) {
return accountLength + exports.TYPE_SIZE;

@@ -105,7 +105,7 @@ }

function getMintLen(extensionTypes) {
return getLen(extensionTypes, mint_1.MINT_SIZE);
return getLen(extensionTypes, mint_js_1.MINT_SIZE);
}
exports.getMintLen = getMintLen;
function getAccountLen(extensionTypes) {
return getLen(extensionTypes, account_1.ACCOUNT_SIZE);
return getLen(extensionTypes, account_js_1.ACCOUNT_SIZE);
}

@@ -112,0 +112,0 @@ exports.getAccountLen = getAccountLen;

@@ -5,3 +5,3 @@ "use strict";

const buffer_layout_1 = require("@solana/buffer-layout");
const extensionType_1 = require("./extensionType");
const extensionType_js_1 = require("./extensionType.js");
/** Buffer layout for de/serializing an account */

@@ -11,3 +11,3 @@ exports.ImmutableOwnerLayout = (0, buffer_layout_1.struct)([]);

function getImmutableOwner(account) {
const extensionData = (0, extensionType_1.getExtensionData)(extensionType_1.ExtensionType.ImmutableOwner, account.tlvData);
const extensionData = (0, extensionType_js_1.getExtensionData)(extensionType_js_1.ExtensionType.ImmutableOwner, account.tlvData);
if (extensionData !== null) {

@@ -14,0 +14,0 @@ return exports.ImmutableOwnerLayout.decode(extensionData);

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,11 +17,11 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./accountType"), exports);
__exportStar(require("./defaultAccountState/index"), exports);
__exportStar(require("./extensionType"), exports);
__exportStar(require("./memoTransfer/index"), exports);
__exportStar(require("./mintCloseAuthority"), exports);
__exportStar(require("./immutableOwner"), exports);
__exportStar(require("./interestBearingMint"), exports);
__exportStar(require("./nonTransferable"), exports);
__exportStar(require("./transferFee/index"), exports);
__exportStar(require("./accountType.js"), exports);
__exportStar(require("./defaultAccountState/index.js"), exports);
__exportStar(require("./extensionType.js"), exports);
__exportStar(require("./memoTransfer/index.js"), exports);
__exportStar(require("./mintCloseAuthority.js"), exports);
__exportStar(require("./immutableOwner.js"), exports);
__exportStar(require("./interestBearingMint/index.js"), exports);
__exportStar(require("./nonTransferable.js"), exports);
__exportStar(require("./transferFee/index.js"), exports);
//# sourceMappingURL=index.js.map

@@ -14,7 +14,7 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const internal_1 = require("../../actions/internal");
const constants_1 = require("../../constants");
const instructions_1 = require("../../instructions");
const extensionType_1 = require("../extensionType");
const instructions_2 = require("./instructions");
const internal_js_1 = require("../../actions/internal.js");
const constants_js_1 = require("../../constants.js");
const initializeMint_js_1 = require("../../instructions/initializeMint.js");
const extensionType_js_1 = require("../extensionType.js");
const instructions_js_1 = require("./instructions.js");
/**

@@ -36,5 +36,5 @@ * Initialize an interest bearing account on a mint

*/
function createInterestBearingMint(connection, payer, mintAuthority, freezeAuthority, rateAuthority, rate, decimals, keypair = web3_js_1.Keypair.generate(), confirmOptions, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function createInterestBearingMint(connection, payer, mintAuthority, freezeAuthority, rateAuthority, rate, decimals, keypair = web3_js_1.Keypair.generate(), confirmOptions, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const mintLen = (0, extensionType_1.getMintLen)([extensionType_1.ExtensionType.InterestBearingMint]);
const mintLen = (0, extensionType_js_1.getMintLen)([extensionType_js_1.ExtensionType.InterestBearingMint]);
const lamports = yield connection.getMinimumBalanceForRentExemption(mintLen);

@@ -47,3 +47,3 @@ const transaction = new web3_js_1.Transaction().add(web3_js_1.SystemProgram.createAccount({

programId,
}), (0, instructions_2.createInitializeInterestBearingMintInstruction)(keypair.publicKey, rateAuthority, rate, programId), (0, instructions_1.createInitializeMintInstruction)(keypair.publicKey, decimals, mintAuthority, freezeAuthority, programId));
}), (0, instructions_js_1.createInitializeInterestBearingMintInstruction)(keypair.publicKey, rateAuthority, rate, programId), (0, initializeMint_js_1.createInitializeMintInstruction)(keypair.publicKey, decimals, mintAuthority, freezeAuthority, programId));
yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, keypair], confirmOptions);

@@ -68,6 +68,6 @@ return keypair.publicKey;

*/
function updateRateInterestBearingMint(connection, payer, mint, rateAuthority, rate, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function updateRateInterestBearingMint(connection, payer, mint, rateAuthority, rate, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [rateAuthorityPublicKey, signers] = (0, internal_1.getSigners)(rateAuthority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_2.createUpdateRateInterestBearingMintInstruction)(mint, rateAuthorityPublicKey, rate, signers, programId));
const [rateAuthorityPublicKey, signers] = (0, internal_js_1.getSigners)(rateAuthority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_js_1.createUpdateRateInterestBearingMintInstruction)(mint, rateAuthorityPublicKey, rate, signers, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, rateAuthority, ...signers], confirmOptions);

@@ -74,0 +74,0 @@ });

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,5 +17,5 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./actions"), exports);
__exportStar(require("./instructions"), exports);
__exportStar(require("./state"), exports);
__exportStar(require("./actions.js"), exports);
__exportStar(require("./instructions.js"), exports);
__exportStar(require("./state.js"), exports);
//# sourceMappingURL=index.js.map

@@ -7,5 +7,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../../constants");
const instructions_1 = require("../../instructions");
const internal_1 = require("../../instructions/internal");
const constants_js_1 = require("../../constants.js");
const internal_js_1 = require("../../instructions/internal.js");
const types_js_1 = require("../../instructions/types.js");
var InterestBearingMintInstruction;

@@ -38,7 +38,7 @@ (function (InterestBearingMintInstruction) {

*/
function createInitializeInterestBearingMintInstruction(mint, rateAuthority, rate, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function createInitializeInterestBearingMintInstruction(mint, rateAuthority, rate, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
const keys = [{ pubkey: mint, isSigner: false, isWritable: true }];
const data = Buffer.alloc(exports.interestBearingMintInitializeInstructionData.span);
exports.interestBearingMintInitializeInstructionData.encode({
instruction: instructions_1.TokenInstruction.InterestBearingMintExtension,
instruction: types_js_1.TokenInstruction.InterestBearingMintExtension,
interestBearingMintInstruction: InterestBearingMintInstruction.Initialize,

@@ -62,4 +62,4 @@ rateAuthority,

*/
function createUpdateRateInterestBearingMintInstruction(mint, rateAuthority, rate, multiSigners = [], programId = constants_1.TOKEN_2022_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createUpdateRateInterestBearingMintInstruction(mint, rateAuthority, rate, multiSigners = [], programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: mint, isSigner: false, isWritable: true },

@@ -70,3 +70,3 @@ { pubkey: rateAuthority, isSigner: !multiSigners.length, isWritable: false },

exports.interestBearingMintUpdateRateInstructionData.encode({
instruction: instructions_1.TokenInstruction.InterestBearingMintExtension,
instruction: types_js_1.TokenInstruction.InterestBearingMintExtension,
interestBearingMintInstruction: InterestBearingMintInstruction.UpdateRate,

@@ -73,0 +73,0 @@ rate,

@@ -6,3 +6,3 @@ "use strict";

const buffer_layout_utils_1 = require("@solana/buffer-layout-utils");
const extensionType_1 = require("../extensionType");
const extensionType_js_1 = require("../extensionType.js");
exports.InterestBearingMintConfigStateLayout = (0, buffer_layout_1.struct)([

@@ -17,3 +17,3 @@ (0, buffer_layout_utils_1.publicKey)('rateAuthority'),

function getInterestBearingMintConfigState(mint) {
const extensionData = (0, extensionType_1.getExtensionData)(extensionType_1.ExtensionType.InterestBearingMint, mint.tlvData);
const extensionData = (0, extensionType_js_1.getExtensionData)(extensionType_js_1.ExtensionType.InterestBearingMint, mint.tlvData);
if (extensionData !== null) {

@@ -20,0 +20,0 @@ return exports.InterestBearingMintConfigStateLayout.decode(extensionData);

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../../constants");
const instructions_1 = require("./instructions");
const internal_1 = require("../../actions/internal");
const internal_js_1 = require("../../actions/internal.js");
const constants_js_1 = require("../../constants.js");
const instructions_js_1 = require("./instructions.js");
/**

@@ -31,6 +31,6 @@ * Enable memo transfers on the given account

*/
function enableRequiredMemoTransfers(connection, payer, account, owner, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function enableRequiredMemoTransfers(connection, payer, account, owner, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [ownerPublicKey, signers] = (0, internal_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_1.createEnableRequiredMemoTransfersInstruction)(account, ownerPublicKey, signers, programId));
const [ownerPublicKey, signers] = (0, internal_js_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_js_1.createEnableRequiredMemoTransfersInstruction)(account, ownerPublicKey, signers, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -53,6 +53,6 @@ });

*/
function disableRequiredMemoTransfers(connection, payer, account, owner, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function disableRequiredMemoTransfers(connection, payer, account, owner, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [ownerPublicKey, signers] = (0, internal_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_1.createDisableRequiredMemoTransfersInstruction)(account, ownerPublicKey, signers, programId));
const [ownerPublicKey, signers] = (0, internal_js_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_js_1.createDisableRequiredMemoTransfersInstruction)(account, ownerPublicKey, signers, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -59,0 +59,0 @@ });

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,5 +17,5 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./actions"), exports);
__exportStar(require("./instructions"), exports);
__exportStar(require("./state"), exports);
__exportStar(require("./actions.js"), exports);
__exportStar(require("./instructions.js"), exports);
__exportStar(require("./state.js"), exports);
//# sourceMappingURL=index.js.map

@@ -6,5 +6,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const types_1 = require("../../instructions/types");
const constants_1 = require("../../constants");
const errors_1 = require("../../errors");
const constants_js_1 = require("../../constants.js");
const errors_js_1 = require("../../errors.js");
const types_js_1 = require("../../instructions/types.js");
var MemoTransferInstruction;

@@ -30,3 +30,3 @@ (function (MemoTransferInstruction) {

*/
function createEnableRequiredMemoTransfersInstruction(account, authority, multiSigners = [], programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function createEnableRequiredMemoTransfersInstruction(account, authority, multiSigners = [], programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return createMemoTransferInstruction(/* enable */ true, account, authority, multiSigners, programId);

@@ -45,3 +45,3 @@ }

*/
function createDisableRequiredMemoTransfersInstruction(account, authority, multiSigners = [], programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function createDisableRequiredMemoTransfersInstruction(account, authority, multiSigners = [], programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return createMemoTransferInstruction(/* enable */ false, account, authority, multiSigners, programId);

@@ -51,4 +51,4 @@ }

function createMemoTransferInstruction(enable, account, authority, multiSigners, programId) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}

@@ -62,3 +62,3 @@ const keys = [{ pubkey: account, isSigner: false, isWritable: true }];

exports.memoTransferInstructionData.encode({
instruction: types_1.TokenInstruction.MemoTransferExtension,
instruction: types_js_1.TokenInstruction.MemoTransferExtension,
memoTransferInstruction: enable ? MemoTransferInstruction.Enable : MemoTransferInstruction.Disable,

@@ -65,0 +65,0 @@ }, data);

@@ -6,3 +6,3 @@ "use strict";

const buffer_layout_utils_1 = require("@solana/buffer-layout-utils");
const extensionType_1 = require("../extensionType");
const extensionType_js_1 = require("../extensionType.js");
/** Buffer layout for de/serializing a transfer fee config extension */

@@ -12,3 +12,3 @@ exports.MemoTransferLayout = (0, buffer_layout_1.struct)([(0, buffer_layout_utils_1.bool)('requireIncomingTransferMemos')]);

function getMemoTransfer(account) {
const extensionData = (0, extensionType_1.getExtensionData)(extensionType_1.ExtensionType.MemoTransfer, account.tlvData);
const extensionData = (0, extensionType_js_1.getExtensionData)(extensionType_js_1.ExtensionType.MemoTransfer, account.tlvData);
if (extensionData !== null) {

@@ -15,0 +15,0 @@ return exports.MemoTransferLayout.decode(extensionData);

@@ -6,3 +6,3 @@ "use strict";

const buffer_layout_utils_1 = require("@solana/buffer-layout-utils");
const extensionType_1 = require("./extensionType");
const extensionType_js_1 = require("./extensionType.js");
/** Buffer layout for de/serializing a mint */

@@ -12,3 +12,3 @@ exports.MintCloseAuthorityLayout = (0, buffer_layout_1.struct)([(0, buffer_layout_utils_1.publicKey)('closeAuthority')]);

function getMintCloseAuthority(mint) {
const extensionData = (0, extensionType_1.getExtensionData)(extensionType_1.ExtensionType.MintCloseAuthority, mint.tlvData);
const extensionData = (0, extensionType_js_1.getExtensionData)(extensionType_js_1.ExtensionType.MintCloseAuthority, mint.tlvData);
if (extensionData !== null) {

@@ -15,0 +15,0 @@ return exports.MintCloseAuthorityLayout.decode(extensionData);

@@ -5,3 +5,3 @@ "use strict";

const buffer_layout_1 = require("@solana/buffer-layout");
const extensionType_1 = require("./extensionType");
const extensionType_js_1 = require("./extensionType.js");
/** Buffer layout for de/serializing an account */

@@ -11,3 +11,3 @@ exports.NonTransferableLayout = (0, buffer_layout_1.struct)([]);

function getNonTransferable(mint) {
const extensionData = (0, extensionType_1.getExtensionData)(extensionType_1.ExtensionType.NonTransferable, mint.tlvData);
const extensionData = (0, extensionType_js_1.getExtensionData)(extensionType_js_1.ExtensionType.NonTransferable, mint.tlvData);
if (extensionData !== null) {

@@ -14,0 +14,0 @@ return exports.NonTransferableLayout.decode(extensionData);

@@ -14,5 +14,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../../constants");
const instructions_1 = require("./instructions");
const internal_1 = require("../../actions/internal");
const internal_js_1 = require("../../actions/internal.js");
const constants_js_1 = require("../../constants.js");
const instructions_js_1 = require("./instructions.js");
/**

@@ -35,6 +35,6 @@ * Transfer tokens from one account to another, asserting the transfer fee, token mint, and decimals

*/
function transferCheckedWithFee(connection, payer, source, mint, destination, owner, amount, decimals, fee, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function transferCheckedWithFee(connection, payer, source, mint, destination, owner, amount, decimals, fee, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [ownerPublicKey, signers] = (0, internal_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_1.createTransferCheckedWithFeeInstruction)(source, mint, destination, ownerPublicKey, amount, decimals, fee, multiSigners, programId));
const [ownerPublicKey, signers] = (0, internal_js_1.getSigners)(owner, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_js_1.createTransferCheckedWithFeeInstruction)(source, mint, destination, ownerPublicKey, amount, decimals, fee, multiSigners, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -58,6 +58,6 @@ });

*/
function withdrawWithheldTokensFromMint(connection, payer, mint, destination, authority, multiSigners = [], confirmOptions, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function withdrawWithheldTokensFromMint(connection, payer, mint, destination, authority, multiSigners = [], confirmOptions, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [authorityPublicKey, signers] = (0, internal_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_1.createWithdrawWithheldTokensFromMintInstruction)(mint, destination, authorityPublicKey, signers, programId));
const [authorityPublicKey, signers] = (0, internal_js_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_js_1.createWithdrawWithheldTokensFromMintInstruction)(mint, destination, authorityPublicKey, signers, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -82,6 +82,6 @@ });

*/
function withdrawWithheldTokensFromAccounts(connection, payer, mint, destination, authority, multiSigners, sources, confirmOptions, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function withdrawWithheldTokensFromAccounts(connection, payer, mint, destination, authority, multiSigners, sources, confirmOptions, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const [authorityPublicKey, signers] = (0, internal_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_1.createWithdrawWithheldTokensFromAccountsInstruction)(mint, destination, authorityPublicKey, signers, sources, programId));
const [authorityPublicKey, signers] = (0, internal_js_1.getSigners)(authority, multiSigners);
const transaction = new web3_js_1.Transaction().add((0, instructions_js_1.createWithdrawWithheldTokensFromAccountsInstruction)(mint, destination, authorityPublicKey, signers, sources, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer, ...signers], confirmOptions);

@@ -103,5 +103,5 @@ });

*/
function harvestWithheldTokensToMint(connection, payer, mint, sources, confirmOptions, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
function harvestWithheldTokensToMint(connection, payer, mint, sources, confirmOptions, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
const transaction = new web3_js_1.Transaction().add((0, instructions_1.createHarvestWithheldTokensToMintInstruction)(mint, sources, programId));
const transaction = new web3_js_1.Transaction().add((0, instructions_js_1.createHarvestWithheldTokensToMintInstruction)(mint, sources, programId));
return yield (0, web3_js_1.sendAndConfirmTransaction)(connection, transaction, [payer], confirmOptions);

@@ -108,0 +108,0 @@ });

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,5 +17,5 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./actions"), exports);
__exportStar(require("./instructions"), exports);
__exportStar(require("./state"), exports);
__exportStar(require("./actions.js"), exports);
__exportStar(require("./instructions.js"), exports);
__exportStar(require("./state.js"), exports);
//# sourceMappingURL=index.js.map

@@ -7,5 +7,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const errors_1 = require("../../errors");
const types_1 = require("../../instructions/types");
const constants_1 = require("../../constants");
const constants_js_1 = require("../../constants.js");
const errors_js_1 = require("../../errors.js");
const types_js_1 = require("../../instructions/types.js");
var TransferFeeInstruction;

@@ -43,5 +43,5 @@ (function (TransferFeeInstruction) {

*/
function createInitializeTransferFeeConfigInstruction(mint, transferFeeConfigAuthority, withdrawWithheldAuthority, transferFeeBasisPoints, maximumFee, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
function createInitializeTransferFeeConfigInstruction(mint, transferFeeConfigAuthority, withdrawWithheldAuthority, transferFeeBasisPoints, maximumFee, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}

@@ -51,3 +51,3 @@ const keys = [{ pubkey: mint, isSigner: false, isWritable: true }];

exports.initializeTransferFeeConfigInstructionData.encode({
instruction: types_1.TokenInstruction.TransferFeeExtension,
instruction: types_js_1.TokenInstruction.TransferFeeExtension,
transferFeeInstruction: TransferFeeInstruction.InitializeTransferFeeConfig,

@@ -74,11 +74,11 @@ transferFeeConfigAuthorityOption: transferFeeConfigAuthority ? 1 : 0,

if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.initializeTransferFeeConfigInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { mint }, data, } = decodeInitializeTransferFeeConfigInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.TransferFeeExtension ||
if (data.instruction !== types_js_1.TokenInstruction.TransferFeeExtension ||
data.transferFeeInstruction !== TransferFeeInstruction.InitializeTransferFeeConfig)
throw new errors_1.TokenInvalidInstructionTypeError();
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!mint)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
return {

@@ -140,9 +140,9 @@ programId,

*/
function createTransferCheckedWithFeeInstruction(source, mint, destination, authority, amount, decimals, fee, multiSigners = [], programId = constants_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
function createTransferCheckedWithFeeInstruction(source, mint, destination, authority, amount, decimals, fee, multiSigners = [], programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}
const data = Buffer.alloc(exports.transferCheckedWithFeeInstructionData.span);
exports.transferCheckedWithFeeInstructionData.encode({
instruction: types_1.TokenInstruction.TransferFeeExtension,
instruction: types_js_1.TokenInstruction.TransferFeeExtension,
transferFeeInstruction: TransferFeeInstruction.TransferCheckedWithFee,

@@ -174,11 +174,11 @@ amount,

if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.transferCheckedWithFeeInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { source, mint, destination, authority, signers }, data, } = decodeTransferCheckedWithFeeInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.TransferFeeExtension ||
if (data.instruction !== types_js_1.TokenInstruction.TransferFeeExtension ||
data.transferFeeInstruction !== TransferFeeInstruction.TransferCheckedWithFee)
throw new errors_1.TokenInvalidInstructionTypeError();
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!mint)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
return {

@@ -240,9 +240,9 @@ programId,

*/
function createWithdrawWithheldTokensFromMintInstruction(mint, destination, authority, signers = [], programId = constants_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
function createWithdrawWithheldTokensFromMintInstruction(mint, destination, authority, signers = [], programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}
const data = Buffer.alloc(exports.withdrawWithheldTokensFromMintInstructionData.span);
exports.withdrawWithheldTokensFromMintInstructionData.encode({
instruction: types_1.TokenInstruction.TransferFeeExtension,
instruction: types_js_1.TokenInstruction.TransferFeeExtension,
transferFeeInstruction: TransferFeeInstruction.WithdrawWithheldTokensFromMint,

@@ -268,11 +268,11 @@ }, data);

if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.withdrawWithheldTokensFromMintInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { mint, destination, authority, signers }, data, } = decodeWithdrawWithheldTokensFromMintInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.TransferFeeExtension ||
if (data.instruction !== types_js_1.TokenInstruction.TransferFeeExtension ||
data.transferFeeInstruction !== TransferFeeInstruction.WithdrawWithheldTokensFromMint)
throw new errors_1.TokenInvalidInstructionTypeError();
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!mint)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
return {

@@ -331,9 +331,9 @@ programId,

*/
function createWithdrawWithheldTokensFromAccountsInstruction(mint, destination, authority, signers, sources, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
function createWithdrawWithheldTokensFromAccountsInstruction(mint, destination, authority, signers, sources, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}
const data = Buffer.alloc(exports.withdrawWithheldTokensFromAccountsInstructionData.span);
exports.withdrawWithheldTokensFromAccountsInstructionData.encode({
instruction: types_1.TokenInstruction.TransferFeeExtension,
instruction: types_js_1.TokenInstruction.TransferFeeExtension,
transferFeeInstruction: TransferFeeInstruction.WithdrawWithheldTokensFromAccounts,

@@ -363,11 +363,11 @@ numTokenAccounts: sources.length,

if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.withdrawWithheldTokensFromAccountsInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { mint, destination, authority, signers, sources }, data, } = decodeWithdrawWithheldTokensFromAccountsInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.TransferFeeExtension ||
if (data.instruction !== types_js_1.TokenInstruction.TransferFeeExtension ||
data.transferFeeInstruction !== TransferFeeInstruction.WithdrawWithheldTokensFromAccounts)
throw new errors_1.TokenInvalidInstructionTypeError();
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!mint)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
return {

@@ -432,9 +432,9 @@ programId,

*/
function createHarvestWithheldTokensToMintInstruction(mint, sources, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
function createHarvestWithheldTokensToMintInstruction(mint, sources, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}
const data = Buffer.alloc(exports.harvestWithheldTokensToMintInstructionData.span);
exports.harvestWithheldTokensToMintInstructionData.encode({
instruction: types_1.TokenInstruction.TransferFeeExtension,
instruction: types_js_1.TokenInstruction.TransferFeeExtension,
transferFeeInstruction: TransferFeeInstruction.HarvestWithheldTokensToMint,

@@ -460,11 +460,11 @@ }, data);

if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.harvestWithheldTokensToMintInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { mint, sources }, data, } = decodeHarvestWithheldTokensToMintInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.TransferFeeExtension ||
if (data.instruction !== types_js_1.TokenInstruction.TransferFeeExtension ||
data.transferFeeInstruction !== TransferFeeInstruction.HarvestWithheldTokensToMint)
throw new errors_1.TokenInvalidInstructionTypeError();
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!mint)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
return {

@@ -471,0 +471,0 @@ programId,

@@ -6,3 +6,3 @@ "use strict";

const buffer_layout_utils_1 = require("@solana/buffer-layout-utils");
const extensionType_1 = require("../extensionType");
const extensionType_js_1 = require("../extensionType.js");
exports.MAX_FEE_BASIS_POINTS = 10000;

@@ -28,3 +28,3 @@ exports.ONE_IN_BASIS_POINTS = exports.MAX_FEE_BASIS_POINTS;

function getTransferFeeConfig(mint) {
const extensionData = (0, extensionType_1.getExtensionData)(extensionType_1.ExtensionType.TransferFeeConfig, mint.tlvData);
const extensionData = (0, extensionType_js_1.getExtensionData)(extensionType_js_1.ExtensionType.TransferFeeConfig, mint.tlvData);
if (extensionData !== null) {

@@ -39,3 +39,3 @@ return exports.TransferFeeConfigLayout.decode(extensionData);

function getTransferFeeAmount(account) {
const extensionData = (0, extensionType_1.getExtensionData)(extensionType_1.ExtensionType.TransferFeeAmount, account.tlvData);
const extensionData = (0, extensionType_js_1.getExtensionData)(extensionType_js_1.ExtensionType.TransferFeeAmount, account.tlvData);
if (extensionData !== null) {

@@ -42,0 +42,0 @@ return exports.TransferFeeAmountLayout.decode(extensionData);

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,8 +17,8 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./extensions/index"), exports);
__exportStar(require("./instructions/index"), exports);
__exportStar(require("./state/index"), exports);
__exportStar(require("./actions/index"), exports);
__exportStar(require("./constants"), exports);
__exportStar(require("./errors"), exports);
__exportStar(require("./extensions/index.js"), exports);
__exportStar(require("./instructions/index.js"), exports);
__exportStar(require("./state/index.js"), exports);
__exportStar(require("./actions/index.js"), exports);
__exportStar(require("./constants.js"), exports);
__exportStar(require("./errors.js"), exports);
//# sourceMappingURL=index.js.map

@@ -7,6 +7,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -26,4 +26,4 @@ exports.approveInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction'), (0, buffer_layout_utils_1.u64)('amount')]);

*/
function createApproveInstruction(account, delegate, owner, amount, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createApproveInstruction(account, delegate, owner, amount, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: account, isSigner: false, isWritable: true },

@@ -34,3 +34,3 @@ { pubkey: delegate, isSigner: false, isWritable: false },

exports.approveInstructionData.encode({
instruction: types_1.TokenInstruction.Approve,
instruction: types_js_1.TokenInstruction.Approve,
amount: BigInt(amount),

@@ -49,12 +49,12 @@ }, data);

*/
function decodeApproveInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeApproveInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.approveInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, delegate, owner, multiSigners }, data, } = decodeApproveInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.Approve)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.Approve)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !delegate || !owner)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -61,0 +61,0 @@ return {

@@ -7,6 +7,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -32,4 +32,4 @@ exports.approveCheckedInstructionData = (0, buffer_layout_1.struct)([

*/
function createApproveCheckedInstruction(account, mint, delegate, owner, amount, decimals, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createApproveCheckedInstruction(account, mint, delegate, owner, amount, decimals, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: account, isSigner: false, isWritable: true },

@@ -41,3 +41,3 @@ { pubkey: mint, isSigner: false, isWritable: false },

exports.approveCheckedInstructionData.encode({
instruction: types_1.TokenInstruction.ApproveChecked,
instruction: types_js_1.TokenInstruction.ApproveChecked,
amount: BigInt(amount),

@@ -57,12 +57,12 @@ decimals,

*/
function decodeApproveCheckedInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeApproveCheckedInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.approveCheckedInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, mint, delegate, owner, multiSigners }, data, } = decodeApproveCheckedInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.ApproveChecked)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.ApproveChecked)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !mint || !delegate || !owner)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -69,0 +69,0 @@ return {

@@ -5,3 +5,3 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const constants_js_1 = require("../constants.js");
/**

@@ -19,3 +19,3 @@ * Construct an AssociatedTokenAccount instruction

*/
function createAssociatedTokenAccountInstruction(payer, associatedToken, owner, mint, programId = constants_1.TOKEN_PROGRAM_ID, associatedTokenProgramId = constants_1.ASSOCIATED_TOKEN_PROGRAM_ID) {
function createAssociatedTokenAccountInstruction(payer, associatedToken, owner, mint, programId = constants_js_1.TOKEN_PROGRAM_ID, associatedTokenProgramId = constants_js_1.ASSOCIATED_TOKEN_PROGRAM_ID) {
const keys = [

@@ -22,0 +22,0 @@ { pubkey: payer, isSigner: true, isWritable: true },

@@ -7,6 +7,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -26,4 +26,4 @@ exports.burnInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction'), (0, buffer_layout_utils_1.u64)('amount')]);

*/
function createBurnInstruction(account, mint, owner, amount, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createBurnInstruction(account, mint, owner, amount, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: account, isSigner: false, isWritable: true },

@@ -34,3 +34,3 @@ { pubkey: mint, isSigner: false, isWritable: true },

exports.burnInstructionData.encode({
instruction: types_1.TokenInstruction.Burn,
instruction: types_js_1.TokenInstruction.Burn,
amount: BigInt(amount),

@@ -49,12 +49,12 @@ }, data);

*/
function decodeBurnInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeBurnInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.burnInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, mint, owner, multiSigners }, data, } = decodeBurnInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.Burn)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.Burn)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !mint || !owner)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -61,0 +61,0 @@ return {

@@ -7,6 +7,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -31,4 +31,4 @@ exports.burnCheckedInstructionData = (0, buffer_layout_1.struct)([

*/
function createBurnCheckedInstruction(account, mint, owner, amount, decimals, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createBurnCheckedInstruction(account, mint, owner, amount, decimals, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: account, isSigner: false, isWritable: true },

@@ -39,3 +39,3 @@ { pubkey: mint, isSigner: false, isWritable: true },

exports.burnCheckedInstructionData.encode({
instruction: types_1.TokenInstruction.BurnChecked,
instruction: types_js_1.TokenInstruction.BurnChecked,
amount: BigInt(amount),

@@ -55,12 +55,12 @@ decimals,

*/
function decodeBurnCheckedInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeBurnCheckedInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.burnCheckedInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, mint, owner, multiSigners }, data, } = decodeBurnCheckedInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.BurnChecked)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.BurnChecked)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !mint || !owner)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -67,0 +67,0 @@ return {

@@ -6,6 +6,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -24,4 +24,4 @@ exports.closeAccountInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction')]);

*/
function createCloseAccountInstruction(account, destination, authority, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createCloseAccountInstruction(account, destination, authority, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: account, isSigner: false, isWritable: true },

@@ -31,3 +31,3 @@ { pubkey: destination, isSigner: false, isWritable: true },

const data = Buffer.alloc(exports.closeAccountInstructionData.span);
exports.closeAccountInstructionData.encode({ instruction: types_1.TokenInstruction.CloseAccount }, data);
exports.closeAccountInstructionData.encode({ instruction: types_js_1.TokenInstruction.CloseAccount }, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -44,12 +44,12 @@ }

*/
function decodeCloseAccountInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeCloseAccountInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.closeAccountInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, destination, authority, multiSigners }, data, } = decodeCloseAccountInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.CloseAccount)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.CloseAccount)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !destination || !authority)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -56,0 +56,0 @@ return {

@@ -6,6 +6,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const types_1 = require("./types");
const errors_1 = require("../errors");
const constants_2 = require("../constants");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -23,5 +22,5 @@ exports.createNativeMintInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction')]);

*/
function createCreateNativeMintInstruction(payer, nativeMintId = constants_1.NATIVE_MINT_2022, programId = constants_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_2.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
function createCreateNativeMintInstruction(payer, nativeMintId = constants_js_1.NATIVE_MINT_2022, programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}

@@ -34,3 +33,3 @@ const keys = [

const data = Buffer.alloc(exports.createNativeMintInstructionData.span);
exports.createNativeMintInstructionData.encode({ instruction: types_1.TokenInstruction.CreateNativeMint }, data);
exports.createNativeMintInstructionData.encode({ instruction: types_js_1.TokenInstruction.CreateNativeMint }, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -37,0 +36,0 @@ }

@@ -5,75 +5,75 @@ "use strict";

const buffer_layout_1 = require("@solana/buffer-layout");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const approve_1 = require("./approve");
const approveChecked_1 = require("./approveChecked");
const burn_1 = require("./burn");
const burnChecked_1 = require("./burnChecked");
const closeAccount_1 = require("./closeAccount");
const freezeAccount_1 = require("./freezeAccount");
const initializeAccount_1 = require("./initializeAccount");
const initializeAccount2_1 = require("./initializeAccount2");
const initializeAccount3_1 = require("./initializeAccount3");
const initializeMint_1 = require("./initializeMint");
const initializeMultisig_1 = require("./initializeMultisig");
const mintTo_1 = require("./mintTo");
const mintToChecked_1 = require("./mintToChecked");
const revoke_1 = require("./revoke");
const setAuthority_1 = require("./setAuthority");
const syncNative_1 = require("./syncNative");
const thawAccount_1 = require("./thawAccount");
const transfer_1 = require("./transfer");
const transferChecked_1 = require("./transferChecked");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const approve_js_1 = require("./approve.js");
const approveChecked_js_1 = require("./approveChecked.js");
const burn_js_1 = require("./burn.js");
const burnChecked_js_1 = require("./burnChecked.js");
const closeAccount_js_1 = require("./closeAccount.js");
const freezeAccount_js_1 = require("./freezeAccount.js");
const initializeAccount_js_1 = require("./initializeAccount.js");
const initializeAccount2_js_1 = require("./initializeAccount2.js");
const initializeAccount3_js_1 = require("./initializeAccount3.js");
const initializeMint_js_1 = require("./initializeMint.js");
const initializeMultisig_js_1 = require("./initializeMultisig.js");
const mintTo_js_1 = require("./mintTo.js");
const mintToChecked_js_1 = require("./mintToChecked.js");
const revoke_js_1 = require("./revoke.js");
const setAuthority_js_1 = require("./setAuthority.js");
const syncNative_js_1 = require("./syncNative.js");
const thawAccount_js_1 = require("./thawAccount.js");
const transfer_js_1 = require("./transfer.js");
const transferChecked_js_1 = require("./transferChecked.js");
const types_js_1 = require("./types.js");
/** TODO: docs */
function decodeInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.data.length)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const type = (0, buffer_layout_1.u8)().decode(instruction.data);
if (type === types_1.TokenInstruction.InitializeMint)
return (0, initializeMint_1.decodeInitializeMintInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.InitializeAccount)
return (0, initializeAccount_1.decodeInitializeAccountInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.InitializeMultisig)
return (0, initializeMultisig_1.decodeInitializeMultisigInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.Transfer)
return (0, transfer_1.decodeTransferInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.Approve)
return (0, approve_1.decodeApproveInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.Revoke)
return (0, revoke_1.decodeRevokeInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.SetAuthority)
return (0, setAuthority_1.decodeSetAuthorityInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.MintTo)
return (0, mintTo_1.decodeMintToInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.Burn)
return (0, burn_1.decodeBurnInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.CloseAccount)
return (0, closeAccount_1.decodeCloseAccountInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.FreezeAccount)
return (0, freezeAccount_1.decodeFreezeAccountInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.ThawAccount)
return (0, thawAccount_1.decodeThawAccountInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.TransferChecked)
return (0, transferChecked_1.decodeTransferCheckedInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.ApproveChecked)
return (0, approveChecked_1.decodeApproveCheckedInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.MintToChecked)
return (0, mintToChecked_1.decodeMintToCheckedInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.BurnChecked)
return (0, burnChecked_1.decodeBurnCheckedInstruction)(instruction, programId);
if (type === types_1.TokenInstruction.InitializeAccount2)
return (0, initializeAccount2_1.decodeInitializeAccount2Instruction)(instruction, programId);
if (type === types_1.TokenInstruction.SyncNative)
return (0, syncNative_1.decodeSyncNativeInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.InitializeMint)
return (0, initializeMint_js_1.decodeInitializeMintInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.InitializeAccount)
return (0, initializeAccount_js_1.decodeInitializeAccountInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.InitializeMultisig)
return (0, initializeMultisig_js_1.decodeInitializeMultisigInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.Transfer)
return (0, transfer_js_1.decodeTransferInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.Approve)
return (0, approve_js_1.decodeApproveInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.Revoke)
return (0, revoke_js_1.decodeRevokeInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.SetAuthority)
return (0, setAuthority_js_1.decodeSetAuthorityInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.MintTo)
return (0, mintTo_js_1.decodeMintToInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.Burn)
return (0, burn_js_1.decodeBurnInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.CloseAccount)
return (0, closeAccount_js_1.decodeCloseAccountInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.FreezeAccount)
return (0, freezeAccount_js_1.decodeFreezeAccountInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.ThawAccount)
return (0, thawAccount_js_1.decodeThawAccountInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.TransferChecked)
return (0, transferChecked_js_1.decodeTransferCheckedInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.ApproveChecked)
return (0, approveChecked_js_1.decodeApproveCheckedInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.MintToChecked)
return (0, mintToChecked_js_1.decodeMintToCheckedInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.BurnChecked)
return (0, burnChecked_js_1.decodeBurnCheckedInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.InitializeAccount2)
return (0, initializeAccount2_js_1.decodeInitializeAccount2Instruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.SyncNative)
return (0, syncNative_js_1.decodeSyncNativeInstruction)(instruction, programId);
// TODO: implement
if (type === types_1.TokenInstruction.InitializeAccount3)
return (0, initializeAccount3_1.decodeInitializeAccount3Instruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.InitializeAccount3)
return (0, initializeAccount3_js_1.decodeInitializeAccount3Instruction)(instruction, programId);
// TODO: implement
if (type === types_1.TokenInstruction.InitializeMultisig2)
throw new errors_1.TokenInvalidInstructionTypeError();
if (type === types_js_1.TokenInstruction.InitializeMultisig2)
throw new errors_js_1.TokenInvalidInstructionTypeError();
// TODO: implement
if (type === types_1.TokenInstruction.InitializeMint2)
throw new errors_1.TokenInvalidInstructionTypeError();
throw new errors_1.TokenInvalidInstructionTypeError();
if (type === types_js_1.TokenInstruction.InitializeMint2)
throw new errors_js_1.TokenInvalidInstructionTypeError();
throw new errors_js_1.TokenInvalidInstructionTypeError();
}

@@ -83,3 +83,3 @@ exports.decodeInstruction = decodeInstruction;

function isInitializeMintInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.InitializeMint;
return decoded.data.instruction === types_js_1.TokenInstruction.InitializeMint;
}

@@ -89,3 +89,3 @@ exports.isInitializeMintInstruction = isInitializeMintInstruction;

function isInitializeAccountInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.InitializeAccount;
return decoded.data.instruction === types_js_1.TokenInstruction.InitializeAccount;
}

@@ -95,3 +95,3 @@ exports.isInitializeAccountInstruction = isInitializeAccountInstruction;

function isInitializeMultisigInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.InitializeMultisig;
return decoded.data.instruction === types_js_1.TokenInstruction.InitializeMultisig;
}

@@ -101,3 +101,3 @@ exports.isInitializeMultisigInstruction = isInitializeMultisigInstruction;

function isTransferInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.Transfer;
return decoded.data.instruction === types_js_1.TokenInstruction.Transfer;
}

@@ -107,3 +107,3 @@ exports.isTransferInstruction = isTransferInstruction;

function isApproveInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.Approve;
return decoded.data.instruction === types_js_1.TokenInstruction.Approve;
}

@@ -113,3 +113,3 @@ exports.isApproveInstruction = isApproveInstruction;

function isRevokeInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.Revoke;
return decoded.data.instruction === types_js_1.TokenInstruction.Revoke;
}

@@ -119,3 +119,3 @@ exports.isRevokeInstruction = isRevokeInstruction;

function isSetAuthorityInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.SetAuthority;
return decoded.data.instruction === types_js_1.TokenInstruction.SetAuthority;
}

@@ -125,3 +125,3 @@ exports.isSetAuthorityInstruction = isSetAuthorityInstruction;

function isMintToInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.MintTo;
return decoded.data.instruction === types_js_1.TokenInstruction.MintTo;
}

@@ -131,3 +131,3 @@ exports.isMintToInstruction = isMintToInstruction;

function isBurnInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.Burn;
return decoded.data.instruction === types_js_1.TokenInstruction.Burn;
}

@@ -137,3 +137,3 @@ exports.isBurnInstruction = isBurnInstruction;

function isCloseAccountInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.CloseAccount;
return decoded.data.instruction === types_js_1.TokenInstruction.CloseAccount;
}

@@ -143,3 +143,3 @@ exports.isCloseAccountInstruction = isCloseAccountInstruction;

function isFreezeAccountInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.FreezeAccount;
return decoded.data.instruction === types_js_1.TokenInstruction.FreezeAccount;
}

@@ -149,3 +149,3 @@ exports.isFreezeAccountInstruction = isFreezeAccountInstruction;

function isThawAccountInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.ThawAccount;
return decoded.data.instruction === types_js_1.TokenInstruction.ThawAccount;
}

@@ -155,3 +155,3 @@ exports.isThawAccountInstruction = isThawAccountInstruction;

function isTransferCheckedInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.TransferChecked;
return decoded.data.instruction === types_js_1.TokenInstruction.TransferChecked;
}

@@ -161,3 +161,3 @@ exports.isTransferCheckedInstruction = isTransferCheckedInstruction;

function isApproveCheckedInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.ApproveChecked;
return decoded.data.instruction === types_js_1.TokenInstruction.ApproveChecked;
}

@@ -167,3 +167,3 @@ exports.isApproveCheckedInstruction = isApproveCheckedInstruction;

function isMintToCheckedInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.MintToChecked;
return decoded.data.instruction === types_js_1.TokenInstruction.MintToChecked;
}

@@ -173,3 +173,3 @@ exports.isMintToCheckedInstruction = isMintToCheckedInstruction;

function isBurnCheckedInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.BurnChecked;
return decoded.data.instruction === types_js_1.TokenInstruction.BurnChecked;
}

@@ -179,3 +179,3 @@ exports.isBurnCheckedInstruction = isBurnCheckedInstruction;

function isInitializeAccount2Instruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.InitializeAccount2;
return decoded.data.instruction === types_js_1.TokenInstruction.InitializeAccount2;
}

@@ -185,3 +185,3 @@ exports.isInitializeAccount2Instruction = isInitializeAccount2Instruction;

function isSyncNativeInstruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.SyncNative;
return decoded.data.instruction === types_js_1.TokenInstruction.SyncNative;
}

@@ -191,3 +191,3 @@ exports.isSyncNativeInstruction = isSyncNativeInstruction;

function isInitializeAccount3Instruction(decoded) {
return decoded.data.instruction === types_1.TokenInstruction.InitializeAccount3;
return decoded.data.instruction === types_js_1.TokenInstruction.InitializeAccount3;
}

@@ -194,0 +194,0 @@ exports.isInitializeAccount3Instruction = isInitializeAccount3Instruction;

@@ -6,6 +6,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -24,4 +24,4 @@ exports.freezeAccountInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction')]);

*/
function createFreezeAccountInstruction(account, mint, authority, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createFreezeAccountInstruction(account, mint, authority, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: account, isSigner: false, isWritable: true },

@@ -31,3 +31,3 @@ { pubkey: mint, isSigner: false, isWritable: false },

const data = Buffer.alloc(exports.freezeAccountInstructionData.span);
exports.freezeAccountInstructionData.encode({ instruction: types_1.TokenInstruction.FreezeAccount }, data);
exports.freezeAccountInstructionData.encode({ instruction: types_js_1.TokenInstruction.FreezeAccount }, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -44,12 +44,12 @@ }

*/
function decodeFreezeAccountInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeFreezeAccountInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.freezeAccountInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, mint, authority, multiSigners }, data, } = decodeFreezeAccountInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.FreezeAccount)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.FreezeAccount)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !mint || !authority)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -56,0 +56,0 @@ return {

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,31 +17,31 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./types"), exports);
__exportStar(require("./initializeMint"), exports); // 0
__exportStar(require("./initializeAccount"), exports); // 1
__exportStar(require("./initializeMultisig"), exports); // 2
__exportStar(require("./transfer"), exports); // 3
__exportStar(require("./approve"), exports); // 4
__exportStar(require("./revoke"), exports); // 5
__exportStar(require("./setAuthority"), exports); // 6
__exportStar(require("./mintTo"), exports); // 7
__exportStar(require("./burn"), exports); // 8
__exportStar(require("./closeAccount"), exports); // 9
__exportStar(require("./freezeAccount"), exports); // 10
__exportStar(require("./thawAccount"), exports); // 11
__exportStar(require("./transferChecked"), exports); // 12
__exportStar(require("./approveChecked"), exports); // 13
__exportStar(require("./mintToChecked"), exports); // 14
__exportStar(require("./burnChecked"), exports); // 15
__exportStar(require("./initializeAccount2"), exports); // 16
__exportStar(require("./syncNative"), exports); // 17
__exportStar(require("./initializeAccount3"), exports); // 18
__exportStar(require("./initializeMultisig2"), exports); // 19
__exportStar(require("./initializeMint2"), exports); // 20
__exportStar(require("./initializeImmutableOwner"), exports); // 22
__exportStar(require("./initializeMintCloseAuthority"), exports); // 23
__exportStar(require("./reallocate"), exports); // 29
__exportStar(require("./createNativeMint"), exports); // 31
__exportStar(require("./initializeNonTransferableMint"), exports); // 32
__exportStar(require("./decode"), exports);
__exportStar(require("./associatedTokenAccount"), exports);
__exportStar(require("./associatedTokenAccount.js"), exports);
__exportStar(require("./decode.js"), exports);
__exportStar(require("./types.js"), exports);
__exportStar(require("./initializeMint.js"), exports); // 0
__exportStar(require("./initializeAccount.js"), exports); // 1
__exportStar(require("./initializeMultisig.js"), exports); // 2
__exportStar(require("./transfer.js"), exports); // 3
__exportStar(require("./approve.js"), exports); // 4
__exportStar(require("./revoke.js"), exports); // 5
__exportStar(require("./setAuthority.js"), exports); // 6
__exportStar(require("./mintTo.js"), exports); // 7
__exportStar(require("./burn.js"), exports); // 8
__exportStar(require("./closeAccount.js"), exports); // 9
__exportStar(require("./freezeAccount.js"), exports); // 10
__exportStar(require("./thawAccount.js"), exports); // 11
__exportStar(require("./transferChecked.js"), exports); // 12
__exportStar(require("./approveChecked.js"), exports); // 13
__exportStar(require("./mintToChecked.js"), exports); // 14
__exportStar(require("./burnChecked.js"), exports); // 15
__exportStar(require("./initializeAccount2.js"), exports); // 16
__exportStar(require("./syncNative.js"), exports); // 17
__exportStar(require("./initializeAccount3.js"), exports); // 18
__exportStar(require("./initializeMultisig2.js"), exports); // 19
__exportStar(require("./initializeMint2.js"), exports); // 20
__exportStar(require("./initializeImmutableOwner.js"), exports); // 22
__exportStar(require("./initializeMintCloseAuthority.js"), exports); // 23
__exportStar(require("./reallocate.js"), exports); // 29
__exportStar(require("./createNativeMint.js"), exports); // 31
__exportStar(require("./initializeNonTransferableMint.js"), exports); // 32
//# sourceMappingURL=index.js.map

@@ -6,5 +6,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -22,3 +22,3 @@ exports.initializeAccountInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction')]);

*/
function createInitializeAccountInstruction(account, mint, owner, programId = constants_1.TOKEN_PROGRAM_ID) {
function createInitializeAccountInstruction(account, mint, owner, programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = [

@@ -31,3 +31,3 @@ { pubkey: account, isSigner: false, isWritable: true },

const data = Buffer.alloc(exports.initializeAccountInstructionData.span);
exports.initializeAccountInstructionData.encode({ instruction: types_1.TokenInstruction.InitializeAccount }, data);
exports.initializeAccountInstructionData.encode({ instruction: types_js_1.TokenInstruction.InitializeAccount }, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -44,12 +44,12 @@ }

*/
function decodeInitializeAccountInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeInitializeAccountInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.initializeAccountInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, mint, owner, rent }, data, } = decodeInitializeAccountInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.InitializeAccount)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.InitializeAccount)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !mint || !owner || !rent)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -56,0 +56,0 @@ return {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decodeInitializeAccount2InstructionUnchecked = exports.decodeInitializeAccount2Instruction = exports.createInitializeAccount2Instruction = exports.initializeAccount2InstructionData = void 0;
const types_1 = require("./types");
const buffer_layout_1 = require("@solana/buffer-layout");
const buffer_layout_utils_1 = require("@solana/buffer-layout-utils");
const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const types_js_1 = require("./types.js");
exports.initializeAccount2InstructionData = (0, buffer_layout_1.struct)([

@@ -24,3 +24,3 @@ (0, buffer_layout_1.u8)('instruction'),

*/
function createInitializeAccount2Instruction(account, mint, owner, programId = constants_1.TOKEN_PROGRAM_ID) {
function createInitializeAccount2Instruction(account, mint, owner, programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = [

@@ -32,3 +32,3 @@ { pubkey: account, isSigner: false, isWritable: true },

const data = Buffer.alloc(exports.initializeAccount2InstructionData.span);
exports.initializeAccount2InstructionData.encode({ instruction: types_1.TokenInstruction.InitializeAccount2, owner }, data);
exports.initializeAccount2InstructionData.encode({ instruction: types_js_1.TokenInstruction.InitializeAccount2, owner }, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -45,12 +45,12 @@ }

*/
function decodeInitializeAccount2Instruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeInitializeAccount2Instruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.initializeAccount2InstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, mint, rent }, data, } = decodeInitializeAccount2InstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.InitializeAccount2)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.InitializeAccount2)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !mint || !rent)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -57,0 +57,0 @@ return {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decodeInitializeAccount3InstructionUnchecked = exports.decodeInitializeAccount3Instruction = exports.createInitializeAccount3Instruction = exports.initializeAccount3InstructionData = void 0;
const types_1 = require("./types");
const buffer_layout_1 = require("@solana/buffer-layout");
const buffer_layout_utils_1 = require("@solana/buffer-layout-utils");
const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const types_js_1 = require("./types.js");
exports.initializeAccount3InstructionData = (0, buffer_layout_1.struct)([

@@ -24,3 +24,3 @@ (0, buffer_layout_1.u8)('instruction'),

*/
function createInitializeAccount3Instruction(account, mint, owner, programId = constants_1.TOKEN_PROGRAM_ID) {
function createInitializeAccount3Instruction(account, mint, owner, programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = [

@@ -31,3 +31,3 @@ { pubkey: account, isSigner: false, isWritable: true },

const data = Buffer.alloc(exports.initializeAccount3InstructionData.span);
exports.initializeAccount3InstructionData.encode({ instruction: types_1.TokenInstruction.InitializeAccount3, owner }, data);
exports.initializeAccount3InstructionData.encode({ instruction: types_js_1.TokenInstruction.InitializeAccount3, owner }, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -44,12 +44,12 @@ }

*/
function decodeInitializeAccount3Instruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeInitializeAccount3Instruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.initializeAccount3InstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, mint }, data, } = decodeInitializeAccount3InstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.InitializeAccount3)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.InitializeAccount3)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !mint)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -56,0 +56,0 @@ return {

@@ -6,4 +6,4 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const errors_1 = require("../errors");
const types_1 = require("./types");
const errors_js_1 = require("../errors.js");
const types_js_1 = require("./types.js");
/** The struct that represents the instruction data as it is read by the program */

@@ -25,3 +25,3 @@ exports.initializeImmutableOwnerInstructionData = (0, buffer_layout_1.struct)([

exports.initializeImmutableOwnerInstructionData.encode({
instruction: types_1.TokenInstruction.InitializeImmutableOwner,
instruction: types_js_1.TokenInstruction.InitializeImmutableOwner,
}, data);

@@ -41,10 +41,10 @@ return new web3_js_1.TransactionInstruction({ keys, programId, data });

if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.initializeImmutableOwnerInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account }, data, } = decodeInitializeImmutableOwnerInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.InitializeImmutableOwner)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.InitializeImmutableOwner)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
return {

@@ -51,0 +51,0 @@ programId,

@@ -7,5 +7,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -30,3 +30,3 @@ exports.initializeMintInstructionData = (0, buffer_layout_1.struct)([

*/
function createInitializeMintInstruction(mint, decimals, mintAuthority, freezeAuthority, programId = constants_1.TOKEN_PROGRAM_ID) {
function createInitializeMintInstruction(mint, decimals, mintAuthority, freezeAuthority, programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = [

@@ -38,3 +38,3 @@ { pubkey: mint, isSigner: false, isWritable: true },

exports.initializeMintInstructionData.encode({
instruction: types_1.TokenInstruction.InitializeMint,
instruction: types_js_1.TokenInstruction.InitializeMint,
decimals,

@@ -56,12 +56,12 @@ mintAuthority,

*/
function decodeInitializeMintInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeInitializeMintInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.initializeMintInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { mint, rent }, data, } = decodeInitializeMintInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.InitializeMint)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.InitializeMint)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!mint || !rent)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -68,0 +68,0 @@ return {

@@ -7,5 +7,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const errors_1 = require("../errors");
const types_1 = require("./types");
const constants_1 = require("../constants");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -27,4 +27,4 @@ exports.initializeMintCloseAuthorityInstructionData = (0, buffer_layout_1.struct)([

function createInitializeMintCloseAuthorityInstruction(mint, closeAuthority, programId) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}

@@ -34,3 +34,3 @@ const keys = [{ pubkey: mint, isSigner: false, isWritable: true }];

exports.initializeMintCloseAuthorityInstructionData.encode({
instruction: types_1.TokenInstruction.InitializeMintCloseAuthority,
instruction: types_js_1.TokenInstruction.InitializeMintCloseAuthority,
closeAuthorityOption: closeAuthority ? 1 : 0,

@@ -52,10 +52,10 @@ closeAuthority: closeAuthority || new web3_js_1.PublicKey(0),

if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.initializeMintCloseAuthorityInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { mint }, data, } = decodeInitializeMintCloseAuthorityInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.InitializeMintCloseAuthority)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.InitializeMintCloseAuthority)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!mint)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
return {

@@ -62,0 +62,0 @@ programId,

@@ -6,5 +6,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -25,3 +25,3 @@ exports.initializeMultisigInstructionData = (0, buffer_layout_1.struct)([

*/
function createInitializeMultisigInstruction(account, signers, m, programId = constants_1.TOKEN_PROGRAM_ID) {
function createInitializeMultisigInstruction(account, signers, m, programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = [

@@ -36,3 +36,3 @@ { pubkey: account, isSigner: false, isWritable: true },

exports.initializeMultisigInstructionData.encode({
instruction: types_1.TokenInstruction.InitializeMultisig,
instruction: types_js_1.TokenInstruction.InitializeMultisig,
m,

@@ -51,12 +51,12 @@ }, data);

*/
function decodeInitializeMultisigInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeInitializeMultisigInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.initializeMultisigInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, rent, signers }, data, } = decodeInitializeMultisigInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.InitializeMultisig)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.InitializeMultisig)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !rent || !signers.length)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -63,0 +63,0 @@ return {

@@ -6,5 +6,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const types_1 = require("./types");
const errors_1 = require("../errors");
const constants_1 = require("../constants");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const types_js_1 = require("./types.js");
/** The struct that represents the instruction data as it is read by the program */

@@ -23,4 +23,4 @@ exports.initializeNonTransferableMintInstructionData = (0, buffer_layout_1.struct)([

function createInitializeNonTransferableMintInstruction(mint, programId) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}

@@ -30,3 +30,3 @@ const keys = [{ pubkey: mint, isSigner: false, isWritable: true }];

exports.initializeNonTransferableMintInstructionData.encode({
instruction: types_1.TokenInstruction.InitializeNonTransferableMint,
instruction: types_js_1.TokenInstruction.InitializeNonTransferableMint,
}, data);

@@ -33,0 +33,0 @@ return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -7,6 +7,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -26,4 +26,4 @@ exports.mintToInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction'), (0, buffer_layout_utils_1.u64)('amount')]);

*/
function createMintToInstruction(mint, destination, authority, amount, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createMintToInstruction(mint, destination, authority, amount, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: mint, isSigner: false, isWritable: true },

@@ -34,3 +34,3 @@ { pubkey: destination, isSigner: false, isWritable: true },

exports.mintToInstructionData.encode({
instruction: types_1.TokenInstruction.MintTo,
instruction: types_js_1.TokenInstruction.MintTo,
amount: BigInt(amount),

@@ -49,12 +49,12 @@ }, data);

*/
function decodeMintToInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeMintToInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.mintToInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { mint, destination, authority, multiSigners }, data, } = decodeMintToInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.MintTo)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.MintTo)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!mint || !destination || !authority)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -61,0 +61,0 @@ return {

@@ -7,6 +7,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -31,4 +31,4 @@ exports.mintToCheckedInstructionData = (0, buffer_layout_1.struct)([

*/
function createMintToCheckedInstruction(mint, destination, authority, amount, decimals, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createMintToCheckedInstruction(mint, destination, authority, amount, decimals, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: mint, isSigner: false, isWritable: true },

@@ -39,3 +39,3 @@ { pubkey: destination, isSigner: false, isWritable: true },

exports.mintToCheckedInstructionData.encode({
instruction: types_1.TokenInstruction.MintToChecked,
instruction: types_js_1.TokenInstruction.MintToChecked,
amount: BigInt(amount),

@@ -55,12 +55,12 @@ decimals,

*/
function decodeMintToCheckedInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeMintToCheckedInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.mintToCheckedInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { mint, destination, authority, multiSigners }, data, } = decodeMintToCheckedInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.MintToChecked)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.MintToChecked)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!mint || !destination || !authority)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -67,0 +67,0 @@ return {

@@ -6,6 +6,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/**

@@ -23,5 +23,5 @@ * Construct a Reallocate instruction

*/
function createReallocateInstruction(account, payer, extensionTypes, owner, multiSigners = [], programId = constants_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
function createReallocateInstruction(account, payer, extensionTypes, owner, multiSigners = [], programId = constants_js_1.TOKEN_2022_PROGRAM_ID) {
if (!(0, constants_js_1.programSupportsExtensions)(programId)) {
throw new errors_js_1.TokenUnsupportedInstructionError();
}

@@ -33,3 +33,3 @@ const baseKeys = [

];
const keys = (0, internal_1.addSigners)(baseKeys, owner, multiSigners);
const keys = (0, internal_js_1.addSigners)(baseKeys, owner, multiSigners);
const reallocateInstructionData = (0, buffer_layout_1.struct)([

@@ -40,3 +40,3 @@ (0, buffer_layout_1.u8)('instruction'),

const data = Buffer.alloc(reallocateInstructionData.span);
reallocateInstructionData.encode({ instruction: types_1.TokenInstruction.Reallocate, extensionTypes }, data);
reallocateInstructionData.encode({ instruction: types_js_1.TokenInstruction.Reallocate, extensionTypes }, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -43,0 +43,0 @@ }

@@ -6,6 +6,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -23,6 +23,6 @@ exports.revokeInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction')]);

*/
function createRevokeInstruction(account, owner, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([{ pubkey: account, isSigner: false, isWritable: true }], owner, multiSigners);
function createRevokeInstruction(account, owner, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([{ pubkey: account, isSigner: false, isWritable: true }], owner, multiSigners);
const data = Buffer.alloc(exports.revokeInstructionData.span);
exports.revokeInstructionData.encode({ instruction: types_1.TokenInstruction.Revoke }, data);
exports.revokeInstructionData.encode({ instruction: types_js_1.TokenInstruction.Revoke }, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -39,12 +39,12 @@ }

*/
function decodeRevokeInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeRevokeInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.revokeInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, owner, multiSigners }, data, } = decodeRevokeInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.Revoke)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.Revoke)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !owner)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -51,0 +51,0 @@ return {

@@ -7,6 +7,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** Authority types defined by the program */

@@ -39,7 +39,7 @@ var AuthorityType;

*/
function createSetAuthorityInstruction(account, currentAuthority, authorityType, newAuthority, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([{ pubkey: account, isSigner: false, isWritable: true }], currentAuthority, multiSigners);
function createSetAuthorityInstruction(account, currentAuthority, authorityType, newAuthority, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([{ pubkey: account, isSigner: false, isWritable: true }], currentAuthority, multiSigners);
const data = Buffer.alloc(exports.setAuthorityInstructionData.span);
exports.setAuthorityInstructionData.encode({
instruction: types_1.TokenInstruction.SetAuthority,
instruction: types_js_1.TokenInstruction.SetAuthority,
authorityType,

@@ -60,12 +60,12 @@ newAuthorityOption: newAuthority ? 1 : 0,

*/
function decodeSetAuthorityInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeSetAuthorityInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.setAuthorityInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, currentAuthority, multiSigners }, data, } = decodeSetAuthorityInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.SetAuthority)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.SetAuthority)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !currentAuthority)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -72,0 +72,0 @@ return {

@@ -6,5 +6,5 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -20,6 +20,6 @@ exports.syncNativeInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction')]);

*/
function createSyncNativeInstruction(account, programId = constants_1.TOKEN_PROGRAM_ID) {
function createSyncNativeInstruction(account, programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = [{ pubkey: account, isSigner: false, isWritable: true }];
const data = Buffer.alloc(exports.syncNativeInstructionData.span);
exports.syncNativeInstructionData.encode({ instruction: types_1.TokenInstruction.SyncNative }, data);
exports.syncNativeInstructionData.encode({ instruction: types_js_1.TokenInstruction.SyncNative }, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -36,12 +36,12 @@ }

*/
function decodeSyncNativeInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeSyncNativeInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.syncNativeInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account }, data, } = decodeSyncNativeInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.SyncNative)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.SyncNative)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -48,0 +48,0 @@ return {

@@ -6,6 +6,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -24,4 +24,4 @@ exports.thawAccountInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction')]);

*/
function createThawAccountInstruction(account, mint, authority, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createThawAccountInstruction(account, mint, authority, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: account, isSigner: false, isWritable: true },

@@ -31,3 +31,3 @@ { pubkey: mint, isSigner: false, isWritable: false },

const data = Buffer.alloc(exports.thawAccountInstructionData.span);
exports.thawAccountInstructionData.encode({ instruction: types_1.TokenInstruction.ThawAccount }, data);
exports.thawAccountInstructionData.encode({ instruction: types_js_1.TokenInstruction.ThawAccount }, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });

@@ -44,12 +44,12 @@ }

*/
function decodeThawAccountInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeThawAccountInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.thawAccountInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { account, mint, authority, multiSigners }, data, } = decodeThawAccountInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.ThawAccount)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.ThawAccount)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!account || !mint || !authority)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -56,0 +56,0 @@ return {

@@ -7,6 +7,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -26,4 +26,4 @@ exports.transferInstructionData = (0, buffer_layout_1.struct)([(0, buffer_layout_1.u8)('instruction'), (0, buffer_layout_utils_1.u64)('amount')]);

*/
function createTransferInstruction(source, destination, owner, amount, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createTransferInstruction(source, destination, owner, amount, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: source, isSigner: false, isWritable: true },

@@ -34,3 +34,3 @@ { pubkey: destination, isSigner: false, isWritable: true },

exports.transferInstructionData.encode({
instruction: types_1.TokenInstruction.Transfer,
instruction: types_js_1.TokenInstruction.Transfer,
amount: BigInt(amount),

@@ -49,12 +49,12 @@ }, data);

*/
function decodeTransferInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeTransferInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.transferInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { source, destination, owner, multiSigners }, data, } = decodeTransferInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.Transfer)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.Transfer)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!source || !destination || !owner)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -61,0 +61,0 @@ return {

@@ -7,6 +7,6 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const internal_1 = require("./internal");
const types_1 = require("./types");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const internal_js_1 = require("./internal.js");
const types_js_1 = require("./types.js");
/** TODO: docs */

@@ -32,4 +32,4 @@ exports.transferCheckedInstructionData = (0, buffer_layout_1.struct)([

*/
function createTransferCheckedInstruction(source, mint, destination, owner, amount, decimals, multiSigners = [], programId = constants_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_1.addSigners)([
function createTransferCheckedInstruction(source, mint, destination, owner, amount, decimals, multiSigners = [], programId = constants_js_1.TOKEN_PROGRAM_ID) {
const keys = (0, internal_js_1.addSigners)([
{ pubkey: source, isSigner: false, isWritable: true },

@@ -41,3 +41,3 @@ { pubkey: mint, isSigner: false, isWritable: false },

exports.transferCheckedInstructionData.encode({
instruction: types_1.TokenInstruction.TransferChecked,
instruction: types_js_1.TokenInstruction.TransferChecked,
amount: BigInt(amount),

@@ -57,12 +57,12 @@ decimals,

*/
function decodeTransferCheckedInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) {
function decodeTransferCheckedInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!instruction.programId.equals(programId))
throw new errors_1.TokenInvalidInstructionProgramError();
throw new errors_js_1.TokenInvalidInstructionProgramError();
if (instruction.data.length !== exports.transferCheckedInstructionData.span)
throw new errors_1.TokenInvalidInstructionDataError();
throw new errors_js_1.TokenInvalidInstructionDataError();
const { keys: { source, mint, destination, owner, multiSigners }, data, } = decodeTransferCheckedInstructionUnchecked(instruction);
if (data.instruction !== types_1.TokenInstruction.TransferChecked)
throw new errors_1.TokenInvalidInstructionTypeError();
if (data.instruction !== types_js_1.TokenInstruction.TransferChecked)
throw new errors_js_1.TokenInvalidInstructionTypeError();
if (!source || !mint || !destination || !owner)
throw new errors_1.TokenInvalidInstructionKeysError();
throw new errors_js_1.TokenInvalidInstructionKeysError();
// TODO: key checks?

@@ -69,0 +69,0 @@ return {

@@ -15,7 +15,7 @@ "use strict";

const buffer_layout_utils_1 = require("@solana/buffer-layout-utils");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const multisig_1 = require("./multisig");
const accountType_1 = require("../extensions/accountType");
const extensionType_1 = require("../extensions/extensionType");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const accountType_js_1 = require("../extensions/accountType.js");
const extensionType_js_1 = require("../extensions/extensionType.js");
const multisig_js_1 = require("./multisig.js");
/** Token account state as stored by the program */

@@ -54,3 +54,3 @@ var AccountState;

*/
function getAccount(connection, address, commitment, programId = constants_1.TOKEN_PROGRAM_ID) {
function getAccount(connection, address, commitment, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {

@@ -72,3 +72,3 @@ const info = yield connection.getAccountInfo(address, commitment);

*/
function getMultipleAccounts(connection, addresses, commitment, programId = constants_1.TOKEN_PROGRAM_ID) {
function getMultipleAccounts(connection, addresses, commitment, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {

@@ -102,3 +102,3 @@ const infos = yield connection.getMultipleAccountsInfo(addresses, commitment);

return __awaiter(this, void 0, void 0, function* () {
const accountLen = (0, extensionType_1.getAccountLen)(extensions);
const accountLen = (0, extensionType_js_1.getAccountLen)(extensions);
return yield connection.getMinimumBalanceForRentExemption(accountLen, commitment);

@@ -117,17 +117,17 @@ });

*/
function unpackAccount(address, info, programId = constants_1.TOKEN_PROGRAM_ID) {
function unpackAccount(address, info, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!info)
throw new errors_1.TokenAccountNotFoundError();
throw new errors_js_1.TokenAccountNotFoundError();
if (!info.owner.equals(programId))
throw new errors_1.TokenInvalidAccountOwnerError();
throw new errors_js_1.TokenInvalidAccountOwnerError();
if (info.data.length < exports.ACCOUNT_SIZE)
throw new errors_1.TokenInvalidAccountSizeError();
throw new errors_js_1.TokenInvalidAccountSizeError();
const rawAccount = exports.AccountLayout.decode(info.data.slice(0, exports.ACCOUNT_SIZE));
let tlvData = Buffer.alloc(0);
if (info.data.length > exports.ACCOUNT_SIZE) {
if (info.data.length === multisig_1.MULTISIG_SIZE)
throw new errors_1.TokenInvalidAccountSizeError();
if (info.data[exports.ACCOUNT_SIZE] != accountType_1.AccountType.Account)
throw new errors_1.TokenInvalidAccountError();
tlvData = info.data.slice(exports.ACCOUNT_SIZE + accountType_1.ACCOUNT_TYPE_SIZE);
if (info.data.length === multisig_js_1.MULTISIG_SIZE)
throw new errors_js_1.TokenInvalidAccountSizeError();
if (info.data[exports.ACCOUNT_SIZE] != accountType_js_1.AccountType.Account)
throw new errors_js_1.TokenInvalidAccountError();
tlvData = info.data.slice(exports.ACCOUNT_SIZE + accountType_js_1.ACCOUNT_TYPE_SIZE);
}

@@ -134,0 +134,0 @@ return {

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,5 +17,5 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./account"), exports);
__exportStar(require("./mint"), exports);
__exportStar(require("./multisig"), exports);
__exportStar(require("./account.js"), exports);
__exportStar(require("./mint.js"), exports);
__exportStar(require("./multisig.js"), exports);
//# sourceMappingURL=index.js.map

@@ -16,8 +16,8 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const account_1 = require("./account");
const multisig_1 = require("./multisig");
const accountType_1 = require("../extensions/accountType");
const extensionType_1 = require("../extensions/extensionType");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const accountType_js_1 = require("../extensions/accountType.js");
const extensionType_js_1 = require("../extensions/extensionType.js");
const account_js_1 = require("./account.js");
const multisig_js_1 = require("./multisig.js");
/** Buffer layout for de/serializing a mint */

@@ -45,3 +45,3 @@ exports.MintLayout = (0, buffer_layout_1.struct)([

*/
function getMint(connection, address, commitment, programId = constants_1.TOKEN_PROGRAM_ID) {
function getMint(connection, address, commitment, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {

@@ -62,19 +62,19 @@ const info = yield connection.getAccountInfo(address, commitment);

*/
function unpackMint(address, info, programId = constants_1.TOKEN_PROGRAM_ID) {
function unpackMint(address, info, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!info)
throw new errors_1.TokenAccountNotFoundError();
throw new errors_js_1.TokenAccountNotFoundError();
if (!info.owner.equals(programId))
throw new errors_1.TokenInvalidAccountOwnerError();
throw new errors_js_1.TokenInvalidAccountOwnerError();
if (info.data.length < exports.MINT_SIZE)
throw new errors_1.TokenInvalidAccountSizeError();
throw new errors_js_1.TokenInvalidAccountSizeError();
const rawMint = exports.MintLayout.decode(info.data.slice(0, exports.MINT_SIZE));
let tlvData = Buffer.alloc(0);
if (info.data.length > exports.MINT_SIZE) {
if (info.data.length <= account_1.ACCOUNT_SIZE)
throw new errors_1.TokenInvalidAccountSizeError();
if (info.data.length === multisig_1.MULTISIG_SIZE)
throw new errors_1.TokenInvalidAccountSizeError();
if (info.data[account_1.ACCOUNT_SIZE] != accountType_1.AccountType.Mint)
throw new errors_1.TokenInvalidMintError();
tlvData = info.data.slice(account_1.ACCOUNT_SIZE + accountType_1.ACCOUNT_TYPE_SIZE);
if (info.data.length <= account_js_1.ACCOUNT_SIZE)
throw new errors_js_1.TokenInvalidAccountSizeError();
if (info.data.length === multisig_js_1.MULTISIG_SIZE)
throw new errors_js_1.TokenInvalidAccountSizeError();
if (info.data[account_js_1.ACCOUNT_SIZE] != accountType_js_1.AccountType.Mint)
throw new errors_js_1.TokenInvalidMintError();
tlvData = info.data.slice(account_js_1.ACCOUNT_SIZE + accountType_js_1.ACCOUNT_TYPE_SIZE);
}

@@ -115,3 +115,3 @@ return {

return __awaiter(this, void 0, void 0, function* () {
const mintLen = (0, extensionType_1.getMintLen)(extensions);
const mintLen = (0, extensionType_js_1.getMintLen)(extensions);
return yield connection.getMinimumBalanceForRentExemption(mintLen, commitment);

@@ -133,6 +133,6 @@ });

*/
function getAssociatedTokenAddress(mint, owner, allowOwnerOffCurve = false, programId = constants_1.TOKEN_PROGRAM_ID, associatedTokenProgramId = constants_1.ASSOCIATED_TOKEN_PROGRAM_ID) {
function getAssociatedTokenAddress(mint, owner, allowOwnerOffCurve = false, programId = constants_js_1.TOKEN_PROGRAM_ID, associatedTokenProgramId = constants_js_1.ASSOCIATED_TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {
if (!allowOwnerOffCurve && !web3_js_1.PublicKey.isOnCurve(owner.toBuffer()))
throw new errors_1.TokenOwnerOffCurveError();
throw new errors_js_1.TokenOwnerOffCurveError();
const [address] = yield web3_js_1.PublicKey.findProgramAddress([owner.toBuffer(), programId.toBuffer(), mint.toBuffer()], associatedTokenProgramId);

@@ -154,5 +154,5 @@ return address;

*/
function getAssociatedTokenAddressSync(mint, owner, allowOwnerOffCurve = false, programId = constants_1.TOKEN_PROGRAM_ID, associatedTokenProgramId = constants_1.ASSOCIATED_TOKEN_PROGRAM_ID) {
function getAssociatedTokenAddressSync(mint, owner, allowOwnerOffCurve = false, programId = constants_js_1.TOKEN_PROGRAM_ID, associatedTokenProgramId = constants_js_1.ASSOCIATED_TOKEN_PROGRAM_ID) {
if (!allowOwnerOffCurve && !web3_js_1.PublicKey.isOnCurve(owner.toBuffer()))
throw new errors_1.TokenOwnerOffCurveError();
throw new errors_js_1.TokenOwnerOffCurveError();
const [address] = web3_js_1.PublicKey.findProgramAddressSync([owner.toBuffer(), programId.toBuffer(), mint.toBuffer()], associatedTokenProgramId);

@@ -159,0 +159,0 @@ return address;

@@ -15,4 +15,4 @@ "use strict";

const buffer_layout_utils_1 = require("@solana/buffer-layout-utils");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
/** Buffer layout for de/serializing a multisig */

@@ -47,3 +47,3 @@ exports.MultisigLayout = (0, buffer_layout_1.struct)([

*/
function getMultisig(connection, address, commitment, programId = constants_1.TOKEN_PROGRAM_ID) {
function getMultisig(connection, address, commitment, programId = constants_js_1.TOKEN_PROGRAM_ID) {
return __awaiter(this, void 0, void 0, function* () {

@@ -64,9 +64,9 @@ const info = yield connection.getAccountInfo(address, commitment);

*/
function unpackMultisig(address, info, programId = constants_1.TOKEN_PROGRAM_ID) {
function unpackMultisig(address, info, programId = constants_js_1.TOKEN_PROGRAM_ID) {
if (!info)
throw new errors_1.TokenAccountNotFoundError();
throw new errors_js_1.TokenAccountNotFoundError();
if (!info.owner.equals(programId))
throw new errors_1.TokenInvalidAccountOwnerError();
throw new errors_js_1.TokenInvalidAccountOwnerError();
if (info.data.length != exports.MULTISIG_SIZE)
throw new errors_1.TokenInvalidAccountSizeError();
throw new errors_js_1.TokenInvalidAccountSizeError();
const multisig = exports.MultisigLayout.decode(info.data);

@@ -73,0 +73,0 @@ return Object.assign({ address }, multisig);

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -18,1 +18,2 @@ * Approve a delegate to transfer up to a maximum number of tokens from an account

export declare function approve(connection: Connection, payer: Signer, account: PublicKey, delegate: PublicKey, owner: Signer | PublicKey, amount: number | bigint, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=approve.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -20,1 +20,2 @@ * Approve a delegate to transfer up to a maximum number of tokens from an account, asserting the token mint and

export declare function approveChecked(connection: Connection, payer: Signer, mint: PublicKey, account: PublicKey, delegate: PublicKey, owner: Signer | PublicKey, amount: number | bigint, decimals: number, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=approveChecked.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -18,1 +18,2 @@ * Burn tokens from an account

export declare function burn(connection: Connection, payer: Signer, account: PublicKey, mint: PublicKey, owner: Signer | PublicKey, amount: number | bigint, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=burn.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -19,1 +19,2 @@ * Burn tokens from an account, asserting the token mint and decimals

export declare function burnChecked(connection: Connection, payer: Signer, account: PublicKey, mint: PublicKey, owner: Signer | PublicKey, amount: number | bigint, decimals: number, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=burnChecked.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -17,1 +17,2 @@ * Close a token account

export declare function closeAccount(connection: Connection, payer: Signer, account: PublicKey, destination: PublicKey, authority: Signer | PublicKey, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=closeAccount.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, Keypair, PublicKey, Signer } from '@solana/web3.js';
import type { ConfirmOptions, Connection, Keypair, PublicKey, Signer } from '@solana/web3.js';
/**

@@ -16,1 +16,2 @@ * Create and initialize a new token account

export declare function createAccount(connection: Connection, payer: Signer, mint: PublicKey, owner: PublicKey, keypair?: Keypair, confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<PublicKey>;
//# sourceMappingURL=createAccount.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
/**

@@ -16,1 +16,2 @@ * Create and initialize a new associated token account

export declare function createAssociatedTokenAccount(connection: Connection, payer: Signer, mint: PublicKey, owner: PublicKey, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey): Promise<PublicKey>;
//# sourceMappingURL=createAssociatedTokenAccount.d.ts.map

@@ -1,2 +0,3 @@

import { ConfirmOptions, Connection, Keypair, PublicKey, Signer } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import { Keypair } from '@solana/web3.js';
/**

@@ -17,1 +18,2 @@ * Create and initialize a new mint

export declare function createMint(connection: Connection, payer: Signer, mintAuthority: PublicKey, freezeAuthority: PublicKey | null, decimals: number, keypair?: Keypair, confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<PublicKey>;
//# sourceMappingURL=createMint.d.ts.map

@@ -1,2 +0,3 @@

import { ConfirmOptions, Connection, Keypair, PublicKey, Signer } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import { Keypair } from '@solana/web3.js';
/**

@@ -16,1 +17,2 @@ * Create and initialize a new multisig

export declare function createMultisig(connection: Connection, payer: Signer, signers: PublicKey[], m: number, keypair?: Keypair, confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<PublicKey>;
//# sourceMappingURL=createMultisig.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, Signer } from '@solana/web3.js';
import type { ConfirmOptions, Connection, Signer } from '@solana/web3.js';
/**

@@ -12,1 +12,2 @@ * Create native mint

export declare function createNativeMint(connection: Connection, payer: Signer, confirmOptions?: ConfirmOptions, nativeMint?: import("@solana/web3.js").PublicKey, programId?: import("@solana/web3.js").PublicKey): Promise<void>;
//# sourceMappingURL=createNativeMint.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, Keypair, PublicKey, Signer } from '@solana/web3.js';
import type { ConfirmOptions, Connection, Keypair, PublicKey, Signer } from '@solana/web3.js';
/**

@@ -16,1 +16,2 @@ * Create, initialize, and fund a new wrapped native SOL account

export declare function createWrappedNativeAccount(connection: Connection, payer: Signer, owner: PublicKey, amount: number, keypair?: Keypair, confirmOptions?: ConfirmOptions, programId?: PublicKey, nativeMint?: PublicKey): Promise<PublicKey>;
//# sourceMappingURL=createWrappedNativeAccount.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -17,1 +17,2 @@ * Freeze a token account

export declare function freezeAccount(connection: Connection, payer: Signer, account: PublicKey, mint: PublicKey, authority: Signer | PublicKey, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=freezeAccount.d.ts.map

@@ -1,3 +0,3 @@

import { Commitment, ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import { Account } from '../state/index';
import type { Commitment, ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import type { Account } from '../state/account.js';
/**

@@ -19,1 +19,2 @@ * Retrieve the associated token account, or create it if it doesn't exist

export declare function getOrCreateAssociatedTokenAccount(connection: Connection, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, commitment?: Commitment, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey): Promise<Account>;
//# sourceMappingURL=getOrCreateAssociatedTokenAccount.d.ts.map

@@ -1,21 +0,22 @@

export * from './createMint';
export * from './createNativeMint';
export * from './createAccount';
export * from './createWrappedNativeAccount';
export * from './createMultisig';
export * from './transfer';
export * from './approve';
export * from './revoke';
export * from './setAuthority';
export * from './mintTo';
export * from './burn';
export * from './closeAccount';
export * from './freezeAccount';
export * from './thawAccount';
export * from './transferChecked';
export * from './approveChecked';
export * from './mintToChecked';
export * from './burnChecked';
export * from './syncNative';
export * from './createAssociatedTokenAccount';
export * from './getOrCreateAssociatedTokenAccount';
export * from './createMint.js';
export * from './createNativeMint.js';
export * from './createAccount.js';
export * from './createWrappedNativeAccount.js';
export * from './createMultisig.js';
export * from './transfer.js';
export * from './approve.js';
export * from './revoke.js';
export * from './setAuthority.js';
export * from './mintTo.js';
export * from './burn.js';
export * from './closeAccount.js';
export * from './freezeAccount.js';
export * from './thawAccount.js';
export * from './transferChecked.js';
export * from './approveChecked.js';
export * from './mintToChecked.js';
export * from './burnChecked.js';
export * from './syncNative.js';
export * from './createAssociatedTokenAccount.js';
export * from './getOrCreateAssociatedTokenAccount.js';
//# sourceMappingURL=index.d.ts.map
export {};
//# sourceMappingURL=internal.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -18,1 +18,2 @@ * Mint tokens to an account

export declare function mintTo(connection: Connection, payer: Signer, mint: PublicKey, destination: PublicKey, authority: Signer | PublicKey, amount: number | bigint, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=mintTo.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -19,1 +19,2 @@ * Mint tokens to an account, asserting the token mint and decimals

export declare function mintToChecked(connection: Connection, payer: Signer, mint: PublicKey, destination: PublicKey, authority: Signer | PublicKey, amount: number | bigint, decimals: number, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=mintToChecked.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -16,1 +16,2 @@ * Revoke approval for the transfer of tokens from an account

export declare function revoke(connection: Connection, payer: Signer, account: PublicKey, owner: Signer | PublicKey, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=revoke.d.ts.map

@@ -1,3 +0,3 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { AuthorityType } from '../instructions/index';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { AuthorityType } from '../instructions/setAuthority.js';
/**

@@ -19,1 +19,2 @@ * Assign a new authority to the account

export declare function setAuthority(connection: Connection, payer: Signer, account: PublicKey, currentAuthority: Signer | PublicKey, authorityType: AuthorityType, newAuthority: PublicKey | null, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=setAuthority.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -14,1 +14,2 @@ * Sync the balance of a native SPL token account to the underlying system account's lamports

export declare function syncNative(connection: Connection, payer: Signer, account: PublicKey, confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=syncNative.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -17,1 +17,2 @@ * Thaw (unfreeze) a token account

export declare function thawAccount(connection: Connection, payer: Signer, account: PublicKey, mint: PublicKey, authority: Signer | PublicKey, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=thawAccount.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -18,1 +18,2 @@ * Transfer tokens from one account to another

export declare function transfer(connection: Connection, payer: Signer, source: PublicKey, destination: PublicKey, owner: Signer | PublicKey, amount: number | bigint, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=transfer.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -20,1 +20,2 @@ * Transfer tokens from one account to another, asserting the token mint and decimals

export declare function transferChecked(connection: Connection, payer: Signer, source: PublicKey, mint: PublicKey, destination: PublicKey, owner: Signer | PublicKey, amount: number | bigint, decimals: number, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=transferChecked.d.ts.map

@@ -14,1 +14,2 @@ import { PublicKey } from '@solana/web3.js';

export declare function programSupportsExtensions(programId: PublicKey): boolean;
//# sourceMappingURL=constants.d.ts.map

@@ -53,1 +53,2 @@ /** Base class for errors */

}
//# sourceMappingURL=errors.d.ts.map

@@ -7,1 +7,2 @@ export declare enum AccountType {

export declare const ACCOUNT_TYPE_SIZE = 1;
//# sourceMappingURL=accountType.d.ts.map

@@ -1,3 +0,3 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { AccountState } from '../../state';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { AccountState } from '../../state/account.js';
/**

@@ -31,1 +31,2 @@ * Initialize a default account state on a mint

export declare function updateDefaultAccountState(connection: Connection, payer: Signer, mint: PublicKey, state: AccountState, freezeAuthority: Signer | PublicKey, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=actions.d.ts.map

@@ -1,3 +0,4 @@

export * from './actions';
export * from './instructions';
export * from './state';
export * from './actions.js';
export * from './instructions.js';
export * from './state.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,4 +0,5 @@

import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { AccountState } from '../../state/account';
import { TokenInstruction } from '../../instructions/types';
import type { PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from '../../instructions/types.js';
import type { AccountState } from '../../state/account.js';
export declare enum DefaultAccountStateInstruction {

@@ -38,1 +39,2 @@ Initialize = 0,

export declare function createUpdateDefaultAccountStateInstruction(mint: PublicKey, accountState: AccountState, freezeAuthority: PublicKey, multiSigners?: Signer[], programId?: PublicKey): TransactionInstruction;
//# sourceMappingURL=instructions.d.ts.map

@@ -1,3 +0,3 @@

import { AccountState } from '../../state';
import { Mint } from '../../state';
import type { AccountState } from '../../state/account.js';
import type { Mint } from '../../state/mint.js';
/** DefaultAccountState as stored by the program */

@@ -12,1 +12,2 @@ export interface DefaultAccountState {

export declare function getDefaultAccountState(mint: Mint): DefaultAccountState | null;
//# sourceMappingURL=state.d.ts.map
/// <reference types="node" />
import { Mint } from '../state/mint';
import type { Mint } from '../state/mint.js';
export declare enum ExtensionType {

@@ -25,1 +25,2 @@ Uninitialized = 0,

export declare function getAccountLenForMint(mint: Mint): number;
//# sourceMappingURL=extensionType.d.ts.map

@@ -1,2 +0,2 @@

import { Account } from '../state/account';
import type { Account } from '../state/account.js';
/** ImmutableOwner as stored by the program */

@@ -9,1 +9,2 @@ export interface ImmutableOwner {

export declare function getImmutableOwner(account: Account): ImmutableOwner | null;
//# sourceMappingURL=immutableOwner.d.ts.map

@@ -1,9 +0,10 @@

export * from './accountType';
export * from './defaultAccountState/index';
export * from './extensionType';
export * from './memoTransfer/index';
export * from './mintCloseAuthority';
export * from './immutableOwner';
export * from './interestBearingMint';
export * from './nonTransferable';
export * from './transferFee/index';
export * from './accountType.js';
export * from './defaultAccountState/index.js';
export * from './extensionType.js';
export * from './memoTransfer/index.js';
export * from './mintCloseAuthority.js';
export * from './immutableOwner.js';
export * from './interestBearingMint/index.js';
export * from './nonTransferable.js';
export * from './transferFee/index.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,3 @@

import { ConfirmOptions, Connection, Keypair, PublicKey, Signer } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import { Keypair } from '@solana/web3.js';
/**

@@ -34,1 +35,2 @@ * Initialize an interest bearing account on a mint

export declare function updateRateInterestBearingMint(connection: Connection, payer: Signer, mint: PublicKey, rateAuthority: Signer, rate: number, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<string>;
//# sourceMappingURL=actions.d.ts.map

@@ -1,3 +0,4 @@

export * from './actions';
export * from './instructions';
export * from './state';
export * from './actions.js';
export * from './instructions.js';
export * from './state.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,3 +0,4 @@

import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from '../../instructions';
import type { PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from '../../instructions/types.js';
export declare enum InterestBearingMintInstruction {

@@ -43,1 +44,2 @@ Initialize = 0,

export declare function createUpdateRateInterestBearingMintInstruction(mint: PublicKey, rateAuthority: PublicKey, rate: number, multiSigners?: Signer[], programId?: PublicKey): TransactionInstruction;
//# sourceMappingURL=instructions.d.ts.map

@@ -1,8 +0,8 @@

import { PublicKey } from '@solana/web3.js';
import { Mint } from '../../state';
import type { PublicKey } from '@solana/web3.js';
import type { Mint } from '../../state/mint.js';
export interface InterestBearingMintConfigState {
rateAuthority: PublicKey;
initializationTimestamp: BigInt;
initializationTimestamp: bigint;
preUpdateAverageRate: number;
lastUpdateTimestamp: BigInt;
lastUpdateTimestamp: bigint;
currentRate: number;

@@ -13,1 +13,2 @@ }

export declare function getInterestBearingMintConfigState(mint: Mint): InterestBearingMintConfigState | null;
//# sourceMappingURL=state.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -30,1 +30,2 @@ * Enable memo transfers on the given account

export declare function disableRequiredMemoTransfers(connection: Connection, payer: Signer, account: PublicKey, owner: Signer | PublicKey, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=actions.d.ts.map

@@ -1,3 +0,4 @@

export * from './actions';
export * from './instructions';
export * from './state';
export * from './actions.js';
export * from './instructions.js';
export * from './state.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,3 +0,4 @@

import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from '../../instructions/types';
import type { PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from '../../instructions/types.js';
export declare enum MemoTransferInstruction {

@@ -36,1 +37,2 @@ Enable = 0,

export declare function createDisableRequiredMemoTransfersInstruction(account: PublicKey, authority: PublicKey, multiSigners?: Signer[], programId?: PublicKey): TransactionInstruction;
//# sourceMappingURL=instructions.d.ts.map

@@ -1,2 +0,2 @@

import { Account } from '../../state';
import type { Account } from '../../state/account.js';
/** MemoTransfer as stored by the program */

@@ -11,1 +11,2 @@ export interface MemoTransfer {

export declare function getMemoTransfer(account: Account): MemoTransfer | null;
//# sourceMappingURL=state.d.ts.map

@@ -1,3 +0,3 @@

import { PublicKey } from '@solana/web3.js';
import { Mint } from '../state/mint';
import type { PublicKey } from '@solana/web3.js';
import type { Mint } from '../state/mint.js';
/** MintCloseAuthority as stored by the program */

@@ -11,1 +11,2 @@ export interface MintCloseAuthority {

export declare function getMintCloseAuthority(mint: Mint): MintCloseAuthority | null;
//# sourceMappingURL=mintCloseAuthority.d.ts.map

@@ -1,2 +0,2 @@

import { Mint } from '../state/mint';
import type { Mint } from '../state/mint.js';
/** Non-transferable state as stored by the program */

@@ -9,1 +9,2 @@ export interface NonTransferable {

export declare function getNonTransferable(mint: Mint): NonTransferable | null;
//# sourceMappingURL=nonTransferable.d.ts.map

@@ -1,2 +0,2 @@

import { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
/**

@@ -64,1 +64,2 @@ * Transfer tokens from one account to another, asserting the transfer fee, token mint, and decimals

export declare function harvestWithheldTokensToMint(connection: Connection, payer: Signer, mint: PublicKey, sources: PublicKey[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
//# sourceMappingURL=actions.d.ts.map

@@ -1,3 +0,4 @@

export * from './actions';
export * from './instructions';
export * from './state';
export * from './actions.js';
export * from './instructions.js';
export * from './state.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from '../../instructions/types';
import type { AccountMeta, Signer } from '@solana/web3.js';
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from '../../instructions/types.js';
export declare enum TransferFeeInstruction {

@@ -20,3 +21,3 @@ InitializeTransferFeeConfig = 0,

transferFeeBasisPoints: number;
maximumFee: BigInt;
maximumFee: bigint;
}

@@ -37,3 +38,3 @@ /** TODO: docs */

*/
export declare function createInitializeTransferFeeConfigInstruction(mint: PublicKey, transferFeeConfigAuthority: PublicKey | null, withdrawWithheldAuthority: PublicKey | null, transferFeeBasisPoints: number, maximumFee: BigInt, programId?: PublicKey): TransactionInstruction;
export declare function createInitializeTransferFeeConfigInstruction(mint: PublicKey, transferFeeConfigAuthority: PublicKey | null, withdrawWithheldAuthority: PublicKey | null, transferFeeBasisPoints: number, maximumFee: bigint, programId?: PublicKey): TransactionInstruction;
/** A decoded, valid InitializeTransferFeeConfig instruction */

@@ -51,3 +52,3 @@ export interface DecodedInitializeTransferFeeConfigInstruction {

transferFeeBasisPoints: number;
maximumFee: BigInt;
maximumFee: bigint;
};

@@ -76,3 +77,3 @@ }

transferFeeBasisPoints: number;
maximumFee: BigInt;
maximumFee: bigint;
};

@@ -91,5 +92,5 @@ }

transferFeeInstruction: TransferFeeInstruction.TransferCheckedWithFee;
amount: BigInt;
amount: bigint;
decimals: number;
fee: BigInt;
fee: bigint;
}

@@ -112,3 +113,3 @@ export declare const transferCheckedWithFeeInstructionData: import("@solana/buffer-layout").Structure<TransferCheckedWithFeeInstructionData>;

*/
export declare function createTransferCheckedWithFeeInstruction(source: PublicKey, mint: PublicKey, destination: PublicKey, authority: PublicKey, amount: BigInt, decimals: number, fee: BigInt, multiSigners?: Signer[], programId?: PublicKey): TransactionInstruction;
export declare function createTransferCheckedWithFeeInstruction(source: PublicKey, mint: PublicKey, destination: PublicKey, authority: PublicKey, amount: bigint, decimals: number, fee: bigint, multiSigners?: Signer[], programId?: PublicKey): TransactionInstruction;
/** A decoded, valid TransferCheckedWithFee instruction */

@@ -127,5 +128,5 @@ export interface DecodedTransferCheckedWithFeeInstruction {

transferFeeInstruction: TransferFeeInstruction.TransferCheckedWithFee;
amount: BigInt;
amount: bigint;
decimals: number;
fee: BigInt;
fee: bigint;
};

@@ -155,5 +156,5 @@ }

transferFeeInstruction: TransferFeeInstruction.TransferCheckedWithFee;
amount: BigInt;
amount: bigint;
decimals: number;
fee: BigInt;
fee: bigint;
};

@@ -355,1 +356,2 @@ }

export declare function decodeHarvestWithheldTokensToMintInstructionUnchecked({ programId, keys: [mint, ...sources], data, }: TransactionInstruction): DecodedHarvestWithheldTokensToMintInstructionUnchecked;
//# sourceMappingURL=instructions.d.ts.map

@@ -1,13 +0,13 @@

import { Layout } from '@solana/buffer-layout';
import { PublicKey } from '@solana/web3.js';
import { Account } from '../../state';
import { Mint } from '../../state/mint';
import type { Layout } from '@solana/buffer-layout';
import type { PublicKey } from '@solana/web3.js';
import type { Account } from '../../state/account.js';
import type { Mint } from '../../state/mint.js';
export declare const MAX_FEE_BASIS_POINTS = 10000;
export declare const ONE_IN_BASIS_POINTS: BigInt;
export declare const ONE_IN_BASIS_POINTS: bigint;
/** TransferFeeConfig as stored by the program */
export interface TransferFee {
/** First epoch where the transfer fee takes effect */
epoch: BigInt;
epoch: bigint;
/** Maximum fee assessed on transfers, expressed as an amount of tokens */
maximumFee: BigInt;
maximumFee: bigint;
/**

@@ -26,3 +26,3 @@ * Amount of transfer collected as fees, expressed as basis points of the

/** Withheld transfer fee tokens that have been moved to the mint for withdrawal */
withheldAmount: BigInt;
withheldAmount: bigint;
/** Older transfer fee, used if the current epoch < newerTransferFee.epoch */

@@ -41,3 +41,3 @@ olderTransferFee: TransferFee;

/** Withheld transfer fee tokens that can be claimed by the fee authority */
withheldAmount: BigInt;
withheldAmount: bigint;
}

@@ -49,1 +49,2 @@ /** Buffer layout for de/serializing */

export declare function getTransferFeeAmount(account: Account): TransferFeeAmount | null;
//# sourceMappingURL=state.d.ts.map

@@ -1,6 +0,7 @@

export * from './extensions/index';
export * from './instructions/index';
export * from './state/index';
export * from './actions/index';
export * from './constants';
export * from './errors';
export * from './extensions/index.js';
export * from './instructions/index.js';
export * from './state/index.js';
export * from './actions/index.js';
export * from './constants.js';
export * from './errors.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -68,1 +69,2 @@ export interface ApproveInstructionData {

export declare function decodeApproveInstructionUnchecked({ programId, keys: [account, delegate, owner, ...multiSigners], data, }: TransactionInstruction): DecodedApproveInstructionUnchecked;
//# sourceMappingURL=approve.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -75,1 +76,2 @@ export interface ApproveCheckedInstructionData {

export declare function decodeApproveCheckedInstructionUnchecked({ programId, keys: [account, mint, delegate, owner, ...multiSigners], data, }: TransactionInstruction): DecodedApproveCheckedInstructionUnchecked;
//# sourceMappingURL=approveChecked.d.ts.map

@@ -1,2 +0,3 @@

import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import type { PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
/**

@@ -15,1 +16,2 @@ * Construct an AssociatedTokenAccount instruction

export declare function createAssociatedTokenAccountInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey): TransactionInstruction;
//# sourceMappingURL=associatedTokenAccount.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -68,1 +69,2 @@ export interface BurnInstructionData {

export declare function decodeBurnInstructionUnchecked({ programId, keys: [account, mint, owner, ...multiSigners], data, }: TransactionInstruction): DecodedBurnInstructionUnchecked;
//# sourceMappingURL=burn.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -72,1 +73,2 @@ export interface BurnCheckedInstructionData {

export declare function decodeBurnCheckedInstructionUnchecked({ programId, keys: [account, mint, owner, ...multiSigners], data, }: TransactionInstruction): DecodedBurnCheckedInstructionUnchecked;
//# sourceMappingURL=burnChecked.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -64,1 +65,2 @@ export interface CloseAccountInstructionData {

export declare function decodeCloseAccountInstructionUnchecked({ programId, keys: [account, destination, authority, ...multiSigners], data, }: TransactionInstruction): DecodedCloseAccountInstructionUnchecked;
//# sourceMappingURL=closeAccount.d.ts.map

@@ -1,3 +0,4 @@

import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -20,1 +21,2 @@ export interface CreateNativeMintInstructionData {

export declare function createCreateNativeMintInstruction(payer: PublicKey, nativeMintId?: PublicKey, programId?: PublicKey): TransactionInstruction;
//# sourceMappingURL=createNativeMint.d.ts.map

@@ -1,21 +0,21 @@

import { TransactionInstruction } from '@solana/web3.js';
import { DecodedApproveInstruction } from './approve';
import { DecodedApproveCheckedInstruction } from './approveChecked';
import { DecodedBurnInstruction } from './burn';
import { DecodedBurnCheckedInstruction } from './burnChecked';
import { DecodedCloseAccountInstruction } from './closeAccount';
import { DecodedFreezeAccountInstruction } from './freezeAccount';
import { DecodedInitializeAccountInstruction } from './initializeAccount';
import { DecodedInitializeAccount2Instruction } from './initializeAccount2';
import { DecodedInitializeAccount3Instruction } from './initializeAccount3';
import { DecodedInitializeMintInstruction } from './initializeMint';
import { DecodedInitializeMultisigInstruction } from './initializeMultisig';
import { DecodedMintToInstruction } from './mintTo';
import { DecodedMintToCheckedInstruction } from './mintToChecked';
import { DecodedRevokeInstruction } from './revoke';
import { DecodedSetAuthorityInstruction } from './setAuthority';
import { DecodedSyncNativeInstruction } from './syncNative';
import { DecodedThawAccountInstruction } from './thawAccount';
import { DecodedTransferInstruction } from './transfer';
import { DecodedTransferCheckedInstruction } from './transferChecked';
import type { TransactionInstruction } from '@solana/web3.js';
import type { DecodedApproveInstruction } from './approve.js';
import type { DecodedApproveCheckedInstruction } from './approveChecked.js';
import type { DecodedBurnInstruction } from './burn.js';
import type { DecodedBurnCheckedInstruction } from './burnChecked.js';
import type { DecodedCloseAccountInstruction } from './closeAccount.js';
import type { DecodedFreezeAccountInstruction } from './freezeAccount.js';
import type { DecodedInitializeAccountInstruction } from './initializeAccount.js';
import type { DecodedInitializeAccount2Instruction } from './initializeAccount2.js';
import type { DecodedInitializeAccount3Instruction } from './initializeAccount3.js';
import type { DecodedInitializeMintInstruction } from './initializeMint.js';
import type { DecodedInitializeMultisigInstruction } from './initializeMultisig.js';
import type { DecodedMintToInstruction } from './mintTo.js';
import type { DecodedMintToCheckedInstruction } from './mintToChecked.js';
import type { DecodedRevokeInstruction } from './revoke.js';
import type { DecodedSetAuthorityInstruction } from './setAuthority.js';
import type { DecodedSyncNativeInstruction } from './syncNative.js';
import type { DecodedThawAccountInstruction } from './thawAccount.js';
import type { DecodedTransferInstruction } from './transfer.js';
import type { DecodedTransferCheckedInstruction } from './transferChecked.js';
/** TODO: docs */

@@ -65,1 +65,2 @@ export declare type DecodedInstruction = DecodedInitializeMintInstruction | DecodedInitializeAccountInstruction | DecodedInitializeMultisigInstruction | DecodedTransferInstruction | DecodedApproveInstruction | DecodedRevokeInstruction | DecodedSetAuthorityInstruction | DecodedMintToInstruction | DecodedBurnInstruction | DecodedCloseAccountInstruction | DecodedFreezeAccountInstruction | DecodedThawAccountInstruction | DecodedTransferCheckedInstruction | DecodedApproveCheckedInstruction | DecodedMintToCheckedInstruction | DecodedBurnCheckedInstruction | DecodedInitializeAccount2Instruction | DecodedSyncNativeInstruction | DecodedInitializeAccount3Instruction | never;

/** TODO: docs, implement */
//# sourceMappingURL=decode.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -64,1 +65,2 @@ export interface FreezeAccountInstructionData {

export declare function decodeFreezeAccountInstructionUnchecked({ programId, keys: [account, mint, authority, ...multiSigners], data, }: TransactionInstruction): DecodedFreezeAccountInstructionUnchecked;
//# sourceMappingURL=freezeAccount.d.ts.map

@@ -1,29 +0,30 @@

export * from './types';
export * from './initializeMint';
export * from './initializeAccount';
export * from './initializeMultisig';
export * from './transfer';
export * from './approve';
export * from './revoke';
export * from './setAuthority';
export * from './mintTo';
export * from './burn';
export * from './closeAccount';
export * from './freezeAccount';
export * from './thawAccount';
export * from './transferChecked';
export * from './approveChecked';
export * from './mintToChecked';
export * from './burnChecked';
export * from './initializeAccount2';
export * from './syncNative';
export * from './initializeAccount3';
export * from './initializeMultisig2';
export * from './initializeMint2';
export * from './initializeImmutableOwner';
export * from './initializeMintCloseAuthority';
export * from './reallocate';
export * from './createNativeMint';
export * from './initializeNonTransferableMint';
export * from './decode';
export * from './associatedTokenAccount';
export * from './associatedTokenAccount.js';
export * from './decode.js';
export * from './types.js';
export * from './initializeMint.js';
export * from './initializeAccount.js';
export * from './initializeMultisig.js';
export * from './transfer.js';
export * from './approve.js';
export * from './revoke.js';
export * from './setAuthority.js';
export * from './mintTo.js';
export * from './burn.js';
export * from './closeAccount.js';
export * from './freezeAccount.js';
export * from './thawAccount.js';
export * from './transferChecked.js';
export * from './approveChecked.js';
export * from './mintToChecked.js';
export * from './burnChecked.js';
export * from './initializeAccount2.js';
export * from './syncNative.js';
export * from './initializeAccount3.js';
export * from './initializeMultisig2.js';
export * from './initializeMint2.js';
export * from './initializeImmutableOwner.js';
export * from './initializeMintCloseAuthority.js';
export * from './reallocate.js';
export * from './createNativeMint.js';
export * from './initializeNonTransferableMint.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -63,1 +64,2 @@ export interface InitializeAccountInstructionData {

export declare function decodeInitializeAccountInstructionUnchecked({ programId, keys: [account, mint, owner, rent], data, }: TransactionInstruction): DecodedInitializeAccountInstructionUnchecked;
//# sourceMappingURL=initializeAccount.d.ts.map

@@ -1,3 +0,4 @@

import { TokenInstruction } from './types';
import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
export interface InitializeAccount2InstructionData {

@@ -62,1 +63,2 @@ instruction: TokenInstruction.InitializeAccount2;

export declare function decodeInitializeAccount2InstructionUnchecked({ programId, keys: [account, mint, rent], data, }: TransactionInstruction): DecodedInitializeAccount2InstructionUnchecked;
//# sourceMappingURL=initializeAccount2.d.ts.map

@@ -1,3 +0,4 @@

import { TokenInstruction } from './types';
import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
export interface InitializeAccount3InstructionData {

@@ -60,1 +61,2 @@ instruction: TokenInstruction.InitializeAccount3;

export declare function decodeInitializeAccount3InstructionUnchecked({ programId, keys: [account, mint], data, }: TransactionInstruction): DecodedInitializeAccount3InstructionUnchecked;
//# sourceMappingURL=initializeAccount3.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** Deserialized instruction for the initiation of an immutable owner account */

@@ -55,1 +56,2 @@ export interface InitializeImmutableOwnerInstructionData {

export declare function decodeInitializeImmutableOwnerInstructionUnchecked({ programId, keys: [account], data, }: TransactionInstruction): DecodedInitializeImmutableOwnerInstructionUnchecked;
//# sourceMappingURL=initializeImmutableOwner.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta } from '@solana/web3.js';
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -70,1 +71,2 @@ export interface InitializeMintInstructionData {

export declare function decodeInitializeMintInstructionUnchecked({ programId, keys: [mint, rent], data, }: TransactionInstruction): DecodedInitializeMintInstructionUnchecked;
//# sourceMappingURL=initializeMint.d.ts.map
export {};
//# sourceMappingURL=initializeMint2.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta } from '@solana/web3.js';
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -60,1 +61,2 @@ export interface InitializeMintCloseAuthorityInstructionData {

export declare function decodeInitializeMintCloseAuthorityInstructionUnchecked({ programId, keys: [mint], data, }: TransactionInstruction): DecodedInitializeMintCloseAuthorityInstructionUnchecked;
//# sourceMappingURL=initializeMintCloseAuthority.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -64,1 +65,2 @@ export interface InitializeMultisigInstructionData {

export declare function decodeInitializeMultisigInstructionUnchecked({ programId, keys: [account, rent, ...signers], data, }: TransactionInstruction): DecodedInitializeMultisigInstructionUnchecked;
//# sourceMappingURL=initializeMultisig.d.ts.map
export {};
//# sourceMappingURL=initializeMultisig2.d.ts.map

@@ -1,3 +0,4 @@

import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** Deserialized instruction for the initiation of an immutable owner account */

@@ -18,1 +19,2 @@ export interface InitializeNonTransferableMintInstructionData {

export declare function createInitializeNonTransferableMintInstruction(mint: PublicKey, programId: PublicKey): TransactionInstruction;
//# sourceMappingURL=initializeNonTransferableMint.d.ts.map
export {};
//# sourceMappingURL=internal.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -68,1 +69,2 @@ export interface MintToInstructionData {

export declare function decodeMintToInstructionUnchecked({ programId, keys: [mint, destination, authority, ...multiSigners], data, }: TransactionInstruction): DecodedMintToInstructionUnchecked;
//# sourceMappingURL=mintTo.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -72,1 +73,2 @@ export interface MintToCheckedInstructionData {

export declare function decodeMintToCheckedInstructionUnchecked({ programId, keys: [mint, destination, authority, ...multiSigners], data, }: TransactionInstruction): DecodedMintToCheckedInstructionUnchecked;
//# sourceMappingURL=mintToChecked.d.ts.map

@@ -1,4 +0,5 @@

import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import { ExtensionType } from '../extensions';
import type { PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import type { ExtensionType } from '../extensions/extensionType.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -22,1 +23,2 @@ export interface ReallocateInstructionData {

export declare function createReallocateInstruction(account: PublicKey, payer: PublicKey, extensionTypes: ExtensionType[], owner: PublicKey, multiSigners?: Signer[], programId?: PublicKey): TransactionInstruction;
//# sourceMappingURL=reallocate.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -61,1 +62,2 @@ export interface RevokeInstructionData {

export declare function decodeRevokeInstructionUnchecked({ programId, keys: [account, owner, ...multiSigners], data, }: TransactionInstruction): DecodedRevokeInstructionUnchecked;
//# sourceMappingURL=revoke.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, Signer } from '@solana/web3.js';
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** Authority types defined by the program */

@@ -77,1 +78,2 @@ export declare enum AuthorityType {

export declare function decodeSetAuthorityInstructionUnchecked({ programId, keys: [account, currentAuthority, ...multiSigners], data, }: TransactionInstruction): DecodedSetAuthorityInstructionUnchecked;
//# sourceMappingURL=setAuthority.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -55,1 +56,2 @@ export interface SyncNativeInstructionData {

export declare function decodeSyncNativeInstructionUnchecked({ programId, keys: [account], data, }: TransactionInstruction): DecodedSyncNativeInstructionUnchecked;
//# sourceMappingURL=syncNative.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -64,1 +65,2 @@ export interface ThawAccountInstructionData {

export declare function decodeThawAccountInstructionUnchecked({ programId, keys: [account, mint, authority, ...multiSigners], data, }: TransactionInstruction): DecodedThawAccountInstructionUnchecked;
//# sourceMappingURL=thawAccount.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -68,1 +69,2 @@ export interface TransferInstructionData {

export declare function decodeTransferInstructionUnchecked({ programId, keys: [source, destination, owner, ...multiSigners], data, }: TransactionInstruction): DecodedTransferInstructionUnchecked;
//# sourceMappingURL=transfer.d.ts.map

@@ -1,3 +0,4 @@

import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types.js';
/** TODO: docs */

@@ -75,1 +76,2 @@ export interface TransferCheckedInstructionData {

export declare function decodeTransferCheckedInstructionUnchecked({ programId, keys: [source, mint, destination, owner, ...multiSigners], data, }: TransactionInstruction): DecodedTransferCheckedInstructionUnchecked;
//# sourceMappingURL=transferChecked.d.ts.map

@@ -38,1 +38,2 @@ /** Instructions defined by the program */

}
//# sourceMappingURL=types.d.ts.map
/// <reference types="node" />
import { Commitment, Connection, PublicKey, AccountInfo } from '@solana/web3.js';
import { ExtensionType } from '../extensions/extensionType';
import type { AccountInfo, Commitment, Connection, PublicKey } from '@solana/web3.js';
import type { ExtensionType } from '../extensions/extensionType.js';
/** Information about a token account */

@@ -105,1 +105,2 @@ export interface Account {

export declare function unpackAccount(address: PublicKey, info: AccountInfo<Buffer> | null, programId?: PublicKey): Account;
//# sourceMappingURL=account.d.ts.map

@@ -1,3 +0,4 @@

export * from './account';
export * from './mint';
export * from './multisig';
export * from './account.js';
export * from './mint.js';
export * from './multisig.js';
//# sourceMappingURL=index.d.ts.map
/// <reference types="node" />
import { AccountInfo, Commitment, Connection, PublicKey } from '@solana/web3.js';
import { ExtensionType } from '../extensions/extensionType';
import type { AccountInfo, Commitment, Connection } from '@solana/web3.js';
import { PublicKey } from '@solana/web3.js';
import type { ExtensionType } from '../extensions/extensionType.js';
/** Information about a mint */

@@ -101,1 +102,2 @@ export interface Mint {

export declare function getAssociatedTokenAddressSync(mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, programId?: PublicKey, associatedTokenProgramId?: PublicKey): PublicKey;
//# sourceMappingURL=mint.d.ts.map
/// <reference types="node" />
import { AccountInfo, Commitment, Connection, PublicKey } from '@solana/web3.js';
import type { AccountInfo, Commitment, Connection, PublicKey } from '@solana/web3.js';
/** Information about a multisig */

@@ -61,1 +61,2 @@ export interface Multisig {

export declare function getMinimumBalanceForRentExemptMultisig(connection: Connection, commitment?: Commitment): Promise<number>;
//# sourceMappingURL=multisig.d.ts.map
{
"name": "@solana/spl-token",
"version": "0.3.1",
"description": "SPL Token Program JS API",
"version": "0.3.2",
"author": "Solana Maintainers <maintainers@solana.foundation>",
"repository": "https://github.com/solana-labs/solana-program-library",
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
"type": "module",
"sideEffects": false,
"engines": {
"node": ">=16"
},

@@ -16,18 +19,25 @@ "files": [

],
"type": "module",
"sideEffects": false,
"main": "lib/cjs/index.js",
"module": "lib/esm/index.mjs",
"types": "lib/types/index.d.ts",
"publishConfig": {
"access": "public"
},
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
"types": "./lib/types/index.d.ts",
"exports": {
"import": "./lib/esm/index.mjs",
"require": "./lib/cjs/index.js"
"require": "./lib/cjs/index.js",
"import": "./lib/esm/index.js",
"types": "./lib/types/index.d.ts"
},
"scripts": {
"clean": "shx rm -rf lib",
"build": "yarn clean && tsc -p tsconfig.json; tsc-esm -p tsconfig.json && tsc -p tsconfig.cjs.json",
"postbuild": "echo '{\"type\":\"commonjs\"}' > lib/cjs/package.json && echo '{\"type\":\"module\"}' > lib/esm/package.json",
"deploy": "yarn docs && gh-pages --dist docs --dest token/js --dotfiles",
"nuke": "shx rm -rf node_modules package-lock.json || true",
"reinstall": "npm run nuke && npm install",
"clean": "shx rm -rf lib **/*.tsbuildinfo || true",
"build": "tsc --build --verbose tsconfig.all.json",
"watch": "tsc --build --verbose --watch tsconfig.all.json",
"release": "npm run clean && npm run build",
"fmt": "prettier --write '{*,**/*}.{ts,tsx,js,jsx,json}'",
"lint": "prettier --check '{*,**/*}.{ts,tsx,js,jsx,json}' && eslint --max-warnings 0 .",
"lint:fix": "npm run fmt && eslint --fix .",
"example": "node --experimental-specifier-resolution=node --loader ts-node/esm examples/createMintAndTransferTokens.ts",
"test": "yarn test:unit && yarn test:e2e-built && yarn test:e2e-native && yarn test:e2e-2022",
"test": "npm run test:unit && npm run test:e2e-built && npm run test:e2e-native && npm run test:e2e-2022",
"test:unit": "mocha test/unit",

@@ -37,40 +47,42 @@ "test:e2e-built": "start-server-and-test 'solana-test-validator --bpf-program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA ../../target/deploy/spl_token.so --reset --quiet' http://localhost:8899/health 'mocha test/e2e'",

"test:e2e-native": "start-server-and-test 'solana-test-validator --reset --quiet' http://localhost:8899/health 'mocha test/e2e'",
"test:build-programs": "cargo build-bpf --manifest-path ../program/Cargo.toml && cargo build-bpf --manifest-path ../program-2022/Cargo.toml && cargo build-bpf --manifest-path ../../associated-token-account/program/Cargo.toml",
"docs": "shx rm -rf docs && NODE_OPTIONS=--max_old_space_size=4096 typedoc && shx cp .nojekyll docs/",
"fmt": "prettier --write '{*,**/*}.{js,ts,jsx,tsx,json}'",
"lint": "eslint --max-warnings 0 --ext .ts . && prettier --check '{*,**/*}.{js,ts,jsx,tsx,json}'",
"lint:fix": "eslint --fix --ext .ts . && yarn fmt",
"nuke": "shx rm -rf node_modules yarn.lock"
"test:build-programs": "cargo build-sbf --manifest-path ../program/Cargo.toml && cargo build-sbf --manifest-path ../program-2022/Cargo.toml && cargo build-sbf --manifest-path ../../associated-token-account/program/Cargo.toml",
"deploy": "npm run deploy:docs",
"docs": "shx rm -rf docs && typedoc && shx cp .nojekyll docs/",
"deploy:docs": "npm run docs && gh-pages --dist token/js --dotfiles"
},
"peerDependencies": {
"@solana/web3.js": "^1.20.0"
},
"dependencies": {
"@solana/buffer-layout": "^4.0.0",
"@solana/buffer-layout-utils": "^0.2.0",
"@solana/web3.js": "^1.41.0"
"buffer": "^6.0.3"
},
"devDependencies": {
"@solana/spl-memo": "^0.2.0",
"@solana/spl-memo": "^0.2.1",
"@solana/web3.js": "^1.20.0",
"@types/chai-as-promised": "^7.1.4",
"@types/eslint": "^8.4.0",
"@types/eslint-plugin-prettier": "^3.1.0",
"@types/chai": "^4.3.3",
"@types/mocha": "^9.1.0",
"@types/node": "^16.11.21",
"@types/prettier": "^2.4.3",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"chai": "^4.3.4",
"@types/node": "^18.7.9",
"@types/node-fetch": "^2.6.2",
"@types/prettier": "^2.7.0",
"@typescript-eslint/eslint-plugin": "^5.34.0",
"@typescript-eslint/parser": "^5.34.0",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"eslint": "^8.7.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"gh-pages": "^3.2.3",
"mocha": "^9.1.4",
"prettier": "^2.5.1",
"prettier": "^2.7.1",
"process": "^0.11.10",
"shx": "^0.3.4",
"start-server-and-test": "^1.14.0",
"ts-node": "^10.4.0",
"tslib": "^2.3.1",
"typedoc": "^0.22.11",
"typescript": "^4.5.5",
"typescript-esm": "^2.0.0"
"ts-node": "^10.9.1",
"typedoc": "^0.23.10",
"typescript": "^4.7.4"
}
}

@@ -28,7 +28,16 @@ # `@solana/spl-token`

```shell
yarn add @solana/spl-token
npm install --save @solana/spl-token @solana/web3.js
```
_OR_
```shell
yarn add @solana/spl-token @solana/web3.js
```
## Build from Source
0. Prerequisites
* Node 16+
* NPM 8+
1. Clone the project:

@@ -46,3 +55,3 @@ ```shell

```shell
yarn install
npm install
```

@@ -52,3 +61,3 @@

```shell
yarn build
npm run build
```

@@ -58,3 +67,3 @@

```shell
yarn test:build-programs
npm run test:build-programs
```

@@ -64,3 +73,3 @@

```shell
yarn test
npm run test
```

@@ -70,3 +79,3 @@

```shell
yarn example
npm run example
```

@@ -73,0 +82,0 @@

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createApproveInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createApproveInstruction } from '../instructions/approve.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createApproveCheckedInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createApproveCheckedInstruction } from '../instructions/approveChecked.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createBurnInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createBurnInstruction } from '../instructions/burn.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createBurnCheckedInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createBurnCheckedInstruction } from '../instructions/burnChecked.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createCloseAccountInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createCloseAccountInstruction } from '../instructions/closeAccount.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -1,16 +0,8 @@

import {
ConfirmOptions,
Connection,
Keypair,
PublicKey,
sendAndConfirmTransaction,
Signer,
SystemProgram,
Transaction,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createInitializeAccountInstruction } from '../instructions/index';
import { getMint } from '../state/index';
import { createAssociatedTokenAccount } from './createAssociatedTokenAccount';
import { getAccountLenForMint } from '../extensions/extensionType';
import type { ConfirmOptions, Connection, Keypair, PublicKey, Signer } from '@solana/web3.js';
import { sendAndConfirmTransaction, SystemProgram, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { getAccountLenForMint } from '../extensions/extensionType.js';
import { createInitializeAccountInstruction } from '../instructions/initializeAccount.js';
import { getMint } from '../state/mint.js';
import { createAssociatedTokenAccount } from './createAssociatedTokenAccount.js';

@@ -17,0 +9,0 @@ /**

@@ -1,5 +0,6 @@

import { ConfirmOptions, Connection, PublicKey, sendAndConfirmTransaction, Signer, Transaction } from '@solana/web3.js';
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '../constants';
import { createAssociatedTokenAccountInstruction } from '../instructions/index';
import { getAssociatedTokenAddress } from '../state/index';
import type { ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '../constants.js';
import { createAssociatedTokenAccountInstruction } from '../instructions/associatedTokenAccount.js';
import { getAssociatedTokenAddress } from '../state/mint.js';

@@ -6,0 +7,0 @@ /**

@@ -1,14 +0,6 @@

import {
ConfirmOptions,
Connection,
Keypair,
PublicKey,
sendAndConfirmTransaction,
Signer,
SystemProgram,
Transaction,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createInitializeMintInstruction } from '../instructions/index';
import { getMinimumBalanceForRentExemptMint, MINT_SIZE } from '../state/index';
import type { ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import { Keypair, sendAndConfirmTransaction, SystemProgram, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createInitializeMintInstruction } from '../instructions/initializeMint.js';
import { getMinimumBalanceForRentExemptMint, MINT_SIZE } from '../state/mint.js';

@@ -15,0 +7,0 @@ /**

@@ -1,14 +0,6 @@

import {
ConfirmOptions,
Connection,
Keypair,
PublicKey,
sendAndConfirmTransaction,
Signer,
SystemProgram,
Transaction,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createInitializeMultisigInstruction } from '../instructions/index';
import { getMinimumBalanceForRentExemptMultisig, MULTISIG_SIZE } from '../state/index';
import type { ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import { Keypair, sendAndConfirmTransaction, SystemProgram, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createInitializeMultisigInstruction } from '../instructions/initializeMultisig.js';
import { getMinimumBalanceForRentExemptMultisig, MULTISIG_SIZE } from '../state/multisig.js';

@@ -15,0 +7,0 @@ /**

@@ -1,4 +0,5 @@

import { ConfirmOptions, Connection, sendAndConfirmTransaction, Signer, Transaction } from '@solana/web3.js';
import { TOKEN_2022_PROGRAM_ID, NATIVE_MINT_2022 } from '../constants';
import { createCreateNativeMintInstruction } from '../instructions/index';
import type { ConfirmOptions, Connection, Signer } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { NATIVE_MINT_2022, TOKEN_2022_PROGRAM_ID } from '../constants.js';
import { createCreateNativeMintInstruction } from '../instructions/createNativeMint.js';

@@ -5,0 +6,0 @@ /**

@@ -1,19 +0,10 @@

import {
ConfirmOptions,
Connection,
Keypair,
PublicKey,
sendAndConfirmTransaction,
Signer,
SystemProgram,
Transaction,
} from '@solana/web3.js';
import { ASSOCIATED_TOKEN_PROGRAM_ID, NATIVE_MINT, TOKEN_PROGRAM_ID } from '../constants';
import {
createAssociatedTokenAccountInstruction,
createInitializeAccountInstruction,
createSyncNativeInstruction,
} from '../instructions/index';
import { ACCOUNT_SIZE, getAssociatedTokenAddress, getMinimumBalanceForRentExemptAccount } from '../state/index';
import { createAccount } from './createAccount';
import type { ConfirmOptions, Connection, Keypair, PublicKey, Signer } from '@solana/web3.js';
import { sendAndConfirmTransaction, SystemProgram, Transaction } from '@solana/web3.js';
import { ASSOCIATED_TOKEN_PROGRAM_ID, NATIVE_MINT, TOKEN_PROGRAM_ID } from '../constants.js';
import { createAssociatedTokenAccountInstruction } from '../instructions/associatedTokenAccount.js';
import { createInitializeAccountInstruction } from '../instructions/initializeAccount.js';
import { createSyncNativeInstruction } from '../instructions/syncNative.js';
import { ACCOUNT_SIZE, getMinimumBalanceForRentExemptAccount } from '../state/account.js';
import { getAssociatedTokenAddress } from '../state/mint.js';
import { createAccount } from './createAccount.js';

@@ -20,0 +11,0 @@ /**

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createFreezeAccountInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createFreezeAccountInstruction } from '../instructions/freezeAccount.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -0,12 +1,5 @@

import type { Commitment, ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '../constants.js';
import {
Commitment,
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
} from '@solana/web3.js';
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '../constants';
import {
TokenAccountNotFoundError,

@@ -16,5 +9,7 @@ TokenInvalidAccountOwnerError,

TokenInvalidOwnerError,
} from '../errors';
import { createAssociatedTokenAccountInstruction } from '../instructions/index';
import { Account, getAccount, getAssociatedTokenAddress } from '../state/index';
} from '../errors.js';
import { createAssociatedTokenAccountInstruction } from '../instructions/associatedTokenAccount.js';
import type { Account } from '../state/account.js';
import { getAccount } from '../state/account.js';
import { getAssociatedTokenAddress } from '../state/mint.js';

@@ -21,0 +16,0 @@ /**

@@ -1,22 +0,22 @@

export * from './createMint';
export * from './createNativeMint';
export * from './createAccount';
export * from './createWrappedNativeAccount';
export * from './createMultisig';
export * from './transfer';
export * from './approve';
export * from './revoke';
export * from './setAuthority';
export * from './mintTo';
export * from './burn';
export * from './closeAccount';
export * from './freezeAccount';
export * from './thawAccount';
export * from './transferChecked';
export * from './approveChecked';
export * from './mintToChecked';
export * from './burnChecked';
export * from './syncNative';
export * from './createMint.js';
export * from './createNativeMint.js';
export * from './createAccount.js';
export * from './createWrappedNativeAccount.js';
export * from './createMultisig.js';
export * from './transfer.js';
export * from './approve.js';
export * from './revoke.js';
export * from './setAuthority.js';
export * from './mintTo.js';
export * from './burn.js';
export * from './closeAccount.js';
export * from './freezeAccount.js';
export * from './thawAccount.js';
export * from './transferChecked.js';
export * from './approveChecked.js';
export * from './mintToChecked.js';
export * from './burnChecked.js';
export * from './syncNative.js';
export * from './createAssociatedTokenAccount';
export * from './getOrCreateAssociatedTokenAccount';
export * from './createAssociatedTokenAccount.js';
export * from './getOrCreateAssociatedTokenAccount.js';

@@ -1,2 +0,3 @@

import { PublicKey, Signer } from '@solana/web3.js';
import type { Signer } from '@solana/web3.js';
import { PublicKey } from '@solana/web3.js';

@@ -3,0 +4,0 @@ /** @internal */

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createMintToInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createMintToInstruction } from '../instructions/mintTo.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createMintToCheckedInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createMintToCheckedInstruction } from '../instructions/mintToChecked.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createRevokeInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createRevokeInstruction } from '../instructions/revoke.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -1,13 +0,7 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { AuthorityType, createSetAuthorityInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import type { AuthorityType } from '../instructions/setAuthority.js';
import { createSetAuthorityInstruction } from '../instructions/setAuthority.js';
import { getSigners } from './internal.js';

@@ -14,0 +8,0 @@ /**

@@ -1,12 +0,5 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createSyncNativeInstruction } from '../instructions/index';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createSyncNativeInstruction } from '../instructions/syncNative.js';

@@ -13,0 +6,0 @@ /**

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createThawAccountInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createThawAccountInstruction } from '../instructions/thawAccount.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createTransferInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createTransferInstruction } from '../instructions/transfer.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -1,13 +0,6 @@

import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { createTransferCheckedInstruction } from '../instructions/index';
import { getSigners } from './internal';
import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { createTransferCheckedInstruction } from '../instructions/transferChecked.js';
import { getSigners } from './internal.js';

@@ -14,0 +7,0 @@ /**

@@ -0,17 +1,10 @@

import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { getSigners } from '../../actions/internal.js';
import { TOKEN_2022_PROGRAM_ID } from '../../constants.js';
import type { AccountState } from '../../state/account.js';
import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_2022_PROGRAM_ID } from '../../constants';
import { AccountState } from '../../state';
import {
createInitializeDefaultAccountStateInstruction,
createUpdateDefaultAccountStateInstruction,
} from './instructions';
import { getSigners } from '../../actions/internal';
} from './instructions.js';

@@ -18,0 +11,0 @@ /**

@@ -1,3 +0,3 @@

export * from './actions';
export * from './instructions';
export * from './state';
export * from './actions.js';
export * from './instructions.js';
export * from './state.js';
import { struct, u8 } from '@solana/buffer-layout';
import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { AccountState } from '../../state/account';
import { TokenInstruction } from '../../instructions/types';
import { programSupportsExtensions, TOKEN_2022_PROGRAM_ID } from '../../constants';
import { TokenUnsupportedInstructionError } from '../../errors';
import type { PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { programSupportsExtensions, TOKEN_2022_PROGRAM_ID } from '../../constants.js';
import { TokenUnsupportedInstructionError } from '../../errors.js';
import { TokenInstruction } from '../../instructions/types.js';
import type { AccountState } from '../../state/account.js';

@@ -8,0 +9,0 @@ export enum DefaultAccountStateInstruction {

import { struct, u8 } from '@solana/buffer-layout';
import { AccountState } from '../../state';
import { Mint } from '../../state';
import { ExtensionType, getExtensionData } from '../extensionType';
import type { AccountState } from '../../state/account.js';
import type { Mint } from '../../state/mint.js';
import { ExtensionType, getExtensionData } from '../extensionType.js';

@@ -6,0 +6,0 @@ /** DefaultAccountState as stored by the program */

@@ -1,12 +0,13 @@

import { ACCOUNT_SIZE } from '../state/account';
import { Mint, MINT_SIZE } from '../state/mint';
import { MULTISIG_SIZE } from '../state/multisig';
import { ACCOUNT_TYPE_SIZE } from './accountType';
import { MEMO_TRANSFER_SIZE } from './memoTransfer';
import { DEFAULT_ACCOUNT_STATE_SIZE } from './defaultAccountState';
import { MINT_CLOSE_AUTHORITY_SIZE } from './mintCloseAuthority';
import { IMMUTABLE_OWNER_SIZE } from './immutableOwner';
import { TRANSFER_FEE_CONFIG_SIZE, TRANSFER_FEE_AMOUNT_SIZE } from './transferFee';
import { NON_TRANSFERABLE_SIZE } from './nonTransferable';
import { INTEREST_BEARING_MINT_CONFIG_STATE_SIZE } from './interestBearingMint/state';
import { ACCOUNT_SIZE } from '../state/account.js';
import type { Mint } from '../state/mint.js';
import { MINT_SIZE } from '../state/mint.js';
import { MULTISIG_SIZE } from '../state/multisig.js';
import { ACCOUNT_TYPE_SIZE } from './accountType.js';
import { DEFAULT_ACCOUNT_STATE_SIZE } from './defaultAccountState/index.js';
import { IMMUTABLE_OWNER_SIZE } from './immutableOwner.js';
import { INTEREST_BEARING_MINT_CONFIG_STATE_SIZE } from './interestBearingMint/state.js';
import { MEMO_TRANSFER_SIZE } from './memoTransfer/index.js';
import { MINT_CLOSE_AUTHORITY_SIZE } from './mintCloseAuthority.js';
import { NON_TRANSFERABLE_SIZE } from './nonTransferable.js';
import { TRANSFER_FEE_AMOUNT_SIZE, TRANSFER_FEE_CONFIG_SIZE } from './transferFee/index.js';

@@ -13,0 +14,0 @@ export enum ExtensionType {

import { struct } from '@solana/buffer-layout';
import { Account } from '../state/account';
import { ExtensionType, getExtensionData } from './extensionType';
import type { Account } from '../state/account.js';
import { ExtensionType, getExtensionData } from './extensionType.js';

@@ -5,0 +5,0 @@ /** ImmutableOwner as stored by the program */

@@ -1,9 +0,9 @@

export * from './accountType';
export * from './defaultAccountState/index';
export * from './extensionType';
export * from './memoTransfer/index';
export * from './mintCloseAuthority';
export * from './immutableOwner';
export * from './interestBearingMint';
export * from './nonTransferable';
export * from './transferFee/index';
export * from './accountType.js';
export * from './defaultAccountState/index.js';
export * from './extensionType.js';
export * from './memoTransfer/index.js';
export * from './mintCloseAuthority.js';
export * from './immutableOwner.js';
export * from './interestBearingMint/index.js';
export * from './nonTransferable.js';
export * from './transferFee/index.js';

@@ -0,19 +1,11 @@

import type { ConfirmOptions, Connection, PublicKey, Signer } from '@solana/web3.js';
import { Keypair, sendAndConfirmTransaction, SystemProgram, Transaction } from '@solana/web3.js';
import { getSigners } from '../../actions/internal.js';
import { TOKEN_2022_PROGRAM_ID } from '../../constants.js';
import { createInitializeMintInstruction } from '../../instructions/initializeMint.js';
import { ExtensionType, getMintLen } from '../extensionType.js';
import {
ConfirmOptions,
Connection,
Keypair,
PublicKey,
sendAndConfirmTransaction,
Signer,
SystemProgram,
Transaction,
} from '@solana/web3.js';
import { getSigners } from '../../actions/internal';
import { TOKEN_2022_PROGRAM_ID } from '../../constants';
import { createInitializeMintInstruction } from '../../instructions';
import { ExtensionType, getMintLen } from '../extensionType';
import {
createInitializeInterestBearingMintInstruction,
createUpdateRateInterestBearingMintInstruction,
} from './instructions';
} from './instructions.js';

@@ -20,0 +12,0 @@ /**

@@ -1,3 +0,3 @@

export * from './actions';
export * from './instructions';
export * from './state';
export * from './actions.js';
export * from './instructions.js';
export * from './state.js';

@@ -1,7 +0,8 @@

import { struct, s16, u8 } from '@solana/buffer-layout';
import { s16, struct, u8 } from '@solana/buffer-layout';
import { publicKey } from '@solana/buffer-layout-utils';
import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_2022_PROGRAM_ID } from '../../constants';
import { TokenInstruction } from '../../instructions';
import { addSigners } from '../../instructions/internal';
import type { PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_2022_PROGRAM_ID } from '../../constants.js';
import { addSigners } from '../../instructions/internal.js';
import { TokenInstruction } from '../../instructions/types.js';

@@ -8,0 +9,0 @@ export enum InterestBearingMintInstruction {

@@ -1,12 +0,12 @@

import { s16, ns64, struct } from '@solana/buffer-layout';
import { ns64, s16, struct } from '@solana/buffer-layout';
import { publicKey } from '@solana/buffer-layout-utils';
import { PublicKey } from '@solana/web3.js';
import { Mint } from '../../state';
import { ExtensionType, getExtensionData } from '../extensionType';
import type { PublicKey } from '@solana/web3.js';
import type { Mint } from '../../state/mint.js';
import { ExtensionType, getExtensionData } from '../extensionType.js';
export interface InterestBearingMintConfigState {
rateAuthority: PublicKey;
initializationTimestamp: BigInt;
initializationTimestamp: bigint;
preUpdateAverageRate: number;
lastUpdateTimestamp: BigInt;
lastUpdateTimestamp: bigint;
currentRate: number;

@@ -13,0 +13,0 @@ }

@@ -0,16 +1,9 @@

import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { getSigners } from '../../actions/internal.js';
import { TOKEN_2022_PROGRAM_ID } from '../../constants.js';
import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_2022_PROGRAM_ID } from '../../constants';
import {
createDisableRequiredMemoTransfersInstruction,
createEnableRequiredMemoTransfersInstruction,
createDisableRequiredMemoTransfersInstruction,
} from './instructions';
import { getSigners } from '../../actions/internal';
} from './instructions.js';

@@ -17,0 +10,0 @@ /**

@@ -1,3 +0,3 @@

export * from './actions';
export * from './instructions';
export * from './state';
export * from './actions.js';
export * from './instructions.js';
export * from './state.js';
import { struct, u8 } from '@solana/buffer-layout';
import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from '../../instructions/types';
import { programSupportsExtensions, TOKEN_2022_PROGRAM_ID } from '../../constants';
import { TokenUnsupportedInstructionError } from '../../errors';
import type { PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { programSupportsExtensions, TOKEN_2022_PROGRAM_ID } from '../../constants.js';
import { TokenUnsupportedInstructionError } from '../../errors.js';
import { TokenInstruction } from '../../instructions/types.js';

@@ -7,0 +8,0 @@ export enum MemoTransferInstruction {

import { struct } from '@solana/buffer-layout';
import { bool } from '@solana/buffer-layout-utils';
import { Account } from '../../state';
import { ExtensionType, getExtensionData } from '../extensionType';
import type { Account } from '../../state/account.js';
import { ExtensionType, getExtensionData } from '../extensionType.js';

@@ -6,0 +6,0 @@ /** MemoTransfer as stored by the program */

import { struct } from '@solana/buffer-layout';
import { publicKey } from '@solana/buffer-layout-utils';
import { PublicKey } from '@solana/web3.js';
import { Mint } from '../state/mint';
import { ExtensionType, getExtensionData } from './extensionType';
import type { PublicKey } from '@solana/web3.js';
import type { Mint } from '../state/mint.js';
import { ExtensionType, getExtensionData } from './extensionType.js';

@@ -7,0 +7,0 @@ /** MintCloseAuthority as stored by the program */

import { struct } from '@solana/buffer-layout';
import { Mint } from '../state/mint';
import { ExtensionType, getExtensionData } from './extensionType';
import type { Mint } from '../state/mint.js';
import { ExtensionType, getExtensionData } from './extensionType.js';

@@ -5,0 +5,0 @@ /** Non-transferable state as stored by the program */

@@ -0,18 +1,11 @@

import type { ConfirmOptions, Connection, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
import { sendAndConfirmTransaction, Transaction } from '@solana/web3.js';
import { getSigners } from '../../actions/internal.js';
import { TOKEN_2022_PROGRAM_ID } from '../../constants.js';
import {
ConfirmOptions,
Connection,
PublicKey,
sendAndConfirmTransaction,
Signer,
Transaction,
TransactionSignature,
} from '@solana/web3.js';
import { TOKEN_2022_PROGRAM_ID } from '../../constants';
import {
createHarvestWithheldTokensToMintInstruction,
createTransferCheckedWithFeeInstruction,
createHarvestWithheldTokensToMintInstruction,
createWithdrawWithheldTokensFromAccountsInstruction,
createWithdrawWithheldTokensFromMintInstruction,
} from './instructions';
import { getSigners } from '../../actions/internal';
} from './instructions.js';

@@ -19,0 +12,0 @@ /**

@@ -1,3 +0,3 @@

export * from './actions';
export * from './instructions';
export * from './state';
export * from './actions.js';
export * from './instructions.js';
export * from './state.js';

@@ -1,6 +0,7 @@

import { struct, u8, u16 } from '@solana/buffer-layout';
import { struct, u16, u8 } from '@solana/buffer-layout';
import { publicKey, u64 } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import type { AccountMeta, Signer } from '@solana/web3.js';
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import { programSupportsExtensions, TOKEN_2022_PROGRAM_ID } from '../../constants.js';
import {
TokenUnsupportedInstructionError,
TokenInvalidInstructionDataError,

@@ -10,5 +11,5 @@ TokenInvalidInstructionKeysError,

TokenInvalidInstructionTypeError,
} from '../../errors';
import { TokenInstruction } from '../../instructions/types';
import { programSupportsExtensions, TOKEN_2022_PROGRAM_ID } from '../../constants';
TokenUnsupportedInstructionError,
} from '../../errors.js';
import { TokenInstruction } from '../../instructions/types.js';

@@ -35,3 +36,3 @@ export enum TransferFeeInstruction {

transferFeeBasisPoints: number;
maximumFee: BigInt;
maximumFee: bigint;
}

@@ -68,3 +69,3 @@

transferFeeBasisPoints: number,
maximumFee: BigInt,
maximumFee: bigint,
programId = TOKEN_2022_PROGRAM_ID

@@ -107,3 +108,3 @@ ): TransactionInstruction {

transferFeeBasisPoints: number;
maximumFee: BigInt;
maximumFee: bigint;
};

@@ -160,3 +161,3 @@ }

transferFeeBasisPoints: number;
maximumFee: BigInt;
maximumFee: bigint;
};

@@ -208,5 +209,5 @@ }

transferFeeInstruction: TransferFeeInstruction.TransferCheckedWithFee;
amount: BigInt;
amount: bigint;
decimals: number;
fee: BigInt;
fee: bigint;
}

@@ -242,5 +243,5 @@

authority: PublicKey,
amount: BigInt,
amount: bigint,
decimals: number,
fee: BigInt,
fee: bigint,
multiSigners: Signer[] = [],

@@ -287,5 +288,5 @@ programId = TOKEN_2022_PROGRAM_ID

transferFeeInstruction: TransferFeeInstruction.TransferCheckedWithFee;
amount: BigInt;
amount: bigint;
decimals: number;
fee: BigInt;
fee: bigint;
};

@@ -347,5 +348,5 @@ }

transferFeeInstruction: TransferFeeInstruction.TransferCheckedWithFee;
amount: BigInt;
amount: bigint;
decimals: number;
fee: BigInt;
fee: bigint;
};

@@ -352,0 +353,0 @@ }

@@ -1,10 +0,11 @@

import { struct, u16, Layout } from '@solana/buffer-layout';
import type { Layout } from '@solana/buffer-layout';
import { struct, u16 } from '@solana/buffer-layout';
import { publicKey, u64 } from '@solana/buffer-layout-utils';
import { PublicKey } from '@solana/web3.js';
import { Account } from '../../state';
import { Mint } from '../../state/mint';
import { ExtensionType, getExtensionData } from '../extensionType';
import type { PublicKey } from '@solana/web3.js';
import type { Account } from '../../state/account.js';
import type { Mint } from '../../state/mint.js';
import { ExtensionType, getExtensionData } from '../extensionType.js';
export const MAX_FEE_BASIS_POINTS = 10_000;
export const ONE_IN_BASIS_POINTS: BigInt = MAX_FEE_BASIS_POINTS as unknown as BigInt;
export const ONE_IN_BASIS_POINTS: bigint = MAX_FEE_BASIS_POINTS as unknown as bigint;

@@ -14,5 +15,5 @@ /** TransferFeeConfig as stored by the program */

/** First epoch where the transfer fee takes effect */
epoch: BigInt;
epoch: bigint;
/** Maximum fee assessed on transfers, expressed as an amount of tokens */
maximumFee: BigInt;
maximumFee: bigint;
/**

@@ -32,3 +33,3 @@ * Amount of transfer collected as fees, expressed as basis points of the

/** Withheld transfer fee tokens that have been moved to the mint for withdrawal */
withheldAmount: BigInt;
withheldAmount: bigint;
/** Older transfer fee, used if the current epoch < newerTransferFee.epoch */

@@ -59,3 +60,3 @@ olderTransferFee: TransferFee;

/** Withheld transfer fee tokens that can be claimed by the fee authority */
withheldAmount: BigInt;
withheldAmount: bigint;
}

@@ -62,0 +63,0 @@ /** Buffer layout for de/serializing */

@@ -1,6 +0,6 @@

export * from './extensions/index';
export * from './instructions/index';
export * from './state/index';
export * from './actions/index';
export * from './constants';
export * from './errors';
export * from './extensions/index.js';
export * from './instructions/index.js';
export * from './state/index.js';
export * from './actions/index.js';
export * from './constants.js';
export * from './errors.js';
import { struct, u8 } from '@solana/buffer-layout';
import { u64 } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,5 +11,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -15,0 +16,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { u64 } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,5 +11,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -15,0 +16,0 @@ /** TODO: docs */

@@ -1,3 +0,4 @@

import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '../constants';
import type { PublicKey } from '@solana/web3.js';
import { SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '../constants.js';

@@ -4,0 +5,0 @@ /**

import { struct, u8 } from '@solana/buffer-layout';
import { u64 } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,5 +11,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -15,0 +16,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { u64 } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,5 +11,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -15,0 +16,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -9,5 +10,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -14,0 +15,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { PublicKey, TransactionInstruction, SystemProgram } from '@solana/web3.js';
import { TOKEN_2022_PROGRAM_ID, NATIVE_MINT_2022 } from '../constants';
import { TokenInstruction } from './types';
import { TokenUnsupportedInstructionError } from '../errors';
import { programSupportsExtensions } from '../constants';
import type { PublicKey } from '@solana/web3.js';
import { SystemProgram, TransactionInstruction } from '@solana/web3.js';
import { NATIVE_MINT_2022, programSupportsExtensions, TOKEN_2022_PROGRAM_ID } from '../constants.js';
import { TokenUnsupportedInstructionError } from '../errors.js';
import { TokenInstruction } from './types.js';

@@ -8,0 +8,0 @@ /** TODO: docs */

import { u8 } from '@solana/buffer-layout';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { TokenInvalidInstructionDataError, TokenInvalidInstructionTypeError } from '../errors';
import { decodeApproveInstruction, DecodedApproveInstruction } from './approve';
import { decodeApproveCheckedInstruction, DecodedApproveCheckedInstruction } from './approveChecked';
import { decodeBurnInstruction, DecodedBurnInstruction } from './burn';
import { decodeBurnCheckedInstruction, DecodedBurnCheckedInstruction } from './burnChecked';
import { decodeCloseAccountInstruction, DecodedCloseAccountInstruction } from './closeAccount';
import { DecodedFreezeAccountInstruction, decodeFreezeAccountInstruction } from './freezeAccount';
import { DecodedInitializeAccountInstruction, decodeInitializeAccountInstruction } from './initializeAccount';
import { DecodedInitializeAccount2Instruction, decodeInitializeAccount2Instruction } from './initializeAccount2';
import { DecodedInitializeAccount3Instruction, decodeInitializeAccount3Instruction } from './initializeAccount3';
import { DecodedInitializeMintInstruction, decodeInitializeMintInstruction } from './initializeMint';
import { DecodedInitializeMultisigInstruction, decodeInitializeMultisigInstruction } from './initializeMultisig';
import { DecodedMintToInstruction, decodeMintToInstruction } from './mintTo';
import { DecodedMintToCheckedInstruction, decodeMintToCheckedInstruction } from './mintToChecked';
import { DecodedRevokeInstruction, decodeRevokeInstruction } from './revoke';
import { DecodedSetAuthorityInstruction, decodeSetAuthorityInstruction } from './setAuthority';
import { DecodedSyncNativeInstruction, decodeSyncNativeInstruction } from './syncNative';
import { DecodedThawAccountInstruction, decodeThawAccountInstruction } from './thawAccount';
import { DecodedTransferInstruction, decodeTransferInstruction } from './transfer';
import { DecodedTransferCheckedInstruction, decodeTransferCheckedInstruction } from './transferChecked';
import { TokenInstruction } from './types';
import type { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { TokenInvalidInstructionDataError, TokenInvalidInstructionTypeError } from '../errors.js';
import type { DecodedApproveInstruction } from './approve.js';
import { decodeApproveInstruction } from './approve.js';
import type { DecodedApproveCheckedInstruction } from './approveChecked.js';
import { decodeApproveCheckedInstruction } from './approveChecked.js';
import type { DecodedBurnInstruction } from './burn.js';
import { decodeBurnInstruction } from './burn.js';
import type { DecodedBurnCheckedInstruction } from './burnChecked.js';
import { decodeBurnCheckedInstruction } from './burnChecked.js';
import type { DecodedCloseAccountInstruction } from './closeAccount.js';
import { decodeCloseAccountInstruction } from './closeAccount.js';
import type { DecodedFreezeAccountInstruction } from './freezeAccount.js';
import { decodeFreezeAccountInstruction } from './freezeAccount.js';
import type { DecodedInitializeAccountInstruction } from './initializeAccount.js';
import { decodeInitializeAccountInstruction } from './initializeAccount.js';
import type { DecodedInitializeAccount2Instruction } from './initializeAccount2.js';
import { decodeInitializeAccount2Instruction } from './initializeAccount2.js';
import type { DecodedInitializeAccount3Instruction } from './initializeAccount3.js';
import { decodeInitializeAccount3Instruction } from './initializeAccount3.js';
import type { DecodedInitializeMintInstruction } from './initializeMint.js';
import { decodeInitializeMintInstruction } from './initializeMint.js';
import type { DecodedInitializeMultisigInstruction } from './initializeMultisig.js';
import { decodeInitializeMultisigInstruction } from './initializeMultisig.js';
import type { DecodedMintToInstruction } from './mintTo.js';
import { decodeMintToInstruction } from './mintTo.js';
import type { DecodedMintToCheckedInstruction } from './mintToChecked.js';
import { decodeMintToCheckedInstruction } from './mintToChecked.js';
import type { DecodedRevokeInstruction } from './revoke.js';
import { decodeRevokeInstruction } from './revoke.js';
import type { DecodedSetAuthorityInstruction } from './setAuthority.js';
import { decodeSetAuthorityInstruction } from './setAuthority.js';
import type { DecodedSyncNativeInstruction } from './syncNative.js';
import { decodeSyncNativeInstruction } from './syncNative.js';
import type { DecodedThawAccountInstruction } from './thawAccount.js';
import { decodeThawAccountInstruction } from './thawAccount.js';
import type { DecodedTransferInstruction } from './transfer.js';
import { decodeTransferInstruction } from './transfer.js';
import type { DecodedTransferCheckedInstruction } from './transferChecked.js';
import { decodeTransferCheckedInstruction } from './transferChecked.js';
import { TokenInstruction } from './types.js';

@@ -26,0 +45,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -9,5 +10,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -14,0 +15,0 @@ /** TODO: docs */

@@ -1,32 +0,30 @@

export * from './types';
export * from './associatedTokenAccount.js';
export * from './decode.js';
export * from './types.js';
export * from './initializeMint'; // 0
export * from './initializeAccount'; // 1
export * from './initializeMultisig'; // 2
export * from './transfer'; // 3
export * from './approve'; // 4
export * from './revoke'; // 5
export * from './setAuthority'; // 6
export * from './mintTo'; // 7
export * from './burn'; // 8
export * from './closeAccount'; // 9
export * from './freezeAccount'; // 10
export * from './thawAccount'; // 11
export * from './transferChecked'; // 12
export * from './approveChecked'; // 13
export * from './mintToChecked'; // 14
export * from './burnChecked'; // 15
export * from './initializeAccount2'; // 16
export * from './syncNative'; // 17
export * from './initializeAccount3'; // 18
export * from './initializeMultisig2'; // 19
export * from './initializeMint2'; // 20
export * from './initializeImmutableOwner'; // 22
export * from './initializeMintCloseAuthority'; // 23
export * from './reallocate'; // 29
export * from './createNativeMint'; // 31
export * from './initializeNonTransferableMint'; // 32
export * from './decode';
export * from './associatedTokenAccount';
export * from './initializeMint.js'; // 0
export * from './initializeAccount.js'; // 1
export * from './initializeMultisig.js'; // 2
export * from './transfer.js'; // 3
export * from './approve.js'; // 4
export * from './revoke.js'; // 5
export * from './setAuthority.js'; // 6
export * from './mintTo.js'; // 7
export * from './burn.js'; // 8
export * from './closeAccount.js'; // 9
export * from './freezeAccount.js'; // 10
export * from './thawAccount.js'; // 11
export * from './transferChecked.js'; // 12
export * from './approveChecked.js'; // 13
export * from './mintToChecked.js'; // 14
export * from './burnChecked.js'; // 15
export * from './initializeAccount2.js'; // 16
export * from './syncNative.js'; // 17
export * from './initializeAccount3.js'; // 18
export * from './initializeMultisig2.js'; // 19
export * from './initializeMint2.js'; // 20
export * from './initializeImmutableOwner.js'; // 22
export * from './initializeMintCloseAuthority.js'; // 23
export * from './reallocate.js'; // 29
export * from './createNativeMint.js'; // 31
export * from './initializeNonTransferableMint.js'; // 32
import { struct, u8 } from '@solana/buffer-layout';
import { AccountMeta, PublicKey, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -9,4 +10,4 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { TokenInstruction } from './types';
} from '../errors.js';
import { TokenInstruction } from './types.js';

@@ -13,0 +14,0 @@ /** TODO: docs */

@@ -1,6 +0,6 @@

import { TokenInstruction } from './types';
import { struct, u8 } from '@solana/buffer-layout';
import { publicKey } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -11,3 +11,4 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
} from '../errors.js';
import { TokenInstruction } from './types.js';

@@ -14,0 +15,0 @@ export interface InitializeAccount2InstructionData {

@@ -1,6 +0,6 @@

import { TokenInstruction } from './types';
import { struct, u8 } from '@solana/buffer-layout';
import { publicKey } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -11,3 +11,4 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
} from '../errors.js';
import { TokenInstruction } from './types.js';

@@ -14,0 +15,0 @@ export interface InitializeAccount3InstructionData {

import { struct, u8 } from '@solana/buffer-layout';
import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import {

@@ -8,4 +9,4 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { TokenInstruction } from './types';
} from '../errors.js';
import { TokenInstruction } from './types.js';

@@ -12,0 +13,0 @@ /** Deserialized instruction for the initiation of an immutable owner account */

import { struct, u8 } from '@solana/buffer-layout';
import { publicKey } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta } from '@solana/web3.js';
import { PublicKey, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,4 +11,4 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { TokenInstruction } from './types';
} from '../errors.js';
import { TokenInstruction } from './types.js';

@@ -14,0 +15,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { publicKey } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import type { AccountMeta } from '@solana/web3.js';
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import { programSupportsExtensions } from '../constants.js';
import {
TokenUnsupportedInstructionError,
TokenInvalidInstructionDataError,

@@ -10,5 +11,5 @@ TokenInvalidInstructionKeysError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { TokenInstruction } from './types';
import { programSupportsExtensions } from '../constants';
TokenUnsupportedInstructionError,
} from '../errors.js';
import { TokenInstruction } from './types.js';

@@ -15,0 +16,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { AccountMeta, PublicKey, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -9,4 +10,4 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { TokenInstruction } from './types';
} from '../errors.js';
import { TokenInstruction } from './types.js';

@@ -13,0 +14,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TokenInstruction } from './types';
import { TokenUnsupportedInstructionError } from '../errors';
import { programSupportsExtensions } from '../constants';
import type { PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { programSupportsExtensions } from '../constants.js';
import { TokenUnsupportedInstructionError } from '../errors.js';
import { TokenInstruction } from './types.js';

@@ -7,0 +8,0 @@ /** Deserialized instruction for the initiation of an immutable owner account */

@@ -1,2 +0,2 @@

import { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';

@@ -3,0 +3,0 @@ /** @internal */

import { struct, u8 } from '@solana/buffer-layout';
import { u64 } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,5 +11,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -15,0 +16,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { u64 } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,5 +11,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -15,0 +16,0 @@ /** TODO: docs */

@@ -1,8 +0,9 @@

import { seq, struct, u8, u16 } from '@solana/buffer-layout';
import { PublicKey, Signer, SystemProgram, TransactionInstruction } from '@solana/web3.js';
import { programSupportsExtensions, TOKEN_2022_PROGRAM_ID } from '../constants';
import { TokenUnsupportedInstructionError } from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
import { ExtensionType } from '../extensions';
import { seq, struct, u16, u8 } from '@solana/buffer-layout';
import type { PublicKey, Signer } from '@solana/web3.js';
import { SystemProgram, TransactionInstruction } from '@solana/web3.js';
import { programSupportsExtensions, TOKEN_2022_PROGRAM_ID } from '../constants.js';
import { TokenUnsupportedInstructionError } from '../errors.js';
import type { ExtensionType } from '../extensions/extensionType.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -9,0 +10,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -9,5 +10,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -14,0 +15,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { publicKey } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, Signer } from '@solana/web3.js';
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,5 +11,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -15,0 +16,0 @@ /** Authority types defined by the program */

import { struct, u8 } from '@solana/buffer-layout';
import { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -9,4 +10,4 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { TokenInstruction } from './types';
} from '../errors.js';
import { TokenInstruction } from './types.js';

@@ -13,0 +14,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -9,5 +10,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -14,0 +15,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { u64 } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,5 +11,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -15,0 +16,0 @@ /** TODO: docs */

import { struct, u8 } from '@solana/buffer-layout';
import { u64 } from '@solana/buffer-layout-utils';
import { AccountMeta, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountMeta, PublicKey, Signer } from '@solana/web3.js';
import { TransactionInstruction } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,5 +11,5 @@ TokenInvalidInstructionDataError,

TokenInvalidInstructionTypeError,
} from '../errors';
import { addSigners } from './internal';
import { TokenInstruction } from './types';
} from '../errors.js';
import { addSigners } from './internal.js';
import { TokenInstruction } from './types.js';

@@ -15,0 +16,0 @@ /** TODO: docs */

import { struct, u32, u8 } from '@solana/buffer-layout';
import { publicKey, u64 } from '@solana/buffer-layout-utils';
import { Commitment, Connection, PublicKey, AccountInfo } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import type { AccountInfo, Commitment, Connection, PublicKey } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -10,6 +10,7 @@ TokenAccountNotFoundError,

TokenInvalidAccountSizeError,
} from '../errors';
import { MULTISIG_SIZE } from './multisig';
import { AccountType, ACCOUNT_TYPE_SIZE } from '../extensions/accountType';
import { ExtensionType, getAccountLen } from '../extensions/extensionType';
} from '../errors.js';
import { ACCOUNT_TYPE_SIZE, AccountType } from '../extensions/accountType.js';
import type { ExtensionType } from '../extensions/extensionType.js';
import { getAccountLen } from '../extensions/extensionType.js';
import { MULTISIG_SIZE } from './multisig.js';

@@ -16,0 +17,0 @@ /** Information about a token account */

@@ -1,3 +0,3 @@

export * from './account';
export * from './mint';
export * from './multisig';
export * from './account.js';
export * from './mint.js';
export * from './multisig.js';
import { struct, u32, u8 } from '@solana/buffer-layout';
import { bool, publicKey, u64 } from '@solana/buffer-layout-utils';
import { AccountInfo, Commitment, Connection, PublicKey } from '@solana/web3.js';
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '../constants';
import type { AccountInfo, Commitment, Connection } from '@solana/web3.js';
import { PublicKey } from '@solana/web3.js';
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '../constants.js';
import {

@@ -11,7 +12,8 @@ TokenAccountNotFoundError,

TokenOwnerOffCurveError,
} from '../errors';
import { ACCOUNT_SIZE } from './account';
import { MULTISIG_SIZE } from './multisig';
import { AccountType, ACCOUNT_TYPE_SIZE } from '../extensions/accountType';
import { ExtensionType, getMintLen } from '../extensions/extensionType';
} from '../errors.js';
import { ACCOUNT_TYPE_SIZE, AccountType } from '../extensions/accountType.js';
import type { ExtensionType } from '../extensions/extensionType.js';
import { getMintLen } from '../extensions/extensionType.js';
import { ACCOUNT_SIZE } from './account.js';
import { MULTISIG_SIZE } from './multisig.js';

@@ -18,0 +20,0 @@ /** Information about a mint */

import { struct, u8 } from '@solana/buffer-layout';
import { bool, publicKey } from '@solana/buffer-layout-utils';
import { AccountInfo, Commitment, Connection, PublicKey } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants';
import { TokenAccountNotFoundError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError } from '../errors';
import type { AccountInfo, Commitment, Connection, PublicKey } from '@solana/web3.js';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { TokenAccountNotFoundError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError } from '../errors.js';

@@ -7,0 +7,0 @@ /** Information about a multisig */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc