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.2 to 0.3.3

lib/cjs/actions/amountToUiAmount.js

30

lib/cjs/actions/index.js

@@ -17,23 +17,25 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./amountToUiAmount.js"), exports);
__exportStar(require("./approve.js"), exports);
__exportStar(require("./approveChecked.js"), exports);
__exportStar(require("./burn.js"), exports);
__exportStar(require("./burnChecked.js"), exports);
__exportStar(require("./closeAccount.js"), exports);
__exportStar(require("./createAccount.js"), exports);
__exportStar(require("./createAssociatedTokenAccount.js"), exports);
__exportStar(require("./createMint.js"), exports);
__exportStar(require("./createMultisig.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("./freezeAccount.js"), exports);
__exportStar(require("./getOrCreateAssociatedTokenAccount.js"), exports);
__exportStar(require("./mintTo.js"), exports);
__exportStar(require("./mintToChecked.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("./syncNative.js"), exports);
__exportStar(require("./thawAccount.js"), exports);
__exportStar(require("./transfer.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);
__exportStar(require("./uiAmountToAmount.js"), exports);
//# sourceMappingURL=index.js.map

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

__exportStar(require("./extensionType.js"), exports);
__exportStar(require("./immutableOwner.js"), exports);
__exportStar(require("./interestBearingMint/index.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

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

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./actions/index.js"), exports);
__exportStar(require("./constants.js"), exports);
__exportStar(require("./errors.js"), 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
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isInitializeAccount3Instruction = exports.isSyncNativeInstruction = exports.isInitializeAccount2Instruction = exports.isBurnCheckedInstruction = exports.isMintToCheckedInstruction = exports.isApproveCheckedInstruction = exports.isTransferCheckedInstruction = exports.isThawAccountInstruction = exports.isFreezeAccountInstruction = exports.isCloseAccountInstruction = exports.isBurnInstruction = exports.isMintToInstruction = exports.isSetAuthorityInstruction = exports.isRevokeInstruction = exports.isApproveInstruction = exports.isTransferInstruction = exports.isInitializeMultisigInstruction = exports.isInitializeAccountInstruction = exports.isInitializeMintInstruction = exports.decodeInstruction = void 0;
exports.isUiamountToAmountInstruction = exports.isAmountToUiAmountInstruction = exports.isInitializeAccount3Instruction = exports.isSyncNativeInstruction = exports.isInitializeAccount2Instruction = exports.isBurnCheckedInstruction = exports.isMintToCheckedInstruction = exports.isApproveCheckedInstruction = exports.isTransferCheckedInstruction = exports.isThawAccountInstruction = exports.isFreezeAccountInstruction = exports.isCloseAccountInstruction = exports.isBurnInstruction = exports.isMintToInstruction = exports.isSetAuthorityInstruction = exports.isRevokeInstruction = exports.isApproveInstruction = exports.isTransferInstruction = exports.isInitializeMultisigInstruction = exports.isInitializeAccountInstruction = exports.isInitializeMintInstruction = exports.decodeInstruction = void 0;
const buffer_layout_1 = require("@solana/buffer-layout");
const constants_js_1 = require("../constants.js");
const errors_js_1 = require("../errors.js");
const amountToUiAmount_js_1 = require("./amountToUiAmount.js");
const approve_js_1 = require("./approve.js");

@@ -27,2 +28,3 @@ const approveChecked_js_1 = require("./approveChecked.js");

const types_js_1 = require("./types.js");
const uiAmountToAmount_js_1 = require("./uiAmountToAmount.js");
/** TODO: docs */

@@ -69,2 +71,6 @@ function decodeInstruction(instruction, programId = constants_js_1.TOKEN_PROGRAM_ID) {

return (0, syncNative_js_1.decodeSyncNativeInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.AmountToUiAmount)
return (0, amountToUiAmount_js_1.decodeAmountToUiAmountInstruction)(instruction, programId);
if (type === types_js_1.TokenInstruction.UiAmountToAmount)
return (0, uiAmountToAmount_js_1.decodeUiAmountToAmountInstruction)(instruction, programId);
// TODO: implement

@@ -177,2 +183,12 @@ if (type === types_js_1.TokenInstruction.InitializeAccount3)

exports.isInitializeAccount3Instruction = isInitializeAccount3Instruction;
/** TODO: docs */
function isAmountToUiAmountInstruction(decoded) {
return decoded.data.instruction === types_js_1.TokenInstruction.AmountToUiAmount;
}
exports.isAmountToUiAmountInstruction = isAmountToUiAmountInstruction;
/** TODO: docs */
function isUiamountToAmountInstruction(decoded) {
return decoded.data.instruction === types_js_1.TokenInstruction.UiAmountToAmount;
}
exports.isUiamountToAmountInstruction = isUiamountToAmountInstruction;
/** TODO: docs, implement */

@@ -179,0 +195,0 @@ // export function isInitializeMultisig2Instruction(

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

__exportStar(require("./initializeImmutableOwner.js"), exports); // 22
__exportStar(require("./initializeMintCloseAuthority.js"), exports); // 23
__exportStar(require("./amountToUiAmount.js"), exports); // 23
__exportStar(require("./uiAmountToAmount.js"), exports); // 24
__exportStar(require("./initializeMintCloseAuthority.js"), exports); // 25
__exportStar(require("./reallocate.js"), exports); // 29

@@ -45,0 +47,0 @@ __exportStar(require("./createNativeMint.js"), exports); // 31

@@ -0,22 +1,24 @@

export * from './amountToUiAmount.js';
export * from './approve.js';
export * from './approveChecked.js';
export * from './burn.js';
export * from './burnChecked.js';
export * from './closeAccount.js';
export * from './createAccount.js';
export * from './createAssociatedTokenAccount.js';
export * from './createMint.js';
export * from './createMultisig.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 './freezeAccount.js';
export * from './getOrCreateAssociatedTokenAccount.js';
export * from './mintTo.js';
export * from './mintToChecked.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 './syncNative.js';
export * from './thawAccount.js';
export * from './transfer.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';
export * from './uiAmountToAmount.js';
//# sourceMappingURL=index.js.map
export * from './accountType.js';
export * from './defaultAccountState/index.js';
export * from './extensionType.js';
export * from './immutableOwner.js';
export * from './interestBearingMint/index.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.js.map

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

export * from './actions/index.js';
export * from './constants.js';
export * from './errors.js';
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.js.map
import { u8 } from '@solana/buffer-layout';
import { TOKEN_PROGRAM_ID } from '../constants.js';
import { TokenInvalidInstructionDataError, TokenInvalidInstructionTypeError } from '../errors.js';
import { decodeAmountToUiAmountInstruction } from './amountToUiAmount.js';
import { decodeApproveInstruction } from './approve.js';

@@ -24,2 +25,3 @@ import { decodeApproveCheckedInstruction } from './approveChecked.js';

import { TokenInstruction } from './types.js';
import { decodeUiAmountToAmountInstruction } from './uiAmountToAmount.js';
/** TODO: docs */

@@ -66,2 +68,6 @@ export function decodeInstruction(instruction, programId = TOKEN_PROGRAM_ID) {

return decodeSyncNativeInstruction(instruction, programId);
if (type === TokenInstruction.AmountToUiAmount)
return decodeAmountToUiAmountInstruction(instruction, programId);
if (type === TokenInstruction.UiAmountToAmount)
return decodeUiAmountToAmountInstruction(instruction, programId);
// TODO: implement

@@ -154,2 +160,10 @@ if (type === TokenInstruction.InitializeAccount3)

}
/** TODO: docs */
export function isAmountToUiAmountInstruction(decoded) {
return decoded.data.instruction === TokenInstruction.AmountToUiAmount;
}
/** TODO: docs */
export function isUiamountToAmountInstruction(decoded) {
return decoded.data.instruction === TokenInstruction.UiAmountToAmount;
}
/** TODO: docs, implement */

@@ -156,0 +170,0 @@ // export function isInitializeMultisig2Instruction(

@@ -26,3 +26,5 @@ export * from './associatedTokenAccount.js';

export * from './initializeImmutableOwner.js'; // 22
export * from './initializeMintCloseAuthority.js'; // 23
export * from './amountToUiAmount.js'; // 23
export * from './uiAmountToAmount.js'; // 24
export * from './initializeMintCloseAuthority.js'; // 25
export * from './reallocate.js'; // 29

@@ -29,0 +31,0 @@ export * from './createNativeMint.js'; // 31

@@ -0,22 +1,24 @@

export * from './amountToUiAmount.js';
export * from './approve.js';
export * from './approveChecked.js';
export * from './burn.js';
export * from './burnChecked.js';
export * from './closeAccount.js';
export * from './createAccount.js';
export * from './createAssociatedTokenAccount.js';
export * from './createMint.js';
export * from './createMultisig.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 './freezeAccount.js';
export * from './getOrCreateAssociatedTokenAccount.js';
export * from './mintTo.js';
export * from './mintToChecked.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 './syncNative.js';
export * from './thawAccount.js';
export * from './transfer.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';
export * from './uiAmountToAmount.js';
//# sourceMappingURL=index.d.ts.map
export * from './accountType.js';
export * from './defaultAccountState/index.js';
export * from './extensionType.js';
export * from './immutableOwner.js';
export * from './interestBearingMint/index.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

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

export * from './actions/index.js';
export * from './constants.js';
export * from './errors.js';
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
import type { TransactionInstruction } from '@solana/web3.js';
import type { DecodedAmountToUiAmountInstruction } from './amountToUiAmount.js';
import type { DecodedApproveInstruction } from './approve.js';

@@ -21,4 +22,5 @@ import type { DecodedApproveCheckedInstruction } from './approveChecked.js';

import type { DecodedTransferCheckedInstruction } from './transferChecked.js';
import type { DecodedUiAmountToAmountInstruction } from './uiAmountToAmount.js';
/** TODO: docs */
export declare type DecodedInstruction = DecodedInitializeMintInstruction | DecodedInitializeAccountInstruction | DecodedInitializeMultisigInstruction | DecodedTransferInstruction | DecodedApproveInstruction | DecodedRevokeInstruction | DecodedSetAuthorityInstruction | DecodedMintToInstruction | DecodedBurnInstruction | DecodedCloseAccountInstruction | DecodedFreezeAccountInstruction | DecodedThawAccountInstruction | DecodedTransferCheckedInstruction | DecodedApproveCheckedInstruction | DecodedMintToCheckedInstruction | DecodedBurnCheckedInstruction | DecodedInitializeAccount2Instruction | DecodedSyncNativeInstruction | DecodedInitializeAccount3Instruction | never;
export declare type DecodedInstruction = DecodedInitializeMintInstruction | DecodedInitializeAccountInstruction | DecodedInitializeMultisigInstruction | DecodedTransferInstruction | DecodedApproveInstruction | DecodedRevokeInstruction | DecodedSetAuthorityInstruction | DecodedMintToInstruction | DecodedBurnInstruction | DecodedCloseAccountInstruction | DecodedFreezeAccountInstruction | DecodedThawAccountInstruction | DecodedTransferCheckedInstruction | DecodedApproveCheckedInstruction | DecodedMintToCheckedInstruction | DecodedBurnCheckedInstruction | DecodedInitializeAccount2Instruction | DecodedSyncNativeInstruction | DecodedInitializeAccount3Instruction | DecodedAmountToUiAmountInstruction | DecodedUiAmountToAmountInstruction | never;
/** TODO: docs */

@@ -64,4 +66,8 @@ export declare function decodeInstruction(instruction: TransactionInstruction, programId?: import("@solana/web3.js").PublicKey): DecodedInstruction;

export declare function isInitializeAccount3Instruction(decoded: DecodedInstruction): decoded is DecodedInitializeAccount3Instruction;
/** TODO: docs */
export declare function isAmountToUiAmountInstruction(decoded: DecodedInstruction): decoded is DecodedAmountToUiAmountInstruction;
/** TODO: docs */
export declare function isUiamountToAmountInstruction(decoded: DecodedInstruction): decoded is DecodedUiAmountToAmountInstruction;
/** TODO: docs, implement */
/** TODO: docs, implement */
//# sourceMappingURL=decode.d.ts.map

@@ -26,2 +26,4 @@ export * from './associatedTokenAccount.js';

export * from './initializeImmutableOwner.js';
export * from './amountToUiAmount.js';
export * from './uiAmountToAmount.js';
export * from './initializeMintCloseAuthority.js';

@@ -28,0 +30,0 @@ export * from './reallocate.js';

{
"name": "@solana/spl-token",
"description": "SPL Token Program JS API",
"version": "0.3.2",
"version": "0.3.3",
"author": "Solana Maintainers <maintainers@solana.foundation>",

@@ -52,3 +52,3 @@ "repository": "https://github.com/solana-labs/solana-program-library",

"peerDependencies": {
"@solana/web3.js": "^1.20.0"
"@solana/web3.js": "^1.47.4"
},

@@ -62,3 +62,3 @@ "dependencies": {

"@solana/spl-memo": "^0.2.1",
"@solana/web3.js": "^1.20.0",
"@solana/web3.js": "^1.47.4",
"@types/chai-as-promised": "^7.1.4",

@@ -65,0 +65,0 @@ "@types/chai": "^4.3.3",

@@ -0,22 +1,23 @@

export * from './amountToUiAmount.js';
export * from './approve.js';
export * from './approveChecked.js';
export * from './burn.js';
export * from './burnChecked.js';
export * from './closeAccount.js';
export * from './createAccount.js';
export * from './createAssociatedTokenAccount.js';
export * from './createMint.js';
export * from './createMultisig.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 './freezeAccount.js';
export * from './getOrCreateAssociatedTokenAccount.js';
export * from './mintTo.js';
export * from './mintToChecked.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 './syncNative.js';
export * from './thawAccount.js';
export * from './transfer.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';
export * from './uiAmountToAmount.js';
export * from './accountType.js';
export * from './defaultAccountState/index.js';
export * from './extensionType.js';
export * from './immutableOwner.js';
export * from './interestBearingMint/index.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,6 +1,6 @@

export * from './actions/index.js';
export * from './constants.js';
export * from './errors.js';
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';

@@ -5,2 +5,4 @@ import { u8 } from '@solana/buffer-layout';

import { TokenInvalidInstructionDataError, TokenInvalidInstructionTypeError } from '../errors.js';
import type { DecodedAmountToUiAmountInstruction } from './amountToUiAmount.js';
import { decodeAmountToUiAmountInstruction } from './amountToUiAmount.js';
import type { DecodedApproveInstruction } from './approve.js';

@@ -45,2 +47,4 @@ import { decodeApproveInstruction } from './approve.js';

import { TokenInstruction } from './types.js';
import type { DecodedUiAmountToAmountInstruction } from './uiAmountToAmount.js';
import { decodeUiAmountToAmountInstruction } from './uiAmountToAmount.js';

@@ -68,2 +72,4 @@ /** TODO: docs */

| DecodedInitializeAccount3Instruction
| DecodedAmountToUiAmountInstruction
| DecodedUiAmountToAmountInstruction
// | DecodedInitializeMultisig2Instruction

@@ -102,2 +108,4 @@ // | DecodedInitializeMint2Instruction

if (type === TokenInstruction.SyncNative) return decodeSyncNativeInstruction(instruction, programId);
if (type === TokenInstruction.AmountToUiAmount) return decodeAmountToUiAmountInstruction(instruction, programId);
if (type === TokenInstruction.UiAmountToAmount) return decodeUiAmountToAmountInstruction(instruction, programId);
// TODO: implement

@@ -219,2 +227,16 @@ if (type === TokenInstruction.InitializeAccount3)

/** TODO: docs */
export function isAmountToUiAmountInstruction(
decoded: DecodedInstruction
): decoded is DecodedAmountToUiAmountInstruction {
return decoded.data.instruction === TokenInstruction.AmountToUiAmount;
}
/** TODO: docs */
export function isUiamountToAmountInstruction(
decoded: DecodedInstruction
): decoded is DecodedUiAmountToAmountInstruction {
return decoded.data.instruction === TokenInstruction.UiAmountToAmount;
}
/** TODO: docs, implement */

@@ -221,0 +243,0 @@ // export function isInitializeMultisig2Instruction(

@@ -27,5 +27,7 @@ export * from './associatedTokenAccount.js';

export * from './initializeImmutableOwner.js'; // 22
export * from './initializeMintCloseAuthority.js'; // 23
export * from './amountToUiAmount.js'; // 23
export * from './uiAmountToAmount.js'; // 24
export * from './initializeMintCloseAuthority.js'; // 25
export * from './reallocate.js'; // 29
export * from './createNativeMint.js'; // 31
export * from './initializeNonTransferableMint.js'; // 32

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