@onekeyfe/cardano-coin-selection-asmjs 1.1.5 → 1.1.6

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.
@@ -86,8 +86,14 @@ const getUtxos = async (address, utxos, amount) => {
86
86
  };
87
87
  const convertCborTxToEncodeTx = async (txHex, utxos, addresses, changeAddress) => {
88
88
  var _a, _b;
89
- const tx = CardanoWasm.Transaction.from_bytes(Buffer.from(txHex, 'hex'));
90
- const body = tx.body();
89
+ let body;
90
+ try {
91
+ const tx = CardanoWasm.Transaction.from_bytes(Buffer.from(txHex, 'hex'));
92
+ body = tx.body();
93
+ }
94
+ catch (_c) {
95
+ body = CardanoWasm.TransactionBody.from_bytes(Buffer.from(txHex, 'hex'));
96
+ }
91
97
  // Fee
92
98
  const fee = body.fee().to_str();
93
99
  const totalFeeInNative = new bignumber_js_1.default(fee).shiftedBy(-1 * 6).toFixed();
@@ -56,8 +56,14 @@ const getUtxos = async (address, utxos, amount) => {
56
56
  };
57
57
  const convertCborTxToEncodeTx = async (txHex, utxos, addresses, changeAddress) => {
58
58
  var _a, _b;
59
- const tx = CardanoWasm.Transaction.from_bytes(Buffer.from(txHex, 'hex'));
60
- const body = tx.body();
59
+ let body;
60
+ try {
61
+ const tx = CardanoWasm.Transaction.from_bytes(Buffer.from(txHex, 'hex'));
62
+ body = tx.body();
63
+ }
64
+ catch (_c) {
65
+ body = CardanoWasm.TransactionBody.from_bytes(Buffer.from(txHex, 'hex'));
66
+ }
61
67
  // Fee
62
68
  const fee = body.fee().to_str();
63
69
  const totalFeeInNative = new BigNumber(fee).shiftedBy(-1 * 6).toFixed();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/cardano-coin-selection-asmjs",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "coin selection"