@broxus/js-bridge-essentials
Version:
Bridge JavaScript Essentials library
66 lines (65 loc) • 5.99 kB
TypeScript
import { type AbiEventName, type AbiFunctionName, type Address, type DecodeEventParams, type DecodeTransactionParams, type DecodedAbiFunctionOutputs, type DecodedEvent, type DecodedTransaction, type FullContractState, type ProviderRpcClient, type Transaction } from 'everscale-inpage-provider';
import { type TonAlienProxyV3Abi } from '../../models/ton-alien-proxy/abi';
import { type DeriveEvmAlienJettonRootAbiParams, type DeriveTonAlienJettonRootAbiParams, type EvmJettonMergeDetails, type MergePoolJettons, type TonJettonMergeDetails } from '../../models/ton-alien-proxy/types';
export interface TonAlienProxyV3DailyLimits {
dailyIncomingVolume: string;
dailyOutgoingVolume: string;
dayStartTimestamp: number;
incomingLimit: string | null;
outgoingLimit: string | null;
}
export type TonAlienProxyV3TvmTokenFee = DecodedAbiFunctionOutputs<typeof TonAlienProxyV3Abi, 'getTvmTokenFee'>;
export type TonAlienProxyV3TvmDefaultFee = DecodedAbiFunctionOutputs<typeof TonAlienProxyV3Abi, 'getTvmDefaultFee'>;
export type TonAlienProxyV3TvmFees = Map<string, {
incoming: string;
outgoing: string;
}>;
export type TonAlienProxyV3Configurations = DecodedAbiFunctionOutputs<typeof TonAlienProxyV3Abi, 'getConfiguration'>;
export type TonAlienProxyV3DecodedEvent = DecodedEvent<typeof TonAlienProxyV3Abi, AbiEventName<typeof TonAlienProxyV3Abi>>;
export type TonAlienProxyV3DecodedTransaction = DecodedTransaction<typeof TonAlienProxyV3Abi, AbiFunctionName<typeof TonAlienProxyV3Abi>>;
export declare abstract class TonAlienProxyV3Utils {
static getExpectedTokenFeeAddress(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, cachedState?: FullContractState): Promise<Address>;
static getDailyLimits(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, cachedState?: FullContractState): Promise<TonAlienProxyV3DailyLimits>;
static getTvmDefaultFee(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<TonAlienProxyV3TvmDefaultFee>;
static getTvmFees(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<TonAlienProxyV3TvmFees>;
static getTvmTokenFee(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, cachedState?: FullContractState): Promise<TonAlienProxyV3TvmTokenFee>;
static getConfiguration(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<TonAlienProxyV3Configurations>;
static getTonEvmConfiguration(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<Address>;
/**
* Derive EVM alien token address in TVM by the given proxy address and EVM token params
* @param {ProviderRpcClient} connection
* @param {Address | string} proxyAddress
* @param {DeriveEvmAlienJettonRootAbiParams} params
* @param {FullContractState} [cachedState] - optional. Full contract state of the alien proxy contract
*/
static deriveEvmAlienTokenRoot(connection: ProviderRpcClient, proxyAddress: Address | string, params: DeriveEvmAlienJettonRootAbiParams, cachedState?: FullContractState): Promise<Address>;
/**
* Derive TON alien token address in TON by the given proxy address and TON token params
* @param {ProviderRpcClient} connection
* @param {Address | string} proxyAddress
* @param {DeriveTonAlienJettonRootAbiParams} params
* @param {FullContractState} [cachedState] - optional. Full contract state of the alien proxy contract
*/
static deriveTonAlienTokenRoot(connection: ProviderRpcClient, proxyAddress: Address | string, params: DeriveTonAlienJettonRootAbiParams, cachedState?: FullContractState): Promise<Address>;
/**
* Get derive merge router address by the given TVM-like token and proxy addresses
* @param {ProviderRpcClient} connection
* @param {Address | string} proxyAddress
* @param {Address | string} tokenAddress
* @param {FullContractState} [cachedState] - optional. Full contract state of the alien proxy contract
*/
static deriveMergeRouter(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, cachedState?: FullContractState): Promise<Address>;
/**
* Get merge pool address by the given merge router address
* @param {ProviderRpcClient} connection
* @param {Address | string} mergeRouterAddress
* @param {FullContractState} [cachedState] - optional. Full contract state of the merge router contract
*/
static getMergePoolAddress(connection: ProviderRpcClient, mergeRouterAddress: Address | string, cachedState?: FullContractState): Promise<Address>;
static getMergePoolTokens(connection: ProviderRpcClient, mergePoolAddress: Address | string, cachedState?: FullContractState): Promise<MergePoolJettons>;
static getEvmTokenMergeDetails(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, chainId: string, cachedState?: FullContractState): Promise<EvmJettonMergeDetails | undefined>;
static getTonTokenMergeDetails(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, cachedState?: FullContractState): Promise<TonJettonMergeDetails | undefined>;
static decodeEvent(connection: ProviderRpcClient, proxyAddress: Address | string, args: DecodeEventParams<typeof TonAlienProxyV3Abi>): Promise<TonAlienProxyV3DecodedEvent | undefined>;
static decodeTransaction(connection: ProviderRpcClient, proxyAddress: Address | string, args: DecodeTransactionParams<typeof TonAlienProxyV3Abi>): Promise<TonAlienProxyV3DecodedTransaction | undefined>;
static decodeTransactionEvents(connection: ProviderRpcClient, proxyAddress: Address | string, transaction: Transaction): Promise<TonAlienProxyV3DecodedEvent[]>;
}