@tetherto/wdk-wallet-evm 1.0.0-beta.22 → 1.0.0-beta.24
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tetherto/wdk-wallet-evm",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.24",
|
|
4
4
|
"description": "EVM wallet module for WDK (Wallet Development Kit) by Tether.",
|
|
5
5
|
"homepage": "https://docs.wdk.tether.io/sdk/wallet-modules/wallet-evm/",
|
|
6
6
|
"keywords": [
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@noble/hashes": "1.8.0",
|
|
34
34
|
"@noble/secp256k1": "2.2.3",
|
|
35
|
-
"@tetherto/wdk-wallet": "1.0.0-beta.21",
|
|
36
35
|
"@tetherto/wdk-failover-provider": "1.0.0-beta.2",
|
|
37
|
-
"
|
|
36
|
+
"@tetherto/wdk-wallet": "1.0.0-beta.21",
|
|
37
|
+
"bare-node-runtime": "^1.5.2",
|
|
38
38
|
"bip39": "3.1.0",
|
|
39
39
|
"ethers": "6.17.0",
|
|
40
40
|
"sodium-universal": "5.0.1"
|
|
@@ -91,7 +91,7 @@ import FailoverProvider from '@tetherto/wdk-failover-provider'
|
|
|
91
91
|
* @typedef {Object} EvmWalletConfig
|
|
92
92
|
* @property {string | Provider | Eip1193Provider | Array<string | Provider | Eip1193Provider>} [provider] - The url of the rpc provider, an already-built ethers provider (e.g. a `JsonRpcProvider` or a failover wrapper), or an instance of a class that implements eip-1193. It's also possible to provide an array of these instead. In such case, connection errors will cause the wallet to automatically fallback on the next provider in the list. An already-built provider is reused as-is, which lets a manager share a single provider across all the accounts it creates.
|
|
93
93
|
* @property {number} [retries] - If set and if 'provider' is a list of urls or EIP 1193 providers, the number of additional retry attempts after the initial call fails. Total attempts = `1 + retries`. For example, `retries: 3` with 4 providers will try each provider once before throwing. If `retries` exceeds the number of providers, the failover will loop back and retry already-failed providers in round-robin order. Default: 3.
|
|
94
|
-
* @property {number} [chainId] - The chain ID of the network. When provided, skips automatic chain ID detection from the provider.
|
|
94
|
+
* @property {number} [chainId] - The chain ID of the network. When provided, skips automatic chain ID detection from the provider, except for an already-built provider passed in `provider`, which is reused with its own network configuration.
|
|
95
95
|
* @property {number | bigint} [transferMaxFee] - The maximum fee amount for transfer operations.
|
|
96
96
|
* @property {number | bigint} [transactionMaxFee] - The maximum fee amount for sendTransaction and signTransaction operations.
|
|
97
97
|
*/
|
|
@@ -139,9 +139,10 @@ export default class WalletAccountReadOnlyEvm extends WalletAccountReadOnly {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
|
-
* Builds an ethers provider from the wallet configuration
|
|
142
|
+
* Builds an ethers provider from the wallet configuration. When `chainId` is set, the providers built here are
|
|
143
|
+
* pinned to that chain and never ask the rpc for it:
|
|
143
144
|
* - a url string -> a new `JsonRpcProvider`
|
|
144
|
-
* - an already-built ethers provider (or failover wrapper) -> reused as-is
|
|
145
|
+
* - an already-built ethers provider (or failover wrapper) -> reused as-is, with its own network configuration
|
|
145
146
|
* - anything else (EIP-1193 / browser wallet) -> wrapped in a `BrowserProvider`
|
|
146
147
|
* - an array of the above -> a `FailoverProvider` across each entry
|
|
147
148
|
*
|
|
@@ -160,7 +161,7 @@ export default class WalletAccountReadOnlyEvm extends WalletAccountReadOnly {
|
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
if (WalletAccountReadOnlyEvm._isEip1193Provider(entry)) {
|
|
163
|
-
return new BrowserProvider(entry)
|
|
164
|
+
return new BrowserProvider(entry, network, providerOpts)
|
|
164
165
|
}
|
|
165
166
|
|
|
166
167
|
return entry
|
|
@@ -16,9 +16,10 @@ export default class WalletAccountReadOnlyEvm extends WalletAccountReadOnly {
|
|
|
16
16
|
*/
|
|
17
17
|
protected static _isEip1193Provider(value: string | Eip1193Provider | Provider): boolean;
|
|
18
18
|
/**
|
|
19
|
-
* Builds an ethers provider from the wallet configuration
|
|
19
|
+
* Builds an ethers provider from the wallet configuration. When `chainId` is set, the providers built here are
|
|
20
|
+
* pinned to that chain and never ask the rpc for it:
|
|
20
21
|
* - a url string -> a new `JsonRpcProvider`
|
|
21
|
-
* - an already-built ethers provider (or failover wrapper) -> reused as-is
|
|
22
|
+
* - an already-built ethers provider (or failover wrapper) -> reused as-is, with its own network configuration
|
|
22
23
|
* - anything else (EIP-1193 / browser wallet) -> wrapped in a `BrowserProvider`
|
|
23
24
|
* - an array of the above -> a `FailoverProvider` across each entry
|
|
24
25
|
*
|
|
@@ -339,7 +340,7 @@ export type EvmWalletConfig = {
|
|
|
339
340
|
*/
|
|
340
341
|
retries?: number;
|
|
341
342
|
/**
|
|
342
|
-
* - The chain ID of the network. When provided, skips automatic chain ID detection from the provider.
|
|
343
|
+
* - The chain ID of the network. When provided, skips automatic chain ID detection from the provider, except for an already-built provider passed in `provider`, which is reused with its own network configuration.
|
|
343
344
|
*/
|
|
344
345
|
chainId?: number;
|
|
345
346
|
/**
|