@dfns/lib-ethersjs5 0.1.1 → 0.1.2-rc.1
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/index.js +3 -5
- package/package.json +2 -18
package/index.js
CHANGED
|
@@ -12,12 +12,11 @@ const transactions_1 = require("@ethersproject/transactions");
|
|
|
12
12
|
const sleep = (interval = 0) => new Promise((resolve) => setTimeout(resolve, interval));
|
|
13
13
|
class DfnsWallet extends abstract_signer_1.Signer {
|
|
14
14
|
constructor(options, provider) {
|
|
15
|
-
var _a, _b;
|
|
16
15
|
super();
|
|
17
16
|
this.options = {
|
|
18
17
|
...options,
|
|
19
|
-
maxRetries:
|
|
20
|
-
retryInterval:
|
|
18
|
+
maxRetries: options.maxRetries ?? 3,
|
|
19
|
+
retryInterval: options.retryInterval ?? 1000,
|
|
21
20
|
};
|
|
22
21
|
(0, properties_1.defineReadOnly)(this, 'provider', provider || undefined);
|
|
23
22
|
}
|
|
@@ -25,12 +24,11 @@ class DfnsWallet extends abstract_signer_1.Signer {
|
|
|
25
24
|
return new DfnsWallet(this.options, provider);
|
|
26
25
|
}
|
|
27
26
|
async getAddress() {
|
|
28
|
-
var _a, _b;
|
|
29
27
|
if (!this.address) {
|
|
30
28
|
const { walletId, dfnsClient } = this.options;
|
|
31
29
|
const res = await dfnsClient.wallets.getWallet({ walletId });
|
|
32
30
|
if (!res.signingKey || res.signingKey.scheme !== Wallets_1.KeyScheme.ECDSA || res.signingKey.curve !== Wallets_1.KeyCurve.secp256k1) {
|
|
33
|
-
throw new Error(`wallet ${walletId} has incompatible scheme (${
|
|
31
|
+
throw new Error(`wallet ${walletId} has incompatible scheme (${res.signingKey?.scheme}) or curve (${res.signingKey?.curve})`);
|
|
34
32
|
}
|
|
35
33
|
if (res.address) {
|
|
36
34
|
this.address = (0, address_1.getAddress)(res.address);
|
package/package.json
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfns/lib-ethersjs5",
|
|
3
|
-
"version": "0.1.1",
|
|
4
|
-
"dependencies": {
|
|
5
|
-
"@ethersproject/abstract-provider": "5.7.0",
|
|
6
|
-
"@ethersproject/abstract-signer": "5.7.0",
|
|
7
|
-
"@ethersproject/address": "5.7.0",
|
|
8
|
-
"@ethersproject/bytes": "5.7.0",
|
|
9
|
-
"@ethersproject/hash": "5.7.0",
|
|
10
|
-
"@ethersproject/keccak256": "5.7.0",
|
|
11
|
-
"@ethersproject/properties": "5.7.0",
|
|
12
|
-
"@ethersproject/transactions": "5.7.0",
|
|
13
|
-
"buffer": "6.0.3",
|
|
14
|
-
"cross-fetch": "3.1.6",
|
|
15
|
-
"uuid": "9.0.0"
|
|
16
|
-
},
|
|
17
|
-
"peerDependencies": {
|
|
18
|
-
"@dfns/sdk": "0.1.1"
|
|
19
|
-
},
|
|
3
|
+
"version": "0.1.2-rc.1",
|
|
20
4
|
"main": "./index.js",
|
|
21
|
-
"
|
|
5
|
+
"type": "commonjs"
|
|
22
6
|
}
|