UNPKG

@broxus/js-core

Version:

MobX-based JavaScript Core library

93 lines (92 loc) 5.24 kB
import { type Address, type DecodeEventParams, type DecodeTransactionParams, type DelayedMessageExecution, type FullContractState, type ProviderRpcClient, type SendInternalParams, type Transaction } from 'everscale-inpage-provider'; import { type DexRootAbi } from '../../models/dex/abi'; import { type DexDecodedEvent, type DexDecodedTransaction } from '../../models/dex/types'; export interface DexDeployAccountAbiParams { ownerAddress: Address | string; senderAddress?: Address | string; sendGasTo?: Address | string; } export interface DexDeployPairAbiParams { leftRootAddress: Address | string; rightRootAddress: Address | string; sendGasTo: Address | string; } export interface DexDeployPoolAbiParams { roots: (Address | string)[]; sendGasTo: Address | string; } export interface DexExpectedAccountAddressAbiParams { ownerAddress: Address | string; } export interface DexExpectedPairAddressAbiParams { leftRootAddress: Address | string; rightRootAddress: Address | string; } export interface DexExpectedPoolAddressAbiParams { roots: (Address | string)[]; } export declare abstract class DexUtils { /** * Sends a delayed message to deploy a DEX Account * @param {ProviderRpcClient} provider * @param {Address | string} dexRootAddress * @param {DexDeployAccountAbiParams} params * @param {Partial<SendInternalParams>} [args] * @returns {Promise<DelayedMessageExecution>} */ static deployAccount(provider: ProviderRpcClient, dexRootAddress: Address | string, params: DexDeployAccountAbiParams, args?: Partial<SendInternalParams>): Promise<DelayedMessageExecution>; /** * Sends a delayed message to deploy a pair * @param {ProviderRpcClient} provider * @param {Address | string} dexRootAddress * @param {DexDeployPairAbiParams} params * @param {Partial<SendInternalParams>} [args] * @returns {Promise<DelayedMessageExecution>} */ static deployPair(provider: ProviderRpcClient, dexRootAddress: Address | string, params: DexDeployPairAbiParams, args?: Partial<SendInternalParams>): Promise<DelayedMessageExecution>; /** * Sends a delayed message to deploy a pool * @param {ProviderRpcClient} provider * @param {Address | string} dexRootAddress * @param {DexDeployPoolAbiParams} params * @param {Partial<SendInternalParams>} [args] * @returns {Promise<DelayedMessageExecution>} */ static deployStablePool(provider: ProviderRpcClient, dexRootAddress: Address | string, params: DexDeployPoolAbiParams, args?: Partial<SendInternalParams>): Promise<DelayedMessageExecution>; /** * Returns an expected user DEX account address * by a given DEX root address and user wallet address * @param {ProviderRpcClient} connection * @param {Address | string} dexRootAddress * @param {DexExpectedAccountAddressAbiParams} params * @param {FullContractState} [cachedState] * @returns {Promise<Address>} */ static getExpectedAccountAddress(connection: ProviderRpcClient, dexRootAddress: Address | string, params: DexExpectedAccountAddressAbiParams, cachedState?: FullContractState): Promise<Address>; /** * Returns an expected pair address by a given DEX root address * and left and right tokens addresses * @param {ProviderRpcClient} connection * @param {Address | string} dexRootAddress * @param {DexExpectedPairAddressAbiParams} params * @param {FullContractState} [cachedState] * @return {Promise<Address>} */ static getExpectedPairAddress(connection: ProviderRpcClient, dexRootAddress: Address | string, params: DexExpectedPairAddressAbiParams, cachedState?: FullContractState): Promise<Address>; /** * Returns an expected pool address by a given DEX root address * and possible included tokens addresses * @param {ProviderRpcClient} connection * @param {Address | string} dexRootAddress * @param {DexExpectedPoolAddressAbiParams} params * @param {FullContractState} [cachedState] * @return {Promise<Address>} */ static getExpectedPoolAddress(connection: ProviderRpcClient, dexRootAddress: Address | string, params: DexExpectedPoolAddressAbiParams, cachedState?: FullContractState): Promise<Address>; static getManager(connection: ProviderRpcClient, dexRootAddress: Address | string, cachedState?: FullContractState): Promise<Address>; static getOwner(connection: ProviderRpcClient, dexRootAddress: Address | string, cachedState?: FullContractState): Promise<Address>; static getVault(connection: ProviderRpcClient, dexRootAddress: Address | string, cachedState?: FullContractState): Promise<Address>; static decodeEvent(connection: ProviderRpcClient, dexRootAddress: Address | string, args: DecodeEventParams<typeof DexRootAbi>): Promise<DexDecodedEvent | undefined>; static decodeTransaction(connection: ProviderRpcClient, dexRootAddress: Address | string, args: DecodeTransactionParams<typeof DexRootAbi>): Promise<DexDecodedTransaction | undefined>; static decodeTransactionEvents(connection: ProviderRpcClient, dexRootAddress: Address | string, transaction: Transaction): Promise<DexDecodedEvent[]>; }