@solana/spl-token
Advanced tools
Comparing version 0.2.0-alpha.0 to 0.2.0-alpha.1
@@ -20,2 +20,42 @@ import { TransactionInstruction } from '@solana/web3.js'; | ||
/** TODO: docs */ | ||
export declare function decodeInstruction(instruction: TransactionInstruction, programId?: import("@solana/web3.js").PublicKey): DecodedInitializeMintInstruction | DecodedInitializeAccountInstruction | DecodedInitializeMultisigInstruction | DecodedTransferInstruction | DecodedApproveInstruction | DecodedRevokeInstruction | DecodedSetAuthorityInstruction | DecodedMintToInstruction | DecodedBurnInstruction | DecodedCloseAccountInstruction | DecodedFreezeAccountInstruction | DecodedThawAccountInstruction | DecodedTransferCheckedInstruction | DecodedApproveCheckedInstruction | DecodedMintToCheckedInstruction | DecodedBurnCheckedInstruction | DecodedSyncNativeInstruction; | ||
export declare type DecodedInstruction = DecodedInitializeMintInstruction | DecodedInitializeAccountInstruction | DecodedInitializeMultisigInstruction | DecodedTransferInstruction | DecodedApproveInstruction | DecodedRevokeInstruction | DecodedSetAuthorityInstruction | DecodedMintToInstruction | DecodedBurnInstruction | DecodedCloseAccountInstruction | DecodedFreezeAccountInstruction | DecodedThawAccountInstruction | DecodedTransferCheckedInstruction | DecodedApproveCheckedInstruction | DecodedMintToCheckedInstruction | DecodedBurnCheckedInstruction | DecodedSyncNativeInstruction | never; | ||
/** TODO: docs */ | ||
export declare function decodeInstruction(instruction: TransactionInstruction, programId?: import("@solana/web3.js").PublicKey): DecodedInstruction; | ||
/** TODO: docs */ | ||
export declare function isInitializeMintInstruction(decoded: DecodedInstruction): decoded is DecodedInitializeMintInstruction; | ||
/** TODO: docs */ | ||
export declare function isInitializeAccountInstruction(decoded: DecodedInstruction): decoded is DecodedInitializeAccountInstruction; | ||
/** TODO: docs */ | ||
export declare function isInitializeMultisigInstruction(decoded: DecodedInstruction): decoded is DecodedInitializeMultisigInstruction; | ||
/** TODO: docs */ | ||
export declare function isTransferInstruction(decoded: DecodedInstruction): decoded is DecodedTransferInstruction; | ||
/** TODO: docs */ | ||
export declare function isApproveInstruction(decoded: DecodedInstruction): decoded is DecodedApproveInstruction; | ||
/** TODO: docs */ | ||
export declare function isRevokeInstruction(decoded: DecodedInstruction): decoded is DecodedRevokeInstruction; | ||
/** TODO: docs */ | ||
export declare function isSetAuthorityInstruction(decoded: DecodedInstruction): decoded is DecodedSetAuthorityInstruction; | ||
/** TODO: docs */ | ||
export declare function isMintToInstruction(decoded: DecodedInstruction): decoded is DecodedMintToInstruction; | ||
/** TODO: docs */ | ||
export declare function isBurnInstruction(decoded: DecodedInstruction): decoded is DecodedBurnInstruction; | ||
/** TODO: docs */ | ||
export declare function isCloseAccountInstruction(decoded: DecodedInstruction): decoded is DecodedCloseAccountInstruction; | ||
/** TODO: docs */ | ||
export declare function isFreezeAccountInstruction(decoded: DecodedInstruction): decoded is DecodedFreezeAccountInstruction; | ||
/** TODO: docs */ | ||
export declare function isThawAccountInstruction(decoded: DecodedInstruction): decoded is DecodedThawAccountInstruction; | ||
/** TODO: docs */ | ||
export declare function isTransferCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedTransferCheckedInstruction; | ||
/** TODO: docs */ | ||
export declare function isApproveCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedApproveCheckedInstruction; | ||
/** TODO: docs */ | ||
export declare function isMintToCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedMintToCheckedInstruction; | ||
/** TODO: docs */ | ||
export declare function isBurnCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedBurnCheckedInstruction; | ||
/** TODO: docs, implement */ | ||
/** TODO: docs */ | ||
export declare function isSyncNativeInstruction(decoded: DecodedInstruction): decoded is DecodedSyncNativeInstruction; | ||
/** TODO: docs, implement */ | ||
/** TODO: docs, implement */ | ||
/** TODO: docs, implement */ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.decodeInstruction = void 0; | ||
exports.isSyncNativeInstruction = 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"); | ||
@@ -27,6 +27,2 @@ const constants_1 = require("../constants"); | ||
function decodeInstruction(instruction, programId = constants_1.TOKEN_PROGRAM_ID) { | ||
// | DecodedInitializeAccount3Instruction | ||
// | DecodedInitializeMultisig2Instruction | ||
// | DecodedInitializeMint2Instruction | ||
// TODO: implement ^ | ||
if (!instruction.data.length) | ||
@@ -84,2 +80,111 @@ throw new errors_1.TokenInvalidInstructionDataError(); | ||
exports.decodeInstruction = decodeInstruction; | ||
/** TODO: docs */ | ||
function isInitializeMintInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.InitializeMint; | ||
} | ||
exports.isInitializeMintInstruction = isInitializeMintInstruction; | ||
/** TODO: docs */ | ||
function isInitializeAccountInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.InitializeAccount; | ||
} | ||
exports.isInitializeAccountInstruction = isInitializeAccountInstruction; | ||
/** TODO: docs */ | ||
function isInitializeMultisigInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.InitializeMultisig; | ||
} | ||
exports.isInitializeMultisigInstruction = isInitializeMultisigInstruction; | ||
/** TODO: docs */ | ||
function isTransferInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.Transfer; | ||
} | ||
exports.isTransferInstruction = isTransferInstruction; | ||
/** TODO: docs */ | ||
function isApproveInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.Approve; | ||
} | ||
exports.isApproveInstruction = isApproveInstruction; | ||
/** TODO: docs */ | ||
function isRevokeInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.Revoke; | ||
} | ||
exports.isRevokeInstruction = isRevokeInstruction; | ||
/** TODO: docs */ | ||
function isSetAuthorityInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.SetAuthority; | ||
} | ||
exports.isSetAuthorityInstruction = isSetAuthorityInstruction; | ||
/** TODO: docs */ | ||
function isMintToInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.MintTo; | ||
} | ||
exports.isMintToInstruction = isMintToInstruction; | ||
/** TODO: docs */ | ||
function isBurnInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.Burn; | ||
} | ||
exports.isBurnInstruction = isBurnInstruction; | ||
/** TODO: docs */ | ||
function isCloseAccountInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.CloseAccount; | ||
} | ||
exports.isCloseAccountInstruction = isCloseAccountInstruction; | ||
/** TODO: docs */ | ||
function isFreezeAccountInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.FreezeAccount; | ||
} | ||
exports.isFreezeAccountInstruction = isFreezeAccountInstruction; | ||
/** TODO: docs */ | ||
function isThawAccountInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.ThawAccount; | ||
} | ||
exports.isThawAccountInstruction = isThawAccountInstruction; | ||
/** TODO: docs */ | ||
function isTransferCheckedInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.TransferChecked; | ||
} | ||
exports.isTransferCheckedInstruction = isTransferCheckedInstruction; | ||
/** TODO: docs */ | ||
function isApproveCheckedInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.ApproveChecked; | ||
} | ||
exports.isApproveCheckedInstruction = isApproveCheckedInstruction; | ||
/** TODO: docs */ | ||
function isMintToCheckedInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.MintToChecked; | ||
} | ||
exports.isMintToCheckedInstruction = isMintToCheckedInstruction; | ||
/** TODO: docs */ | ||
function isBurnCheckedInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.BurnChecked; | ||
} | ||
exports.isBurnCheckedInstruction = isBurnCheckedInstruction; | ||
/** TODO: docs, implement */ | ||
// export function isInitializeAccount2Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeAccount2Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeAccount2; | ||
// } | ||
/** TODO: docs */ | ||
function isSyncNativeInstruction(decoded) { | ||
return decoded.data.instruction === types_1.TokenInstruction.SyncNative; | ||
} | ||
exports.isSyncNativeInstruction = isSyncNativeInstruction; | ||
/** TODO: docs, implement */ | ||
// export function isInitializeAccount3Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeAccount3Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeAccount3; | ||
// } | ||
/** TODO: docs, implement */ | ||
// export function isInitializeMultisig2Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeMultisig2Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeMultisig2; | ||
// } | ||
/** TODO: docs, implement */ | ||
// export function isInitializeMint2Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeMint2Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeMint2; | ||
// } | ||
//# sourceMappingURL=decode.js.map |
@@ -20,2 +20,42 @@ import { TransactionInstruction } from '@solana/web3.js'; | ||
/** TODO: docs */ | ||
export declare function decodeInstruction(instruction: TransactionInstruction, programId?: import("@solana/web3.js").PublicKey): DecodedInitializeMintInstruction | DecodedInitializeAccountInstruction | DecodedInitializeMultisigInstruction | DecodedTransferInstruction | DecodedApproveInstruction | DecodedRevokeInstruction | DecodedSetAuthorityInstruction | DecodedMintToInstruction | DecodedBurnInstruction | DecodedCloseAccountInstruction | DecodedFreezeAccountInstruction | DecodedThawAccountInstruction | DecodedTransferCheckedInstruction | DecodedApproveCheckedInstruction | DecodedMintToCheckedInstruction | DecodedBurnCheckedInstruction | DecodedSyncNativeInstruction; | ||
export declare type DecodedInstruction = DecodedInitializeMintInstruction | DecodedInitializeAccountInstruction | DecodedInitializeMultisigInstruction | DecodedTransferInstruction | DecodedApproveInstruction | DecodedRevokeInstruction | DecodedSetAuthorityInstruction | DecodedMintToInstruction | DecodedBurnInstruction | DecodedCloseAccountInstruction | DecodedFreezeAccountInstruction | DecodedThawAccountInstruction | DecodedTransferCheckedInstruction | DecodedApproveCheckedInstruction | DecodedMintToCheckedInstruction | DecodedBurnCheckedInstruction | DecodedSyncNativeInstruction | never; | ||
/** TODO: docs */ | ||
export declare function decodeInstruction(instruction: TransactionInstruction, programId?: import("@solana/web3.js").PublicKey): DecodedInstruction; | ||
/** TODO: docs */ | ||
export declare function isInitializeMintInstruction(decoded: DecodedInstruction): decoded is DecodedInitializeMintInstruction; | ||
/** TODO: docs */ | ||
export declare function isInitializeAccountInstruction(decoded: DecodedInstruction): decoded is DecodedInitializeAccountInstruction; | ||
/** TODO: docs */ | ||
export declare function isInitializeMultisigInstruction(decoded: DecodedInstruction): decoded is DecodedInitializeMultisigInstruction; | ||
/** TODO: docs */ | ||
export declare function isTransferInstruction(decoded: DecodedInstruction): decoded is DecodedTransferInstruction; | ||
/** TODO: docs */ | ||
export declare function isApproveInstruction(decoded: DecodedInstruction): decoded is DecodedApproveInstruction; | ||
/** TODO: docs */ | ||
export declare function isRevokeInstruction(decoded: DecodedInstruction): decoded is DecodedRevokeInstruction; | ||
/** TODO: docs */ | ||
export declare function isSetAuthorityInstruction(decoded: DecodedInstruction): decoded is DecodedSetAuthorityInstruction; | ||
/** TODO: docs */ | ||
export declare function isMintToInstruction(decoded: DecodedInstruction): decoded is DecodedMintToInstruction; | ||
/** TODO: docs */ | ||
export declare function isBurnInstruction(decoded: DecodedInstruction): decoded is DecodedBurnInstruction; | ||
/** TODO: docs */ | ||
export declare function isCloseAccountInstruction(decoded: DecodedInstruction): decoded is DecodedCloseAccountInstruction; | ||
/** TODO: docs */ | ||
export declare function isFreezeAccountInstruction(decoded: DecodedInstruction): decoded is DecodedFreezeAccountInstruction; | ||
/** TODO: docs */ | ||
export declare function isThawAccountInstruction(decoded: DecodedInstruction): decoded is DecodedThawAccountInstruction; | ||
/** TODO: docs */ | ||
export declare function isTransferCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedTransferCheckedInstruction; | ||
/** TODO: docs */ | ||
export declare function isApproveCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedApproveCheckedInstruction; | ||
/** TODO: docs */ | ||
export declare function isMintToCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedMintToCheckedInstruction; | ||
/** TODO: docs */ | ||
export declare function isBurnCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedBurnCheckedInstruction; | ||
/** TODO: docs, implement */ | ||
/** TODO: docs */ | ||
export declare function isSyncNativeInstruction(decoded: DecodedInstruction): decoded is DecodedSyncNativeInstruction; | ||
/** TODO: docs, implement */ | ||
/** TODO: docs, implement */ | ||
/** TODO: docs, implement */ |
@@ -24,6 +24,2 @@ import { u8 } from '@solana/buffer-layout'; | ||
export function decodeInstruction(instruction, programId = TOKEN_PROGRAM_ID) { | ||
// | DecodedInitializeAccount3Instruction | ||
// | DecodedInitializeMultisig2Instruction | ||
// | DecodedInitializeMint2Instruction | ||
// TODO: implement ^ | ||
if (!instruction.data.length) | ||
@@ -80,2 +76,94 @@ throw new TokenInvalidInstructionDataError(); | ||
} | ||
/** TODO: docs */ | ||
export function isInitializeMintInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.InitializeMint; | ||
} | ||
/** TODO: docs */ | ||
export function isInitializeAccountInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.InitializeAccount; | ||
} | ||
/** TODO: docs */ | ||
export function isInitializeMultisigInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.InitializeMultisig; | ||
} | ||
/** TODO: docs */ | ||
export function isTransferInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.Transfer; | ||
} | ||
/** TODO: docs */ | ||
export function isApproveInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.Approve; | ||
} | ||
/** TODO: docs */ | ||
export function isRevokeInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.Revoke; | ||
} | ||
/** TODO: docs */ | ||
export function isSetAuthorityInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.SetAuthority; | ||
} | ||
/** TODO: docs */ | ||
export function isMintToInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.MintTo; | ||
} | ||
/** TODO: docs */ | ||
export function isBurnInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.Burn; | ||
} | ||
/** TODO: docs */ | ||
export function isCloseAccountInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.CloseAccount; | ||
} | ||
/** TODO: docs */ | ||
export function isFreezeAccountInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.FreezeAccount; | ||
} | ||
/** TODO: docs */ | ||
export function isThawAccountInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.ThawAccount; | ||
} | ||
/** TODO: docs */ | ||
export function isTransferCheckedInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.TransferChecked; | ||
} | ||
/** TODO: docs */ | ||
export function isApproveCheckedInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.ApproveChecked; | ||
} | ||
/** TODO: docs */ | ||
export function isMintToCheckedInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.MintToChecked; | ||
} | ||
/** TODO: docs */ | ||
export function isBurnCheckedInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.BurnChecked; | ||
} | ||
/** TODO: docs, implement */ | ||
// export function isInitializeAccount2Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeAccount2Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeAccount2; | ||
// } | ||
/** TODO: docs */ | ||
export function isSyncNativeInstruction(decoded) { | ||
return decoded.data.instruction === TokenInstruction.SyncNative; | ||
} | ||
/** TODO: docs, implement */ | ||
// export function isInitializeAccount3Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeAccount3Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeAccount3; | ||
// } | ||
/** TODO: docs, implement */ | ||
// export function isInitializeMultisig2Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeMultisig2Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeMultisig2; | ||
// } | ||
/** TODO: docs, implement */ | ||
// export function isInitializeMint2Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeMint2Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeMint2; | ||
// } | ||
//# sourceMappingURL=decode.js.map |
{ | ||
"name": "@solana/spl-token", | ||
"version": "0.2.0-alpha.0", | ||
"version": "0.2.0-alpha.1", | ||
"author": "Solana Maintainers <maintainers@solana.foundation>", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/solana-labs/solana-program-library", |
@@ -25,6 +25,3 @@ import { u8 } from '@solana/buffer-layout'; | ||
/** TODO: docs */ | ||
export function decodeInstruction( | ||
instruction: TransactionInstruction, | ||
programId = TOKEN_PROGRAM_ID | ||
): | ||
export type DecodedInstruction = | ||
| DecodedInitializeMintInstruction | ||
@@ -47,7 +44,14 @@ | DecodedInitializeAccountInstruction | ||
// | DecodedInitializeAccount2Instruction | ||
| DecodedSyncNativeInstruction { | ||
| DecodedSyncNativeInstruction | ||
// | DecodedInitializeAccount3Instruction | ||
// | DecodedInitializeMultisig2Instruction | ||
// | DecodedInitializeMint2Instruction | ||
// TODO: implement ^ | ||
// TODO: implement ^ and remove `never` | ||
| never; | ||
/** TODO: docs */ | ||
export function decodeInstruction( | ||
instruction: TransactionInstruction, | ||
programId = TOKEN_PROGRAM_ID | ||
): DecodedInstruction { | ||
if (!instruction.data.length) throw new TokenInvalidInstructionDataError(); | ||
@@ -85,1 +89,120 @@ | ||
} | ||
/** TODO: docs */ | ||
export function isInitializeMintInstruction(decoded: DecodedInstruction): decoded is DecodedInitializeMintInstruction { | ||
return decoded.data.instruction === TokenInstruction.InitializeMint; | ||
} | ||
/** TODO: docs */ | ||
export function isInitializeAccountInstruction( | ||
decoded: DecodedInstruction | ||
): decoded is DecodedInitializeAccountInstruction { | ||
return decoded.data.instruction === TokenInstruction.InitializeAccount; | ||
} | ||
/** TODO: docs */ | ||
export function isInitializeMultisigInstruction( | ||
decoded: DecodedInstruction | ||
): decoded is DecodedInitializeMultisigInstruction { | ||
return decoded.data.instruction === TokenInstruction.InitializeMultisig; | ||
} | ||
/** TODO: docs */ | ||
export function isTransferInstruction(decoded: DecodedInstruction): decoded is DecodedTransferInstruction { | ||
return decoded.data.instruction === TokenInstruction.Transfer; | ||
} | ||
/** TODO: docs */ | ||
export function isApproveInstruction(decoded: DecodedInstruction): decoded is DecodedApproveInstruction { | ||
return decoded.data.instruction === TokenInstruction.Approve; | ||
} | ||
/** TODO: docs */ | ||
export function isRevokeInstruction(decoded: DecodedInstruction): decoded is DecodedRevokeInstruction { | ||
return decoded.data.instruction === TokenInstruction.Revoke; | ||
} | ||
/** TODO: docs */ | ||
export function isSetAuthorityInstruction(decoded: DecodedInstruction): decoded is DecodedSetAuthorityInstruction { | ||
return decoded.data.instruction === TokenInstruction.SetAuthority; | ||
} | ||
/** TODO: docs */ | ||
export function isMintToInstruction(decoded: DecodedInstruction): decoded is DecodedMintToInstruction { | ||
return decoded.data.instruction === TokenInstruction.MintTo; | ||
} | ||
/** TODO: docs */ | ||
export function isBurnInstruction(decoded: DecodedInstruction): decoded is DecodedBurnInstruction { | ||
return decoded.data.instruction === TokenInstruction.Burn; | ||
} | ||
/** TODO: docs */ | ||
export function isCloseAccountInstruction(decoded: DecodedInstruction): decoded is DecodedCloseAccountInstruction { | ||
return decoded.data.instruction === TokenInstruction.CloseAccount; | ||
} | ||
/** TODO: docs */ | ||
export function isFreezeAccountInstruction(decoded: DecodedInstruction): decoded is DecodedFreezeAccountInstruction { | ||
return decoded.data.instruction === TokenInstruction.FreezeAccount; | ||
} | ||
/** TODO: docs */ | ||
export function isThawAccountInstruction(decoded: DecodedInstruction): decoded is DecodedThawAccountInstruction { | ||
return decoded.data.instruction === TokenInstruction.ThawAccount; | ||
} | ||
/** TODO: docs */ | ||
export function isTransferCheckedInstruction( | ||
decoded: DecodedInstruction | ||
): decoded is DecodedTransferCheckedInstruction { | ||
return decoded.data.instruction === TokenInstruction.TransferChecked; | ||
} | ||
/** TODO: docs */ | ||
export function isApproveCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedApproveCheckedInstruction { | ||
return decoded.data.instruction === TokenInstruction.ApproveChecked; | ||
} | ||
/** TODO: docs */ | ||
export function isMintToCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedMintToCheckedInstruction { | ||
return decoded.data.instruction === TokenInstruction.MintToChecked; | ||
} | ||
/** TODO: docs */ | ||
export function isBurnCheckedInstruction(decoded: DecodedInstruction): decoded is DecodedBurnCheckedInstruction { | ||
return decoded.data.instruction === TokenInstruction.BurnChecked; | ||
} | ||
/** TODO: docs, implement */ | ||
// export function isInitializeAccount2Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeAccount2Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeAccount2; | ||
// } | ||
/** TODO: docs */ | ||
export function isSyncNativeInstruction(decoded: DecodedInstruction): decoded is DecodedSyncNativeInstruction { | ||
return decoded.data.instruction === TokenInstruction.SyncNative; | ||
} | ||
/** TODO: docs, implement */ | ||
// export function isInitializeAccount3Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeAccount3Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeAccount3; | ||
// } | ||
/** TODO: docs, implement */ | ||
// export function isInitializeMultisig2Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeMultisig2Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeMultisig2; | ||
// } | ||
/** TODO: docs, implement */ | ||
// export function isInitializeMint2Instruction( | ||
// decoded: DecodedInstruction | ||
// ): decoded is DecodedInitializeMint2Instruction { | ||
// return decoded.data.instruction === TokenInstruction.InitializeMint2; | ||
// } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
710512
13332
0