@omnity/widget
Version:
The Omnity Widget is a simple way to embed Omnity into your website. It is a simple JavaScript file that you can include in your website to display Omnity content.
103 lines (91 loc) • 2.28 kB
text/typescript
export enum ChainID {
ICP = "eICP",
Bitcoin = "Bitcoin",
}
export enum Service {
Route = "Route",
Customs = "Customs",
}
export interface Token {
id: string; // ICP: canisterId, BTC: rune_id
name: string;
symbol: string;
decimals: number;
icon?: string;
balance: bigint;
token_id: string;
fee: bigint;
}
export enum SubmitRequire {
Select_Source_Chain = "Select source chain",
Connect_Source_Chain_Wallet = "Connect source chain wallet",
Select_Token = "Select token",
Enter_Amount = "Enter amount",
Insufficient_Balance = "Insufficient balance",
Invalid_Amount = "Invalid amount",
Invalid_Token = "Invalid token",
Invalid_Chain = "Invalid chain",
Wrong_Network = "Wrong network",
Select_Target_Chain = "Select target chain",
Connect_Target_Chain_Wallet = "Connect target chain wallet",
Confirm = "Confirm",
Source_Chain_Not_Active = "Source chain not active",
Target_Chain_Not_Active = "Target chain not active",
Under_Maintenance = "Under maintenance",
}
export type Network = "mainnet" | "testnet";
export interface OmnityWidgetProps {
width?: number;
sourceChain?: ChainID;
targetChain?: ChainID;
reversible?: boolean;
tokenIds?: string[];
colorMode?: "system" | "light" | "dark";
withChakraProvider?: boolean;
network?: Network;
}
export interface Ticket {
token: string;
dst_chain: ChainID;
ticket_id?: string;
memo?: string;
ticket_time: number;
src_chain: ChainID;
amount: string;
symbol?: string;
receiver: string;
sender: string;
decimals?: number;
finalized?: boolean;
block_height?: number;
}
export interface HubToken {
decimals: number;
icon: string[];
issue_chain: ChainID;
metadata: any[];
symbol: string;
token_id: string;
}
export enum ChainType {
Settlement = "Settlement",
ExecutionChain = "ExecutionChain",
}
export enum ChainState {
Active = "Active",
Deactive = "Deactive",
}
export interface Chain {
chain_id: ChainID;
canister_id: string;
fee_token: string[];
chain_type: ChainType;
counterparties: ChainID[];
chain_state: ChainState;
}
export interface TicketConfirmation {
currentBlockHeight: number;
txBlockHeight: number;
status: "broadcasting" | "confirming" | "confirmed";
confirmations: number;
}