Add new chain id for Celestia
This commit is contained in:
parent
2e31789c70
commit
61f34510f8
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@certusone/wormhole-sdk",
|
"name": "@certusone/wormhole-sdk",
|
||||||
"version": "0.10.5",
|
"version": "0.10.6",
|
||||||
"description": "SDK for interacting with Wormhole",
|
"description": "SDK for interacting with Wormhole",
|
||||||
"homepage": "https://wormhole.com",
|
"homepage": "https://wormhole.com",
|
||||||
"main": "./lib/cjs/index.js",
|
"main": "./lib/cjs/index.js",
|
||||||
|
|
|
@ -16,6 +16,7 @@ import {
|
||||||
isTerraChain,
|
isTerraChain,
|
||||||
CHAIN_ID_KUJIRA,
|
CHAIN_ID_KUJIRA,
|
||||||
CHAIN_ID_OSMOSIS,
|
CHAIN_ID_OSMOSIS,
|
||||||
|
CHAIN_ID_CELESTIA,
|
||||||
} from "../utils";
|
} from "../utils";
|
||||||
|
|
||||||
export const isNativeDenomInjective = (denom: string) => denom === "inj";
|
export const isNativeDenomInjective = (denom: string) => denom === "inj";
|
||||||
|
@ -24,8 +25,10 @@ export const isNativeDenomSei = (denom: string) => denom === "usei";
|
||||||
export const isNativeDenomWormchain = (denom: string) => denom === "uworm";
|
export const isNativeDenomWormchain = (denom: string) => denom === "uworm";
|
||||||
export const isNativeDenomOsmosis = (denom: string) => denom === "uosmo";
|
export const isNativeDenomOsmosis = (denom: string) => denom === "uosmo";
|
||||||
export const isNativeDenomCosmosHub = (denom: string) => denom === "uatom";
|
export const isNativeDenomCosmosHub = (denom: string) => denom === "uatom";
|
||||||
export const isNativeDenomEvmos = (denom: string) => denom === "aevmos";
|
export const isNativeDenomEvmos = (denom: string) =>
|
||||||
|
denom === "aevmos" || denom === "atevmos";
|
||||||
export const isNativeDenomKujira = (denom: string) => denom === "ukuji";
|
export const isNativeDenomKujira = (denom: string) => denom === "ukuji";
|
||||||
|
export const isNativeDenomCelestia = (denom: string) => denom === "utia";
|
||||||
|
|
||||||
export function isNativeCosmWasmDenom(
|
export function isNativeCosmWasmDenom(
|
||||||
chainId: CosmWasmChainId,
|
chainId: CosmWasmChainId,
|
||||||
|
@ -40,7 +43,8 @@ export function isNativeCosmWasmDenom(
|
||||||
(chainId === CHAIN_ID_OSMOSIS && isNativeDenomOsmosis(address)) ||
|
(chainId === CHAIN_ID_OSMOSIS && isNativeDenomOsmosis(address)) ||
|
||||||
(chainId === CHAIN_ID_COSMOSHUB && isNativeDenomCosmosHub(address)) ||
|
(chainId === CHAIN_ID_COSMOSHUB && isNativeDenomCosmosHub(address)) ||
|
||||||
(chainId === CHAIN_ID_EVMOS && isNativeDenomEvmos(address)) ||
|
(chainId === CHAIN_ID_EVMOS && isNativeDenomEvmos(address)) ||
|
||||||
(chainId === CHAIN_ID_KUJIRA && isNativeDenomKujira(address))
|
(chainId === CHAIN_ID_KUJIRA && isNativeDenomKujira(address)) ||
|
||||||
|
(chainId === CHAIN_ID_CELESTIA && isNativeDenomCelestia(address))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ import {
|
||||||
CHAIN_ID_COSMOSHUB,
|
CHAIN_ID_COSMOSHUB,
|
||||||
CHAIN_ID_EVMOS,
|
CHAIN_ID_EVMOS,
|
||||||
CHAIN_ID_KUJIRA,
|
CHAIN_ID_KUJIRA,
|
||||||
|
CHAIN_ID_CELESTIA,
|
||||||
} from "./consts";
|
} from "./consts";
|
||||||
import { hashLookup } from "./near";
|
import { hashLookup } from "./near";
|
||||||
import { getExternalAddressFromType, isValidAptosType } from "./aptos";
|
import { getExternalAddressFromType, isValidAptosType } from "./aptos";
|
||||||
|
@ -129,6 +130,8 @@ export const tryUint8ArrayToNative = (
|
||||||
throw Error("uint8ArrayToNative: Evmos not supported yet.");
|
throw Error("uint8ArrayToNative: Evmos not supported yet.");
|
||||||
} else if (chainId === CHAIN_ID_KUJIRA) {
|
} else if (chainId === CHAIN_ID_KUJIRA) {
|
||||||
throw Error("uint8ArrayToNative: Kujira not supported yet.");
|
throw Error("uint8ArrayToNative: Kujira not supported yet.");
|
||||||
|
} else if (chainId === CHAIN_ID_CELESTIA) {
|
||||||
|
throw Error("uint8ArrayToNative: Celestia not supported yet.");
|
||||||
} else if (chainId === CHAIN_ID_SUI) {
|
} else if (chainId === CHAIN_ID_SUI) {
|
||||||
throw Error("uint8ArrayToNative: Sui not supported yet.");
|
throw Error("uint8ArrayToNative: Sui not supported yet.");
|
||||||
} else if (chainId === CHAIN_ID_APTOS) {
|
} else if (chainId === CHAIN_ID_APTOS) {
|
||||||
|
@ -272,6 +275,8 @@ export const tryNativeToHexString = (
|
||||||
throw Error("nativeToHexString: Evmos not supported yet.");
|
throw Error("nativeToHexString: Evmos not supported yet.");
|
||||||
} else if (chainId === CHAIN_ID_KUJIRA) {
|
} else if (chainId === CHAIN_ID_KUJIRA) {
|
||||||
throw Error("nativeToHexString: Kujira not supported yet.");
|
throw Error("nativeToHexString: Kujira not supported yet.");
|
||||||
|
} else if (chainId === CHAIN_ID_CELESTIA) {
|
||||||
|
throw Error("nativeToHexString: Celestia not supported yet.");
|
||||||
} else if (chainId === CHAIN_ID_SUI) {
|
} else if (chainId === CHAIN_ID_SUI) {
|
||||||
if (!isValidSuiType(address) && isValidSuiAddress(address)) {
|
if (!isValidSuiType(address) && isValidSuiAddress(address)) {
|
||||||
return uint8ArrayToHex(
|
return uint8ArrayToHex(
|
||||||
|
|
|
@ -35,6 +35,7 @@ export const CHAINS = {
|
||||||
cosmoshub: 4000,
|
cosmoshub: 4000,
|
||||||
evmos: 4001,
|
evmos: 4001,
|
||||||
kujira: 4002,
|
kujira: 4002,
|
||||||
|
celestia: 4004,
|
||||||
sepolia: 10002,
|
sepolia: 10002,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
@ -86,6 +87,7 @@ export const CosmWasmChainNames = [
|
||||||
"evmos",
|
"evmos",
|
||||||
"cosmoshub",
|
"cosmoshub",
|
||||||
"kujira",
|
"kujira",
|
||||||
|
"celestia",
|
||||||
] as const;
|
] as const;
|
||||||
export type CosmWasmChainName = typeof CosmWasmChainNames[number];
|
export type CosmWasmChainName = typeof CosmWasmChainNames[number];
|
||||||
|
|
||||||
|
@ -299,6 +301,11 @@ const MAINNET = {
|
||||||
token_bridge: undefined,
|
token_bridge: undefined,
|
||||||
nft_bridge: undefined,
|
nft_bridge: undefined,
|
||||||
},
|
},
|
||||||
|
celestia: {
|
||||||
|
core: undefined,
|
||||||
|
token_bridge: undefined,
|
||||||
|
nft_bridge: undefined,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const TESTNET = {
|
const TESTNET = {
|
||||||
|
@ -494,6 +501,11 @@ const TESTNET = {
|
||||||
token_bridge: undefined,
|
token_bridge: undefined,
|
||||||
nft_bridge: undefined,
|
nft_bridge: undefined,
|
||||||
},
|
},
|
||||||
|
celestia: {
|
||||||
|
core: undefined,
|
||||||
|
token_bridge: undefined,
|
||||||
|
nft_bridge: undefined,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const DEVNET = {
|
const DEVNET = {
|
||||||
|
@ -687,6 +699,11 @@ const DEVNET = {
|
||||||
token_bridge: undefined,
|
token_bridge: undefined,
|
||||||
nft_bridge: undefined,
|
nft_bridge: undefined,
|
||||||
},
|
},
|
||||||
|
celestia: {
|
||||||
|
core: undefined,
|
||||||
|
token_bridge: undefined,
|
||||||
|
nft_bridge: undefined,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -764,6 +781,7 @@ export const CHAIN_ID_GATEWAY = CHAIN_ID_WORMCHAIN;
|
||||||
export const CHAIN_ID_COSMOSHUB = CHAINS["cosmoshub"];
|
export const CHAIN_ID_COSMOSHUB = CHAINS["cosmoshub"];
|
||||||
export const CHAIN_ID_EVMOS = CHAINS["evmos"];
|
export const CHAIN_ID_EVMOS = CHAINS["evmos"];
|
||||||
export const CHAIN_ID_KUJIRA = CHAINS["kujira"];
|
export const CHAIN_ID_KUJIRA = CHAINS["kujira"];
|
||||||
|
export const CHAIN_ID_CELESTIA = CHAINS["celestia"];
|
||||||
export const CHAIN_ID_SEPOLIA = CHAINS["sepolia"];
|
export const CHAIN_ID_SEPOLIA = CHAINS["sepolia"];
|
||||||
|
|
||||||
// This inverts the [[CHAINS]] object so that we can look up a chain by id
|
// This inverts the [[CHAINS]] object so that we can look up a chain by id
|
||||||
|
|
Loading…
Reference in New Issue