@wuwei-labs/srsly
Version:
[](https://www.npmjs.com/package/ts-sdk-example)
27 lines • 1.34 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
*/
import { addDecoderSizePrefix, addEncoderSizePrefix, combineCodec, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, } from '@solana/kit';
import { getSerializableAccountDecoder, getSerializableAccountEncoder, } from '.';
export function getSerializableInstructionEncoder() {
return getStructEncoder([
['programId', getAddressEncoder()],
['accounts', getArrayEncoder(getSerializableAccountEncoder())],
['data', addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],
]);
}
export function getSerializableInstructionDecoder() {
return getStructDecoder([
['programId', getAddressDecoder()],
['accounts', getArrayDecoder(getSerializableAccountDecoder())],
['data', addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())],
]);
}
export function getSerializableInstructionCodec() {
return combineCodec(getSerializableInstructionEncoder(), getSerializableInstructionDecoder());
}
//# sourceMappingURL=serializableInstruction.js.map