UNPKG

@broxus/js-bridge-essentials

Version:

Bridge JavaScript Essentials library

51 lines (50 loc) 5.07 kB
import { type AbiEventName, type AbiFunctionName, type Address, type DecodedAbiFunctionOutputs, type DecodedEvent, type DecodedTransaction, type DecodeEventParams, type DecodeTransactionParams, type FullContractState, type ProviderRpcClient, type Transaction } from 'everscale-inpage-provider'; import { type TonAlienProxyV2Abi } from '../../models/ton-alien-proxy/abi'; import { type DeriveEvmAlienJettonRootAbiParams, type DeriveTonAlienJettonRootAbiParams, type EvmJettonMergeDetails, type MergePoolJettons, type TonJettonMergeDetails } from '../../models/ton-alien-proxy/types'; export type TonAlienProxyV2TvmTokenFeeDetails = DecodedAbiFunctionOutputs<typeof TonAlienProxyV2Abi, 'getTvmTokenFee'>; export type TonAlienProxyV2Configurations = DecodedAbiFunctionOutputs<typeof TonAlienProxyV2Abi, 'getConfiguration'>; export type TonAlienProxyV2DecodedEvent = DecodedEvent<typeof TonAlienProxyV2Abi, AbiEventName<typeof TonAlienProxyV2Abi>>; export type TonAlienProxyV2DecodedTransaction = DecodedTransaction<typeof TonAlienProxyV2Abi, AbiFunctionName<typeof TonAlienProxyV2Abi>>; export declare abstract class TonAlienProxyV2Utils { static getExpectedTokenFeeAddress(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, cachedState?: FullContractState): Promise<Address>; static getTvmTokenFee(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, cachedState?: FullContractState): Promise<TonAlienProxyV2TvmTokenFeeDetails>; static getConfiguration(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<TonAlienProxyV2Configurations>; 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 TonAlienProxyV2Abi>): Promise<TonAlienProxyV2DecodedEvent | undefined>; static decodeTransaction(connection: ProviderRpcClient, proxyAddress: Address | string, args: DecodeTransactionParams<typeof TonAlienProxyV2Abi>): Promise<TonAlienProxyV2DecodedTransaction | undefined>; static decodeTransactionEvents(connection: ProviderRpcClient, proxyAddress: Address | string, transaction: Transaction): Promise<TonAlienProxyV2DecodedEvent[]>; }