import { calculateFee } from "@cosmjs/stargate";
import { encoding } from "@wormhole-foundation/connect-sdk";
import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx";
import { DEFAULT_FEE, MSG_EXECUTE_CONTRACT_TYPE_URL } from "./constants";
import { CosmwasmPlatform } from "./platform";
export function computeFee(network, chain) {
    return calculateFee(DEFAULT_FEE, `0.1${CosmwasmPlatform.getNativeDenom(network, chain)}`);
}
export function buildExecuteMsg(sender, contract, msg, funds) {
    return {
        typeUrl: MSG_EXECUTE_CONTRACT_TYPE_URL,
        value: MsgExecuteContract.fromPartial({
            sender: sender,
            contract: contract,
            msg: encoding.bytes.encode(JSON.stringify(msg)),
            funds,
        }),
    };
}
export class CosmwasmUnsignedTransaction {
    transaction;
    network;
    chain;
    description;
    parallelizable;
    constructor(transaction, network, chain, description, parallelizable = false) {
        this.transaction = transaction;
        this.network = network;
        this.chain = chain;
        this.description = description;
        this.parallelizable = parallelizable;
    }
}
//# sourceMappingURL=unsignedTransaction.js.map