@dfns/lib-polkadot 0.4.3-alpha.1 → 0.4.3
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 +4 -4
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const assertSignResponseSuccessful = (response) => {
|
|
|
9
9
|
else if (response.status !== 'Signed') {
|
|
10
10
|
throw new sdk_1.DfnsError(-1, 'cannot complete signing synchronously because this wallet action requires policy approval', response);
|
|
11
11
|
}
|
|
12
|
-
else if (!response.signature || !
|
|
12
|
+
else if (!response.signature || !response.signature.encoded) {
|
|
13
13
|
throw new sdk_1.DfnsError(-1, 'signature missing', response);
|
|
14
14
|
}
|
|
15
15
|
};
|
|
@@ -42,15 +42,15 @@ class DfnsWallet {
|
|
|
42
42
|
if (this.address !== address) {
|
|
43
43
|
throw new sdk_1.DfnsError(-1, 'address does not match the wallet used to initialize DfnsWallet', {
|
|
44
44
|
expectedAddress: this.address,
|
|
45
|
-
givenAddress: address
|
|
45
|
+
givenAddress: address,
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
const response = await this.dfnsClient.wallets.generateSignature({
|
|
49
49
|
walletId: this.walletId,
|
|
50
|
-
body: { kind: 'Message', message: data
|
|
50
|
+
body: { kind: 'Message', message: data },
|
|
51
51
|
});
|
|
52
52
|
assertSignResponseSuccessful(response);
|
|
53
|
-
return
|
|
53
|
+
return response.signature.encoded;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
exports.DfnsWallet = DfnsWallet;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfns/lib-polkadot",
|
|
3
|
-
"version": "0.4.3
|
|
3
|
+
"version": "0.4.3",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@polkadot/api": "^10.0.0",
|
|
6
|
+
"@dfns/sdk": "0.4.3"
|
|
7
|
+
},
|
|
4
8
|
"dependencies": {
|
|
5
|
-
"@polkadot/
|
|
6
|
-
"@polkadot/types": "10.12.6",
|
|
9
|
+
"@polkadot/types": "10.13.1",
|
|
7
10
|
"@polkadot/util": "12.6.2",
|
|
8
11
|
"buffer": "6.0.3",
|
|
9
12
|
"cross-fetch": "3.1.6",
|
|
10
13
|
"uuid": "9.0.0"
|
|
11
14
|
},
|
|
12
|
-
"peerDependencies": {
|
|
13
|
-
"@dfns/sdk": "0.4.3-alpha.1"
|
|
14
|
-
},
|
|
15
15
|
"main": "./index.js",
|
|
16
16
|
"type": "commonjs"
|
|
17
17
|
}
|