@broxus/js-bridge-essentials
Version:
Bridge JavaScript Essentials library
79 lines (78 loc) • 7.73 kB
TypeScript
import { type AbiEventName, type AbiFunctionName, type Address, type DecodeEventParams, type DecodeTransactionParams, type DecodedAbiFunctionInputs, type DecodedAbiFunctionOutputs, type DecodedEvent, type DecodedTransaction, type DelayedMessageExecution, type FullContractState, type ProviderRpcClient, type SendInternalParams, type Transaction } from 'everscale-inpage-provider';
import { type AlienProxyV10Abi } from '../../models/alien-proxy/abi';
import { type EvmTokenMergeDetails, type MergePoolTokens, type SolanaTokenMergeDetails, type TvmTokenMergeDetails } from '../../models/alien-proxy/types';
export interface AlienProxyV10DeployTokenFeeAbiParams {
remainingGasTo: Address | string;
tokenAddress: Address | string;
}
export type AlienProxyV10DailyLimits = DecodedAbiFunctionOutputs<typeof AlienProxyV10Abi, 'getDailyLimits'>;
export type AlienProxyV10TvmTokenFee = DecodedAbiFunctionOutputs<typeof AlienProxyV10Abi, 'getTvmTokenFee'>;
export type AlienProxyV10TvmDefaultFee = DecodedAbiFunctionOutputs<typeof AlienProxyV10Abi, 'getTvmDefaultFee'>;
export type AlienProxyV10TvmFees = Map<string, {
incoming: string;
outgoing: string;
}>;
export type DeriveEvmAlienTokenRootV10AbiParams = Omit<DecodedAbiFunctionInputs<typeof AlienProxyV10Abi, 'deriveEVMAlienTokenRoot'>, 'answerId'>;
export type DeriveTvmAlienTokenRootV10AbiParams = Omit<DecodedAbiFunctionInputs<typeof AlienProxyV10Abi, 'deriveTVMAlienTokenRoot'>, 'answerId'>;
export type DeriveSolanaAlienTokenRootV10AbiParams = Omit<DecodedAbiFunctionInputs<typeof AlienProxyV10Abi, 'deriveSolanaAlienTokenRoot'>, 'answerId'>;
export type AlienProxyV10Configurations = DecodedAbiFunctionOutputs<typeof AlienProxyV10Abi, 'getConfiguration'>;
export type AlienProxyV10DecodedEvent = DecodedEvent<typeof AlienProxyV10Abi, AbiEventName<typeof AlienProxyV10Abi>>;
export type AlienProxyV10DecodedTransaction = DecodedTransaction<typeof AlienProxyV10Abi, AbiFunctionName<typeof AlienProxyV10Abi>>;
export declare abstract class AlienProxyV10Utils {
static deployTokenFee(provider: ProviderRpcClient, proxyAddress: Address | string, params: AlienProxyV10DeployTokenFeeAbiParams, args?: Partial<SendInternalParams>): Promise<DelayedMessageExecution>;
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<AlienProxyV10DailyLimits>;
static getTvmDefaultFee(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<AlienProxyV10TvmDefaultFee>;
static getTvmFees(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<AlienProxyV10TvmFees>;
static getTvmTokenFee(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, cachedState?: FullContractState): Promise<AlienProxyV10TvmTokenFee>;
static getConfiguration(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<AlienProxyV10Configurations>;
static getTvmEvmConfiguration(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<Address>;
static getSolTvmConfiguration(connection: ProviderRpcClient, proxyAddress: Address | string, cachedState?: FullContractState): Promise<Address>;
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 {DeriveEvmAlienTokenRootV10AbiParams} params
* @param {FullContractState} [cachedState] - optional. Full contract state of the alien proxy contract
*/
static deriveEvmAlienTokenRoot(connection: ProviderRpcClient, proxyAddress: Address | string, params: DeriveEvmAlienTokenRootV10AbiParams, cachedState?: FullContractState): Promise<Address>;
/**
* Derive TVM alien token address in TVM by the given proxy address and EVM token params
* @param {ProviderRpcClient} connection
* @param {Address | string} proxyAddress
* @param {DeriveTvmAlienTokenRootV10AbiParams} params
* @param {FullContractState} [cachedState] - optional. Full contract state of the alien proxy contract
*/
static deriveTvmAlienTokenRoot(connection: ProviderRpcClient, proxyAddress: Address | string, params: DeriveTvmAlienTokenRootV10AbiParams, 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 {DeriveSolanaAlienTokenRootV10AbiParams} params
* @param {FullContractState} [cachedState] - optional. Full contract state of the alien proxy contract
*/
static deriveSolanaAlienTokenRoot(connection: ProviderRpcClient, proxyAddress: Address | string, params: DeriveSolanaAlienTokenRootV10AbiParams, 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<MergePoolTokens>;
static getEvmTokenMergeDetails(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, chainId: string, cachedState?: FullContractState): Promise<EvmTokenMergeDetails | undefined>;
static getTvmTokenMergeDetails(connection: ProviderRpcClient, proxyAddress: Address | string, tokenAddress: Address | string, cachedState?: FullContractState): Promise<TvmTokenMergeDetails | 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 AlienProxyV10Abi>): Promise<AlienProxyV10DecodedEvent | undefined>;
static decodeTransaction(connection: ProviderRpcClient, proxyAddress: Address | string, args: DecodeTransactionParams<typeof AlienProxyV10Abi>): Promise<AlienProxyV10DecodedTransaction | undefined>;
static decodeTransactionEvents(connection: ProviderRpcClient, proxyAddress: Address | string, transaction: Transaction): Promise<AlienProxyV10DecodedEvent[]>;
}