///
import type { SignDoc, TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx';
import BigNumber from 'bignumber.js';
import { StdSignDoc } from '@cosmjs/amino';
import type { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx';
import type { MsgTransfer } from 'cosmjs-types/ibc/applications/transfer/v1/tx';
import type { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx';
import type { Coin } from '@cosmjs/stargate';
import { MsgDepositForBurn, MsgDepositForBurnWithCaller } from './circle/cctp/v1';
import { MsgExecute } from '@initia/initia.proto/initia/move/v1/tx';
import { MsgInitiateTokenDeposit } from '@initia/opinit.proto/opinit/ophost/v1/tx';
import { NativeToken } from './lifi-api';
export interface SignDirectResponse {
signature: Uint8Array;
signed: SignDoc;
}
export interface SignDirectMethod {
(address: string, signDoc: SignDoc): Promise;
}
export interface SignAminoMethod {
(address: string, signDoc: StdSignDoc): Promise;
}
export interface SignAminoResponse {
readonly signed: StdSignDoc;
readonly signature: Uint8Array;
}
export interface Signer {
signDirect: SignDirectMethod;
signAmino: SignAminoMethod;
}
/**
* A utility type to make a union type show up in a better way in the IDE auto-completion.
*/
export type Prettify = {
[K in keyof T]: T[K];
} & unknown;
export declare enum NodeProvider {
NUMIA = "numia"
}
/**
* A type that represents a network URLs of a chain.
*/
type NetworkUrl = {
rpcUrl: string;
restUrl: string;
};
/**
* utxo type is used for chains and assets (BTC, Doge) etc.
* btc type is for on-ramps
*/
export type ChainType = 'cosmos' | 'evm' | 'btc' | 'utxo';
export interface ChainBaseData {
chainName: string;
icon: string;
chainId: string | number;
chainType: ChainType;
}
export interface ExplorerConfig {
name: string;
txUrl: string;
}
export interface CosmosChainData extends ChainBaseData {
chainId: string;
testnetChainId?: string;
restUrl: string;
restTestUrl?: string;
rpcUrl: string;
rpcTestUrl?: string;
addressPrefix: string;
baseDenom: string;
chainType: 'cosmos';
coinType: string;
chainRegistryPath: string;
privateInfra?: Record;
txExplorer: {
mainnet: ExplorerConfig;
testnet?: ExplorerConfig;
};
associatedAssets?: any;
key: string;
}
export interface EVMChainData extends ChainBaseData {
chainId: number;
chainType: 'evm';
txExplorer: {
mainnet: ExplorerConfig;
testnet?: ExplorerConfig;
};
}
export interface UTXOChainData extends ChainBaseData {
chainId: 'string';
chainType: 'utxo';
txExplorer: {
mainnet: ExplorerConfig;
testnet?: ExplorerConfig;
};
}
export type ChainData = CosmosChainData | EVMChainData | UTXOChainData;
export type DenomData = {
coinDenom: string;
coinMinimalDenom: string;
coinDecimals: number;
icon: string;
chain: string;
coinGeckoId: string;
};
export type Amount = {
denom: string;
amount: string;
};
export type TokenBalanceData = {
coin: Amount;
denomData: DenomData;
denomTrace?: {
path: string;
baseDenom: string;
};
amount: BigNumber;
priceInUsd: BigNumber | null;
valueInUsd: BigNumber | null;
};
export type ChainBalanceData = {
chainId: string;
balances: Record;
};
export type GasPriceStep = {
low: number;
average: number;
high: number;
};
export type ChainConfig = {
[chainId: string]: {
cosmosSDK: string;
dynamic_fee_market: boolean;
cosmos_directory_registry_path: string;
is_testnet: boolean;
};
};
export type SupportedChain = {
chainId: string;
chainName: string;
pfmEnabled: boolean;
logoUri: string;
bech32Prefix: string;
chainType: ChainType;
icon: string;
baseDenom?: string;
isTestnet: boolean;
nativeToken?: NativeToken;
multicallAddress?: string;
lifiChainId?: string;
relayChainId?: string;
explorerUrl?: string;
};
export declare enum TXN_STATUS {
INIT = "INIT",
PENDING = "PENDING",
SUCCESS = "SUCCESS",
FAILED = "FAILED",
SIGNED = "SIGNED"
}
export type Currency = {
name: string;
symbol: string;
code: string;
countryCode?: string;
};
export type Asset = {
denom: string;
symbol: string;
logoUri: string;
originDenom: string;
decimals: number;
originChainId?: string | undefined;
icon?: string;
denomTracePath?: string;
tokenContract?: string;
coingeckoId?: string | undefined;
priceUSD?: string;
};
export type MsgSendInfo = {
chain: CosmosChainData;
asset: Asset | string;
sender: string;
receiver: string;
amount: string;
};
export type MsgExecuteContractInfo = {
chain: CosmosChainData;
sender: string;
contract: string;
msg: string;
funds: Coin[];
};
export type MsgTransferInfo = {
fromChain: CosmosChainData;
toChain: CosmosChainData | undefined;
sourcePort: string;
sourceChannel: string;
asset: Asset | string;
sender: string;
receiver: string;
amount: string;
};
export type MsgDepositForBurnInfo = {
sender: string;
destinationDomain: number;
recipient: string;
token: string;
amount: string;
};
export type MsgDepositForBurnWithCallerInfo = {
sender: string;
destinationDomain: number;
recipient: string;
token: string;
amount: string;
destinationCaller: string;
};
export type MsgExecuteInfo = {
sender: string;
moduleName: string;
moduleAddress: string;
functionName: string;
args: string;
};
export type MsgInitiateTokenDepositInfo = {
sender: string;
to: string;
amount: unknown;
bridgeId: Long;
};
export type MsgSendTypeUrl = '/cosmos.bank.v1beta1.MsgSend';
export type MsgExecuteContractTypeUrl = '/cosmwasm.wasm.v1.MsgExecuteContract';
export type MsgTransferTypeUrl = '/ibc.applications.transfer.v1.MsgTransfer';
export type MsgDepositForBurnTypeUrl = '/circle.cctp.v1.MsgDepositForBurn';
export type MsgDepositForBurnWithCallerTypeUrl = '/circle.cctp.v1.MsgDepositForBurnWithCaller';
export type MsgExecuteTypeUrl = '/initia.move.v1.MsgExecute';
export type MsgInitiateTokenDepositTypeUrl = '/opinit.ophost.v1.MsgInitiateTokenDeposit';
export type MsgTypeUrl = Prettify;
export type MsgValue = Prettify;
export type DistributiveOmit = T extends unknown ? Omit : never;
export type Msg = Prettify>;
export type MessageWithInfo = Prettify<{
typeUrl: MsgSendTypeUrl;
value: MsgSend;
info: MsgSendInfo;
} | {
typeUrl: MsgExecuteContractTypeUrl;
value: MsgExecuteContract;
info: MsgExecuteContractInfo;
} | {
typeUrl: MsgTransferTypeUrl;
value: MsgTransfer;
info: MsgTransferInfo;
} | {
typeUrl: MsgDepositForBurnTypeUrl;
value: MsgDepositForBurn;
info: MsgDepositForBurnInfo;
} | {
typeUrl: MsgDepositForBurnWithCallerTypeUrl;
value: MsgDepositForBurnWithCaller;
info: MsgDepositForBurnWithCallerInfo;
} | {
typeUrl: MsgExecuteTypeUrl;
value: MsgExecute;
info: MsgExecuteInfo;
} | {
typeUrl: MsgInitiateTokenDepositTypeUrl;
value: MsgInitiateTokenDeposit;
info: MsgInitiateTokenDepositInfo;
}>;
export type NonNullableValues = {
[K in keyof T]: NonNullable;
};
export type ElementsConfig = {
routePreferences: {
minimumInputAmountUsd: number;
};
goFastTransferEstimatedTime: string;
};
export type DenomTraceData = {
path: string;
baseDenom: string;
};
export {};