@dfns/lib-tron 0.1.1 → 0.1.2-rc.2
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 +3 -3
package/index.js
CHANGED
|
@@ -30,20 +30,18 @@ const TronWeb = require('tronweb');
|
|
|
30
30
|
const sleep = (interval = 0) => new Promise((resolve) => setTimeout(resolve, interval));
|
|
31
31
|
class DfnsWallet {
|
|
32
32
|
constructor(options, tronAddress) {
|
|
33
|
-
var _a, _b;
|
|
34
33
|
this.options = {
|
|
35
34
|
...options,
|
|
36
|
-
maxRetries:
|
|
37
|
-
retryInterval:
|
|
35
|
+
maxRetries: options.maxRetries ?? 3,
|
|
36
|
+
retryInterval: options.retryInterval ?? 1000,
|
|
38
37
|
};
|
|
39
38
|
this.tronAddress = tronAddress;
|
|
40
39
|
}
|
|
41
40
|
static async init(options) {
|
|
42
|
-
var _a, _b;
|
|
43
41
|
const { walletId, dfnsClient } = options;
|
|
44
42
|
const res = await dfnsClient.wallets.getWallet({ walletId });
|
|
45
43
|
if (!res.signingKey || res.signingKey.scheme !== Wallets_1.KeyScheme.ECDSA || res.signingKey.curve !== Wallets_1.KeyCurve.secp256k1) {
|
|
46
|
-
throw new Error(`wallet ${walletId} has incompatible scheme (${
|
|
44
|
+
throw new Error(`wallet ${walletId} has incompatible scheme (${res.signingKey?.scheme}) or curve (${res.signingKey?.curve})`);
|
|
47
45
|
}
|
|
48
46
|
// Decompressed the key to derive the address
|
|
49
47
|
const ec = new elliptic.ec('secp256k1');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfns/lib-tron",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2-rc.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@tronweb3/tronwallet-abstract-adapter": "^1.1.5",
|
|
6
6
|
"buffer": "6.0.3",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"uuid": "9.0.0"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@dfns/sdk": "0.1.
|
|
13
|
+
"@dfns/sdk": "0.1.2-rc.2"
|
|
14
14
|
},
|
|
15
15
|
"main": "./index.js",
|
|
16
|
-
"
|
|
16
|
+
"type": "commonjs"
|
|
17
17
|
}
|