@onekeyfe/cardano-coin-selection-asmjs 1.1.4 → 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();
@@ -1 +1 @@
1
- export declare const hasSetTagWithBody: (txBodyHex: string) => boolean;
1
+ export declare const hasSetTagWithBody: (txBodyHex: string) => Promise<boolean>;
@@ -39,6 +39,6 @@ const hasSetTagWithBody = (txBodyHex) => {
39
39
  catch (error) {
40
40
  // ignore
41
41
  }
42
- return tagCborSets;
42
+ return Promise.resolve(tagCborSets);
43
43
  };
44
44
  exports.hasSetTagWithBody = hasSetTagWithBody;
@@ -45,6 +45,6 @@ declare const onekeyUtils: {
45
45
  referenceInputs: null;
46
46
  tagCborSets: boolean;
47
47
  }>;
48
- hasSetTagWithBody: (txBodyHex: string) => boolean;
48
+ hasSetTagWithBody: (txBodyHex: string) => Promise<boolean>;
49
49
  };
50
50
  export { onekeyUtils, dAppUtils };
@@ -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();
@@ -1 +1 @@
1
- export declare const hasSetTagWithBody: (txBodyHex: string) => boolean;
1
+ export declare const hasSetTagWithBody: (txBodyHex: string) => Promise<boolean>;
@@ -13,5 +13,5 @@ export const hasSetTagWithBody = (txBodyHex) => {
13
13
  catch (error) {
14
14
  // ignore
15
15
  }
16
- return tagCborSets;
16
+ return Promise.resolve(tagCborSets);
17
17
  };
@@ -45,6 +45,6 @@ declare const onekeyUtils: {
45
45
  referenceInputs: null;
46
46
  tagCborSets: boolean;
47
47
  }>;
48
- hasSetTagWithBody: (txBodyHex: string) => boolean;
48
+ hasSetTagWithBody: (txBodyHex: string) => Promise<boolean>;
49
49
  };
50
50
  export { onekeyUtils, dAppUtils };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/cardano-coin-selection-asmjs",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "coin selection"