@broxus/js-bridge-essentials
Version:
Bridge JavaScript Essentials library
70 lines (69 loc) • 6.13 kB
TypeScript
import { type AbiEventName, type AbiFunctionName, type Address, type DecodedAbiFunctionInputs, type DecodedAbiFunctionOutputs, type DecodedEvent, type DecodedTransaction, type DecodeEventParams, type DecodeTransactionParams, type FullContractState, type ProviderRpcClient, type Transaction } from 'everscale-inpage-provider';
import { type AlienProxyV8Abi } from '../../models/alien-proxy/abi';
import { type EvmTokenMergeDetails, type MergePoolTokens, type SolanaTokenMergeDetails } from '../../models/alien-proxy/types';
export type DeriveEvmAlienTokenRootV8AbiParams = Omit<DecodedAbiFunctionInputs<typeof AlienProxyV8Abi, 'deriveEVMAlienTokenRoot'>, 'answerId'>;
export type DeriveSolanaAlienTokenRootV8AbiParams = Omit<DecodedAbiFunctionInputs<typeof AlienProxyV8Abi, 'deriveSolanaAlienTokenRoot'>, 'answerId'>;
export type AlienProxyV8Configurations = DecodedAbiFunctionOutputs<typeof AlienProxyV8Abi, 'getConfiguration'>;
export type AlienProxyV8DecodedEvent = DecodedEvent<typeof AlienProxyV8Abi, AbiEventName<typeof AlienProxyV8Abi>>;
export type AlienProxyV8DecodedTransaction = DecodedTransaction<typeof AlienProxyV8Abi, AbiFunctionName<typeof AlienProxyV8Abi>>;
export declare abstract class AlienProxyV8Utils {
static getConfiguration(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<AlienProxyV8Configurations>;
/**
* Returns Native configuration address that is used in transfers between TVM and EVM for TVM-based tokens.
* @param {ProviderRpcClient} connection
* @param {Address | string} proxyAddress
* @param {FullContractState} [cachedState] - An optional cached state of the proxy contract to optimize the call.
*/
static getTvmEvmConfiguration(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<Address>;
/**
* Returns Alien configuration address that is used in transfers between Solana and TVM for Solana-based tokens.
* @param {ProviderRpcClient} connection
* @param {Address | string} proxyAddress
* @param {FullContractState} [cachedState] - An optional cached state of the proxy contract to optimize the call.
*/
static getSolTvmConfiguration(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<Address>;
/**
* Returns Native configuration address that is used in transfers between TVM and Solana for TVM-based tokens.
* @param {ProviderRpcClient} connection
* @param {Address | string} proxyAddress
* @param {FullContractState} [cachedState] - An optional cached state of the proxy contract to optimize the call.
*/
static getTvmSolConfiguration(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 {DeriveEvmAlienTokenRootV8AbiParams} params
* @param {FullContractState} [cachedState] - An optional cached state of the proxy contract to optimize the call.
*/
static deriveEvmAlienTokenRoot(connection: ProviderRpcClient, proxyAddress: Address | string, params: DeriveEvmAlienTokenRootV8AbiParams, cachedState?: FullContractState): Promise<Address>;
/**
* Derive Solana alien token address in TVM by the given proxy address and Solana token params
* @param {ProviderRpcClient} connection
* @param {Address | string} proxyAddress
* @param {DeriveSolanaAlienTokenRootV8AbiParams} params
* @param {FullContractState} [cachedState] - An optional cached state of the proxy contract to optimize the call.
*/
static deriveSolanaAlienTokenRoot(connection: ProviderRpcClient, proxyAddress: Address | string, params: DeriveSolanaAlienTokenRootV8AbiParams, 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] - An optional cached state of the proxy contract to optimize the call.
*/
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] - An optional cached state of the proxy contract to optimize the call.
*/
static getMergePoolAddress(connection: ProviderRpcClient, mergeRouterAddress: Address | string, cachedState?: FullContractState): Promise<Address>;
static getMergePoolTokens(connection: ProviderRpcClient, mergePoolAddress: Address | string, cachedState?: FullContractState): Promise<MergePoolTokens>;
static getEvmTokenMergeDetails(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, chainId: string, cachedState?: FullContractState): Promise<EvmTokenMergeDetails | undefined>;
static getSolTokenMergeDetails(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, cachedState?: FullContractState): Promise<SolanaTokenMergeDetails | undefined>;
static decodeEvent(connection: ProviderRpcClient, proxyAddress: Address | string, args: DecodeEventParams<typeof AlienProxyV8Abi>): Promise<AlienProxyV8DecodedEvent | undefined>;
static decodeTransaction(connection: ProviderRpcClient, proxyAddress: Address | string, args: DecodeTransactionParams<typeof AlienProxyV8Abi>): Promise<AlienProxyV8DecodedTransaction | undefined>;
static decodeTransactionEvents(connection: ProviderRpcClient, proxyAddress: Address | string, transaction: Transaction): Promise<AlienProxyV8DecodedEvent[]>;
}