@broxus/js-bridge-essentials
Version:
Bridge JavaScript Essentials library
60 lines (59 loc) • 1.92 kB
TypeScript
import { type NetworkConfigBase, type TokenRaw, type TvmBasedNetwork, type TvmNetworkConfig } from '@broxus/js-core';
import { type PublicKey } from '@solana/web3.js';
import { type Address } from '@ton/ton';
import { type ConnectionProperties } from 'everscale-standalone-client';
export type EvmBasedNetwork = 'evm';
export type TonBasedNetwork = 'ton';
export type SolanaNetwork = 'solana';
export type NetworkType = TvmBasedNetwork | TonBasedNetwork | EvmBasedNetwork | SolanaNetwork;
export declare enum TokenType {
Alien = "Alien",
Native = "Native"
}
export interface TonNetworkConfig extends NetworkConfigBase<Address> {
connectionProperties?: ConnectionProperties;
type: TonBasedNetwork;
}
export interface EvmNetworkConfig extends NetworkConfigBase<string> {
transactionType?: string | string[];
type: EvmBasedNetwork;
}
export interface SolanaNetworkConfig extends NetworkConfigBase<PublicKey> {
type: SolanaNetwork;
}
export type NetworkConfig = TvmNetworkConfig | TonNetworkConfig | EvmNetworkConfig | SolanaNetworkConfig;
export type EvmSendCallback = (err: Error, transactionHash: string) => Promise<void> | void;
export interface CurrencyRaw<Addr = any> extends TokenRaw<Addr> {
wrappedTokenAddress: Addr;
wrappedTokenSymbol: string;
wrappedTokenName: string;
wrappedTokenLogoURI?: string;
}
export interface CurrenciesListManifest {
keywords: string[];
name: string;
timestamp: string;
tokens: CurrencyRaw<string>[];
version: {
major: number;
minor: number;
patch: number;
};
}
export declare enum EvmChains {
Ethereum = 1,
Binance = 56,
Fantom = 250,
Polygon = 137,
Avalanche = 43114,
Klaytn = 8217
}
export declare enum TonChains {
Mainnet = -239,
Testnet = -3
}
export declare enum TonOpcodes {
AcceptNative = 266987780,
Burn = 1499400124,
Transfer = 260734629
}