"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryDemo__factory = void 0;
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
const ethers_1 = require("ethers");
const _abi = [
    {
        inputs: [
            {
                internalType: "address",
                name: "_owner",
                type: "address",
            },
            {
                internalType: "address",
                name: "_wormhole",
                type: "address",
            },
            {
                internalType: "uint16",
                name: "_myChainID",
                type: "uint16",
            },
        ],
        stateMutability: "nonpayable",
        type: "constructor",
    },
    {
        inputs: [],
        name: "ChainIdMismatch",
        type: "error",
    },
    {
        inputs: [],
        name: "EmptyWormholeAddress",
        type: "error",
    },
    {
        inputs: [],
        name: "InvalidChainId",
        type: "error",
    },
    {
        inputs: [],
        name: "InvalidContractAddress",
        type: "error",
    },
    {
        inputs: [],
        name: "InvalidForeignChainID",
        type: "error",
    },
    {
        inputs: [],
        name: "InvalidFunctionSignature",
        type: "error",
    },
    {
        inputs: [],
        name: "InvalidOwner",
        type: "error",
    },
    {
        inputs: [
            {
                internalType: "uint256",
                name: "received",
                type: "uint256",
            },
            {
                internalType: "uint256",
                name: "expected",
                type: "uint256",
            },
        ],
        name: "InvalidPayloadLength",
        type: "error",
    },
    {
        inputs: [],
        name: "InvalidResponseVersion",
        type: "error",
    },
    {
        inputs: [],
        name: "InvalidWormholeAddress",
        type: "error",
    },
    {
        inputs: [],
        name: "NumberOfResponsesMismatch",
        type: "error",
    },
    {
        inputs: [
            {
                internalType: "uint256",
                name: "offset",
                type: "uint256",
            },
            {
                internalType: "uint256",
                name: "length",
                type: "uint256",
            },
        ],
        name: "OutOfBounds",
        type: "error",
    },
    {
        inputs: [],
        name: "RequestTypeMismatch",
        type: "error",
    },
    {
        inputs: [],
        name: "StaleBlockNum",
        type: "error",
    },
    {
        inputs: [],
        name: "StaleBlockTime",
        type: "error",
    },
    {
        inputs: [],
        name: "UnexpectedNumberOfResults",
        type: "error",
    },
    {
        inputs: [],
        name: "UnexpectedResultLength",
        type: "error",
    },
    {
        inputs: [],
        name: "UnexpectedResultMismatch",
        type: "error",
    },
    {
        inputs: [],
        name: "UnsupportedQueryType",
        type: "error",
    },
    {
        inputs: [],
        name: "VersionMismatch",
        type: "error",
    },
    {
        inputs: [],
        name: "ZeroQueries",
        type: "error",
    },
    {
        inputs: [],
        name: "QT_ETH_CALL",
        outputs: [
            {
                internalType: "uint8",
                name: "",
                type: "uint8",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "QT_ETH_CALL_BY_TIMESTAMP",
        outputs: [
            {
                internalType: "uint8",
                name: "",
                type: "uint8",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "QT_ETH_CALL_WITH_FINALITY",
        outputs: [
            {
                internalType: "uint8",
                name: "",
                type: "uint8",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "QT_MAX",
        outputs: [
            {
                internalType: "uint8",
                name: "",
                type: "uint8",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "VERSION",
        outputs: [
            {
                internalType: "uint8",
                name: "",
                type: "uint8",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "getMyCounter",
        outputs: [
            {
                internalType: "uint256",
                name: "",
                type: "uint256",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "bytes",
                name: "response",
                type: "bytes",
            },
        ],
        name: "getResponseDigest",
        outputs: [
            {
                internalType: "bytes32",
                name: "",
                type: "bytes32",
            },
        ],
        stateMutability: "pure",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "bytes",
                name: "response",
                type: "bytes",
            },
        ],
        name: "getResponseHash",
        outputs: [
            {
                internalType: "bytes32",
                name: "",
                type: "bytes32",
            },
        ],
        stateMutability: "pure",
        type: "function",
    },
    {
        inputs: [],
        name: "getState",
        outputs: [
            {
                components: [
                    {
                        internalType: "uint16",
                        name: "chainID",
                        type: "uint16",
                    },
                    {
                        internalType: "address",
                        name: "contractAddress",
                        type: "address",
                    },
                    {
                        internalType: "uint256",
                        name: "counter",
                        type: "uint256",
                    },
                    {
                        internalType: "uint256",
                        name: "blockNum",
                        type: "uint256",
                    },
                    {
                        internalType: "uint256",
                        name: "blockTime",
                        type: "uint256",
                    },
                ],
                internalType: "struct QueryDemo.ChainEntry[]",
                name: "",
                type: "tuple[]",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "bytes",
                name: "response",
                type: "bytes",
            },
            {
                components: [
                    {
                        internalType: "bytes32",
                        name: "r",
                        type: "bytes32",
                    },
                    {
                        internalType: "bytes32",
                        name: "s",
                        type: "bytes32",
                    },
                    {
                        internalType: "uint8",
                        name: "v",
                        type: "uint8",
                    },
                    {
                        internalType: "uint8",
                        name: "guardianIndex",
                        type: "uint8",
                    },
                ],
                internalType: "struct IWormhole.Signature[]",
                name: "signatures",
                type: "tuple[]",
            },
        ],
        name: "parseAndVerifyQueryResponse",
        outputs: [
            {
                components: [
                    {
                        internalType: "uint8",
                        name: "version",
                        type: "uint8",
                    },
                    {
                        internalType: "uint16",
                        name: "senderChainId",
                        type: "uint16",
                    },
                    {
                        internalType: "uint32",
                        name: "nonce",
                        type: "uint32",
                    },
                    {
                        internalType: "bytes",
                        name: "requestId",
                        type: "bytes",
                    },
                    {
                        components: [
                            {
                                internalType: "uint16",
                                name: "chainId",
                                type: "uint16",
                            },
                            {
                                internalType: "uint8",
                                name: "queryType",
                                type: "uint8",
                            },
                            {
                                internalType: "bytes",
                                name: "request",
                                type: "bytes",
                            },
                            {
                                internalType: "bytes",
                                name: "response",
                                type: "bytes",
                            },
                        ],
                        internalType: "struct ParsedPerChainQueryResponse[]",
                        name: "responses",
                        type: "tuple[]",
                    },
                ],
                internalType: "struct ParsedQueryResponse",
                name: "r",
                type: "tuple",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [
            {
                components: [
                    {
                        internalType: "uint16",
                        name: "chainId",
                        type: "uint16",
                    },
                    {
                        internalType: "uint8",
                        name: "queryType",
                        type: "uint8",
                    },
                    {
                        internalType: "bytes",
                        name: "request",
                        type: "bytes",
                    },
                    {
                        internalType: "bytes",
                        name: "response",
                        type: "bytes",
                    },
                ],
                internalType: "struct ParsedPerChainQueryResponse",
                name: "pcr",
                type: "tuple",
            },
        ],
        name: "parseEthCallByTimestampQueryResponse",
        outputs: [
            {
                components: [
                    {
                        internalType: "bytes",
                        name: "requestTargetBlockIdHint",
                        type: "bytes",
                    },
                    {
                        internalType: "bytes",
                        name: "requestFollowingBlockIdHint",
                        type: "bytes",
                    },
                    {
                        internalType: "uint64",
                        name: "requestTargetTimestamp",
                        type: "uint64",
                    },
                    {
                        internalType: "uint64",
                        name: "targetBlockNum",
                        type: "uint64",
                    },
                    {
                        internalType: "uint64",
                        name: "targetBlockTime",
                        type: "uint64",
                    },
                    {
                        internalType: "uint64",
                        name: "followingBlockNum",
                        type: "uint64",
                    },
                    {
                        internalType: "bytes32",
                        name: "targetBlockHash",
                        type: "bytes32",
                    },
                    {
                        internalType: "bytes32",
                        name: "followingBlockHash",
                        type: "bytes32",
                    },
                    {
                        internalType: "uint64",
                        name: "followingBlockTime",
                        type: "uint64",
                    },
                    {
                        components: [
                            {
                                internalType: "address",
                                name: "contractAddress",
                                type: "address",
                            },
                            {
                                internalType: "bytes",
                                name: "callData",
                                type: "bytes",
                            },
                            {
                                internalType: "bytes",
                                name: "result",
                                type: "bytes",
                            },
                        ],
                        internalType: "struct EthCallData[]",
                        name: "result",
                        type: "tuple[]",
                    },
                ],
                internalType: "struct EthCallByTimestampQueryResponse",
                name: "r",
                type: "tuple",
            },
        ],
        stateMutability: "pure",
        type: "function",
    },
    {
        inputs: [
            {
                components: [
                    {
                        internalType: "uint16",
                        name: "chainId",
                        type: "uint16",
                    },
                    {
                        internalType: "uint8",
                        name: "queryType",
                        type: "uint8",
                    },
                    {
                        internalType: "bytes",
                        name: "request",
                        type: "bytes",
                    },
                    {
                        internalType: "bytes",
                        name: "response",
                        type: "bytes",
                    },
                ],
                internalType: "struct ParsedPerChainQueryResponse",
                name: "pcr",
                type: "tuple",
            },
        ],
        name: "parseEthCallQueryResponse",
        outputs: [
            {
                components: [
                    {
                        internalType: "bytes",
                        name: "requestBlockId",
                        type: "bytes",
                    },
                    {
                        internalType: "uint64",
                        name: "blockNum",
                        type: "uint64",
                    },
                    {
                        internalType: "uint64",
                        name: "blockTime",
                        type: "uint64",
                    },
                    {
                        internalType: "bytes32",
                        name: "blockHash",
                        type: "bytes32",
                    },
                    {
                        components: [
                            {
                                internalType: "address",
                                name: "contractAddress",
                                type: "address",
                            },
                            {
                                internalType: "bytes",
                                name: "callData",
                                type: "bytes",
                            },
                            {
                                internalType: "bytes",
                                name: "result",
                                type: "bytes",
                            },
                        ],
                        internalType: "struct EthCallData[]",
                        name: "result",
                        type: "tuple[]",
                    },
                ],
                internalType: "struct EthCallQueryResponse",
                name: "r",
                type: "tuple",
            },
        ],
        stateMutability: "pure",
        type: "function",
    },
    {
        inputs: [
            {
                components: [
                    {
                        internalType: "uint16",
                        name: "chainId",
                        type: "uint16",
                    },
                    {
                        internalType: "uint8",
                        name: "queryType",
                        type: "uint8",
                    },
                    {
                        internalType: "bytes",
                        name: "request",
                        type: "bytes",
                    },
                    {
                        internalType: "bytes",
                        name: "response",
                        type: "bytes",
                    },
                ],
                internalType: "struct ParsedPerChainQueryResponse",
                name: "pcr",
                type: "tuple",
            },
        ],
        name: "parseEthCallWithFinalityQueryResponse",
        outputs: [
            {
                components: [
                    {
                        internalType: "bytes",
                        name: "requestBlockId",
                        type: "bytes",
                    },
                    {
                        internalType: "bytes",
                        name: "requestFinality",
                        type: "bytes",
                    },
                    {
                        internalType: "uint64",
                        name: "blockNum",
                        type: "uint64",
                    },
                    {
                        internalType: "uint64",
                        name: "blockTime",
                        type: "uint64",
                    },
                    {
                        internalType: "bytes32",
                        name: "blockHash",
                        type: "bytes32",
                    },
                    {
                        components: [
                            {
                                internalType: "address",
                                name: "contractAddress",
                                type: "address",
                            },
                            {
                                internalType: "bytes",
                                name: "callData",
                                type: "bytes",
                            },
                            {
                                internalType: "bytes",
                                name: "result",
                                type: "bytes",
                            },
                        ],
                        internalType: "struct EthCallData[]",
                        name: "result",
                        type: "tuple[]",
                    },
                ],
                internalType: "struct EthCallWithFinalityQueryResponse",
                name: "r",
                type: "tuple",
            },
        ],
        stateMutability: "pure",
        type: "function",
    },
    {
        inputs: [],
        name: "responsePrefix",
        outputs: [
            {
                internalType: "bytes",
                name: "",
                type: "bytes",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "bytes",
                name: "response",
                type: "bytes",
            },
            {
                components: [
                    {
                        internalType: "bytes32",
                        name: "r",
                        type: "bytes32",
                    },
                    {
                        internalType: "bytes32",
                        name: "s",
                        type: "bytes32",
                    },
                    {
                        internalType: "uint8",
                        name: "v",
                        type: "uint8",
                    },
                    {
                        internalType: "uint8",
                        name: "guardianIndex",
                        type: "uint8",
                    },
                ],
                internalType: "struct IWormhole.Signature[]",
                name: "signatures",
                type: "tuple[]",
            },
        ],
        name: "updateCounters",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "uint16",
                name: "_chainID",
                type: "uint16",
            },
            {
                internalType: "address",
                name: "_contractAddress",
                type: "address",
            },
        ],
        name: "updateRegistration",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "uint64",
                name: "_blockNum",
                type: "uint64",
            },
            {
                internalType: "uint256",
                name: "_minBlockNum",
                type: "uint256",
            },
        ],
        name: "validateBlockNum",
        outputs: [],
        stateMutability: "pure",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "uint64",
                name: "_blockTime",
                type: "uint64",
            },
            {
                internalType: "uint256",
                name: "_minBlockTime",
                type: "uint256",
            },
        ],
        name: "validateBlockTime",
        outputs: [],
        stateMutability: "pure",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "uint16",
                name: "chainId",
                type: "uint16",
            },
            {
                internalType: "uint16[]",
                name: "_validChainIds",
                type: "uint16[]",
            },
        ],
        name: "validateChainId",
        outputs: [],
        stateMutability: "pure",
        type: "function",
    },
    {
        inputs: [
            {
                components: [
                    {
                        internalType: "address",
                        name: "contractAddress",
                        type: "address",
                    },
                    {
                        internalType: "bytes",
                        name: "callData",
                        type: "bytes",
                    },
                    {
                        internalType: "bytes",
                        name: "result",
                        type: "bytes",
                    },
                ],
                internalType: "struct EthCallData",
                name: "r",
                type: "tuple",
            },
            {
                internalType: "address[]",
                name: "_expectedContractAddresses",
                type: "address[]",
            },
            {
                internalType: "bytes4[]",
                name: "_expectedFunctionSignatures",
                type: "bytes4[]",
            },
        ],
        name: "validateEthCallData",
        outputs: [],
        stateMutability: "pure",
        type: "function",
    },
    {
        inputs: [
            {
                components: [
                    {
                        internalType: "address",
                        name: "contractAddress",
                        type: "address",
                    },
                    {
                        internalType: "bytes",
                        name: "callData",
                        type: "bytes",
                    },
                    {
                        internalType: "bytes",
                        name: "result",
                        type: "bytes",
                    },
                ],
                internalType: "struct EthCallData[]",
                name: "r",
                type: "tuple[]",
            },
            {
                internalType: "address[]",
                name: "_expectedContractAddresses",
                type: "address[]",
            },
            {
                internalType: "bytes4[]",
                name: "_expectedFunctionSignatures",
                type: "bytes4[]",
            },
        ],
        name: "validateMultipleEthCallData",
        outputs: [],
        stateMutability: "pure",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "bytes",
                name: "response",
                type: "bytes",
            },
            {
                components: [
                    {
                        internalType: "bytes32",
                        name: "r",
                        type: "bytes32",
                    },
                    {
                        internalType: "bytes32",
                        name: "s",
                        type: "bytes32",
                    },
                    {
                        internalType: "uint8",
                        name: "v",
                        type: "uint8",
                    },
                    {
                        internalType: "uint8",
                        name: "guardianIndex",
                        type: "uint8",
                    },
                ],
                internalType: "struct IWormhole.Signature[]",
                name: "signatures",
                type: "tuple[]",
            },
        ],
        name: "verifyQueryResponseSignatures",
        outputs: [],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "wormhole",
        outputs: [
            {
                internalType: "contract IWormhole",
                name: "",
                type: "address",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
];
const _bytecode = " ";
const isSuperArgs = (xs) => xs.length > 1;
class QueryDemo__factory extends ethers_1.ContractFactory {
    constructor(...args) {
        if (isSuperArgs(args)) {
            super(...args);
        }
        else {
            super(_abi, _bytecode, args[0]);
        }
    }
    deploy(_owner, _wormhole, _myChainID, overrides) {
        return super.deploy(_owner, _wormhole, _myChainID, overrides || {});
    }
    getDeployTransaction(_owner, _wormhole, _myChainID, overrides) {
        return super.getDeployTransaction(_owner, _wormhole, _myChainID, overrides || {});
    }
    attach(address) {
        return super.attach(address);
    }
    connect(signer) {
        return super.connect(signer);
    }
    static createInterface() {
        return new ethers_1.utils.Interface(_abi);
    }
    static connect(address, signerOrProvider) {
        return new ethers_1.Contract(address, _abi, signerOrProvider);
    }
}
exports.QueryDemo__factory = QueryDemo__factory;
QueryDemo__factory.bytecode = _bytecode;
QueryDemo__factory.abi = _abi;
