@xchainjs/xchain-arbitrum 2.0.13 → 2.1.0

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.
@@ -0,0 +1,4 @@
1
+ import { ClientKeystore as EVMClientKeystore, EVMClientParams } from '@xchainjs/xchain-evm';
2
+ export declare class ClientKeystore extends EVMClientKeystore {
3
+ constructor(config?: Omit<EVMClientParams, 'signer'>);
4
+ }
@@ -0,0 +1,7 @@
1
+ import type Transport from '@ledgerhq/hw-transport';
2
+ import { ClientLedger as EVMClientLedger, EVMClientParams } from '@xchainjs/xchain-evm';
3
+ export declare class ClientLedger extends EVMClientLedger {
4
+ constructor(config: Omit<EVMClientParams, 'signer' | 'phrase'> & {
5
+ transport: Transport;
6
+ });
7
+ }
package/lib/index.d.ts CHANGED
@@ -1,2 +1,5 @@
1
- export * from './client';
1
+ import { ClientKeystore } from './ClientKeystore';
2
+ export { ClientKeystore, ClientKeystore as Client } from './ClientKeystore';
3
+ export { ClientLedger } from './ClientLedger';
2
4
  export * from './const';
5
+ export default ClientKeystore;
package/lib/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Network, ExplorerProvider } from '@xchainjs/xchain-client';
2
- import { Client as Client$1, KeystoreSigner } from '@xchainjs/xchain-evm';
2
+ import { ClientKeystore as ClientKeystore$1, KeystoreSigner, ClientLedger as ClientLedger$1, LedgerSigner } from '@xchainjs/xchain-evm';
3
3
  import { RoutescanProvider } from '@xchainjs/xchain-evm-providers';
4
4
  import { AssetType } from '@xchainjs/xchain-util';
5
5
  import { JsonRpcProvider } from 'ethers';
@@ -91,12 +91,8 @@ const defaultArbParams = {
91
91
  rootDerivationPaths: ethRootDerivationPaths,
92
92
  };
93
93
 
94
- // Import the Client class from '@xchainjs/xchain-evm' module
95
- // Create a class called Client that extends the XchainEvmClient class
96
- class Client extends Client$1 {
97
- // Constructor function that takes an optional config parameter, defaulting to defaultArbParams
94
+ class ClientKeystore extends ClientKeystore$1 {
98
95
  constructor(config = defaultArbParams) {
99
- // Call the constructor of the parent class (XchainEvmClient) with the provided config
100
96
  super(Object.assign(Object.assign({}, config), { signer: config.phrase
101
97
  ? new KeystoreSigner({
102
98
  phrase: config.phrase,
@@ -109,4 +105,14 @@ class Client extends Client$1 {
109
105
  }
110
106
  }
111
107
 
112
- export { ARBChain, ARB_DECIMAL, ARB_GAS_ASSET_DECIMAL, AssetAETH, AssetARB, Client, LOWER_FEE_BOUND, UPPER_FEE_BOUND, defaultArbParams };
108
+ class ClientLedger extends ClientLedger$1 {
109
+ constructor(config) {
110
+ super(Object.assign(Object.assign({}, config), { signer: new LedgerSigner({
111
+ transport: config.transport,
112
+ provider: config.providers[config.network || Network.Mainnet],
113
+ derivationPath: config.rootDerivationPaths ? config.rootDerivationPaths[config.network || Network.Mainnet] : '',
114
+ }) }));
115
+ }
116
+ }
117
+
118
+ export { ARBChain, ARB_DECIMAL, ARB_GAS_ASSET_DECIMAL, AssetAETH, AssetARB, ClientKeystore as Client, ClientKeystore, ClientLedger, LOWER_FEE_BOUND, UPPER_FEE_BOUND, ClientKeystore as default, defaultArbParams };
package/lib/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var xchainClient = require('@xchainjs/xchain-client');
4
6
  var xchainEvm = require('@xchainjs/xchain-evm');
5
7
  var xchainEvmProviders = require('@xchainjs/xchain-evm-providers');
@@ -97,12 +99,8 @@ const defaultArbParams = {
97
99
  rootDerivationPaths: ethRootDerivationPaths,
98
100
  };
99
101
 
100
- // Import the Client class from '@xchainjs/xchain-evm' module
101
- // Create a class called Client that extends the XchainEvmClient class
102
- class Client extends xchainEvm.Client {
103
- // Constructor function that takes an optional config parameter, defaulting to defaultArbParams
102
+ class ClientKeystore extends xchainEvm.ClientKeystore {
104
103
  constructor(config = defaultArbParams) {
105
- // Call the constructor of the parent class (XchainEvmClient) with the provided config
106
104
  super(Object.assign(Object.assign({}, config), { signer: config.phrase
107
105
  ? new xchainEvm.KeystoreSigner({
108
106
  phrase: config.phrase,
@@ -115,12 +113,25 @@ class Client extends xchainEvm.Client {
115
113
  }
116
114
  }
117
115
 
116
+ class ClientLedger extends xchainEvm.ClientLedger {
117
+ constructor(config) {
118
+ super(Object.assign(Object.assign({}, config), { signer: new xchainEvm.LedgerSigner({
119
+ transport: config.transport,
120
+ provider: config.providers[config.network || xchainClient.Network.Mainnet],
121
+ derivationPath: config.rootDerivationPaths ? config.rootDerivationPaths[config.network || xchainClient.Network.Mainnet] : '',
122
+ }) }));
123
+ }
124
+ }
125
+
118
126
  exports.ARBChain = ARBChain;
119
127
  exports.ARB_DECIMAL = ARB_DECIMAL;
120
128
  exports.ARB_GAS_ASSET_DECIMAL = ARB_GAS_ASSET_DECIMAL;
121
129
  exports.AssetAETH = AssetAETH;
122
130
  exports.AssetARB = AssetARB;
123
- exports.Client = Client;
131
+ exports.Client = ClientKeystore;
132
+ exports.ClientKeystore = ClientKeystore;
133
+ exports.ClientLedger = ClientLedger;
124
134
  exports.LOWER_FEE_BOUND = LOWER_FEE_BOUND;
125
135
  exports.UPPER_FEE_BOUND = UPPER_FEE_BOUND;
136
+ exports.default = ClientKeystore;
126
137
  exports.defaultArbParams = defaultArbParams;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-arbitrum",
3
- "version": "2.0.13",
3
+ "version": "2.1.0",
4
4
  "description": "Arbitrum EVM client for XChainJS",
5
5
  "keywords": [
6
6
  "XChain",
@@ -36,9 +36,10 @@
36
36
  "directory": "release/package"
37
37
  },
38
38
  "dependencies": {
39
- "@xchainjs/xchain-client": "2.0.9",
40
- "@xchainjs/xchain-evm": "2.0.13",
41
- "@xchainjs/xchain-evm-providers": "2.0.12",
39
+ "@ledgerhq/hw-transport": "^6.31.6",
40
+ "@xchainjs/xchain-client": "2.0.10",
41
+ "@xchainjs/xchain-evm": "2.0.14",
42
+ "@xchainjs/xchain-evm-providers": "2.0.13",
42
43
  "@xchainjs/xchain-util": "2.0.5",
43
44
  "bignumber.js": "^9.1.2",
44
45
  "ethers": "^6.14.3"
package/lib/client.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { Client as XchainEvmClient, EVMClientParams } from '@xchainjs/xchain-evm';
2
- export declare class Client extends XchainEvmClient {
3
- constructor(config?: Omit<EVMClientParams, 'signer'>);
4
- }