@xchainjs/xchain-arbitrum
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -7,12 +7,4 @@ import { EVMClientParams } from '@xchainjs/xchain-evm'; | ||
export declare const ARB_GAS_ASSET_DECIMAL = 18; | ||
/** | ||
* Chain identifier for ARB. | ||
* | ||
*/ | ||
export declare const ARBChain: "ARB"; | ||
/** | ||
* Base "chain" asset of Arbitrum chain. | ||
* | ||
*/ | ||
export declare const AssetARB: Asset; | ||
export declare const defaultArbParams: EVMClientParams; |
@@ -6,2 +6,4 @@ import { Client as Client$1 } from '@xchainjs/xchain-evm'; | ||
// Import necessary modules and classes from external packages and files | ||
// Define constants related to Arbitrum | ||
const ARB_DECIMAL = 18; | ||
@@ -11,15 +13,8 @@ const LOWER_FEE_BOUND = 100000000; | ||
const ARB_GAS_ASSET_DECIMAL = 18; | ||
/** | ||
* Chain identifier for ARB. | ||
* | ||
*/ | ||
const ARBChain = 'ARB'; | ||
/** | ||
* Base "chain" asset of Arbitrum chain. | ||
* | ||
*/ | ||
const AssetARB = { chain: ARBChain, symbol: 'ARB', ticker: 'ETH', synth: false }; | ||
// =====Ethers providers===== | ||
// Define JSON-RPC providers for mainnet and testnet | ||
const ARBITRUM_MAINNET_ETHERS_PROVIDER = new ethers.providers.JsonRpcProvider('https://arb1.arbitrum.io/rpc'); | ||
const ARBITRUM_TESTNET_ETHERS_PROVIDER = new ethers.providers.JsonRpcProvider('https://goerli-rollup.arbitrum.io/rpc'); | ||
// Define ethers providers for different networks | ||
const ethersJSProviders = { | ||
@@ -30,5 +25,6 @@ [Network.Mainnet]: ARBITRUM_MAINNET_ETHERS_PROVIDER, | ||
}; | ||
// =====ONLINE providers===== | ||
// Define online providers (Etherscan) for mainnet and testnet | ||
const ARB_ONLINE_PROVIDER_MAINNET = new EtherscanProvider(ARBITRUM_MAINNET_ETHERS_PROVIDER, 'https://api.arbiscan.io', process.env.ARBISCAN_API_KEY || '', ARBChain, AssetARB, 18); | ||
const ARB_ONLINE_PROVIDER_TESTNET = new EtherscanProvider(ARBITRUM_TESTNET_ETHERS_PROVIDER, 'https://api-goerli.arbiscan.io', process.env.ARBISCAN_API_KEY || '', ARBChain, AssetARB, 18); | ||
// Define providers for different networks | ||
const arbProviders = { | ||
@@ -39,5 +35,6 @@ [Network.Mainnet]: ARB_ONLINE_PROVIDER_MAINNET, | ||
}; | ||
// =====Explorers===== | ||
// Define explorer providers for mainnet and testnet | ||
const ARB_MAINNET_EXPLORER = new ExplorerProvider('https://arbiscan.io/', 'https://arbiscan.io/address/%%ADDRESS%%', 'https://arbiscan.io/tx/%%TX_ID%%'); | ||
const ARB_TESTNET_EXPLORER = new ExplorerProvider('https://goerli.arbiscan.io', 'https://goerli.arbiscan.io/address/%%ADDRESS%%', 'https://goerli.arbiscan.io/tx/%%TX_ID%%'); | ||
// Define explorer providers for different networks | ||
const arbExplorerProviders = { | ||
@@ -48,3 +45,3 @@ [Network.Mainnet]: ARB_MAINNET_EXPLORER, | ||
}; | ||
// =====Explorers===== | ||
// Define root derivation paths for different networks | ||
const ethRootDerivationPaths = { | ||
@@ -55,2 +52,3 @@ [Network.Mainnet]: `m/44'/60'/0'/0/`, | ||
}; | ||
// Define default parameters for the Arbitrum client | ||
const defaults = { | ||
@@ -76,2 +74,3 @@ [Network.Mainnet]: { | ||
}; | ||
// Define the default parameters for the Arbitrum client | ||
const defaultArbParams = { | ||
@@ -93,4 +92,8 @@ chain: ARBChain, | ||
// Import the Client class from '@xchainjs/xchain-evm' module | ||
// Create a class called Client that extends the XchainEvmClient class | ||
class Client extends Client$1 { | ||
// Constructor function that takes an optional config parameter, defaulting to defaultArbParams | ||
constructor(config = defaultArbParams) { | ||
// Call the constructor of the parent class (XchainEvmClient) with the provided config | ||
super(config); | ||
@@ -97,0 +100,0 @@ } |
@@ -10,2 +10,4 @@ 'use strict'; | ||
// Import necessary modules and classes from external packages and files | ||
// Define constants related to Arbitrum | ||
const ARB_DECIMAL = 18; | ||
@@ -15,15 +17,8 @@ const LOWER_FEE_BOUND = 100000000; | ||
const ARB_GAS_ASSET_DECIMAL = 18; | ||
/** | ||
* Chain identifier for ARB. | ||
* | ||
*/ | ||
const ARBChain = 'ARB'; | ||
/** | ||
* Base "chain" asset of Arbitrum chain. | ||
* | ||
*/ | ||
const AssetARB = { chain: ARBChain, symbol: 'ARB', ticker: 'ETH', synth: false }; | ||
// =====Ethers providers===== | ||
// Define JSON-RPC providers for mainnet and testnet | ||
const ARBITRUM_MAINNET_ETHERS_PROVIDER = new ethers.ethers.providers.JsonRpcProvider('https://arb1.arbitrum.io/rpc'); | ||
const ARBITRUM_TESTNET_ETHERS_PROVIDER = new ethers.ethers.providers.JsonRpcProvider('https://goerli-rollup.arbitrum.io/rpc'); | ||
// Define ethers providers for different networks | ||
const ethersJSProviders = { | ||
@@ -34,5 +29,6 @@ [xchainClient.Network.Mainnet]: ARBITRUM_MAINNET_ETHERS_PROVIDER, | ||
}; | ||
// =====ONLINE providers===== | ||
// Define online providers (Etherscan) for mainnet and testnet | ||
const ARB_ONLINE_PROVIDER_MAINNET = new xchainEvmProviders.EtherscanProvider(ARBITRUM_MAINNET_ETHERS_PROVIDER, 'https://api.arbiscan.io', process.env.ARBISCAN_API_KEY || '', ARBChain, AssetARB, 18); | ||
const ARB_ONLINE_PROVIDER_TESTNET = new xchainEvmProviders.EtherscanProvider(ARBITRUM_TESTNET_ETHERS_PROVIDER, 'https://api-goerli.arbiscan.io', process.env.ARBISCAN_API_KEY || '', ARBChain, AssetARB, 18); | ||
// Define providers for different networks | ||
const arbProviders = { | ||
@@ -43,5 +39,6 @@ [xchainClient.Network.Mainnet]: ARB_ONLINE_PROVIDER_MAINNET, | ||
}; | ||
// =====Explorers===== | ||
// Define explorer providers for mainnet and testnet | ||
const ARB_MAINNET_EXPLORER = new xchainClient.ExplorerProvider('https://arbiscan.io/', 'https://arbiscan.io/address/%%ADDRESS%%', 'https://arbiscan.io/tx/%%TX_ID%%'); | ||
const ARB_TESTNET_EXPLORER = new xchainClient.ExplorerProvider('https://goerli.arbiscan.io', 'https://goerli.arbiscan.io/address/%%ADDRESS%%', 'https://goerli.arbiscan.io/tx/%%TX_ID%%'); | ||
// Define explorer providers for different networks | ||
const arbExplorerProviders = { | ||
@@ -52,3 +49,3 @@ [xchainClient.Network.Mainnet]: ARB_MAINNET_EXPLORER, | ||
}; | ||
// =====Explorers===== | ||
// Define root derivation paths for different networks | ||
const ethRootDerivationPaths = { | ||
@@ -59,2 +56,3 @@ [xchainClient.Network.Mainnet]: `m/44'/60'/0'/0/`, | ||
}; | ||
// Define default parameters for the Arbitrum client | ||
const defaults = { | ||
@@ -80,2 +78,3 @@ [xchainClient.Network.Mainnet]: { | ||
}; | ||
// Define the default parameters for the Arbitrum client | ||
const defaultArbParams = { | ||
@@ -97,4 +96,8 @@ chain: ARBChain, | ||
// Import the Client class from '@xchainjs/xchain-evm' module | ||
// Create a class called Client that extends the XchainEvmClient class | ||
class Client extends xchainEvm.Client { | ||
// Constructor function that takes an optional config parameter, defaulting to defaultArbParams | ||
constructor(config = defaultArbParams) { | ||
// Call the constructor of the parent class (XchainEvmClient) with the provided config | ||
super(config); | ||
@@ -101,0 +104,0 @@ } |
{ | ||
"name": "@xchainjs/xchain-arbitrum", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Arbitrum EVM client for XChainJS", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"scripts": { | ||
"clean": "rimraf lib/**", | ||
"clean": "rimraf --glob ./lib/**", | ||
"build": "yarn clean && rollup -c", | ||
@@ -39,7 +39,7 @@ "test": "jest --passWithNoTests", | ||
"devDependencies": { | ||
"@xchainjs/xchain-client": "^0.16.1", | ||
"@xchainjs/xchain-client": "^0.16.2", | ||
"@xchainjs/xchain-crypto": "^0.3.1", | ||
"@xchainjs/xchain-evm": "^0.4.4", | ||
"@xchainjs/xchain-util": "^0.13.1", | ||
"@xchainjs/xchain-evm-providers": "^0.1.6", | ||
"@xchainjs/xchain-evm": "^0.4.5", | ||
"@xchainjs/xchain-util": "^0.13.3", | ||
"@xchainjs/xchain-evm-providers": "^0.1.7", | ||
"axios": "^1.3.6", | ||
@@ -49,10 +49,10 @@ "ethers": "^5.7.2" | ||
"peerDependencies": { | ||
"@xchainjs/xchain-client": "^0.16.1", | ||
"@xchainjs/xchain-client": "^0.16.2", | ||
"@xchainjs/xchain-crypto": "^0.3.1", | ||
"@xchainjs/xchain-evm": "^0.4.4", | ||
"@xchainjs/xchain-util": "^0.13.1", | ||
"@xchainjs/xchain-evm-providers": "^0.1.6", | ||
"@xchainjs/xchain-evm": "^0.4.5", | ||
"@xchainjs/xchain-util": "^0.13.3", | ||
"@xchainjs/xchain-evm-providers": "^0.1.7", | ||
"axios": "^1.3.6", | ||
"ethers": "^5.7.2" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30599
210