postchain-client 1.14.0 → 1.15.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.
- package/README.md +3 -2
- package/built/cjs/index.js +8 -3
- package/built/cjs/index.js.map +1 -1
- package/built/esm/index.js +8 -4
- package/built/esm/index.js.map +1 -1
- package/built/index.d.ts +2 -2
- package/built/index.js +1 -1
- package/built/index.js.map +1 -1
- package/built/src/blockchainClient/types.d.ts +2 -1
- package/built/src/gtx/gtx.js +7 -3
- package/built/src/gtx/gtx.js.map +1 -1
- package/built/src/gtx/interfaces.d.ts +4 -4
- package/built/umd/index.js +8 -3
- package/built/umd/index.js.map +1 -1
- package/changelog.md +8 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -317,8 +317,9 @@ chromiaClient
|
|
|
317
317
|
This example demonstrates that you can use external signing mechanisms. It could involve a complex function requiring you to sign from your phone, another device, or a different method.
|
|
318
318
|
|
|
319
319
|
```typescript
|
|
320
|
-
function askUserBToSign(
|
|
321
|
-
|
|
320
|
+
function askUserBToSign(rawGtxBody) {
|
|
321
|
+
const digest = getDigestToSignFromRawGtxBody(rawGtxBody);
|
|
322
|
+
return Buffer.from(secp256k1.ecdsaSign(digest, signerPrivKeyB).signature);
|
|
322
323
|
}
|
|
323
324
|
```
|
|
324
325
|
|
package/built/cjs/index.js
CHANGED
|
@@ -1764,8 +1764,9 @@ function sign(gtx, privOrSigProv, pubKey) {
|
|
|
1764
1764
|
return addSignature(pubKey || makeKeyPair(privOrSigProv).pubKey, signature, gtx);
|
|
1765
1765
|
}
|
|
1766
1766
|
else {
|
|
1767
|
-
|
|
1768
|
-
const
|
|
1767
|
+
// Removes signatures and extract the rawgtxBody
|
|
1768
|
+
const rawGtxBody = gtxToRawGtxBody(gtx);
|
|
1769
|
+
const signature = yield privOrSigProv.sign(rawGtxBody);
|
|
1769
1770
|
return addSignature(privOrSigProv.pubKey, signature, gtx);
|
|
1770
1771
|
}
|
|
1771
1772
|
});
|
|
@@ -1848,7 +1849,10 @@ function newSignatureProvider(keyPair) {
|
|
|
1848
1849
|
}
|
|
1849
1850
|
return {
|
|
1850
1851
|
pubKey: pub,
|
|
1851
|
-
sign: (
|
|
1852
|
+
sign: (gtx) => __awaiter$c(this, void 0, void 0, function* () {
|
|
1853
|
+
const signature = getDigestToSignFromRawGtxBody(gtx);
|
|
1854
|
+
return signDigest(signature, priv);
|
|
1855
|
+
}),
|
|
1852
1856
|
};
|
|
1853
1857
|
}
|
|
1854
1858
|
function rawGtvToGtx(gtv) {
|
|
@@ -4164,6 +4168,7 @@ exports.encryption = encryption$1;
|
|
|
4164
4168
|
exports.formatter = formatter;
|
|
4165
4169
|
exports.getAnchoringClient = getAnchoringClient;
|
|
4166
4170
|
exports.getBlockAnchoringTransaction = getBlockAnchoringTransaction;
|
|
4171
|
+
exports.getDigestToSignFromRawGtxBody = getDigestToSignFromRawGtxBody;
|
|
4167
4172
|
exports.getTransactionRidException = getTransactionRidException;
|
|
4168
4173
|
exports.gtv = index;
|
|
4169
4174
|
exports.gtx = gtx;
|