@wuwei-labs/srsly
Version:
[](https://www.npmjs.com/package/ts-sdk-example)
32 lines • 1.51 kB
JavaScript
;
/**
* This code was AUTOGENERATED using the codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun codama to update it.
*
* @see https://github.com/codama-idl/codama
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSerializableInstructionEncoder = getSerializableInstructionEncoder;
exports.getSerializableInstructionDecoder = getSerializableInstructionDecoder;
exports.getSerializableInstructionCodec = getSerializableInstructionCodec;
const kit_1 = require("@solana/kit");
const _1 = require(".");
function getSerializableInstructionEncoder() {
return (0, kit_1.getStructEncoder)([
['programId', (0, kit_1.getAddressEncoder)()],
['accounts', (0, kit_1.getArrayEncoder)((0, _1.getSerializableAccountEncoder)())],
['data', (0, kit_1.addEncoderSizePrefix)((0, kit_1.getBytesEncoder)(), (0, kit_1.getU32Encoder)())],
]);
}
function getSerializableInstructionDecoder() {
return (0, kit_1.getStructDecoder)([
['programId', (0, kit_1.getAddressDecoder)()],
['accounts', (0, kit_1.getArrayDecoder)((0, _1.getSerializableAccountDecoder)())],
['data', (0, kit_1.addDecoderSizePrefix)((0, kit_1.getBytesDecoder)(), (0, kit_1.getU32Decoder)())],
]);
}
function getSerializableInstructionCodec() {
return (0, kit_1.combineCodec)(getSerializableInstructionEncoder(), getSerializableInstructionDecoder());
}
//# sourceMappingURL=serializableInstruction.js.map