@wormhole-foundation/sdk-cosmwasm
Version:
SDK for EVM chains, used in conjunction with @wormhole-foundation/sdk
189 lines • 6.7 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.averageGasPrices = exports.cosmwasmNetworkChainToRestUrls = exports.evmLikeChains = exports.networkChainToChannels = exports.nativeDenomToChain = exports.chainToNativeDenoms = exports.addressPrefixToChain = exports.chainToAddressPrefix = exports.IBC_TIMEOUT_MILLIS = exports.IBC_PACKET_CONN = exports.IBC_PACKET_DATA = exports.IBC_PACKET_SEQ = exports.IBC_PACKET_DST_PORT = exports.IBC_PACKET_SRC_PORT = exports.IBC_PACKET_SRC = exports.IBC_PACKET_DST = exports.IBC_PACKET_RECEIVE = exports.IBC_PACKET_SEND = exports.IBC_TRANSFER_PORT = exports.IBC_MSG_TYPE = exports.MSG_EXECUTE_CONTRACT_TYPE_URL = exports.DEFAULT_FEE = void 0;
const sdk_connect_1 = require("@wormhole-foundation/sdk-connect");
exports.DEFAULT_FEE = 1_000_000;
exports.MSG_EXECUTE_CONTRACT_TYPE_URL = "/cosmwasm.wasm.v1.MsgExecuteContract";
exports.IBC_MSG_TYPE = "/ibc.applications.transfer.v1.MsgTransfer";
exports.IBC_TRANSFER_PORT = "transfer";
// IBC Message Event type
exports.IBC_PACKET_SEND = "send_packet";
exports.IBC_PACKET_RECEIVE = "recv_packet";
// Attributes for IBC Packet Event
exports.IBC_PACKET_DST = "packet_dst_channel";
exports.IBC_PACKET_SRC = "packet_src_channel";
exports.IBC_PACKET_SRC_PORT = "packet_src_port";
exports.IBC_PACKET_DST_PORT = "packet_dst_port";
exports.IBC_PACKET_SEQ = "packet_sequence";
exports.IBC_PACKET_DATA = "packet_data";
exports.IBC_PACKET_CONN = "packet_connection";
exports.IBC_TIMEOUT_MILLIS = 60 * 60 * 1000; // 60 minutes
const cosmwasmAddressPrefix = [
["Cosmoshub", "cosmos"],
["Evmos", "evmos"],
["Injective", "inj"],
["Kujira", "kuji"],
["Osmosis", "osmo"],
["Sei", "sei"],
["Wormchain", "wormhole"],
["Celestia", "celestia"],
["Stargaze", "stars"],
["Dymension", "dym"],
["Neutron", "neutron"],
["Seda", "seda"],
["Provenance", "pb"],
["Noble", "noble"],
];
exports.chainToAddressPrefix = (0, sdk_connect_1.constMap)(cosmwasmAddressPrefix);
exports.addressPrefixToChain = (0, sdk_connect_1.constMap)(cosmwasmAddressPrefix, [1, [0]]);
const cosmwasmNativeDenom = [
[
"Mainnet",
[
["Cosmoshub", "uatom"],
["Evmos", "aevmos"],
["Injective", "inj"],
["Kujira", "kuji"],
["Osmosis", "uosmo"],
["Sei", "usei"],
["Wormchain", "uworm"],
["Celestia", "utia"],
["Dymension", "adym"],
["Stargaze", "ustars"],
["Neutron", "untrn"],
["Provenance", "nhash"],
["Noble", "uusdc"],
],
],
[
"Testnet",
[
["Cosmoshub", "uatom"],
["Evmos", "atevmos"],
["Injective", "inj"],
["Kujira", "kuji"],
["Osmosis", "uosmo"],
["Sei", "usei"],
["Wormchain", "uworm"],
["Seda", "aseda"],
],
],
[
"Devnet",
[
["Cosmoshub", "uatom"],
["Evmos", "atevmos"],
["Injective", "inj"],
["Kujira", "kuji"],
["Osmosis", "uosmo"],
["Sei", "usei"],
["Wormchain", "uworm"],
],
],
];
exports.chainToNativeDenoms = (0, sdk_connect_1.constMap)(cosmwasmNativeDenom);
exports.nativeDenomToChain = (0, sdk_connect_1.constMap)(cosmwasmNativeDenom, [[0, 2], [1]]);
// prettier-ignore
// For each chain, add the channel id for each other chain
const gatewayConnections = [
[
"Mainnet",
[
[
"Wormchain",
{
Osmosis: "channel-3",
Evmos: "channel-5",
Kujira: "channel-9",
Stargaze: "channel-12",
Injective: "channel-13",
Dymension: "channel-15",
},
],
["Osmosis", { Wormchain: "channel-2186" }],
["Evmos", { Wormchain: "channel-94" }],
["Kujira", { Wormchain: "channel-113" }],
["Injective", { Wormchain: "channel-183" }],
["Dymension", { Wormchain: "channel-36" }],
["Stargaze", { Wormchain: "channel-278" }],
],
],
[
"Testnet",
[
["Wormchain",
{
Cosmoshub: "channel-5",
Injective: "channel-15",
Kujira: "channel-16",
Stargaze: "channel-17",
Osmosis: "channel-19",
Dymension: "channel-18",
Evmos: "channel-20",
}
],
["Cosmoshub", { Wormchain: "channel-3086" }],
["Injective", { Wormchain: "channel-76973" }],
["Kujira", { Wormchain: "channel-114" }],
["Osmosis", { Wormchain: "channel-7904" }],
["Stargaze", { Wormchain: "channel-949" }],
["Evmos", { Wormchain: "channel-240" }],
["Dymension", { Wormchain: "channel-23" }]
],
],
[
"Devnet",
[
["Wormchain", { Cosmoshub: "channel-1", Osmosis: "channel-2" }],
["Cosmoshub", { Wormchain: "channel-1" }],
["Osmosis", { Wormchain: "channel-1" }],
],
],
];
exports.networkChainToChannels = (0, sdk_connect_1.constMap)(gatewayConnections);
exports.evmLikeChains = ["Evmos", "Injective"];
const cosmwasmNetworkChainRestUrl = [
[
"Mainnet",
[
["Injective", "https://lcd.injective.network"],
["Evmos", "https://rest.bd.evmos.org:1317"],
],
],
[
"Testnet",
[
["Injective", "https://k8s.testnet.lcd.injective.network"],
["Evmos", "https://rest.bd.evmos.dev:1317"],
],
],
[
"Devnet",
[
["Injective", "https://localhost:1234"],
["Evmos", "https://localhost:1233"],
],
],
];
exports.cosmwasmNetworkChainToRestUrls = (0, sdk_connect_1.constMap)(cosmwasmNetworkChainRestUrl);
const avgPrices = [
[
"Mainnet",
[
["Osmosis", "0.025"],
["Sei", "0.02"],
["Cosmoshub", "0.025"],
["Kujira", "0.0051"],
["Neutron", "0.075"],
["Celestia", "0.02"],
["Stargaze", "1.1"],
["Injective", "700000000"],
["Evmos", "25000000000"],
["Dymension", "5000000000"],
["Provenance", "2100"],
["Noble", "0.1"],
],
],
];
exports.averageGasPrices = (0, sdk_connect_1.constMap)(avgPrices);
//# sourceMappingURL=constants.js.map