@xchainjs/xchain-avax 2.0.2 → 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 +1 -1
- package/lib/index.esm.js +20 -16
- package/lib/index.js +19 -15
- package/package.json +8 -7
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 =
|
|
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 {
|
|
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 =
|
|
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
|
|
19
|
-
|
|
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
|
|
66
|
-
transferGasAssetGasLimit: BigNumber
|
|
67
|
-
transferTokenGasLimit: BigNumber
|
|
68
|
-
gasPrice: BigNumber
|
|
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
|
|
72
|
-
transferGasAssetGasLimit: BigNumber
|
|
73
|
-
transferTokenGasLimit: BigNumber
|
|
74
|
-
gasPrice: BigNumber
|
|
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
|
|
78
|
-
transferGasAssetGasLimit: BigNumber
|
|
79
|
-
transferTokenGasLimit: BigNumber
|
|
80
|
-
gasPrice: BigNumber
|
|
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 =
|
|
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.
|
|
23
|
-
|
|
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:
|
|
70
|
-
transferGasAssetGasLimit:
|
|
71
|
-
transferTokenGasLimit:
|
|
72
|
-
gasPrice:
|
|
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:
|
|
76
|
-
transferGasAssetGasLimit:
|
|
77
|
-
transferTokenGasLimit:
|
|
78
|
-
gasPrice:
|
|
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:
|
|
82
|
-
transferGasAssetGasLimit:
|
|
83
|
-
transferTokenGasLimit:
|
|
84
|
-
gasPrice:
|
|
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.
|
|
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.
|
|
40
|
-
"@xchainjs/xchain-client": "2.0.
|
|
41
|
-
"@xchainjs/xchain-evm": "2.0.
|
|
42
|
-
"@xchainjs/xchain-evm-providers": "2.0.
|
|
43
|
-
"@xchainjs/xchain-util": "2.0.
|
|
44
|
-
"
|
|
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"
|