From 10586c1b4f19aa703a00fee2766f319bb809ea33 Mon Sep 17 00:00:00 2001 From: 0xp3gasus <0xp3gasus@proton.me> Date: Wed, 1 Nov 2023 19:20:28 +0100 Subject: [PATCH 1/8] EVM online data provider interface --- packages/xchain-client/src/provider-types.ts | 7 +++++- .../covalent/covalent-data-provider.ts | 18 +++++---------- .../src/providers/etherscan/etherscan-api.ts | 5 ++++- .../etherscan/etherscan-data-provider.ts | 22 +++++++++++++++++-- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/packages/xchain-client/src/provider-types.ts b/packages/xchain-client/src/provider-types.ts index 987203729..71effb2d8 100644 --- a/packages/xchain-client/src/provider-types.ts +++ b/packages/xchain-client/src/provider-types.ts @@ -1,7 +1,7 @@ import { Address, Asset } from '@xchainjs/xchain-util' import { ExplorerProvider } from './explorer-provider' -import { Balance, Network, Tx, TxHash, TxHistoryParams, TxsPage } from './types' +import { Balance, FeeRates, Network, Tx, TxHash, TxHistoryParams, TxsPage } from './types' export type Witness = { value: number @@ -27,6 +27,11 @@ export interface UtxoOnlineDataProvider extends OnlineDataProvider { broadcastTx(txHex: string): Promise } +export interface EvmOnlineDataProvider extends OnlineDataProvider { + getFeeRates(): Promise +} + export type ExplorerProviders = Record export type OnlineDataProviders = Record export type UtxoOnlineDataProviders = Record +export type EvmOnlineDataProviders = Record diff --git a/packages/xchain-evm-providers/src/providers/covalent/covalent-data-provider.ts b/packages/xchain-evm-providers/src/providers/covalent/covalent-data-provider.ts index a03e687ca..d84b5bbec 100644 --- a/packages/xchain-evm-providers/src/providers/covalent/covalent-data-provider.ts +++ b/packages/xchain-evm-providers/src/providers/covalent/covalent-data-provider.ts @@ -1,9 +1,7 @@ import { Balance, - FeeOption, - FeeType, - Fees, - OnlineDataProvider, + EvmOnlineDataProvider, + FeeRates, Tx, TxFrom, TxHistoryParams, @@ -25,7 +23,7 @@ import { const AVAXChain: Chain = 'AVAX' const AssetAVAX: Asset = { chain: AVAXChain, symbol: 'AVAX', ticker: 'AVAX', synth: false } -export class CovalentProvider implements OnlineDataProvider { +export class CovalentProvider implements EvmOnlineDataProvider { private baseUrl = 'https://api.covalenthq.com' private apiKey: string private chainId: number @@ -203,12 +201,8 @@ export class CovalentProvider implements OnlineDataProvider { hash: '', } } - async getFees(): Promise { - return { - [FeeOption.Average]: baseAmount(1), - [FeeOption.Fast]: baseAmount(1), - [FeeOption.Fastest]: baseAmount(1), - type: FeeType.PerByte, - } + + getFeeRates(): Promise { + throw new Error('Method not implemented.') } } diff --git a/packages/xchain-evm-providers/src/providers/etherscan/etherscan-api.ts b/packages/xchain-evm-providers/src/providers/etherscan/etherscan-api.ts index 0be9226f7..5120fec56 100644 --- a/packages/xchain-evm-providers/src/providers/etherscan/etherscan-api.ts +++ b/packages/xchain-evm-providers/src/providers/etherscan/etherscan-api.ts @@ -116,8 +116,11 @@ export const getTxFromTokenTransaction = (tx: TokenTransactionInfo, chain: Chain */ export const getGasOracle = async (baseUrl: string, apiKey?: string): Promise => { const url = baseUrl + '/api?module=gastracker&action=gasoracle' + const result = (await axios.get(url + getApiKeyQueryParameter(apiKey))).data.result - return (await axios.get(url + getApiKeyQueryParameter(apiKey))).data.result + if (typeof result === 'string') throw Error(`Can not retrieve gasOracle: ${result}`) + + return result } /** diff --git a/packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts b/packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts index 5ed69253a..18a15f9db 100644 --- a/packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts +++ b/packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts @@ -1,5 +1,13 @@ import { Provider } from '@ethersproject/abstract-provider' -import { Balance, OnlineDataProvider, Tx, TxHistoryParams, TxsPage } from '@xchainjs/xchain-client' +import { + Balance, + EvmOnlineDataProvider, + FeeOption, + FeeRates, + Tx, + TxHistoryParams, + TxsPage, +} from '@xchainjs/xchain-client' import { Address, Asset, Chain, assetToString, baseAmount } from '@xchainjs/xchain-util' import axios from 'axios' import { BigNumber, ethers } from 'ethers' @@ -8,7 +16,7 @@ import erc20ABI from './erc20.json' import * as etherscanAPI from './etherscan-api' import { ERC20Tx, GetERC20TxsResponse } from './types' -export class EtherscanProvider implements OnlineDataProvider { +export class EtherscanProvider implements EvmOnlineDataProvider { private provider: Provider private baseUrl: string private apiKey: string @@ -184,4 +192,14 @@ export class EtherscanProvider implements OnlineDataProvider { return tx } + + async getFeeRates(): Promise { + const gasOracleResponse = await etherscanAPI.getGasOracle(this.baseUrl, this.apiKey) + + return { + [FeeOption.Average]: BigNumber.from(gasOracleResponse.SafeGasPrice).toNumber() * 10 ** 9, + [FeeOption.Fast]: BigNumber.from(gasOracleResponse.ProposeGasPrice).toNumber() * 10 ** 9, + [FeeOption.Fastest]: BigNumber.from(gasOracleResponse.FastGasPrice).toNumber() * 10 ** 9, + } + } } From 8a92c1fc6daf91a3e8ffb679ca0e46ea1dae3158 Mon Sep 17 00:00:00 2001 From: 0xp3gasus <0xp3gasus@proton.me> Date: Wed, 1 Nov 2023 19:27:16 +0100 Subject: [PATCH 2/8] getFeeRates roundRobin --- .../xchain-ethereum/__e2e__/eth-client.e2e.ts | 55 +++++++++++- packages/xchain-evm/src/client.ts | 84 ++++++++++++------- 2 files changed, 105 insertions(+), 34 deletions(-) diff --git a/packages/xchain-ethereum/__e2e__/eth-client.e2e.ts b/packages/xchain-ethereum/__e2e__/eth-client.e2e.ts index 75bd8d85d..248afc17d 100644 --- a/packages/xchain-ethereum/__e2e__/eth-client.e2e.ts +++ b/packages/xchain-ethereum/__e2e__/eth-client.e2e.ts @@ -1,5 +1,5 @@ -import { Balance, Network, TxType } from '@xchainjs/xchain-client' -import { ApproveParams, EstimateApproveParams, IsApprovedParams } from '@xchainjs/xchain-evm' +import { Balance, FeeOption, Network, TxType } from '@xchainjs/xchain-client' +import { ApproveParams, EstimateApproveParams, IsApprovedParams, Protocol } from '@xchainjs/xchain-evm' import { Asset, assetAmount, assetToBase, assetToString } from '@xchainjs/xchain-util' import Client from '../src/client' @@ -207,4 +207,55 @@ describe('xchain-evm (Eth) Integration Tests', () => { fail() } }) + // Can not retrieve this info over testnet network, sepolia api in etherscan do not support gas Oracle endpoint and there is no testnet for thorchain + it('should estimate feeRates with default values', async () => { + try { + const feeRates = await clientTestnet.estimateGasPrices() + console.log({ + [FeeOption.Average]: feeRates.average.amount().toString(), + [FeeOption.Fast]: feeRates.fast.amount().toString(), + [FeeOption.Fastest]: feeRates.fastest.amount().toString(), + }) + expect(feeRates.fast.gte(feeRates.average)).toBe(true) + expect(feeRates.fastest.gte(feeRates.average)).toBe(true) + expect(feeRates.fastest.gte(feeRates.fast)).toBe(true) + } catch (err) { + console.error('ERR running test', err) + fail() + } + }) + it('should estimate feeRates using data providers', async () => { + try { + const client = new Client({ ...defaultEthParams, network: Network.Mainnet }) + const feeRates = await client.estimateGasPrices() + console.log({ + [FeeOption.Average]: feeRates.average.amount().toString(), + [FeeOption.Fast]: feeRates.fast.amount().toString(), + [FeeOption.Fastest]: feeRates.fastest.amount().toString(), + }) + expect(feeRates.fast.gte(feeRates.average)).toBe(true) + expect(feeRates.fastest.gte(feeRates.average)).toBe(true) + expect(feeRates.fastest.gte(feeRates.fast)).toBe(true) + } catch (err) { + console.error('ERR running test', err) + fail() + } + }) + it('should estimate feeRates to interact with Thorchain', async () => { + try { + const client = new Client({ ...defaultEthParams, network: Network.Mainnet }) + const feeRates = await client.estimateGasPrices(Protocol.THORCHAIN) + console.log({ + [FeeOption.Average]: feeRates.average.amount().toString(), + [FeeOption.Fast]: feeRates.fast.amount().toString(), + [FeeOption.Fastest]: feeRates.fastest.amount().toString(), + }) + expect(feeRates.fast.gte(feeRates.average)).toBe(true) + expect(feeRates.fastest.gte(feeRates.average)).toBe(true) + expect(feeRates.fastest.gte(feeRates.fast)).toBe(true) + } catch (err) { + console.error('ERR running test', err) + fail() + } + }) }) diff --git a/packages/xchain-evm/src/client.ts b/packages/xchain-evm/src/client.ts index 43e3619b5..4df57cdcb 100644 --- a/packages/xchain-evm/src/client.ts +++ b/packages/xchain-evm/src/client.ts @@ -3,13 +3,13 @@ import { AssetInfo, Balance, BaseXChainClient, + EvmOnlineDataProviders, ExplorerProviders, FeeOption, FeeRates, FeeType, Fees, Network, - OnlineDataProviders, PreparedTx, Tx, TxHash, @@ -47,6 +47,9 @@ import { validateAddress, } from './utils' +export enum Protocol { + THORCHAIN = 1, +} /** * Interface for custom EVM client */ @@ -78,7 +81,7 @@ export type EVMClientParams = XChainClientParams & { defaults: Record providers: Record explorerProviders: ExplorerProviders - dataProviders: OnlineDataProviders[] + dataProviders: EvmOnlineDataProviders[] } /** @@ -91,7 +94,7 @@ export default class Client extends BaseXChainClient implements XChainClient { private hdNode?: HDNode private defaults: Record private explorerProviders: ExplorerProviders - private dataProviders: OnlineDataProviders[] + private dataProviders: EvmOnlineDataProviders[] private providers: Record /** * Constructor @@ -556,43 +559,48 @@ export default class Client extends BaseXChainClient implements XChainClient { /** * Estimate gas price. - * @see https://etherscan.io/apis#gastracker + * @param {Protocol} protocol Protocol to interact with. If there's no protocol provided, fee rates are retrieved from chain data providers * * @returns {GasPrices} The gas prices (average, fast, fastest) in `Wei` (`BaseAmount`) */ - async estimateGasPrices(): Promise { - try { - // Note: `rates` are in `gwei` - // @see https://gitlab.com/thorchain/thornode/-/blob/develop/x/thorchain/querier.go#L416-420 - // To have all values in `BaseAmount`, they needs to be converted into `wei` (1 gwei = 1,000,000,000 wei = 1e9) - const ratesInGwei: FeeRates = standardFeeRates(await this.getFeeRateFromThorchain()) - return { - [FeeOption.Average]: baseAmount(ratesInGwei[FeeOption.Average] * 10 ** 9, this.gasAssetDecimals), - [FeeOption.Fast]: baseAmount(ratesInGwei[FeeOption.Fast] * 10 ** 9, this.gasAssetDecimals), - [FeeOption.Fastest]: baseAmount(ratesInGwei[FeeOption.Fastest] * 10 ** 9, this.gasAssetDecimals), + async estimateGasPrices(protocol?: Protocol): Promise { + if (!protocol) { + try { + const feeRates = await this.roundRobinGetFeeRates() + return { + [FeeOption.Average]: baseAmount(feeRates.average, this.gasAssetDecimals), + [FeeOption.Fast]: baseAmount(feeRates.fast, this.gasAssetDecimals), + [FeeOption.Fastest]: baseAmount(feeRates.fastest, this.gasAssetDecimals), + } + } catch (error) { + console.warn(`Can not round robin over GetFeeRates: ${error}`) } - } catch (error) { - console.warn(error) } - try { - const feeRateInWei = await this.providers[this.network].getGasPrice() - const feeRateInGWei = feeRateInWei.div(10 ** 9) - const ratesInGwei: FeeRates = standardFeeRates(feeRateInGWei.toNumber()) - return { - [FeeOption.Average]: baseAmount(ratesInGwei[FeeOption.Average] * 10 ** 9, this.gasAssetDecimals), - [FeeOption.Fast]: baseAmount(ratesInGwei[FeeOption.Fast] * 10 ** 9, this.gasAssetDecimals), - [FeeOption.Fastest]: baseAmount(ratesInGwei[FeeOption.Fastest] * 10 ** 9, this.gasAssetDecimals), - } - } catch (error) { - console.warn(error) - const defaultRatesInGwei: FeeRates = standardFeeRates(this.defaults[this.network].gasPrice.toNumber()) - return { - [FeeOption.Average]: baseAmount(defaultRatesInGwei[FeeOption.Average] * 10 ** 9, this.gasAssetDecimals), - [FeeOption.Fast]: baseAmount(defaultRatesInGwei[FeeOption.Fast] * 10 ** 9, this.gasAssetDecimals), - [FeeOption.Fastest]: baseAmount(defaultRatesInGwei[FeeOption.Fastest] * 10 ** 9, this.gasAssetDecimals), + // If chain data providers fail, THORCHAIN as fallback + if (!protocol || protocol === Protocol.THORCHAIN) { + try { + // Note: `rates` are in `gwei` + // @see https://gitlab.com/thorchain/thornode/-/blob/develop/x/thorchain/querier.go#L416-420 + // To have all values in `BaseAmount`, they needs to be converted into `wei` (1 gwei = 1,000,000,000 wei = 1e9) + const ratesInGwei: FeeRates = standardFeeRates(await this.getFeeRateFromThorchain()) + return { + [FeeOption.Average]: baseAmount(ratesInGwei[FeeOption.Average] * 10 ** 9, this.gasAssetDecimals), + [FeeOption.Fast]: baseAmount(ratesInGwei[FeeOption.Fast] * 10 ** 9, this.gasAssetDecimals), + [FeeOption.Fastest]: baseAmount(ratesInGwei[FeeOption.Fastest] * 10 ** 9, this.gasAssetDecimals), + } + } catch (error) { + console.warn(error) } } + + // Default fee rates if everything else fails + const defaultRatesInGwei: FeeRates = standardFeeRates(this.defaults[this.network].gasPrice.toNumber()) + return { + [FeeOption.Average]: baseAmount(defaultRatesInGwei[FeeOption.Average] * 10 ** 9, this.gasAssetDecimals), + [FeeOption.Fast]: baseAmount(defaultRatesInGwei[FeeOption.Fast] * 10 ** 9, this.gasAssetDecimals), + [FeeOption.Fastest]: baseAmount(defaultRatesInGwei[FeeOption.Fastest] * 10 ** 9, this.gasAssetDecimals), + } } /** @@ -717,6 +725,18 @@ export default class Client extends BaseXChainClient implements XChainClient { throw Error('no provider able to GetTransactions') } + protected async roundRobinGetFeeRates(): Promise { + for (const provider of this.dataProviders) { + try { + const prov = provider[this.network] + if (prov) return await prov.getFeeRates() + } catch (error) { + console.warn(error) + } + } + throw Error('No provider available to getFeeRates') + } + /** * Prepare transfer. * From 76fc08deca16bb15276333552451c9781de5f9aa Mon Sep 17 00:00:00 2001 From: 0xp3gasus <0xp3gasus@proton.me> Date: Thu, 2 Nov 2023 10:12:05 +0100 Subject: [PATCH 3/8] Thorchain estimation --- packages/xchain-thorchain-amm/src/utils/evm-helper.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/xchain-thorchain-amm/src/utils/evm-helper.ts b/packages/xchain-thorchain-amm/src/utils/evm-helper.ts index a3771b341..8544b1e70 100644 --- a/packages/xchain-thorchain-amm/src/utils/evm-helper.ts +++ b/packages/xchain-thorchain-amm/src/utils/evm-helper.ts @@ -1,5 +1,5 @@ import { TxHash, XChainClient } from '@xchainjs/xchain-client' -import { ApproveParams, Client as EvmClient, MAX_APPROVAL, abi } from '@xchainjs/xchain-evm' +import { ApproveParams, Client as EvmClient, MAX_APPROVAL, Protocol, abi } from '@xchainjs/xchain-evm' import { ThorchainCache } from '@xchainjs/xchain-thorchain-query' import { Asset, BaseAmount, baseAmount, eqAsset, getContractAddressFromAsset } from '@xchainjs/xchain-util' import { ethers } from 'ethers' @@ -40,16 +40,17 @@ export class EvmHelper { } const address = this.client.getAddress(params.walletIndex) - const gasPrice = await this.evmClient.estimateGasPrices() + const gasPrice = await this.evmClient.estimateGasPrices(Protocol.THORCHAIN) if (eqAsset(params.asset, this.evmClient.config.gasAsset)) { // simple transfer - return await this.client.transfer({ + return await this.evmClient.transfer({ walletIndex: params.walletIndex || 0, asset: params.asset, amount: params.amount, recipient: inboundAsgard.address, memo: params.memo, + gasPrice: gasPrice.fast, }) } else { //erc-20 must be depsited to the router From def10a072749483721f4d2732f925e41340a18b3 Mon Sep 17 00:00:00 2001 From: 0xp3gasus <0xp3gasus@proton.me> Date: Thu, 2 Nov 2023 10:57:50 +0100 Subject: [PATCH 4/8] Decimal bugfix --- .../src/providers/etherscan/etherscan-data-provider.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts b/packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts index 18a15f9db..b4b11cfd4 100644 --- a/packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts +++ b/packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts @@ -197,9 +197,9 @@ export class EtherscanProvider implements EvmOnlineDataProvider { const gasOracleResponse = await etherscanAPI.getGasOracle(this.baseUrl, this.apiKey) return { - [FeeOption.Average]: BigNumber.from(gasOracleResponse.SafeGasPrice).toNumber() * 10 ** 9, - [FeeOption.Fast]: BigNumber.from(gasOracleResponse.ProposeGasPrice).toNumber() * 10 ** 9, - [FeeOption.Fastest]: BigNumber.from(gasOracleResponse.FastGasPrice).toNumber() * 10 ** 9, + [FeeOption.Average]: Number(gasOracleResponse.SafeGasPrice) * 10 ** 9, + [FeeOption.Fast]: Number(gasOracleResponse.ProposeGasPrice) * 10 ** 9, + [FeeOption.Fastest]: Number(gasOracleResponse.FastGasPrice) * 10 ** 9, } } } From ffac27d63a244a93010976d7262a572cf023f777 Mon Sep 17 00:00:00 2001 From: 0xp3gasus <0xp3gasus@proton.me> Date: Thu, 2 Nov 2023 11:25:17 +0100 Subject: [PATCH 5/8] Update versions --- packages/xchain-avax/CHANGELOG.md | 6 ++++++ packages/xchain-avax/package.json | 14 ++++++------- packages/xchain-bsc/CHANGELOG.md | 6 ++++++ packages/xchain-bsc/package.json | 14 ++++++------- packages/xchain-client/CHANGELOG.md | 6 ++++++ packages/xchain-client/package.json | 2 +- packages/xchain-ethereum/CHANGELOG.md | 6 ++++++ packages/xchain-ethereum/package.json | 14 ++++++------- packages/xchain-evm-providers/CHANGELOG.md | 6 ++++++ packages/xchain-evm-providers/package.json | 8 ++++---- packages/xchain-evm/CHANGELOG.md | 6 ++++++ packages/xchain-evm/package.json | 10 ++++----- packages/xchain-thorchain-amm/CHANGELOG.md | 6 ++++++ packages/xchain-thorchain-amm/package.json | 24 +++++++++++----------- 14 files changed, 85 insertions(+), 43 deletions(-) diff --git a/packages/xchain-avax/CHANGELOG.md b/packages/xchain-avax/CHANGELOG.md index f1284f613..9a14549ca 100644 --- a/packages/xchain-avax/CHANGELOG.md +++ b/packages/xchain-avax/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.3.4 (2023-11-02) + +## Update + +- Estimations can be done with data provider + # v0.3.3 (2023-10-26) ## Update diff --git a/packages/xchain-avax/package.json b/packages/xchain-avax/package.json index 9ef39abf9..fd29991ec 100644 --- a/packages/xchain-avax/package.json +++ b/packages/xchain-avax/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-avax", - "version": "0.3.3", + "version": "0.3.4", "description": "Avax EVM client for XChainJS", "keywords": [ "XChain", @@ -35,20 +35,20 @@ "access": "public" }, "devDependencies": { - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.4", + "@xchainjs/xchain-evm": "^0.3.5", "@xchainjs/xchain-util": "^0.13.1", - "@xchainjs/xchain-evm-providers": "^0.1.1", + "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", "ethers": "^5.7.2" }, "peerDependencies": { - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.4", + "@xchainjs/xchain-evm": "^0.3.5", "@xchainjs/xchain-util": "^0.13.1", - "@xchainjs/xchain-evm-providers": "^0.1.1", + "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", "ethers": "^5.7.2" } diff --git a/packages/xchain-bsc/CHANGELOG.md b/packages/xchain-bsc/CHANGELOG.md index 6e5aa0e5e..8b0d8da70 100644 --- a/packages/xchain-bsc/CHANGELOG.md +++ b/packages/xchain-bsc/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.3.4 (2023-11-02) + +## Update + +- Estimations can be done with data provider + # v0.3.3 (2023-10-26) ## Update diff --git a/packages/xchain-bsc/package.json b/packages/xchain-bsc/package.json index 9a60fae94..ee858671b 100644 --- a/packages/xchain-bsc/package.json +++ b/packages/xchain-bsc/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-bsc", - "version": "0.3.3", + "version": "0.3.4", "description": "Binance Smart Chain EVM client for XChainJS", "keywords": [ "XChain", @@ -35,20 +35,20 @@ "access": "public" }, "devDependencies": { - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.4", + "@xchainjs/xchain-evm": "^0.3.5", "@xchainjs/xchain-util": "^0.13.1", - "@xchainjs/xchain-evm-providers": "^0.1.1", + "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", "ethers": "^5.7.2" }, "peerDependencies": { - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.4", + "@xchainjs/xchain-evm": "^0.3.5", "@xchainjs/xchain-util": "^0.13.1", - "@xchainjs/xchain-evm-providers": "^0.1.1", + "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", "ethers": "^5.7.2" } diff --git a/packages/xchain-client/CHANGELOG.md b/packages/xchain-client/CHANGELOG.md index f4732545b..9c64df5ca 100644 --- a/packages/xchain-client/CHANGELOG.md +++ b/packages/xchain-client/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.15.2 (2023-11-02) + +## Update + +- EVMOnlineDataProvider interface + # v0.15.1 (2023-10-26) ## Update diff --git a/packages/xchain-client/package.json b/packages/xchain-client/package.json index 005b9ea65..876254d99 100644 --- a/packages/xchain-client/package.json +++ b/packages/xchain-client/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-client", - "version": "0.15.1", + "version": "0.15.2", "license": "MIT", "main": "lib/index.js", "module": "lib/index.esm.js", diff --git a/packages/xchain-ethereum/CHANGELOG.md b/packages/xchain-ethereum/CHANGELOG.md index b6e710690..e14c7fb99 100644 --- a/packages/xchain-ethereum/CHANGELOG.md +++ b/packages/xchain-ethereum/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.30.5 (2023-11-02) + +## Update + +- Estimations can be done with data provider + # v0.30.4 (2023-10-26) ## Update diff --git a/packages/xchain-ethereum/package.json b/packages/xchain-ethereum/package.json index 4994ddf9a..7ce77be5d 100644 --- a/packages/xchain-ethereum/package.json +++ b/packages/xchain-ethereum/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-ethereum", - "version": "0.30.4", + "version": "0.30.5", "description": "Ethereum EVM client for XChainJS", "keywords": [ "XChain", @@ -35,20 +35,20 @@ "access": "public" }, "devDependencies": { - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.4", + "@xchainjs/xchain-evm": "^0.3.5", "@xchainjs/xchain-util": "^0.13.1", - "@xchainjs/xchain-evm-providers": "^0.1.1", + "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", "ethers": "^5.7.2" }, "peerDependencies": { - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.4", + "@xchainjs/xchain-evm": "^0.3.5", "@xchainjs/xchain-util": "^0.13.1", - "@xchainjs/xchain-evm-providers": "^0.1.1", + "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", "ethers": "^5.7.2" } diff --git a/packages/xchain-evm-providers/CHANGELOG.md b/packages/xchain-evm-providers/CHANGELOG.md index 331e1d861..b682e8e31 100644 --- a/packages/xchain-evm-providers/CHANGELOG.md +++ b/packages/xchain-evm-providers/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.1.2 (2023-11-02) + +## Update + +- GetFeeRates + # v0.1.1 (2023-09-11) ## Update diff --git a/packages/xchain-evm-providers/package.json b/packages/xchain-evm-providers/package.json index 7d286d67d..0ca9331f3 100644 --- a/packages/xchain-evm-providers/package.json +++ b/packages/xchain-evm-providers/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-evm-providers", - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", "main": "lib/index.js", "module": "lib/index.esm.js", @@ -27,13 +27,13 @@ "access": "public" }, "devDependencies": { - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", "@xchainjs/xchain-util": "^0.13.1", "axios": "^1.3.6" }, "peerDependencies": { - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", "@xchainjs/xchain-util": "^0.13.1", "axios": "^1.3.6" @@ -41,4 +41,4 @@ "dependencies": { "@supercharge/promise-pool": "^2.4.0" } -} +} \ No newline at end of file diff --git a/packages/xchain-evm/CHANGELOG.md b/packages/xchain-evm/CHANGELOG.md index 6d2f2767e..cc462c840 100644 --- a/packages/xchain-evm/CHANGELOG.md +++ b/packages/xchain-evm/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.3.5 (2023-11-02) + +## Update + +- estimateGasPrices can difference between protocols and non-protocol interactions + # v0.3.4 (2023-10-26) ## Update diff --git a/packages/xchain-evm/package.json b/packages/xchain-evm/package.json index 47eb5fed3..5fc3308a4 100644 --- a/packages/xchain-evm/package.json +++ b/packages/xchain-evm/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-evm", - "version": "0.3.4", + "version": "0.3.5", "description": "Genereic EVM client for XChainJS", "keywords": [ "XChain", @@ -34,18 +34,18 @@ "access": "public" }, "devDependencies": { - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", "@xchainjs/xchain-util": "^0.13.1", - "@xchainjs/xchain-evm-providers": "^0.1.1", + "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", "ethers": "^5.7.2" }, "peerDependencies": { - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", "@xchainjs/xchain-util": "^0.13.1", "axios": "^1.3.6", "ethers": "^5.7.2" } -} +} \ No newline at end of file diff --git a/packages/xchain-thorchain-amm/CHANGELOG.md b/packages/xchain-thorchain-amm/CHANGELOG.md index f750a9b5d..f97f67670 100644 --- a/packages/xchain-thorchain-amm/CHANGELOG.md +++ b/packages/xchain-thorchain-amm/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.7.9 (2023-11-02) + +## Update + +- Force Thorchain estimations + # v0.7.8 (2023-10-31) ## Update diff --git a/packages/xchain-thorchain-amm/package.json b/packages/xchain-thorchain-amm/package.json index ec8a108ab..05bf0af86 100644 --- a/packages/xchain-thorchain-amm/package.json +++ b/packages/xchain-thorchain-amm/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-thorchain-amm", - "version": "0.7.8", + "version": "0.7.9", "description": "module that exposes estimating & swappping cryptocurrency assets on thorchain", "keywords": [ "THORChain", @@ -39,19 +39,19 @@ "@binance-chain/javascript-sdk": "^4.2.0", "@cosmos-client/core": "0.46.1", "@psf/bitcoincashjs-lib": "^4.0.3", - "@xchainjs/xchain-avax": "^0.3.3", + "@xchainjs/xchain-avax": "^0.3.4", "@xchainjs/xchain-binance": "^5.7.4", "@xchainjs/xchain-bitcoin": "^0.23.2", "@xchainjs/xchain-bitcoincash": "^0.17.2", - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-cosmos": "^0.21.5", - "@xchainjs/xchain-bsc": "^0.3.3", + "@xchainjs/xchain-bsc": "^0.3.4", "@xchainjs/xchain-crypto": "^0.3.0", "@xchainjs/xchain-doge": "^0.7.3", - "@xchainjs/xchain-ethereum": "^0.30.4", + "@xchainjs/xchain-ethereum": "^0.30.5", "@xchainjs/xchain-thornode": "^0.3.8", "@xchainjs/xchain-thorchain-query": "^0.6.6", - "@xchainjs/xchain-evm": "^0.3.4", + "@xchainjs/xchain-evm": "^0.3.5", "@xchainjs/xchain-litecoin": "^0.13.2", "@xchainjs/xchain-mayachain": "^0.2.8", "@xchainjs/xchain-midgard": "^0.5.2", @@ -75,19 +75,19 @@ "@binance-chain/javascript-sdk": "^4.2.0", "@cosmos-client/core": "0.46.1", "@psf/bitcoincashjs-lib": "^4.0.3", - "@xchainjs/xchain-avax": "^0.3.3", + "@xchainjs/xchain-avax": "^0.3.4", "@xchainjs/xchain-binance": "^5.7.4", "@xchainjs/xchain-bitcoin": "^0.23.2", "@xchainjs/xchain-bitcoincash": "^0.17.2", - "@xchainjs/xchain-client": "^0.15.1", + "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-cosmos": "^0.21.5", - "@xchainjs/xchain-bsc": "^0.3.3", + "@xchainjs/xchain-bsc": "^0.3.4", "@xchainjs/xchain-crypto": "^0.3.0", "@xchainjs/xchain-doge": "^0.7.3", - "@xchainjs/xchain-ethereum": "^0.30.4", + "@xchainjs/xchain-ethereum": "^0.30.5", "@xchainjs/xchain-thornode": "^0.3.8", "@xchainjs/xchain-thorchain-query": "^0.6.6", - "@xchainjs/xchain-evm": "^0.3.4", + "@xchainjs/xchain-evm": "^0.3.5", "@xchainjs/xchain-litecoin": "^0.13.2", "@xchainjs/xchain-mayachain": "^0.2.8", "@xchainjs/xchain-midgard": "^0.5.2", @@ -109,4 +109,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} From 6068bd86e3132f769a103336926a72ab8386a57f Mon Sep 17 00:00:00 2001 From: 0xp3gasus <0xp3gasus@proton.me> Date: Fri, 3 Nov 2023 12:42:14 +0100 Subject: [PATCH 6/8] EIP 1559 params --- .../xchain-avax/__e2e__/avax-client.e2e.ts | 22 +++++++- packages/xchain-evm/src/client.ts | 56 +++++++++++++------ 2 files changed, 61 insertions(+), 17 deletions(-) diff --git a/packages/xchain-avax/__e2e__/avax-client.e2e.ts b/packages/xchain-avax/__e2e__/avax-client.e2e.ts index dae25ae18..33076ac58 100644 --- a/packages/xchain-avax/__e2e__/avax-client.e2e.ts +++ b/packages/xchain-avax/__e2e__/avax-client.e2e.ts @@ -1,7 +1,7 @@ import { Balance, Network, OnlineDataProviders, TxType } from '@xchainjs/xchain-client' import { ApproveParams, EstimateApproveParams, IsApprovedParams } from '@xchainjs/xchain-evm' import { CovalentProvider } from '@xchainjs/xchain-evm-providers' -import { Asset, assetAmount, assetToBase, assetToString } from '@xchainjs/xchain-util' +import { Asset, assetAmount, assetToBase, assetToString, baseAmount } from '@xchainjs/xchain-util' import AvaxClient from '../src/client' import { AVAXChain, AssetAVAX, defaultAvaxParams } from '../src/const' @@ -108,6 +108,26 @@ describe('xchain-evm (Avax) Integration Tests', () => { const txHash = await client.transfer({ amount, recipient, memo }) console.log(txHash) }) + it('should transfer 0.01 AVAX following EIP1559 because maxFeePerGas', async () => { + const recipient = client.getAddress(1) + const amount = assetToBase(assetAmount('0.01', 18)) + const txHash = await client.transfer({ + amount, + recipient, + maxFeePerGas: baseAmount('51700000000', 18), + }) + console.log(txHash) + }) + it('should transfer 0.01 AVAX following EIP1559 because maxPriorityFeePerGas', async () => { + const recipient = client.getAddress(1) + const amount = assetToBase(assetAmount('0.01', 18)) + const txHash = await client.transfer({ + amount, + recipient, + maxPriorityFeePerGas: baseAmount('1700000000', 18), + }) + console.log(txHash) + }) it('should transfer 0.01 RIP(ERC-20) between wallet 0 and 1', async () => { const recipient = client.getAddress(1) const amount = assetToBase(assetAmount('0.01', 18)) diff --git a/packages/xchain-evm/src/client.ts b/packages/xchain-evm/src/client.ts index 4df57cdcb..3c417499e 100644 --- a/packages/xchain-evm/src/client.ts +++ b/packages/xchain-evm/src/client.ts @@ -34,7 +34,6 @@ import { FeesWithGasPricesAndLimits, GasPrices, IsApprovedParams, - TxOverrides, } from './types' import { call, @@ -493,18 +492,47 @@ export default class Client extends BaseXChainClient implements XChainClient { recipient, feeOption = FeeOption.Fast, gasPrice, + maxFeePerGas, + maxPriorityFeePerGas, gasLimit, }: TxParams & { signer?: Signer feeOption?: FeeOption gasPrice?: BaseAmount + maxFeePerGas?: BaseAmount + maxPriorityFeePerGas?: BaseAmount gasLimit?: BigNumber }): Promise { - const txGasPrice: BigNumber = gasPrice - ? BigNumber.from(gasPrice.amount().toFixed()) - : await this.estimateGasPrices() - .then((prices) => prices[feeOption]) - .then((gp) => BigNumber.from(gp.amount().toFixed())) + if (gasPrice && (maxFeePerGas || maxPriorityFeePerGas)) { + throw new Error('gasPrice is not compatible with EIP 1559 (maxFeePerGas and maxPriorityFeePerGas) params') + } + + const feeData: ethers.providers.FeeData = { + lastBaseFeePerGas: null, + maxFeePerGas: null, + maxPriorityFeePerGas: null, + gasPrice: null, + } + + if (maxFeePerGas || maxPriorityFeePerGas) { + const feeInfo = await this.getProvider().getFeeData() + if (maxFeePerGas) { + feeData.maxFeePerGas = BigNumber.from(maxFeePerGas.amount().toFixed()) + } else if (maxPriorityFeePerGas && feeInfo.lastBaseFeePerGas) { + feeData.maxFeePerGas = feeInfo.lastBaseFeePerGas.mul(2).add(maxPriorityFeePerGas.amount().toFixed()) + } + feeData.maxPriorityFeePerGas = maxPriorityFeePerGas + ? BigNumber.from(maxPriorityFeePerGas.amount().toFixed()) + : feeInfo.maxPriorityFeePerGas + } else { + const txGasPrice: BigNumber = gasPrice + ? BigNumber.from(gasPrice.amount().toFixed()) + : await this.estimateGasPrices() + .then((prices) => prices[feeOption]) + .then((gp) => BigNumber.from(gp.amount().toFixed())) + checkFeeBounds(this.feeBounds, txGasPrice.toNumber()) + feeData.gasPrice = txGasPrice + } const sender = this.getAddress(walletIndex || 0) @@ -521,14 +549,6 @@ export default class Client extends BaseXChainClient implements XChainClient { txGasLimit = gasLimit } - type SafeTxOverrides = Omit & { gasPrice: ethers.BigNumber } - const overrides: SafeTxOverrides = { - gasLimit: txGasLimit, - gasPrice: txGasPrice, - } - - checkFeeBounds(this.feeBounds, overrides.gasPrice.toNumber()) - const { rawUnsignedTx } = await this.prepareTx({ sender, recipient, @@ -541,13 +561,17 @@ export default class Client extends BaseXChainClient implements XChainClient { const signer = txSigner || this.getWallet(walletIndex) - const { hash } = await signer.sendTransaction({ + const tx = await signer.populateTransaction({ from: transactionRequest.from, to: transactionRequest.to, data: transactionRequest.data, value: transactionRequest.value, - ...overrides, + gasLimit: txGasLimit, + gasPrice: feeData.gasPrice || undefined, + maxPriorityFeePerGas: feeData.maxPriorityFeePerGas || undefined, + maxFeePerGas: feeData.maxFeePerGas || undefined, }) + const { hash } = await signer.sendTransaction(tx) return hash } From a559a8866fac0990af8deb6450bcd656234fc6b4 Mon Sep 17 00:00:00 2001 From: 0xp3gasus <0xp3gasus@proton.me> Date: Fri, 3 Nov 2023 12:54:04 +0100 Subject: [PATCH 7/8] Package versions --- packages/xchain-avax/CHANGELOG.md | 6 ++++++ packages/xchain-avax/package.json | 8 ++++---- packages/xchain-bsc/CHANGELOG.md | 6 ++++++ packages/xchain-bsc/package.json | 8 ++++---- packages/xchain-ethereum/CHANGELOG.md | 6 ++++++ packages/xchain-ethereum/package.json | 8 ++++---- packages/xchain-evm/CHANGELOG.md | 6 ++++++ packages/xchain-evm/package.json | 2 +- 8 files changed, 37 insertions(+), 13 deletions(-) diff --git a/packages/xchain-avax/CHANGELOG.md b/packages/xchain-avax/CHANGELOG.md index 9a14549ca..3928b44f4 100644 --- a/packages/xchain-avax/CHANGELOG.md +++ b/packages/xchain-avax/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.3.5 (2023-11-03) + +## Update + +- EIP1559 params + # v0.3.4 (2023-11-02) ## Update diff --git a/packages/xchain-avax/package.json b/packages/xchain-avax/package.json index fd29991ec..a50553cfe 100644 --- a/packages/xchain-avax/package.json +++ b/packages/xchain-avax/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-avax", - "version": "0.3.4", + "version": "0.3.5", "description": "Avax EVM client for XChainJS", "keywords": [ "XChain", @@ -37,7 +37,7 @@ "devDependencies": { "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.5", + "@xchainjs/xchain-evm": "^0.3.6", "@xchainjs/xchain-util": "^0.13.1", "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", @@ -46,10 +46,10 @@ "peerDependencies": { "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.5", + "@xchainjs/xchain-evm": "^0.3.6", "@xchainjs/xchain-util": "^0.13.1", "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", "ethers": "^5.7.2" } -} +} \ No newline at end of file diff --git a/packages/xchain-bsc/CHANGELOG.md b/packages/xchain-bsc/CHANGELOG.md index 8b0d8da70..da624104d 100644 --- a/packages/xchain-bsc/CHANGELOG.md +++ b/packages/xchain-bsc/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.3.5 (2023-11-03) + +## Update + +- EIP1559 params + # v0.3.4 (2023-11-02) ## Update diff --git a/packages/xchain-bsc/package.json b/packages/xchain-bsc/package.json index ee858671b..975a1839b 100644 --- a/packages/xchain-bsc/package.json +++ b/packages/xchain-bsc/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-bsc", - "version": "0.3.4", + "version": "0.3.5", "description": "Binance Smart Chain EVM client for XChainJS", "keywords": [ "XChain", @@ -37,7 +37,7 @@ "devDependencies": { "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.5", + "@xchainjs/xchain-evm": "^0.3.6", "@xchainjs/xchain-util": "^0.13.1", "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", @@ -46,10 +46,10 @@ "peerDependencies": { "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.5", + "@xchainjs/xchain-evm": "^0.3.6", "@xchainjs/xchain-util": "^0.13.1", "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", "ethers": "^5.7.2" } -} +} \ No newline at end of file diff --git a/packages/xchain-ethereum/CHANGELOG.md b/packages/xchain-ethereum/CHANGELOG.md index e14c7fb99..0831f8019 100644 --- a/packages/xchain-ethereum/CHANGELOG.md +++ b/packages/xchain-ethereum/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.30.6 (2023-11-03) + +## Update + +- EIP1559 params + # v0.30.5 (2023-11-02) ## Update diff --git a/packages/xchain-ethereum/package.json b/packages/xchain-ethereum/package.json index 7ce77be5d..8075efbd8 100644 --- a/packages/xchain-ethereum/package.json +++ b/packages/xchain-ethereum/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-ethereum", - "version": "0.30.5", + "version": "0.30.6", "description": "Ethereum EVM client for XChainJS", "keywords": [ "XChain", @@ -37,7 +37,7 @@ "devDependencies": { "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.5", + "@xchainjs/xchain-evm": "^0.3.6", "@xchainjs/xchain-util": "^0.13.1", "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", @@ -46,10 +46,10 @@ "peerDependencies": { "@xchainjs/xchain-client": "^0.15.2", "@xchainjs/xchain-crypto": "^0.3.0", - "@xchainjs/xchain-evm": "^0.3.5", + "@xchainjs/xchain-evm": "^0.3.6", "@xchainjs/xchain-util": "^0.13.1", "@xchainjs/xchain-evm-providers": "^0.1.2", "axios": "^1.3.6", "ethers": "^5.7.2" } -} +} \ No newline at end of file diff --git a/packages/xchain-evm/CHANGELOG.md b/packages/xchain-evm/CHANGELOG.md index cc462c840..ef88f845f 100644 --- a/packages/xchain-evm/CHANGELOG.md +++ b/packages/xchain-evm/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.3.6 (2023-11-03) + +## Update + +- EIP1559 params + # v0.3.5 (2023-11-02) ## Update diff --git a/packages/xchain-evm/package.json b/packages/xchain-evm/package.json index 5fc3308a4..cb9fa9c6c 100644 --- a/packages/xchain-evm/package.json +++ b/packages/xchain-evm/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-evm", - "version": "0.3.5", + "version": "0.3.6", "description": "Genereic EVM client for XChainJS", "keywords": [ "XChain", From 7a82edc9cc9791395b8d1aaa2b6aa18ecbd352f4 Mon Sep 17 00:00:00 2001 From: 0xp3gasus <0xp3gasus@proton.me> Date: Fri, 3 Nov 2023 13:02:06 +0100 Subject: [PATCH 8/8] Typo --- packages/xchain-avax/__e2e__/avax-client.e2e.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/xchain-avax/__e2e__/avax-client.e2e.ts b/packages/xchain-avax/__e2e__/avax-client.e2e.ts index 33076ac58..293d4ed47 100644 --- a/packages/xchain-avax/__e2e__/avax-client.e2e.ts +++ b/packages/xchain-avax/__e2e__/avax-client.e2e.ts @@ -108,7 +108,7 @@ describe('xchain-evm (Avax) Integration Tests', () => { const txHash = await client.transfer({ amount, recipient, memo }) console.log(txHash) }) - it('should transfer 0.01 AVAX following EIP1559 because maxFeePerGas', async () => { + it('should transfer 0.01 AVAX following EIP1559 because of maxFeePerGas', async () => { const recipient = client.getAddress(1) const amount = assetToBase(assetAmount('0.01', 18)) const txHash = await client.transfer({ @@ -118,7 +118,7 @@ describe('xchain-evm (Avax) Integration Tests', () => { }) console.log(txHash) }) - it('should transfer 0.01 AVAX following EIP1559 because maxPriorityFeePerGas', async () => { + it('should transfer 0.01 AVAX following EIP1559 because of maxPriorityFeePerGas', async () => { const recipient = client.getAddress(1) const amount = assetToBase(assetAmount('0.01', 18)) const txHash = await client.transfer({