capitalisk-dex 18.1.0 → 18.1.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 +43 -12
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1266,7 +1266,17 @@ module.exports = class CapitaliskDEXModule {
|
|
|
1266
1266
|
|
|
1267
1267
|
await Promise.all(
|
|
1268
1268
|
this.chainSymbols.map(async (chainSymbol) => {
|
|
1269
|
-
|
|
1269
|
+
try {
|
|
1270
|
+
await this.chainCrypto[chainSymbol].load(channel, this.processedHeights[chainSymbol]);
|
|
1271
|
+
} catch (error) {
|
|
1272
|
+
throw new Error(
|
|
1273
|
+
`Failed to load ChainCrypto plugin for the ${
|
|
1274
|
+
chainSymbol
|
|
1275
|
+
} blockchain because of error: ${
|
|
1276
|
+
error.stack
|
|
1277
|
+
}`
|
|
1278
|
+
);
|
|
1279
|
+
}
|
|
1270
1280
|
})
|
|
1271
1281
|
);
|
|
1272
1282
|
|
|
@@ -2227,7 +2237,17 @@ module.exports = class CapitaliskDEXModule {
|
|
|
2227
2237
|
this.chainSymbols.map(async (chainSymbol) => {
|
|
2228
2238
|
let chainCrypto = this.chainCrypto[chainSymbol];
|
|
2229
2239
|
if (chainCrypto.reset) {
|
|
2230
|
-
|
|
2240
|
+
try {
|
|
2241
|
+
await chainCrypto.reset(this.processedHeights[chainSymbol]);
|
|
2242
|
+
} catch (error) {
|
|
2243
|
+
throw new Error(
|
|
2244
|
+
`Failed to reset ChainCrypto plugin for the ${
|
|
2245
|
+
chainSymbol
|
|
2246
|
+
} blockchain because of error: ${
|
|
2247
|
+
error.stack
|
|
2248
|
+
}`
|
|
2249
|
+
);
|
|
2250
|
+
}
|
|
2231
2251
|
}
|
|
2232
2252
|
})
|
|
2233
2253
|
);
|
|
@@ -2757,16 +2777,27 @@ module.exports = class CapitaliskDEXModule {
|
|
|
2757
2777
|
async execMultisigTransaction(targetChain, transactionData, message, extraTransferData) {
|
|
2758
2778
|
let chainTimestamp = this._denormalizeTimestamp(targetChain, transactionData.timestamp);
|
|
2759
2779
|
let chainCrypto = this.chainCrypto[targetChain];
|
|
2760
|
-
let
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2780
|
+
let prepareTxnResult;
|
|
2781
|
+
|
|
2782
|
+
try {
|
|
2783
|
+
prepareTxnResult = await chainCrypto.prepareTransaction({
|
|
2784
|
+
recipientAddress: transactionData.recipientAddress,
|
|
2785
|
+
amount: transactionData.amount,
|
|
2786
|
+
fee: transactionData.fee,
|
|
2787
|
+
timestamp: chainTimestamp,
|
|
2788
|
+
message
|
|
2789
|
+
});
|
|
2790
|
+
} catch (error) {
|
|
2791
|
+
throw new Error(
|
|
2792
|
+
`ChainCrypto plugin for the ${
|
|
2793
|
+
targetChain
|
|
2794
|
+
} blockchain failed to execute prepareTransaction because of error: ${
|
|
2795
|
+
error.stack
|
|
2796
|
+
}`
|
|
2797
|
+
);
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2800
|
+
let { transaction: preparedTxn, signature: multisigSignaturePacket } = prepareTxnResult;
|
|
2770
2801
|
|
|
2771
2802
|
let processedSignerAddressSet = new Set([multisigSignaturePacket.signerAddress]);
|
|
2772
2803
|
preparedTxn.signatures.push(multisigSignaturePacket);
|