"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.namedPayloads = exports.circleMessageLayout = void 0;
const layout_items_1 = require("../layout-items");
require("./automaticCircleBridge");
const vaa_1 = require("../vaa");
const messageVersionItem = { binary: "uint", size: 4, custom: 0, omit: true };
// https://developers.circle.com/stablecoin/docs/cctp-technical-reference#message
const circleBurnMessageLayout = [
    // messageBodyVersion is:
    // * immutable: https://github.com/circlefin/evm-cctp-contracts/blob/adb2a382b09ea574f4d18d8af5b6706e8ed9b8f2/src/TokenMessenger.sol#L107
    // * 0: https://etherscan.io/address/0xbd3fa81b58ba92a82136038b25adec7066af3155#readContract
    { name: "messageBodyVersion", ...messageVersionItem },
    { name: "burnToken", ...layout_items_1.universalAddressItem },
    { name: "mintRecipient", ...layout_items_1.universalAddressItem },
    { name: "amount", ...layout_items_1.amountItem },
    { name: "messageSender", ...layout_items_1.universalAddressItem },
];
exports.circleMessageLayout = [
    // version is:
    // * immutable: https://github.com/circlefin/evm-cctp-contracts/blob/adb2a382b09ea574f4d18d8af5b6706e8ed9b8f2/src/MessageTransmitter.sol#L75
    // * 0: https://etherscan.io/address/0x0a992d191deec32afe36203ad87d7d289a738f81#readContract
    { name: "version", ...messageVersionItem },
    { name: "sourceDomain", ...layout_items_1.circleDomainItem },
    { name: "destinationDomain", ...layout_items_1.circleDomainItem },
    { name: "nonce", ...layout_items_1.circleNonceItem },
    { name: "sender", ...layout_items_1.universalAddressItem },
    { name: "recipient", ...layout_items_1.universalAddressItem },
    { name: "destinationCaller", ...layout_items_1.universalAddressItem },
    { name: "payload", binary: "object", layout: circleBurnMessageLayout },
];
exports.namedPayloads = [["Message", exports.circleMessageLayout]];
(0, vaa_1.registerPayloadTypes)("CircleBridge", exports.namedPayloads);
//# sourceMappingURL=circleBridge.js.map