@ledgerhq/coin-hedera 1.6.7-nightly.1 → 1.6.7
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/.turbo/turbo-build.log +1 -1
- package/.unimportedrc.json +0 -1
- package/CHANGELOG.md +20 -6
- package/lib/api/mirror.d.ts +3 -16
- package/lib/api/mirror.d.ts.map +1 -1
- package/lib/api/mirror.js +10 -29
- package/lib/api/mirror.js.map +1 -1
- package/lib/bridge/broadcast.d.ts.map +1 -1
- package/lib/bridge/broadcast.js +1 -7
- package/lib/bridge/broadcast.js.map +1 -1
- package/lib/bridge/synchronisation.js +3 -3
- package/lib/bridge/synchronisation.js.map +1 -1
- package/lib/bridge/utils.d.ts +2 -3
- package/lib/bridge/utils.d.ts.map +1 -1
- package/lib/bridge/utils.js +1 -10
- package/lib/bridge/utils.js.map +1 -1
- package/lib/types/bridge.d.ts +3 -1
- package/lib/types/bridge.d.ts.map +1 -1
- package/lib-es/api/mirror.d.ts +3 -16
- package/lib-es/api/mirror.d.ts.map +1 -1
- package/lib-es/api/mirror.js +9 -27
- package/lib-es/api/mirror.js.map +1 -1
- package/lib-es/bridge/broadcast.d.ts.map +1 -1
- package/lib-es/bridge/broadcast.js +2 -8
- package/lib-es/bridge/broadcast.js.map +1 -1
- package/lib-es/bridge/synchronisation.js +3 -3
- package/lib-es/bridge/synchronisation.js.map +1 -1
- package/lib-es/bridge/utils.d.ts +2 -3
- package/lib-es/bridge/utils.d.ts.map +1 -1
- package/lib-es/bridge/utils.js +0 -8
- package/lib-es/bridge/utils.js.map +1 -1
- package/lib-es/types/bridge.d.ts +3 -1
- package/lib-es/types/bridge.d.ts.map +1 -1
- package/package.json +10 -11
- package/src/api/mirror.ts +19 -43
- package/src/bridge/broadcast.ts +4 -11
- package/src/bridge/synchronisation.ts +3 -3
- package/src/bridge/utils.ts +2 -14
- package/src/types/bridge.ts +4 -1
- package/lib/api/mirror.test.d.ts +0 -2
- package/lib/api/mirror.test.d.ts.map +0 -1
- package/lib/api/mirror.test.js +0 -60
- package/lib/api/mirror.test.js.map +0 -1
- package/lib/logic.d.ts +0 -5
- package/lib/logic.d.ts.map +0 -1
- package/lib/logic.js +0 -9
- package/lib/logic.js.map +0 -1
- package/lib/logic.test.d.ts +0 -2
- package/lib/logic.test.d.ts.map +0 -1
- package/lib/logic.test.js +0 -54
- package/lib/logic.test.js.map +0 -1
- package/lib-es/api/mirror.test.d.ts +0 -2
- package/lib-es/api/mirror.test.d.ts.map +0 -1
- package/lib-es/api/mirror.test.js +0 -55
- package/lib-es/api/mirror.test.js.map +0 -1
- package/lib-es/logic.d.ts +0 -5
- package/lib-es/logic.d.ts.map +0 -1
- package/lib-es/logic.js +0 -6
- package/lib-es/logic.js.map +0 -1
- package/lib-es/logic.test.d.ts +0 -2
- package/lib-es/logic.test.d.ts.map +0 -1
- package/lib-es/logic.test.js +0 -52
- package/lib-es/logic.test.js.map +0 -1
- package/src/api/mirror.test.ts +0 -76
- package/src/logic.test.ts +0 -58
- package/src/logic.ts +0 -15
package/src/logic.test.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { BigNumber } from "bignumber.js";
|
|
2
|
-
import { Operation } from "@ledgerhq/types-live";
|
|
3
|
-
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets";
|
|
4
|
-
import { getTransactionExplorer } from "./logic";
|
|
5
|
-
|
|
6
|
-
describe("getTransactionExplorer", () => {
|
|
7
|
-
test("Tx explorer URL is converted from hash to consensus timestamp", async () => {
|
|
8
|
-
const explorerView = getCryptoCurrencyById("hedera").explorerViews[0];
|
|
9
|
-
expect(explorerView).toBeDefined();
|
|
10
|
-
expect(explorerView.tx).toBeDefined();
|
|
11
|
-
|
|
12
|
-
const mockOperation: Operation = {
|
|
13
|
-
extra: {
|
|
14
|
-
consensusTimestamp: "1.2.3.4",
|
|
15
|
-
},
|
|
16
|
-
id: "",
|
|
17
|
-
hash: "",
|
|
18
|
-
type: "IN",
|
|
19
|
-
value: new BigNumber(0),
|
|
20
|
-
fee: new BigNumber(0),
|
|
21
|
-
senders: [],
|
|
22
|
-
recipients: [],
|
|
23
|
-
blockHeight: undefined,
|
|
24
|
-
blockHash: undefined,
|
|
25
|
-
accountId: "",
|
|
26
|
-
date: new Date(),
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const newUrl = getTransactionExplorer(explorerView, mockOperation);
|
|
30
|
-
expect(newUrl).toBe("https://hashscan.io/mainnet/transaction/1.2.3.4");
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test("Tx explorer URL is based on transaction id if consensus timestamp is not available", async () => {
|
|
34
|
-
const explorerView = getCryptoCurrencyById("hedera").explorerViews[0];
|
|
35
|
-
expect(explorerView).toBeDefined();
|
|
36
|
-
expect(explorerView.tx).toBeDefined();
|
|
37
|
-
|
|
38
|
-
const mockOperation: Operation = {
|
|
39
|
-
extra: {
|
|
40
|
-
transactionId: "0.0.1234567-123-123",
|
|
41
|
-
},
|
|
42
|
-
id: "",
|
|
43
|
-
hash: "",
|
|
44
|
-
type: "IN",
|
|
45
|
-
value: new BigNumber(0),
|
|
46
|
-
fee: new BigNumber(0),
|
|
47
|
-
senders: [],
|
|
48
|
-
recipients: [],
|
|
49
|
-
blockHeight: undefined,
|
|
50
|
-
blockHash: undefined,
|
|
51
|
-
accountId: "",
|
|
52
|
-
date: new Date(),
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const newUrl = getTransactionExplorer(explorerView, mockOperation);
|
|
56
|
-
expect(newUrl).toBe("https://hashscan.io/mainnet/transaction/0.0.1234567-123-123");
|
|
57
|
-
});
|
|
58
|
-
});
|
package/src/logic.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ExplorerView } from "@ledgerhq/types-cryptoassets";
|
|
2
|
-
import { Operation } from "@ledgerhq/types-live";
|
|
3
|
-
|
|
4
|
-
import { HederaOperationExtra } from "./types";
|
|
5
|
-
|
|
6
|
-
const getTransactionExplorer = (
|
|
7
|
-
explorerView: ExplorerView | null | undefined,
|
|
8
|
-
operation: Operation,
|
|
9
|
-
): string | undefined => {
|
|
10
|
-
const extra = operation.extra as HederaOperationExtra;
|
|
11
|
-
|
|
12
|
-
return explorerView?.tx?.replace("$hash", extra.consensusTimestamp ?? extra.transactionId ?? "0");
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { getTransactionExplorer };
|