postchain-client 1.14.0 → 1.15.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/README.md +3 -2
- package/built/cjs/index.js +12 -6
- package/built/cjs/index.js.map +1 -1
- package/built/esm/index.js +2252 -2608
- package/built/esm/index.js.map +1 -1
- package/built/esm/package.json +1 -0
- package/built/index.d.ts +3 -2
- package/built/index.js +2 -1
- package/built/index.js.map +1 -1
- package/built/src/blockchainClient/types.d.ts +2 -1
- package/built/src/blockchainClient/utils.d.ts +0 -1
- package/built/src/blockchainClient/utils.js +0 -10
- package/built/src/blockchainClient/utils.js.map +1 -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/src/logger.js +3 -1
- package/built/src/logger.js.map +1 -1
- package/built/src/promiEvent/promiEventEmitter.d.ts +1 -1
- package/built/umd/index.js +1997 -2029
- package/built/umd/index.js.map +1 -1
- package/changelog.md +16 -1
- package/package.json +3 -4
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) {
|
|
@@ -1962,7 +1966,9 @@ const logLevelMap = {
|
|
|
1962
1966
|
[LogLevel.Disabled]: -1,
|
|
1963
1967
|
};
|
|
1964
1968
|
const DEFAULT_LOG_LEVEL = logLevelMap[LogLevel.Warning];
|
|
1965
|
-
let logLevel =
|
|
1969
|
+
let logLevel = typeof process === "undefined"
|
|
1970
|
+
? DEFAULT_LOG_LEVEL
|
|
1971
|
+
: (_a$1 = logLevelMap[process.env.LOG_LEVEL]) !== null && _a$1 !== void 0 ? _a$1 : DEFAULT_LOG_LEVEL;
|
|
1966
1972
|
function setLogLevel(level) {
|
|
1967
1973
|
if (typeof level === "number") {
|
|
1968
1974
|
console.warn("Passing a number is deprecated, please use LogLevel enum instead");
|
|
@@ -3077,8 +3083,6 @@ var __awaiter$6 = (undefined && undefined.__awaiter) || function (thisArg, _argu
|
|
|
3077
3083
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
3078
3084
|
});
|
|
3079
3085
|
};
|
|
3080
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
3081
|
-
require("web3-core-promievent");
|
|
3082
3086
|
function getClientConfigFromSettings(settings) {
|
|
3083
3087
|
var _a, _b, _c, _d;
|
|
3084
3088
|
return __awaiter$6(this, void 0, void 0, function* () {
|
|
@@ -4156,6 +4160,7 @@ exports.TxRejectedError = TxRejectedError;
|
|
|
4156
4160
|
exports.UnexpectedArgumentTypeError = UnexpectedArgumentTypeError;
|
|
4157
4161
|
exports.UnexpectedResponseError = UnexpectedResponseError;
|
|
4158
4162
|
exports.UnexpectedStatusError = UnexpectedStatusError;
|
|
4163
|
+
exports.Web3PromiEvent = Web3PromiEvent;
|
|
4159
4164
|
exports.chromiaClient = chromiaClientProvider$1;
|
|
4160
4165
|
exports.createClient = createClient;
|
|
4161
4166
|
exports.createIccfProofTx = createIccfProofTx;
|
|
@@ -4164,6 +4169,7 @@ exports.encryption = encryption$1;
|
|
|
4164
4169
|
exports.formatter = formatter;
|
|
4165
4170
|
exports.getAnchoringClient = getAnchoringClient;
|
|
4166
4171
|
exports.getBlockAnchoringTransaction = getBlockAnchoringTransaction;
|
|
4172
|
+
exports.getDigestToSignFromRawGtxBody = getDigestToSignFromRawGtxBody;
|
|
4167
4173
|
exports.getTransactionRidException = getTransactionRidException;
|
|
4168
4174
|
exports.gtv = index;
|
|
4169
4175
|
exports.gtx = gtx;
|