@ledgerhq/coin-ton 0.15.0-nightly.8 → 0.15.0
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/CHANGELOG.md +24 -86
- package/lib/__tests__/fixtures/api.fixtures.d.ts +4 -0
- package/lib/__tests__/fixtures/api.fixtures.d.ts.map +1 -0
- package/lib/__tests__/fixtures/api.fixtures.js +37 -0
- package/lib/__tests__/fixtures/api.fixtures.js.map +1 -0
- package/lib/__tests__/fixtures/common.fixtures.d.ts +32 -0
- package/lib/__tests__/fixtures/common.fixtures.d.ts.map +1 -0
- package/lib/__tests__/fixtures/common.fixtures.js +176 -0
- package/lib/__tests__/fixtures/common.fixtures.js.map +1 -0
- package/lib/__tests__/integration/bridge.integration.test.d.ts +14 -0
- package/lib/__tests__/integration/bridge.integration.test.d.ts.map +1 -0
- package/lib/__tests__/integration/bridge.integration.test.js +213 -0
- package/lib/__tests__/integration/bridge.integration.test.js.map +1 -0
- package/lib/__tests__/unit/api.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/api.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/api.unit.test.js +77 -0
- package/lib/__tests__/unit/api.unit.test.js.map +1 -0
- package/lib/__tests__/unit/broadcast.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/broadcast.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/broadcast.unit.test.js +37 -0
- package/lib/__tests__/unit/broadcast.unit.test.js.map +1 -0
- package/lib/__tests__/unit/createTransaction.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/createTransaction.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/createTransaction.unit.test.js +25 -0
- package/lib/__tests__/unit/createTransaction.unit.test.js.map +1 -0
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js +111 -0
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js.map +1 -0
- package/lib/__tests__/unit/estimateMaxSpendable.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/estimateMaxSpendable.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js +30 -0
- package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js.map +1 -0
- package/lib/__tests__/unit/getTransactionStatus.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/getTransactionStatus.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/getTransactionStatus.unit.test.js +120 -0
- package/lib/__tests__/unit/getTransactionStatus.unit.test.js.map +1 -0
- package/lib/__tests__/unit/hw-getAddress.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/hw-getAddress.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/hw-getAddress.unit.test.js +54 -0
- package/lib/__tests__/unit/hw-getAddress.unit.test.js.map +1 -0
- package/lib/__tests__/unit/logic.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/logic.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/logic.unit.test.js +18 -0
- package/lib/__tests__/unit/logic.unit.test.js.map +1 -0
- package/lib/__tests__/unit/prepareTransaction.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/prepareTransaction.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/prepareTransaction.unit.test.js +109 -0
- package/lib/__tests__/unit/prepareTransaction.unit.test.js.map +1 -0
- package/lib/__tests__/unit/signOperation.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/signOperation.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/signOperation.unit.test.js +72 -0
- package/lib/__tests__/unit/signOperation.unit.test.js.map +1 -0
- package/lib/__tests__/unit/txn.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/txn.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/txn.unit.test.js +298 -0
- package/lib/__tests__/unit/txn.unit.test.js.map +1 -0
- package/lib/__tests__/unit/utils.unit.test.d.ts +2 -0
- package/lib/__tests__/unit/utils.unit.test.d.ts.map +1 -0
- package/lib/__tests__/unit/utils.unit.test.js +211 -0
- package/lib/__tests__/unit/utils.unit.test.js.map +1 -0
- package/lib/transaction.d.ts.map +1 -1
- package/lib/transaction.js +0 -44
- package/lib/transaction.js.map +1 -1
- package/lib/transaction.unit.test.d.ts +2 -0
- package/lib/transaction.unit.test.d.ts.map +1 -0
- package/lib/transaction.unit.test.js +600 -0
- package/lib/transaction.unit.test.js.map +1 -0
- package/lib/types.d.ts +2 -40
- package/lib/types.d.ts.map +1 -1
- package/lib-es/__tests__/fixtures/api.fixtures.d.ts +4 -0
- package/lib-es/__tests__/fixtures/api.fixtures.d.ts.map +1 -0
- package/lib-es/__tests__/fixtures/api.fixtures.js +34 -0
- package/lib-es/__tests__/fixtures/api.fixtures.js.map +1 -0
- package/lib-es/__tests__/fixtures/common.fixtures.d.ts +32 -0
- package/lib-es/__tests__/fixtures/common.fixtures.d.ts.map +1 -0
- package/lib-es/__tests__/fixtures/common.fixtures.js +170 -0
- package/lib-es/__tests__/fixtures/common.fixtures.js.map +1 -0
- package/lib-es/__tests__/integration/bridge.integration.test.d.ts +14 -0
- package/lib-es/__tests__/integration/bridge.integration.test.d.ts.map +1 -0
- package/lib-es/__tests__/integration/bridge.integration.test.js +207 -0
- package/lib-es/__tests__/integration/bridge.integration.test.js.map +1 -0
- package/lib-es/__tests__/unit/api.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/api.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/api.unit.test.js +52 -0
- package/lib-es/__tests__/unit/api.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/broadcast.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/broadcast.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/broadcast.unit.test.js +32 -0
- package/lib-es/__tests__/unit/broadcast.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/createTransaction.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/createTransaction.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/createTransaction.unit.test.js +20 -0
- package/lib-es/__tests__/unit/createTransaction.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js +106 -0
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js +25 -0
- package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/getTransactionStatus.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/getTransactionStatus.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js +115 -0
- package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/hw-getAddress.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/hw-getAddress.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/hw-getAddress.unit.test.js +49 -0
- package/lib-es/__tests__/unit/hw-getAddress.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/logic.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/logic.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/logic.unit.test.js +16 -0
- package/lib-es/__tests__/unit/logic.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/prepareTransaction.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/prepareTransaction.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/prepareTransaction.unit.test.js +81 -0
- package/lib-es/__tests__/unit/prepareTransaction.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/signOperation.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/signOperation.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/signOperation.unit.test.js +67 -0
- package/lib-es/__tests__/unit/signOperation.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/txn.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/txn.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/txn.unit.test.js +293 -0
- package/lib-es/__tests__/unit/txn.unit.test.js.map +1 -0
- package/lib-es/__tests__/unit/utils.unit.test.d.ts +2 -0
- package/lib-es/__tests__/unit/utils.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/unit/utils.unit.test.js +186 -0
- package/lib-es/__tests__/unit/utils.unit.test.js.map +1 -0
- package/lib-es/transaction.d.ts.map +1 -1
- package/lib-es/transaction.js +0 -44
- package/lib-es/transaction.js.map +1 -1
- package/lib-es/transaction.unit.test.d.ts +2 -0
- package/lib-es/transaction.unit.test.d.ts.map +1 -0
- package/lib-es/transaction.unit.test.js +595 -0
- package/lib-es/transaction.unit.test.js.map +1 -0
- package/lib-es/types.d.ts +2 -40
- package/lib-es/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/transaction.ts +0 -44
- package/src/transaction.unit.test.ts +8 -71
- package/src/types.ts +2 -52
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @ledgerhq/coin-ton@0.15.0
|
|
2
|
+
> @ledgerhq/coin-ton@0.15.0 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-ton
|
|
3
3
|
> tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es
|
|
4
4
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,111 +1,49 @@
|
|
|
1
1
|
# @ledgerhq/coin-ton
|
|
2
2
|
|
|
3
|
-
## 0.15.0
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies [[`c96d73f`](https://github.com/LedgerHQ/ledger-live/commit/c96d73fed0a75a9c208f78d51c34b742703a7dda)]:
|
|
8
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.8
|
|
9
|
-
|
|
10
|
-
## 0.15.0-nightly.7
|
|
11
|
-
|
|
12
|
-
### Patch Changes
|
|
13
|
-
|
|
14
|
-
- Updated dependencies [[`b4ceaff`](https://github.com/LedgerHQ/ledger-live/commit/b4ceaff2ecf68d8a14e09801c76ab0b014c45286), [`f392f69`](https://github.com/LedgerHQ/ledger-live/commit/f392f6912f445cc2f7cf4dfcfd030fa3da76f736), [`cbc0648`](https://github.com/LedgerHQ/ledger-live/commit/cbc064885d8e0459e40d327a2e5389204b3ec705)]:
|
|
15
|
-
- @ledgerhq/cryptoassets@13.31.0-nightly.7
|
|
16
|
-
- @ledgerhq/types-live@6.87.0-nightly.5
|
|
17
|
-
- @ledgerhq/live-env@2.19.0-nightly.2
|
|
18
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.7
|
|
19
|
-
- @ledgerhq/live-network@2.0.20-nightly.3
|
|
20
|
-
|
|
21
|
-
## 0.15.0-nightly.6
|
|
3
|
+
## 0.15.0
|
|
22
4
|
|
|
23
5
|
### Minor Changes
|
|
24
6
|
|
|
25
|
-
- [#
|
|
26
|
-
|
|
27
|
-
Adds typed payload variants and serialization/deserialization for:
|
|
28
|
-
|
|
29
|
-
- tonwhales-pool-deposit
|
|
30
|
-
- tonwhales-pool-withdraw
|
|
31
|
-
- vesting-send-msg-comment
|
|
32
|
-
|
|
33
|
-
Updates unit tests to cover new payloads and retains an explicit unsupported payload test case (lint-suppressed locally). Also bumps TON-related and wallet-api dependencies and replaces the @ton/core patch file reference.
|
|
34
|
-
|
|
35
|
-
### Patch Changes
|
|
36
|
-
|
|
37
|
-
- Updated dependencies [[`51995e9`](https://github.com/LedgerHQ/ledger-live/commit/51995e96a9e1fafe14c7cbe45ce0b1ec8ebd106b)]:
|
|
38
|
-
- @ledgerhq/types-live@6.87.0-nightly.4
|
|
39
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.6
|
|
40
|
-
- @ledgerhq/cryptoassets@13.31.0-nightly.6
|
|
41
|
-
|
|
42
|
-
## 0.15.0-nightly.5
|
|
43
|
-
|
|
44
|
-
### Patch Changes
|
|
45
|
-
|
|
46
|
-
- Updated dependencies [[`cadf2e1`](https://github.com/LedgerHQ/ledger-live/commit/cadf2e1dfb09248d3f77d96f94ae774425dbca75)]:
|
|
47
|
-
- @ledgerhq/live-env@2.19.0-nightly.1
|
|
48
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.5
|
|
49
|
-
- @ledgerhq/cryptoassets@13.31.0-nightly.5
|
|
50
|
-
- @ledgerhq/live-network@2.0.20-nightly.2
|
|
51
|
-
|
|
52
|
-
## 0.15.0-nightly.4
|
|
53
|
-
|
|
54
|
-
### Patch Changes
|
|
55
|
-
|
|
56
|
-
- Updated dependencies [[`7744980`](https://github.com/LedgerHQ/ledger-live/commit/774498090411f1a6d6c06395dda1fc7cd24adf24), [`759064d`](https://github.com/LedgerHQ/ledger-live/commit/759064d4815c636af2d73ba548a85b4f53e7b491)]:
|
|
57
|
-
- @ledgerhq/types-live@6.87.0-nightly.3
|
|
58
|
-
- @ledgerhq/errors@6.27.0-nightly.0
|
|
59
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.4
|
|
60
|
-
- @ledgerhq/cryptoassets@13.31.0-nightly.4
|
|
61
|
-
- @ledgerhq/devices@8.6.2-nightly.0
|
|
62
|
-
- @ledgerhq/live-network@2.0.20-nightly.1
|
|
63
|
-
|
|
64
|
-
## 0.15.0-nightly.3
|
|
65
|
-
|
|
66
|
-
### Patch Changes
|
|
67
|
-
|
|
68
|
-
- Updated dependencies [[`8645f01`](https://github.com/LedgerHQ/ledger-live/commit/8645f016191d29a55f6b0ca6e4b1d1909fd35445)]:
|
|
69
|
-
- @ledgerhq/types-live@6.87.0-nightly.2
|
|
70
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.3
|
|
71
|
-
- @ledgerhq/cryptoassets@13.31.0-nightly.3
|
|
72
|
-
|
|
73
|
-
## 0.15.0-nightly.2
|
|
74
|
-
|
|
75
|
-
### Minor Changes
|
|
7
|
+
- [#12015](https://github.com/LedgerHQ/ledger-live/pull/12015) [`03af552`](https://github.com/LedgerHQ/ledger-live/commit/03af552b621e19e31747a65b1870dfe8d3bb005b) Thanks [@Justkant](https://github.com/Justkant)! - feat: new signRawTransaction to support any XRP transaction with wallet-api
|
|
76
8
|
|
|
77
9
|
- [#12196](https://github.com/LedgerHQ/ledger-live/pull/12196) [`565da80`](https://github.com/LedgerHQ/ledger-live/commit/565da807b1ebbfc830fd0e47b3d8856f88d410a6) Thanks [@gre-ledger](https://github.com/gre-ledger)! - Remove deprecated getTokenById and hasTokenId functions
|
|
78
10
|
|
|
79
11
|
### Patch Changes
|
|
80
12
|
|
|
81
|
-
- Updated dependencies [[`c6a676f`](https://github.com/LedgerHQ/ledger-live/commit/c6a676ff80581ac19b896adf44d54812983b72da), [`565da80`](https://github.com/LedgerHQ/ledger-live/commit/565da807b1ebbfc830fd0e47b3d8856f88d410a6)]:
|
|
82
|
-
- @ledgerhq/
|
|
83
|
-
- @ledgerhq/
|
|
13
|
+
- Updated dependencies [[`ea16f59`](https://github.com/LedgerHQ/ledger-live/commit/ea16f592e85019a1b77287a7f2b975c6fcffc74c), [`b88faa1`](https://github.com/LedgerHQ/ledger-live/commit/b88faa18e2f5cd309b54fc3157a44db606846cc5), [`cfe65ca`](https://github.com/LedgerHQ/ledger-live/commit/cfe65cafa268be4e53197ee163ce78f28ed72592), [`a9aacdb`](https://github.com/LedgerHQ/ledger-live/commit/a9aacdb330700f0a294833f7d77de17f179229b2), [`3979c07`](https://github.com/LedgerHQ/ledger-live/commit/3979c0715e4f54165c89d00ebe1441e064e1a110), [`f1f3845`](https://github.com/LedgerHQ/ledger-live/commit/f1f3845942e4cbce9c585dc65f6170ddbc319f19), [`c6a676f`](https://github.com/LedgerHQ/ledger-live/commit/c6a676ff80581ac19b896adf44d54812983b72da), [`b5fc1bd`](https://github.com/LedgerHQ/ledger-live/commit/b5fc1bd28fff091241905fec5ff8dc8af4c99b79), [`03af552`](https://github.com/LedgerHQ/ledger-live/commit/03af552b621e19e31747a65b1870dfe8d3bb005b), [`89ac0ed`](https://github.com/LedgerHQ/ledger-live/commit/89ac0eddc145dcf5c7cf240aa8be4301372c8f33), [`565da80`](https://github.com/LedgerHQ/ledger-live/commit/565da807b1ebbfc830fd0e47b3d8856f88d410a6), [`8645f01`](https://github.com/LedgerHQ/ledger-live/commit/8645f016191d29a55f6b0ca6e4b1d1909fd35445), [`1d9860c`](https://github.com/LedgerHQ/ledger-live/commit/1d9860cd1688131d391579955b40c6710b667db8), [`d2b12e7`](https://github.com/LedgerHQ/ledger-live/commit/d2b12e70bba9e772d078d1fe4d9c537b8d316a87), [`db25e21`](https://github.com/LedgerHQ/ledger-live/commit/db25e212b87dea426b153c6f1d988cead63c8c46), [`c8dbf40`](https://github.com/LedgerHQ/ledger-live/commit/c8dbf402268359e225a94782420111e786f875fa), [`cab7d97`](https://github.com/LedgerHQ/ledger-live/commit/cab7d9794e7babb8220c6d339fb08e618e3d4202)]:
|
|
14
|
+
- @ledgerhq/cryptoassets@13.31.0
|
|
15
|
+
- @ledgerhq/types-live@6.87.0
|
|
16
|
+
- @ledgerhq/coin-framework@6.7.0
|
|
17
|
+
- @ledgerhq/live-env@2.19.0
|
|
18
|
+
- @ledgerhq/types-cryptoassets@7.29.0
|
|
19
|
+
- @ledgerhq/live-network@2.0.20
|
|
84
20
|
|
|
85
|
-
## 0.15.0-
|
|
21
|
+
## 0.15.0-next.1
|
|
86
22
|
|
|
87
23
|
### Patch Changes
|
|
88
24
|
|
|
89
|
-
- Updated dependencies [[`
|
|
90
|
-
- @ledgerhq/
|
|
91
|
-
- @ledgerhq/
|
|
92
|
-
- @ledgerhq/
|
|
93
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.1
|
|
94
|
-
- @ledgerhq/live-network@2.0.20-nightly.0
|
|
25
|
+
- Updated dependencies [[`b88faa1`](https://github.com/LedgerHQ/ledger-live/commit/b88faa18e2f5cd309b54fc3157a44db606846cc5)]:
|
|
26
|
+
- @ledgerhq/types-live@6.87.0-next.1
|
|
27
|
+
- @ledgerhq/coin-framework@6.7.0-next.1
|
|
28
|
+
- @ledgerhq/cryptoassets@13.31.0-next.1
|
|
95
29
|
|
|
96
|
-
## 0.15.0-
|
|
30
|
+
## 0.15.0-next.0
|
|
97
31
|
|
|
98
32
|
### Minor Changes
|
|
99
33
|
|
|
100
34
|
- [#12015](https://github.com/LedgerHQ/ledger-live/pull/12015) [`03af552`](https://github.com/LedgerHQ/ledger-live/commit/03af552b621e19e31747a65b1870dfe8d3bb005b) Thanks [@Justkant](https://github.com/Justkant)! - feat: new signRawTransaction to support any XRP transaction with wallet-api
|
|
101
35
|
|
|
36
|
+
- [#12196](https://github.com/LedgerHQ/ledger-live/pull/12196) [`565da80`](https://github.com/LedgerHQ/ledger-live/commit/565da807b1ebbfc830fd0e47b3d8856f88d410a6) Thanks [@gre-ledger](https://github.com/gre-ledger)! - Remove deprecated getTokenById and hasTokenId functions
|
|
37
|
+
|
|
102
38
|
### Patch Changes
|
|
103
39
|
|
|
104
|
-
- Updated dependencies [[`cfe65ca`](https://github.com/LedgerHQ/ledger-live/commit/cfe65cafa268be4e53197ee163ce78f28ed72592), [`b5fc1bd`](https://github.com/LedgerHQ/ledger-live/commit/b5fc1bd28fff091241905fec5ff8dc8af4c99b79), [`03af552`](https://github.com/LedgerHQ/ledger-live/commit/03af552b621e19e31747a65b1870dfe8d3bb005b), [`d2b12e7`](https://github.com/LedgerHQ/ledger-live/commit/d2b12e70bba9e772d078d1fe4d9c537b8d316a87), [`cab7d97`](https://github.com/LedgerHQ/ledger-live/commit/cab7d9794e7babb8220c6d339fb08e618e3d4202)]:
|
|
105
|
-
- @ledgerhq/cryptoassets@13.31.0-
|
|
106
|
-
- @ledgerhq/types-live@6.87.0-
|
|
107
|
-
- @ledgerhq/coin-framework@6.7.0-
|
|
108
|
-
- @ledgerhq/
|
|
40
|
+
- Updated dependencies [[`ea16f59`](https://github.com/LedgerHQ/ledger-live/commit/ea16f592e85019a1b77287a7f2b975c6fcffc74c), [`cfe65ca`](https://github.com/LedgerHQ/ledger-live/commit/cfe65cafa268be4e53197ee163ce78f28ed72592), [`a9aacdb`](https://github.com/LedgerHQ/ledger-live/commit/a9aacdb330700f0a294833f7d77de17f179229b2), [`3979c07`](https://github.com/LedgerHQ/ledger-live/commit/3979c0715e4f54165c89d00ebe1441e064e1a110), [`f1f3845`](https://github.com/LedgerHQ/ledger-live/commit/f1f3845942e4cbce9c585dc65f6170ddbc319f19), [`c6a676f`](https://github.com/LedgerHQ/ledger-live/commit/c6a676ff80581ac19b896adf44d54812983b72da), [`b5fc1bd`](https://github.com/LedgerHQ/ledger-live/commit/b5fc1bd28fff091241905fec5ff8dc8af4c99b79), [`03af552`](https://github.com/LedgerHQ/ledger-live/commit/03af552b621e19e31747a65b1870dfe8d3bb005b), [`89ac0ed`](https://github.com/LedgerHQ/ledger-live/commit/89ac0eddc145dcf5c7cf240aa8be4301372c8f33), [`565da80`](https://github.com/LedgerHQ/ledger-live/commit/565da807b1ebbfc830fd0e47b3d8856f88d410a6), [`8645f01`](https://github.com/LedgerHQ/ledger-live/commit/8645f016191d29a55f6b0ca6e4b1d1909fd35445), [`1d9860c`](https://github.com/LedgerHQ/ledger-live/commit/1d9860cd1688131d391579955b40c6710b667db8), [`d2b12e7`](https://github.com/LedgerHQ/ledger-live/commit/d2b12e70bba9e772d078d1fe4d9c537b8d316a87), [`db25e21`](https://github.com/LedgerHQ/ledger-live/commit/db25e212b87dea426b153c6f1d988cead63c8c46), [`c8dbf40`](https://github.com/LedgerHQ/ledger-live/commit/c8dbf402268359e225a94782420111e786f875fa), [`cab7d97`](https://github.com/LedgerHQ/ledger-live/commit/cab7d9794e7babb8220c6d339fb08e618e3d4202)]:
|
|
41
|
+
- @ledgerhq/cryptoassets@13.31.0-next.0
|
|
42
|
+
- @ledgerhq/types-live@6.87.0-next.0
|
|
43
|
+
- @ledgerhq/coin-framework@6.7.0-next.0
|
|
44
|
+
- @ledgerhq/live-env@2.19.0-next.0
|
|
45
|
+
- @ledgerhq/types-cryptoassets@7.29.0-next.0
|
|
46
|
+
- @ledgerhq/live-network@2.0.20-next.0
|
|
109
47
|
|
|
110
48
|
## 0.14.3
|
|
111
49
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.fixtures.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/api.fixtures.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,gBAAgB,uCAAuC,CAAC;AA8BrE,QAAA,MAAM,UAAU,mCAA2B,CAAC;AAE5C,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.API_TON_ENDPOINT = void 0;
|
|
4
|
+
const msw_1 = require("msw");
|
|
5
|
+
const node_1 = require("msw/node");
|
|
6
|
+
const common_fixtures_1 = require("./common.fixtures");
|
|
7
|
+
// Define the mock base URL for the TON API
|
|
8
|
+
exports.API_TON_ENDPOINT = "https://ton.coin.ledger.com/api/v3";
|
|
9
|
+
// Create request handlers for the mock server
|
|
10
|
+
const handlers = [
|
|
11
|
+
// Handle GET request for masterchainInfo endpoint
|
|
12
|
+
msw_1.http.get(`${exports.API_TON_ENDPOINT}/masterchainInfo`, () => {
|
|
13
|
+
return msw_1.HttpResponse.json(common_fixtures_1.lastBlockNumber);
|
|
14
|
+
}),
|
|
15
|
+
// Handle GET request for transactions endpoint
|
|
16
|
+
msw_1.http.get(`${exports.API_TON_ENDPOINT}/transactions`, () => {
|
|
17
|
+
return msw_1.HttpResponse.json(common_fixtures_1.tonTransactionResponse);
|
|
18
|
+
}),
|
|
19
|
+
// Handle GET request for account endpoint
|
|
20
|
+
msw_1.http.get(`${exports.API_TON_ENDPOINT}/account`, () => {
|
|
21
|
+
return msw_1.HttpResponse.json(common_fixtures_1.tonAccount);
|
|
22
|
+
}),
|
|
23
|
+
// Handle GET request for wallet endpoint
|
|
24
|
+
msw_1.http.get(`${exports.API_TON_ENDPOINT}/wallet`, () => {
|
|
25
|
+
return msw_1.HttpResponse.json(common_fixtures_1.tonWallet);
|
|
26
|
+
}),
|
|
27
|
+
// Handle GET request for jetton transfers endpoint
|
|
28
|
+
msw_1.http.get(`${exports.API_TON_ENDPOINT}/jetton/transfers`, () => msw_1.HttpResponse.json(common_fixtures_1.jettonTransferResponse)),
|
|
29
|
+
// Handle GET request for jetton wallets endpoint
|
|
30
|
+
msw_1.http.get(`${exports.API_TON_ENDPOINT}/jetton/wallets`, () => msw_1.HttpResponse.json(common_fixtures_1.jettonWallets)),
|
|
31
|
+
// Handle POST request for estimate fee endpoint
|
|
32
|
+
msw_1.http.post(`${exports.API_TON_ENDPOINT}/estimateFee`, () => msw_1.HttpResponse.json(common_fixtures_1.tonEstimateFee)),
|
|
33
|
+
];
|
|
34
|
+
// Set up the mock server with the defined handlers
|
|
35
|
+
const mockServer = (0, node_1.setupServer)(...handlers);
|
|
36
|
+
exports.default = mockServer;
|
|
37
|
+
//# sourceMappingURL=api.fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.fixtures.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/api.fixtures.ts"],"names":[],"mappings":";;;AAAA,6BAAyC;AACzC,mCAAuC;AACvC,uDAQ2B;AAE3B,2CAA2C;AAC9B,QAAA,gBAAgB,GAAG,oCAAoC,CAAC;AAErE,8CAA8C;AAC9C,MAAM,QAAQ,GAAG;IACf,kDAAkD;IAClD,UAAI,CAAC,GAAG,CAAC,GAAG,wBAAgB,kBAAkB,EA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alletInfo, TonTransactionsList } from "../../bridge/bridgeHelpers/api.types";
|
|
3
|
+
import type { TonAccount, TonSubAccount, Transaction } from "../../types";
|
|
4
|
+
export declare const mockAddress = "UQDzd8aeBOU-jqYw_ZSuZjceI5p-F4b7HMprAsUJAtRPbMol";
|
|
5
|
+
export declare const mockAccountId = "js:2:ton:b19891a06654f21c64147550b3321bef63acd25b5dd61b688b022c42fac4831d:ton";
|
|
6
|
+
export declare const tokenAccount: TonSubAccount;
|
|
7
|
+
export declare const account: TonAccount;
|
|
8
|
+
export declare const transaction: Transaction;
|
|
9
|
+
export declare const jettonTransaction: Transaction;
|
|
10
|
+
export declare const fees: {
|
|
11
|
+
in_fwd_fee: number;
|
|
12
|
+
storage_fee: number;
|
|
13
|
+
gas_fee: number;
|
|
14
|
+
fwd_fee: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const totalFees: BigNumber;
|
|
17
|
+
export declare const lastBlockNumber: {
|
|
18
|
+
last: {
|
|
19
|
+
seqno: number;
|
|
20
|
+
};
|
|
21
|
+
first: {
|
|
22
|
+
seqno: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const tonAccount: TonAccountInfo;
|
|
26
|
+
export declare const tonWallet: TonResponseWalletInfo;
|
|
27
|
+
export declare const jettonWallets: TonResponseJettonWallets;
|
|
28
|
+
export declare const tonEstimateFee: TonResponseEstimateFee;
|
|
29
|
+
export declare const jettonTransferResponse: TonResponseJettonTransfer;
|
|
30
|
+
export declare const tonTransactionResponse: TonTransactionsList;
|
|
31
|
+
export declare const accountInfo: TonAccountInfo;
|
|
32
|
+
//# sourceMappingURL=common.fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.fixtures.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/common.fixtures.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1E,eAAO,MAAM,WAAW,qDAAqD,CAAC;AAC9E,eAAO,MAAM,aAAa,kFACuD,CAAC;AAElF,eAAO,MAAM,YAAY,eAeP,CAAC;AAEnB,eAAO,MAAM,OAAO,YAWL,CAAC;AAEhB,eAAO,MAAM,WAAW,EAAE,WAOzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAG/B,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;CAKhB,CAAC;AAEF,eAAO,MAAM,SAAS,WAErB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;CAO3B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAMxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,qBAQvB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,wBAY3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,sBAG5B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,yBAkBpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,mBAkDpC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,cAMzB,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.accountInfo = exports.tonTransactionResponse = exports.jettonTransferResponse = exports.tonEstimateFee = exports.jettonWallets = exports.tonWallet = exports.tonAccount = exports.lastBlockNumber = exports.totalFees = exports.fees = exports.jettonTransaction = exports.transaction = exports.account = exports.tokenAccount = exports.mockAccountId = exports.mockAddress = void 0;
|
|
7
|
+
const currencies_1 = require("@ledgerhq/cryptoassets/currencies");
|
|
8
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
9
|
+
exports.mockAddress = "UQDzd8aeBOU-jqYw_ZSuZjceI5p-F4b7HMprAsUJAtRPbMol";
|
|
10
|
+
exports.mockAccountId = "js:2:ton:b19891a06654f21c64147550b3321bef63acd25b5dd61b688b022c42fac4831d:ton";
|
|
11
|
+
exports.tokenAccount = {
|
|
12
|
+
id: "subAccountId",
|
|
13
|
+
type: "TokenAccount",
|
|
14
|
+
spendableBalance: new bignumber_js_1.default("5000000"),
|
|
15
|
+
token: {
|
|
16
|
+
contractAddress: "contractAddress",
|
|
17
|
+
units: [
|
|
18
|
+
{
|
|
19
|
+
code: "NOT",
|
|
20
|
+
magnitude: 9,
|
|
21
|
+
name: "Notcoin",
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
jettonWallet: "0:A2CC9B938389950125001F6B8AF280CACA23BE045714AD69387DD546588D667E",
|
|
26
|
+
};
|
|
27
|
+
exports.account = {
|
|
28
|
+
id: exports.mockAccountId,
|
|
29
|
+
freshAddress: exports.mockAddress,
|
|
30
|
+
freshAddressPath: "44'/607'/0'/0'/0'/0'",
|
|
31
|
+
xpub: "",
|
|
32
|
+
type: "Account",
|
|
33
|
+
currency: (0, currencies_1.getCryptoCurrencyById)("ton"),
|
|
34
|
+
spendableBalance: new bignumber_js_1.default("1000000000"),
|
|
35
|
+
balance: new bignumber_js_1.default("1000000000"),
|
|
36
|
+
seedIdentifier: "seedIdentifier",
|
|
37
|
+
subAccounts: [exports.tokenAccount],
|
|
38
|
+
};
|
|
39
|
+
exports.transaction = {
|
|
40
|
+
recipient: "UQCOvQLYvTcbi5tL9MaDNzuVl3-J3vATimNm9yO5XPafLfV4",
|
|
41
|
+
amount: new bignumber_js_1.default("1000000"),
|
|
42
|
+
useAllAmount: false,
|
|
43
|
+
comment: { isEncrypted: false, text: "" },
|
|
44
|
+
family: "ton",
|
|
45
|
+
fees: new bignumber_js_1.default(1000),
|
|
46
|
+
};
|
|
47
|
+
exports.jettonTransaction = {
|
|
48
|
+
...exports.transaction,
|
|
49
|
+
subAccountId: "subAccountId",
|
|
50
|
+
};
|
|
51
|
+
exports.fees = {
|
|
52
|
+
in_fwd_fee: 10000,
|
|
53
|
+
storage_fee: 10000,
|
|
54
|
+
gas_fee: 10000,
|
|
55
|
+
fwd_fee: 10000,
|
|
56
|
+
};
|
|
57
|
+
exports.totalFees = (0, bignumber_js_1.default)(exports.fees.fwd_fee + exports.fees.gas_fee + exports.fees.in_fwd_fee + exports.fees.storage_fee);
|
|
58
|
+
exports.lastBlockNumber = {
|
|
59
|
+
last: {
|
|
60
|
+
seqno: 38574413,
|
|
61
|
+
},
|
|
62
|
+
first: {
|
|
63
|
+
seqno: 3,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
exports.tonAccount = {
|
|
67
|
+
balance: "1000000000",
|
|
68
|
+
last_transaction_lt: "47055058000008",
|
|
69
|
+
last_transaction_hash: "psVQqt6rf/Lo6xyLzxx0to0jUIx8I2/4znOVf2KhAI0=",
|
|
70
|
+
status: "active",
|
|
71
|
+
seqno: 3,
|
|
72
|
+
};
|
|
73
|
+
exports.tonWallet = {
|
|
74
|
+
balance: "7726736262",
|
|
75
|
+
wallet_type: "wallet v4 r2",
|
|
76
|
+
seqno: 22,
|
|
77
|
+
wallet_id: 698983191,
|
|
78
|
+
last_transaction_lt: "47055058000008",
|
|
79
|
+
last_transaction_hash: "psVQqt6rf/Lo6xyLzxx0to0jUIx8I2/4znOVf2KhAI0=",
|
|
80
|
+
status: "active",
|
|
81
|
+
};
|
|
82
|
+
exports.jettonWallets = {
|
|
83
|
+
jetton_wallets: [
|
|
84
|
+
{
|
|
85
|
+
address: "0:495AB6C978E3C0AE7FCF863A2D4504E37CE8D2D04A5E59048301BA29EC372F79",
|
|
86
|
+
balance: "1200000000000",
|
|
87
|
+
owner: "0:D02D314791CB10EF3F964CC7421E4F46348C262444946F7A64C2374700E3ED19",
|
|
88
|
+
jetton: "0:3C52A0A732A83F022E517E5C2715E0EE458A4B9772580E903FF491526C3E9137",
|
|
89
|
+
last_transaction_lt: "30345242000008",
|
|
90
|
+
code_hash: "3axDia4eCUnTVixqU0/BUA4i8id5BtVw1pt/yayZd6k=",
|
|
91
|
+
data_hash: "P8j0kENM5s4zE2w5IpD8NrrSneGQ7d0mzs5yTBNPlqo=",
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
exports.tonEstimateFee = {
|
|
96
|
+
source_fees: exports.fees,
|
|
97
|
+
destination_fees: [],
|
|
98
|
+
};
|
|
99
|
+
exports.jettonTransferResponse = {
|
|
100
|
+
jetton_transfers: [
|
|
101
|
+
{
|
|
102
|
+
query_id: "1",
|
|
103
|
+
source: "UQDnqcVSV4S9m2Y9gLAQrDerQktKSx2I1uhs6r5o_H8VT4x7",
|
|
104
|
+
destination: exports.mockAddress,
|
|
105
|
+
amount: "",
|
|
106
|
+
source_wallet: "",
|
|
107
|
+
jetton_master: "0:2F956143C461769579BAEF2E32CC2D7BC18283F40D20BB03E432CD603AC33FFC",
|
|
108
|
+
transaction_hash: "",
|
|
109
|
+
transaction_lt: "",
|
|
110
|
+
transaction_now: 0,
|
|
111
|
+
response_destination: "",
|
|
112
|
+
custom_payload: null,
|
|
113
|
+
forward_ton_amount: "",
|
|
114
|
+
forward_payload: null,
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
exports.tonTransactionResponse = {
|
|
119
|
+
transactions: [
|
|
120
|
+
{
|
|
121
|
+
account: exports.mockAddress,
|
|
122
|
+
hash: "hash",
|
|
123
|
+
lt: "lt",
|
|
124
|
+
now: 1718241443,
|
|
125
|
+
orig_status: "active",
|
|
126
|
+
end_status: "active",
|
|
127
|
+
total_fees: "0",
|
|
128
|
+
prev_trans_hash: "",
|
|
129
|
+
prev_trans_lt: "",
|
|
130
|
+
description: {
|
|
131
|
+
aborted: true,
|
|
132
|
+
destroyed: false,
|
|
133
|
+
compute_ph: {
|
|
134
|
+
success: false,
|
|
135
|
+
exit_code: -14,
|
|
136
|
+
},
|
|
137
|
+
credit_first: true,
|
|
138
|
+
},
|
|
139
|
+
block_ref: null,
|
|
140
|
+
in_msg: {
|
|
141
|
+
source: "0:959EAA8BD0E3A2662D814278D51A6F997946207D48478008BEBE7F45F3EF781F",
|
|
142
|
+
destination: exports.mockAddress,
|
|
143
|
+
value: "13509565",
|
|
144
|
+
hash: "inMsgHash",
|
|
145
|
+
fwd_fee: "266669",
|
|
146
|
+
ihr_fee: "0",
|
|
147
|
+
created_lt: "47055058000007",
|
|
148
|
+
created_at: "1718241443",
|
|
149
|
+
opcode: "0xd53276db",
|
|
150
|
+
ihr_disabled: true,
|
|
151
|
+
bounce: false,
|
|
152
|
+
bounced: false,
|
|
153
|
+
import_fee: null,
|
|
154
|
+
message_content: {
|
|
155
|
+
hash: "Qa0w2xg42wA9taurO/aCVOqGTzjOeP3EpzD2Sl7tTss=",
|
|
156
|
+
body: "te6cckEBAQEADgAAGNUydtsAAAAAAAAAAfRC8y4=",
|
|
157
|
+
decoded: null,
|
|
158
|
+
},
|
|
159
|
+
init_state: null,
|
|
160
|
+
},
|
|
161
|
+
out_msgs: [],
|
|
162
|
+
account_state_before: null,
|
|
163
|
+
account_state_after: null,
|
|
164
|
+
mc_block_seqno: 3,
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
address_book: {},
|
|
168
|
+
};
|
|
169
|
+
exports.accountInfo = {
|
|
170
|
+
balance: "7726736262",
|
|
171
|
+
last_transaction_lt: "47055058000008",
|
|
172
|
+
last_transaction_hash: "lastTransactionHash",
|
|
173
|
+
status: "active",
|
|
174
|
+
seqno: 22,
|
|
175
|
+
};
|
|
176
|
+
//# sourceMappingURL=common.fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.fixtures.js","sourceRoot":"","sources":["../../../src/__t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AI;aACjB;YACD,QAAQ,EAAE,EAAE;YACZ,oBAAoB,EAAE,IAAI;YAC1B,mBAAmB,EAAE,IAAI;YACzB,cAAc,EAAE,CAAC;SAClB;KACF;IACD,YAAY,EAAE,EAAE;CACjB,CAAC;AAEW,QAAA,WAAW,GAAmB;IACzC,OAAO,EAAE,YAAY;IACrB,mBAAmB,EAAE,gBAAgB;IACrC,qBAAqB,EAAE,qBAAqB;IAC5C,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,EAAE;CACV,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DatasetTest } from "@ledgerhq/types-live";
|
|
2
|
+
import { Transaction } from "../../types";
|
|
3
|
+
export declare const dataset: DatasetTest<Transaction>;
|
|
4
|
+
/**
|
|
5
|
+
* NOTE: if tests are added to this file,
|
|
6
|
+
* like done in libs/coin-polkadot/src/bridge.integration.test.ts for example,
|
|
7
|
+
* this file fill need to be imported in ledger-live-common
|
|
8
|
+
* libs/ledger-live-common/src/families/ton/bridge.integration.test.ts
|
|
9
|
+
* like done for polkadot.
|
|
10
|
+
* cf.
|
|
11
|
+
* - libs/coin-polkadot/src/bridge.integration.test.ts
|
|
12
|
+
* - libs/ledger-live-common/src/families/polkadot/bridge.integration.test.ts
|
|
13
|
+
*/
|
|
14
|
+
//# sourceMappingURL=bridge.integration.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.integration.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/bridge.integration.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAInE,OAAO,EAAc,WAAW,EAAE,MAAM,aAAa,CAAC;AA+LtD,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,WAAW,CAK5C,CAAC;AAEF;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.dataset = void 0;
|
|
7
|
+
const errors_1 = require("@ledgerhq/errors");
|
|
8
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
9
|
+
const errors_2 = require("../../errors");
|
|
10
|
+
const transaction_1 = require("../../transaction");
|
|
11
|
+
const utils_1 = require("../../utils");
|
|
12
|
+
const PUBKEY = "86196cb40cd25e9e696bc808e3f2c074ce0b39f2a2a9d482a68eafef86e4a060";
|
|
13
|
+
const ADDRESS = "UQCOvQLYvTcbi5tL9MaDNzuVl3-J3vATimNm9yO5XPafLfV4";
|
|
14
|
+
const ADDRESS_2 = "UQAui6M4jOYOezUGfmeONA22Ars9yjd34YIGdAR1Pcpp4sgR";
|
|
15
|
+
const PATH = "44'/607'/0'/0'/0'/0'";
|
|
16
|
+
const SUBACCOUNT = "js:2:ton:86196cb40cd25e9e696bc808e3f2c074ce0b39f2a2a9d482a68eafef86e4a060:ton+ton%2Fjetton%2Feqavlwfdxgf2lxm67y4yzc17wykd9a0guwpkms1gosm~!underscore!~~!underscore!~not";
|
|
17
|
+
const ton = {
|
|
18
|
+
IgnorePrepareTransactionFields: ["fees"],
|
|
19
|
+
scanAccounts: [
|
|
20
|
+
{
|
|
21
|
+
name: "ton seed 1",
|
|
22
|
+
apdus: `
|
|
23
|
+
=> e005000019068000002c8000025f80000000800000008000000080000000
|
|
24
|
+
<= 86196cb40cd25e9e696bc808e3f2c074ce0b39f2a2a9d482a68eafef86e4a0609000
|
|
25
|
+
=> e005000019068000002c8000025f80000000800000008000000180000000
|
|
26
|
+
<= b5177c2b32f9d72fa8c673cc3d61acec6a9f68eb5e4945445fdbb48a45eb48879000
|
|
27
|
+
`,
|
|
28
|
+
test: (expect, accounts) => {
|
|
29
|
+
for (const account of accounts) {
|
|
30
|
+
expect(account.derivationMode).toEqual("ton");
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
accounts: [
|
|
36
|
+
{
|
|
37
|
+
FIXME_tests: [
|
|
38
|
+
"balance is sum of ops",
|
|
39
|
+
"transaction Subaccount Send max", // TypeError: Cannot read properties of undefined (reading 'toString') in ts.amount
|
|
40
|
+
],
|
|
41
|
+
raw: {
|
|
42
|
+
id: `js:2:ton:${PUBKEY}:ton`,
|
|
43
|
+
currencyId: "ton",
|
|
44
|
+
seedIdentifier: PUBKEY,
|
|
45
|
+
name: "TON 1",
|
|
46
|
+
derivationMode: "ton",
|
|
47
|
+
index: 0,
|
|
48
|
+
freshAddress: ADDRESS,
|
|
49
|
+
freshAddressPath: PATH,
|
|
50
|
+
xpub: PUBKEY,
|
|
51
|
+
blockHeight: 0,
|
|
52
|
+
operations: [],
|
|
53
|
+
pendingOperations: [],
|
|
54
|
+
lastSyncDate: "",
|
|
55
|
+
balance: "5000000000",
|
|
56
|
+
subAccounts: [],
|
|
57
|
+
},
|
|
58
|
+
transactions: [
|
|
59
|
+
{
|
|
60
|
+
name: "Not a valid address",
|
|
61
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
62
|
+
family: "ton",
|
|
63
|
+
recipient: "novalidaddress",
|
|
64
|
+
fees: "10000000",
|
|
65
|
+
amount: "1000",
|
|
66
|
+
comment: { isEncrypted: false, text: "" },
|
|
67
|
+
}),
|
|
68
|
+
expectedStatus: {
|
|
69
|
+
errors: {
|
|
70
|
+
recipient: new errors_1.InvalidAddress(),
|
|
71
|
+
},
|
|
72
|
+
warnings: {},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "Not enough balance",
|
|
77
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
78
|
+
family: "ton",
|
|
79
|
+
recipient: ADDRESS_2,
|
|
80
|
+
fees: "10000000",
|
|
81
|
+
amount: (300 * 1e9).toString(),
|
|
82
|
+
comment: { isEncrypted: false, text: "" },
|
|
83
|
+
}),
|
|
84
|
+
expectedStatus: {
|
|
85
|
+
errors: {
|
|
86
|
+
amount: new errors_1.NotEnoughBalance(),
|
|
87
|
+
},
|
|
88
|
+
warnings: {},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "Invalid transferID/Memo",
|
|
93
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
94
|
+
family: "ton",
|
|
95
|
+
recipient: ADDRESS_2,
|
|
96
|
+
fees: "1",
|
|
97
|
+
amount: (1 * 1e2).toString(),
|
|
98
|
+
comment: { isEncrypted: false, text: "😀" },
|
|
99
|
+
}),
|
|
100
|
+
expectedStatus: {
|
|
101
|
+
errors: {
|
|
102
|
+
transaction: new errors_2.TonCommentInvalid(),
|
|
103
|
+
},
|
|
104
|
+
warnings: {},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "New account and sufficient amount",
|
|
109
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
110
|
+
family: "ton",
|
|
111
|
+
recipient: ADDRESS_2,
|
|
112
|
+
fees: "10000000",
|
|
113
|
+
amount: "10000000",
|
|
114
|
+
comment: { isEncrypted: false, text: "Valid" },
|
|
115
|
+
}),
|
|
116
|
+
expectedStatus: {
|
|
117
|
+
amount: new bignumber_js_1.default("10000000"),
|
|
118
|
+
errors: {},
|
|
119
|
+
warnings: {},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
// sub account tests
|
|
123
|
+
{
|
|
124
|
+
name: "Subaccount Not a valid address",
|
|
125
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
126
|
+
family: "ton",
|
|
127
|
+
recipient: "novalidaddress",
|
|
128
|
+
fees: "10000000",
|
|
129
|
+
amount: "1000",
|
|
130
|
+
comment: { isEncrypted: false, text: "" },
|
|
131
|
+
subAccountId: SUBACCOUNT,
|
|
132
|
+
}),
|
|
133
|
+
expectedStatus: {
|
|
134
|
+
errors: {
|
|
135
|
+
recipient: new errors_1.InvalidAddress(),
|
|
136
|
+
},
|
|
137
|
+
warnings: {},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "Subaccount Not enough balance",
|
|
142
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
143
|
+
family: "ton",
|
|
144
|
+
recipient: ADDRESS_2,
|
|
145
|
+
fees: "10000000",
|
|
146
|
+
amount: (300 * 1e9).toString(),
|
|
147
|
+
comment: { isEncrypted: false, text: "" },
|
|
148
|
+
subAccountId: SUBACCOUNT,
|
|
149
|
+
}),
|
|
150
|
+
expectedStatus: {
|
|
151
|
+
errors: {
|
|
152
|
+
amount: new errors_1.NotEnoughBalance(),
|
|
153
|
+
},
|
|
154
|
+
warnings: {},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "Subaccount New account and sufficient amount",
|
|
159
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
160
|
+
family: "ton",
|
|
161
|
+
recipient: ADDRESS,
|
|
162
|
+
fees: "10000000",
|
|
163
|
+
amount: "10000000",
|
|
164
|
+
comment: { isEncrypted: false, text: "Valid" },
|
|
165
|
+
subAccountId: SUBACCOUNT,
|
|
166
|
+
}),
|
|
167
|
+
expectedStatus: {
|
|
168
|
+
amount: new bignumber_js_1.default("10000000"),
|
|
169
|
+
errors: {},
|
|
170
|
+
warnings: {},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "Subaccount Send max",
|
|
175
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
176
|
+
family: "ton",
|
|
177
|
+
recipient: ADDRESS,
|
|
178
|
+
fees: "10000000",
|
|
179
|
+
amount: "10000000",
|
|
180
|
+
comment: { isEncrypted: false, text: "Valid" },
|
|
181
|
+
useAllAmount: true,
|
|
182
|
+
subAccountId: SUBACCOUNT,
|
|
183
|
+
}),
|
|
184
|
+
expectedStatus: (account, tx) => {
|
|
185
|
+
const subAccount = (0, utils_1.findSubAccountById)(account, tx.subAccountId ?? "");
|
|
186
|
+
return {
|
|
187
|
+
amount: subAccount?.spendableBalance,
|
|
188
|
+
errors: {},
|
|
189
|
+
warnings: {},
|
|
190
|
+
};
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
};
|
|
197
|
+
exports.dataset = {
|
|
198
|
+
implementations: ["js"],
|
|
199
|
+
currencies: {
|
|
200
|
+
ton,
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* NOTE: if tests are added to this file,
|
|
205
|
+
* like done in libs/coin-polkadot/src/bridge.integration.test.ts for example,
|
|
206
|
+
* this file fill need to be imported in ledger-live-common
|
|
207
|
+
* libs/ledger-live-common/src/families/ton/bridge.integration.test.ts
|
|
208
|
+
* like done for polkadot.
|
|
209
|
+
* cf.
|
|
210
|
+
* - libs/coin-polkadot/src/bridge.integration.test.ts
|
|
211
|
+
* - libs/ledger-live-common/src/families/polkadot/bridge.integration.test.ts
|
|
212
|
+
*/
|
|
213
|
+
//# sourceMappingURL=bridge.integration.test.js.map
|