UNPKG

@broxus/js-bridge-essentials

Version:

Bridge JavaScript Essentials library

26 lines (25 loc) 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TonNativeProxyUtils = void 0; const js_core_1 = require("@broxus/js-core"); const contracts_1 = require("../../models/ton-native-proxy/contracts"); class TonNativeProxyUtils { static async getConfiguration(connection, proxyAddress, cachedState) { const state = cachedState ?? await (0, js_core_1.getFullContractState)(connection, proxyAddress); return (0, contracts_1.tonNativeProxyContract)(connection, proxyAddress) .methods.getConfiguration({ answerId: 0 }) .call({ cachedState: state, responsible: true }); } static async getTonEvmConfiguration(connection, proxyAddress, cachedState) { const result = await TonNativeProxyUtils.getConfiguration(connection, proxyAddress, cachedState); return result.value0.everscaleConfiguration; } static async getDexMiddleware(connection, proxyAddress, cachedState) { const state = cachedState ?? await (0, js_core_1.getFullContractState)(connection, proxyAddress); const result = await (0, contracts_1.tonNativeProxyContract)(connection, proxyAddress) .methods.dex_middleware() .call({ cachedState: state }); return result.dex_middleware; } } exports.TonNativeProxyUtils = TonNativeProxyUtils;