/**
 * 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 { __assign } from "tslib";
import { combineCodec, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, transformEncoder, } from "@solana/kit";
import { SVM_SPOKE_PROGRAM_ADDRESS } from "../programs";
export var GET_UNSAFE_DEPOSIT_ID_DISCRIMINATOR = new Uint8Array([
    118, 10, 135, 0, 168, 243, 223, 117,
]);
export function getGetUnsafeDepositIdDiscriminatorBytes() {
    return fixEncoderSize(getBytesEncoder(), 8).encode(GET_UNSAFE_DEPOSIT_ID_DISCRIMINATOR);
}
export function getGetUnsafeDepositIdInstructionDataEncoder() {
    return transformEncoder(getStructEncoder([
        ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
        ["signer", getAddressEncoder()],
        ["depositor", getAddressEncoder()],
        ["depositNonce", getU64Encoder()],
    ]), function (value) { return (__assign(__assign({}, value), { discriminator: GET_UNSAFE_DEPOSIT_ID_DISCRIMINATOR })); });
}
export function getGetUnsafeDepositIdInstructionDataDecoder() {
    return getStructDecoder([
        ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
        ["signer", getAddressDecoder()],
        ["depositor", getAddressDecoder()],
        ["depositNonce", getU64Decoder()],
    ]);
}
export function getGetUnsafeDepositIdInstructionDataCodec() {
    return combineCodec(getGetUnsafeDepositIdInstructionDataEncoder(), getGetUnsafeDepositIdInstructionDataDecoder());
}
export function getGetUnsafeDepositIdInstruction(input, config) {
    var _a;
    // Program address.
    var programAddress = (_a = config === null || config === void 0 ? void 0 : config.programAddress) !== null && _a !== void 0 ? _a : SVM_SPOKE_PROGRAM_ADDRESS;
    // Original args.
    var args = __assign({}, input);
    return Object.freeze({
        data: getGetUnsafeDepositIdInstructionDataEncoder().encode(args),
        programAddress: programAddress,
    });
}
export function parseGetUnsafeDepositIdInstruction(instruction) {
    return {
        programAddress: instruction.programAddress,
        data: getGetUnsafeDepositIdInstructionDataDecoder().decode(instruction.data),
    };
}
//# sourceMappingURL=getUnsafeDepositId.js.map