PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@solana/spl-token/lib/cjs/instructions
Просмотр файла: initializeNonTransferableMint.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createInitializeNonTransferableMintInstruction = exports.initializeNonTransferableMintInstructionData = void 0;
const buffer_layout_1 = require("@solana/buffer-layout");
const web3_js_1 = require("@solana/web3.js");
const types_1 = require("./types");
const errors_1 = require("../errors");
const constants_1 = require("../constants");
/** The struct that represents the instruction data as it is read by the program */
exports.initializeNonTransferableMintInstructionData = (0, buffer_layout_1.struct)([
(0, buffer_layout_1.u8)('instruction'),
]);
/**
* Construct an InitializeNonTransferableMint instruction
*
* @param mint Mint Account to make non-transferable
* @param programId SPL Token program account
*
* @return Instruction to add to a transaction
*/
function createInitializeNonTransferableMintInstruction(mint, programId) {
if (!(0, constants_1.programSupportsExtensions)(programId)) {
throw new errors_1.TokenUnsupportedInstructionError();
}
const keys = [{ pubkey: mint, isSigner: false, isWritable: true }];
const data = Buffer.alloc(exports.initializeNonTransferableMintInstructionData.span);
exports.initializeNonTransferableMintInstructionData.encode({
instruction: types_1.TokenInstruction.InitializeNonTransferableMint,
}, data);
return new web3_js_1.TransactionInstruction({ keys, programId, data });
}
exports.createInitializeNonTransferableMintInstruction = createInitializeNonTransferableMintInstruction;
//# sourceMappingURL=initializeNonTransferableMint.js.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!