@xchainjs/xchain-avax 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/const.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { EVMClientParams } from '@xchainjs/xchain-evm';
2
2
  import { Asset } from '@xchainjs/xchain-util';
3
3
  export declare const AVAX_DECIMAL = 18;
4
- export declare const LOWER_FEE_BOUND = 2000000000;
4
+ export declare const LOWER_FEE_BOUND = 1000000000;
5
5
  export declare const UPPER_FEE_BOUND = 1000000000000;
6
6
  export declare const AVAX_GAS_ASSET_DECIMAL = 18;
7
7
  export declare const AVAXChain: "AVAX";
package/lib/index.esm.js CHANGED
@@ -2,12 +2,13 @@ import { Network, ExplorerProvider } from '@xchainjs/xchain-client';
2
2
  import { ClientKeystore as ClientKeystore$1, KeystoreSigner, ClientLedger as ClientLedger$1, LedgerSigner } from '@xchainjs/xchain-evm';
3
3
  import { EtherscanProviderV2, RoutescanProvider } from '@xchainjs/xchain-evm-providers';
4
4
  import { AssetType } from '@xchainjs/xchain-util';
5
- import { ethers, BigNumber } from 'ethers';
5
+ import { JsonRpcProvider } from 'ethers';
6
+ import { BigNumber } from 'bignumber.js';
6
7
 
7
8
  // Import necessary modules and classes from external packages and files
8
9
  // Define constants related to Avalanche
9
10
  const AVAX_DECIMAL = 18;
10
- const LOWER_FEE_BOUND = 2000000000;
11
+ const LOWER_FEE_BOUND = 1000000000;
11
12
  const UPPER_FEE_BOUND = 1000000000000;
12
13
  const AVAX_GAS_ASSET_DECIMAL = 18;
13
14
  const AVAXChain = 'AVAX';
