"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GET_UNSAFE_DEPOSIT_ID_DISCRIMINATOR = void 0;
exports.getGetUnsafeDepositIdDiscriminatorBytes = getGetUnsafeDepositIdDiscriminatorBytes;
exports.getGetUnsafeDepositIdInstructionDataEncoder = getGetUnsafeDepositIdInstructionDataEncoder;
exports.getGetUnsafeDepositIdInstructionDataDecoder = getGetUnsafeDepositIdInstructionDataDecoder;
exports.getGetUnsafeDepositIdInstructionDataCodec = getGetUnsafeDepositIdInstructionDataCodec;
exports.getGetUnsafeDepositIdInstruction = getGetUnsafeDepositIdInstruction;
exports.parseGetUnsafeDepositIdInstruction = parseGetUnsafeDepositIdInstruction;
var tslib_1 = require("tslib");
var kit_1 = require("@solana/kit");
var programs_1 = require("../programs");
exports.GET_UNSAFE_DEPOSIT_ID_DISCRIMINATOR = new Uint8Array([
    118, 10, 135, 0, 168, 243, 223, 117,
]);
function getGetUnsafeDepositIdDiscriminatorBytes() {
    return (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.GET_UNSAFE_DEPOSIT_ID_DISCRIMINATOR);
}
function getGetUnsafeDepositIdInstructionDataEncoder() {
    return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([
        ["discriminator", (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8)],
        ["signer", (0, kit_1.getAddressEncoder)()],
        ["depositor", (0, kit_1.getAddressEncoder)()],
        ["depositNonce", (0, kit_1.getU64Encoder)()],
    ]), function (value) { return (tslib_1.__assign(tslib_1.__assign({}, value), { discriminator: exports.GET_UNSAFE_DEPOSIT_ID_DISCRIMINATOR })); });
}
function getGetUnsafeDepositIdInstructionDataDecoder() {
    return (0, kit_1.getStructDecoder)([
        ["discriminator", (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
        ["signer", (0, kit_1.getAddressDecoder)()],
        ["depositor", (0, kit_1.getAddressDecoder)()],
        ["depositNonce", (0, kit_1.getU64Decoder)()],
    ]);
}
function getGetUnsafeDepositIdInstructionDataCodec() {
    return (0, kit_1.combineCodec)(getGetUnsafeDepositIdInstructionDataEncoder(), getGetUnsafeDepositIdInstructionDataDecoder());
}
function getGetUnsafeDepositIdInstruction(input, config) {
    var _a;
    var programAddress = (_a = config === null || config === void 0 ? void 0 : config.programAddress) !== null && _a !== void 0 ? _a : programs_1.SVM_SPOKE_PROGRAM_ADDRESS;
    var args = tslib_1.__assign({}, input);
    return Object.freeze({
        data: getGetUnsafeDepositIdInstructionDataEncoder().encode(args),
        programAddress: programAddress,
    });
}
function parseGetUnsafeDepositIdInstruction(instruction) {
    return {
        programAddress: instruction.programAddress,
        data: getGetUnsafeDepositIdInstructionDataDecoder().decode(instruction.data),
    };
}
//# sourceMappingURL=getUnsafeDepositId.js.map