UNPKG

@sei-js/evm

Version:

TypeScript library for EVM interactions on the Sei blockchain

37 lines (36 loc) 1.66 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getOraclePrecompileEthersV6Contract = exports.ETHERS_ORACLE_PRECOMPILE_ABI = void 0; const ethers_1 = require("ethers"); const precompiles_1 = require("../precompiles"); /** * The ABI for the Oracle precompile contract, used to create an Ethers contract. * @category Cosmos Interoperability */ exports.ETHERS_ORACLE_PRECOMPILE_ABI = precompiles_1.ORACLE_PRECOMPILE_ABI; /** * Creates and returns a typed Ethers v6 contract instance for the Oracle precompile contract. * This contract is used for interoperability between the EVM and Cosmos. * * @example * ```tsx * import { getOraclePrecompileEthersV6Contract } from '@sei-js/evm/ethers'; * import { ethers } from 'ethers'; * * const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider * const signer = await provider.getSigner(); * * const oraclePrecompileContract = getOraclePrecompileEthersV6Contract(signer); * * const exchangeRates = await oraclePrecompileContract.getExchangeRates(); * console.log('Exchange Rates:', exchangeRates); * ``` * * @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract. * @returns The typed contract instance for interacting with the Oracle precompile contract. * @category Cosmos Interoperability */ const getOraclePrecompileEthersV6Contract = (runner) => { return new ethers_1.Contract(precompiles_1.ORACLE_PRECOMPILE_ADDRESS, exports.ETHERS_ORACLE_PRECOMPILE_ABI, runner); }; exports.getOraclePrecompileEthersV6Contract = getOraclePrecompileEthersV6Contract;