@@ -15,8 +16,11 @@ const AssetAVAX = { chain: AVAXChain, symbol: 'AVAX', ticker: 'AVAX', type: Asse
15
16
  // Ankr api key
16
17
  const ankrApiKey = process.env.ANKR_API_KEY;
17
18
  // Define JSON-RPC providers for mainnet and testnet
18
- const AVALANCHE_MAINNET_ETHERS_PROVIDER = new ethers.providers.JsonRpcProvider(`https://rpc.ankr.com/avalanche/${ankrApiKey}`, { name: 'avalanche', chainId: 43114 });
19
- const AVALANCHE_TESTNET_ETHERS_PROVIDER = new ethers.providers.JsonRpcProvider(`https://rpc.ankr.com/avalanche_fuji/${ankrApiKey}`, {
19
+ const AVALANCHE_MAINNET_ETHERS_PROVIDER = new JsonRpcProvider(`https://rpc.ankr.com/avalanche/${ankrApiKey}`, {
20
+ name: 'avalanche',
21
+ chainId: 43114,
22
+ });
23
+ const AVALANCHE_TESTNET_ETHERS_PROVIDER = new JsonRpcProvider(`https://rpc.ankr.com/avalanche_fuji/${ankrApiKey}`, {
20
24
  name: 'fuji',
21
25
  chainId: 43113,
22
26
  });
@@ -62,22 +66,22 @@ const ethRootDerivationPaths = {
62
66
  // Define default parameters for the Avalanche client
63
67
  const defaults = {
64
68
  [Network.Mainnet]: {
65
- approveGasLimit: BigNumber.from(200000),
66
- transferGasAssetGasLimit: BigNumber.from(23000),
67
- transferTokenGasLimit: BigNumber.from(100000),
68
- gasPrice: BigNumber.from(30 * Math.pow(10, 9)),
69
+ approveGasLimit: new BigNumber(200000),
70
+ transferGasAssetGasLimit: new BigNumber(23000),
71
+ transferTokenGasLimit: new BigNumber(100000),
72
+ gasPrice: new BigNumber(30 * Math.pow(10, 9)),
69
73
  },
70
74
  [Network.Testnet]: {
71
- approveGasLimit: BigNumber.from(200000),
72
- transferGasAssetGasLimit: BigNumber.from(23000),
73
- transferTokenGasLimit: BigNumber.from(100000),
74
- gasPrice: BigNumber.from(30 * Math.pow(10, 9)),
75
+ approveGasLimit: new BigNumber(200000),
76
+ transferGasAssetGasLimit: new BigNumber(23000),
77
+ transferTokenGasLimit: new BigNumber(100000),
78
+ gasPrice: new BigNumber(30 * Math.pow(10, 9)),
75
79
  },
76
80
  [Network.Stagenet]: {
77
- approveGasLimit: BigNumber.from(200000),
78
- transferGasAssetGasLimit: BigNumber.from(23000),
79
- transferTokenGasLimit: BigNumber.from(100000),
80
- gasPrice: BigNumber.from(30 * Math.pow(10, 9)),
81
+ approveGasLimit: new BigNumber(200000),
82
+ transferGasAssetGasLimit: new BigNumber(23000),
83
+ transferTokenGasLimit: new BigNumber(100000),
84
+ gasPrice: new BigNumber(30 * Math.pow(10, 9)),
81
85
  },
82
86
  };
83
87
  // Define the default parameters for the Avalanche client
package/lib/index.js CHANGED
@@ -7,11 +7,12 @@ var xchainEvm = require('@xchainjs/xchain-evm');
7
7
  var xchainEvmProviders = require('@xchainjs/xchain-evm-providers');
8
8
  var xchainUtil = require('@xchainjs/xchain-util');
9
9
  var ethers = require('ethers');
10
+ var bignumber_js = require('bignumber.js');
10
11
 
11
12
  // Import necessary modules and classes from external packages and files
12
13
  // Define constants related to Avalanche
13
14
  const AVAX_DECIMAL = 18;
14
- const LOWER_FEE_BOUND = 2000000000;
15
+ const LOWER_FEE_BOUND = 1000000000;
15
16
  const UPPER_FEE_BOUND = 1000000000000;
16
17
  const AVAX_GAS_ASSET_DECIMAL = 18;
17
18
  const AVAXChain = 'AVAX';
@@ -19,8 +20,11 @@ const AssetAVAX = { chain: AVAXChain, symbol: 'AVAX', ticker: 'AVAX', type: xcha
19
20
  // Ankr api key
20
21
  const ankrApiKey = process.env.ANKR_API_KEY;
21
22
  // Define JSON-RPC providers for mainnet and testnet
22
- const AVALANCHE_MAINNET_ETHERS_PROVIDER = new ethers.ethers.providers.JsonRpcProvider(`https://rpc.ankr.com/avalanche/${ankrApiKey}`, { name: 'avalanche', chainId: 43114 });
23
- const AVALANCHE_TESTNET_ETHERS_PROVIDER = new ethers.ethers.providers.JsonRpcProvider(`https://rpc.ankr.com/avalanche_fuji/${ankrApiKey}`, {
23
+ const AVALANCHE_MAINNET_ETHERS_PROVIDER = new ethers.JsonRpcProvider(`https://rpc.ankr.com/avalanche/${ankrApiKey}`, {
24
+ name: 'avalanche',
25
+ chainId: 43114,
26
+ });
27
+ const AVALANCHE_TESTNET_ETHERS_PROVIDER = new ethers.JsonRpcProvider(`https://rpc.ankr.com/avalanche_fuji/${ankrApiKey}`, {
24
28
  name: 'fuji',
25
29
  chainId: 43113,
26
30
  });
@@ -66,22 +70,22 @@ const ethRootDerivationPaths = {
66
70
  // Define default parameters for the Avalanche client
67
71
  const defaults = {
68
72
  [xchainClient.Network.Mainnet]: {
69
- approveGasLimit: ethers.BigNumber.from(200000),
70
- transferGasAssetGasLimit: ethers.BigNumber.from(23000),
71
- transferTokenGasLimit: ethers.BigNumber.from(100000),
72
- gasPrice: ethers.BigNumber.from(30 * Math.pow(10, 9)),
73
+ approveGasLimit: new bignumber_js.BigNumber(200000),
74
+ transferGasAssetGasLimit: new bignumber_js.BigNumber(23000),
75
+ transferTokenGasLimit: new bignumber_js.BigNumber(100000),
76
+ gasPrice: new bignumber_js.BigNumber(30 * Math.pow(10, 9)),
73
77
  },
74
78
  [xchainClient.Network.Testnet]: {
75
- approveGasLimit: ethers.BigNumber.from(200000),
76
- transferGasAssetGasLimit: ethers.BigNumber.from(23000),
77
- transferTokenGasLimit: ethers.BigNumber.from(100000),
78
- gasPrice: ethers.BigNumber.from(30 * Math.pow(10, 9)),
79
+ approveGasLimit: new bignumber_js.BigNumber(200000),
80
+ transferGasAssetGasLimit: new bignumber_js.BigNumber(23000),
81
+ transferTokenGasLimit: new bignumber_js.BigNumber(100000),
82
+ gasPrice: new bignumber_js.BigNumber(30 * Math.pow(10, 9)),
79
83
  },
80
84
  [xchainClient.Network.Stagenet]: {
81
- approveGasLimit: ethers.BigNumber.from(200000),
82
- transferGasAssetGasLimit: ethers.BigNumber.from(23000),
83
- transferTokenGasLimit: ethers.BigNumber.from(100000),
84
- gasPrice: ethers.BigNumber.from(30 * Math.pow(10, 9)),
85
+ approveGasLimit: new bignumber_js.BigNumber(200000),
86
+ transferGasAssetGasLimit: new bignumber_js.BigNumber(23000),
87
+ transferTokenGasLimit: new bignumber_js.BigNumber(100000),
88
+ gasPrice: new bignumber_js.BigNumber(30 * Math.pow(10, 9)),
85
89
  },
86
90
  };
87
91
  // Define the default parameters for the Avalanche client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-avax",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Avax EVM client for XChainJS",
5
5
  "keywords": [
6
6
  "XChain",
@@ -36,12 +36,13 @@
36
36
  "directory": "release/package"
37
37
  },
38
38
  "dependencies": {
39
- "@ledgerhq/hw-transport": "6.30.6",
40
- "@xchainjs/xchain-client": "2.0.0",
41
- "@xchainjs/xchain-evm": "2.0.1",
42
- "@xchainjs/xchain-evm-providers": "2.0.1",
43
- "@xchainjs/xchain-util": "2.0.0",
44
- "ethers": "5.7.2"
39
+ "@ledgerhq/hw-transport": "^6.31.6",
40
+ "@xchainjs/xchain-client": "2.0.2",
41
+ "@xchainjs/xchain-evm": "2.0.3",
42
+ "@xchainjs/xchain-evm-providers": "2.0.3",
43
+ "@xchainjs/xchain-util": "2.0.1",
44
+ "bignumber.js": "^9.0.0",
45
+ "ethers": "^6.14.3"
45
46
  },
46
47
  "devDependencies": {
47
48
  "@ledgerhq/hw-transport-node-hid": "6.28.6"