UNPKG

@broxus/js-bridge-essentials

Version:

Bridge JavaScript Essentials library

39 lines (38 loc) 3.73 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 TonAlienProxyV1Abi } from '../../models/ton-alien-proxy/abi'; import { type DeriveEvmAlienJettonRootAbiParams, type EvmJettonMergeDetails, type MergePoolJettons } from '../../models/ton-alien-proxy/types'; export type TonAlienProxyV1Configurations = DecodedAbiFunctionOutputs<typeof TonAlienProxyV1Abi, 'getConfiguration'>; export type TonAlienProxyV1DecodedEvent = DecodedEvent<typeof TonAlienProxyV1Abi, AbiEventName<typeof TonAlienProxyV1Abi>>; export type TonAlienProxyV1DecodedTransaction = DecodedTransaction<typeof TonAlienProxyV1Abi, AbiFunctionName<typeof TonAlienProxyV1Abi>>; export declare abstract class TonAlienProxyV1Utils { static getConfiguration(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<TonAlienProxyV1Configurations>; 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>; /** * 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 decodeEvent(connection: ProviderRpcClient, proxyAddress: Address | string, args: DecodeEventParams<typeof TonAlienProxyV1Abi>): Promise<TonAlienProxyV1DecodedEvent | undefined>; static decodeTransaction(connection: ProviderRpcClient, proxyAddress: Address | string, args: DecodeTransactionParams<typeof TonAlienProxyV1Abi>): Promise<TonAlienProxyV1DecodedTransaction | undefined>; static decodeTransactionEvents(connection: ProviderRpcClient, proxyAddress: Address | string, transaction: Transaction): Promise<TonAlienProxyV1DecodedEvent[]>; }