@ledgerhq/coin-multiversx 0.6.0-nightly.9 → 0.6.1-nightly.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/.unimportedrc.json +2 -1
- package/CHANGELOG.md +28 -79
- package/lib/test/bridge.dataset.d.ts +4 -0
- package/lib/test/bridge.dataset.d.ts.map +1 -0
- package/lib/test/bridge.dataset.js +142 -0
- package/lib/test/bridge.dataset.js.map +1 -0
- package/lib-es/test/bridge.dataset.d.ts +4 -0
- package/lib-es/test/bridge.dataset.d.ts.map +1 -0
- package/lib-es/test/bridge.dataset.js +139 -0
- package/lib-es/test/bridge.dataset.js.map +1 -0
- package/package.json +9 -9
- package/src/{bridge.integration.test.ts → test/bridge.dataset.ts} +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @ledgerhq/coin-multiversx@0.6.0
|
|
2
|
+
> @ledgerhq/coin-multiversx@0.6.0 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-multiversx
|
|
3
3
|
> tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es
|
|
4
4
|
|
package/.unimportedrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,93 +1,40 @@
|
|
|
1
1
|
# @ledgerhq/coin-elrond
|
|
2
2
|
|
|
3
|
-
## 0.6.
|
|
3
|
+
## 0.6.1-nightly.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Updated dependencies [[`
|
|
8
|
-
- @ledgerhq/types-
|
|
9
|
-
- @ledgerhq/
|
|
10
|
-
- @ledgerhq/
|
|
11
|
-
- @ledgerhq/types-live@6.87.0-nightly.5
|
|
7
|
+
- Updated dependencies [[`2c6a198`](https://github.com/LedgerHQ/ledger-live/commit/2c6a198ba28391695202a0787ce168c53768ff37)]:
|
|
8
|
+
- @ledgerhq/types-live@6.88.0-nightly.0
|
|
9
|
+
- @ledgerhq/coin-framework@6.7.1-nightly.0
|
|
10
|
+
- @ledgerhq/cryptoassets@13.31.1-nightly.0
|
|
12
11
|
|
|
13
|
-
## 0.6.0
|
|
12
|
+
## 0.6.0
|
|
14
13
|
|
|
15
|
-
###
|
|
16
|
-
|
|
17
|
-
- Updated dependencies [[`c96d73f`](https://github.com/LedgerHQ/ledger-live/commit/c96d73fed0a75a9c208f78d51c34b742703a7dda)]:
|
|
18
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.8
|
|
19
|
-
|
|
20
|
-
## 0.6.0-nightly.7
|
|
21
|
-
|
|
22
|
-
### Patch Changes
|
|
23
|
-
|
|
24
|
-
- 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)]:
|
|
25
|
-
- @ledgerhq/cryptoassets@13.31.0-nightly.7
|
|
26
|
-
- @ledgerhq/types-live@6.87.0-nightly.5
|
|
27
|
-
- @ledgerhq/live-env@2.19.0-nightly.2
|
|
28
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.7
|
|
29
|
-
- @ledgerhq/live-network@2.0.20-nightly.3
|
|
30
|
-
|
|
31
|
-
## 0.6.0-nightly.6
|
|
32
|
-
|
|
33
|
-
### Patch Changes
|
|
34
|
-
|
|
35
|
-
- Updated dependencies [[`51995e9`](https://github.com/LedgerHQ/ledger-live/commit/51995e96a9e1fafe14c7cbe45ce0b1ec8ebd106b)]:
|
|
36
|
-
- @ledgerhq/types-live@6.87.0-nightly.4
|
|
37
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.6
|
|
38
|
-
- @ledgerhq/cryptoassets@13.31.0-nightly.6
|
|
39
|
-
|
|
40
|
-
## 0.6.0-nightly.5
|
|
41
|
-
|
|
42
|
-
### Patch Changes
|
|
43
|
-
|
|
44
|
-
- Updated dependencies [[`cadf2e1`](https://github.com/LedgerHQ/ledger-live/commit/cadf2e1dfb09248d3f77d96f94ae774425dbca75)]:
|
|
45
|
-
- @ledgerhq/live-env@2.19.0-nightly.1
|
|
46
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.5
|
|
47
|
-
- @ledgerhq/cryptoassets@13.31.0-nightly.5
|
|
48
|
-
- @ledgerhq/live-network@2.0.20-nightly.2
|
|
49
|
-
|
|
50
|
-
## 0.6.0-nightly.4
|
|
51
|
-
|
|
52
|
-
### Patch Changes
|
|
53
|
-
|
|
54
|
-
- Updated dependencies [[`7744980`](https://github.com/LedgerHQ/ledger-live/commit/774498090411f1a6d6c06395dda1fc7cd24adf24), [`759064d`](https://github.com/LedgerHQ/ledger-live/commit/759064d4815c636af2d73ba548a85b4f53e7b491)]:
|
|
55
|
-
- @ledgerhq/types-live@6.87.0-nightly.3
|
|
56
|
-
- @ledgerhq/errors@6.27.0-nightly.0
|
|
57
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.4
|
|
58
|
-
- @ledgerhq/cryptoassets@13.31.0-nightly.4
|
|
59
|
-
- @ledgerhq/devices@8.6.2-nightly.0
|
|
60
|
-
- @ledgerhq/live-network@2.0.20-nightly.1
|
|
61
|
-
|
|
62
|
-
## 0.6.0-nightly.3
|
|
63
|
-
|
|
64
|
-
### Patch Changes
|
|
65
|
-
|
|
66
|
-
- Updated dependencies [[`8645f01`](https://github.com/LedgerHQ/ledger-live/commit/8645f016191d29a55f6b0ca6e4b1d1909fd35445)]:
|
|
67
|
-
- @ledgerhq/types-live@6.87.0-nightly.2
|
|
68
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.3
|
|
69
|
-
- @ledgerhq/cryptoassets@13.31.0-nightly.3
|
|
14
|
+
### Minor Changes
|
|
70
15
|
|
|
71
|
-
|
|
16
|
+
- [#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
|
|
72
17
|
|
|
73
18
|
### Patch Changes
|
|
74
19
|
|
|
75
|
-
- Updated dependencies [[`c6a676f`](https://github.com/LedgerHQ/ledger-live/commit/c6a676ff80581ac19b896adf44d54812983b72da), [`565da80`](https://github.com/LedgerHQ/ledger-live/commit/565da807b1ebbfc830fd0e47b3d8856f88d410a6)]:
|
|
76
|
-
- @ledgerhq/
|
|
77
|
-
- @ledgerhq/
|
|
20
|
+
- 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)]:
|
|
21
|
+
- @ledgerhq/cryptoassets@13.31.0
|
|
22
|
+
- @ledgerhq/types-live@6.87.0
|
|
23
|
+
- @ledgerhq/coin-framework@6.7.0
|
|
24
|
+
- @ledgerhq/live-env@2.19.0
|
|
25
|
+
- @ledgerhq/types-cryptoassets@7.29.0
|
|
26
|
+
- @ledgerhq/live-network@2.0.20
|
|
78
27
|
|
|
79
|
-
## 0.6.0-
|
|
28
|
+
## 0.6.0-next.1
|
|
80
29
|
|
|
81
30
|
### Patch Changes
|
|
82
31
|
|
|
83
|
-
- Updated dependencies [[`
|
|
84
|
-
- @ledgerhq/
|
|
85
|
-
- @ledgerhq/
|
|
86
|
-
- @ledgerhq/
|
|
87
|
-
- @ledgerhq/coin-framework@6.7.0-nightly.1
|
|
88
|
-
- @ledgerhq/live-network@2.0.20-nightly.0
|
|
32
|
+
- Updated dependencies [[`b88faa1`](https://github.com/LedgerHQ/ledger-live/commit/b88faa18e2f5cd309b54fc3157a44db606846cc5)]:
|
|
33
|
+
- @ledgerhq/types-live@6.87.0-next.1
|
|
34
|
+
- @ledgerhq/coin-framework@6.7.0-next.1
|
|
35
|
+
- @ledgerhq/cryptoassets@13.31.0-next.1
|
|
89
36
|
|
|
90
|
-
## 0.6.0-
|
|
37
|
+
## 0.6.0-next.0
|
|
91
38
|
|
|
92
39
|
### Minor Changes
|
|
93
40
|
|
|
@@ -95,11 +42,13 @@
|
|
|
95
42
|
|
|
96
43
|
### Patch Changes
|
|
97
44
|
|
|
98
|
-
- 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)]:
|
|
99
|
-
- @ledgerhq/cryptoassets@13.31.0-
|
|
100
|
-
- @ledgerhq/types-live@6.87.0-
|
|
101
|
-
- @ledgerhq/coin-framework@6.7.0-
|
|
102
|
-
- @ledgerhq/
|
|
45
|
+
- 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)]:
|
|
46
|
+
- @ledgerhq/cryptoassets@13.31.0-next.0
|
|
47
|
+
- @ledgerhq/types-live@6.87.0-next.0
|
|
48
|
+
- @ledgerhq/coin-framework@6.7.0-next.0
|
|
49
|
+
- @ledgerhq/live-env@2.19.0-next.0
|
|
50
|
+
- @ledgerhq/types-cryptoassets@7.29.0-next.0
|
|
51
|
+
- @ledgerhq/live-network@2.0.20-next.0
|
|
103
52
|
|
|
104
53
|
## 0.5.3
|
|
105
54
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.dataset.d.ts","sourceRoot":"","sources":["../../src/test/bridge.dataset.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiI5C,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,WAAW,CAM5C,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataset = void 0;
|
|
4
|
+
const errors_1 = require("@ledgerhq/errors");
|
|
5
|
+
const bignumber_js_1 = require("bignumber.js");
|
|
6
|
+
const transaction_1 = require("../transaction");
|
|
7
|
+
const TEST_ADDRESS = "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2";
|
|
8
|
+
const elrond = {
|
|
9
|
+
FIXME_ignorePreloadFields: [
|
|
10
|
+
"validators", // They are always changing
|
|
11
|
+
],
|
|
12
|
+
scanAccounts: [
|
|
13
|
+
{
|
|
14
|
+
name: "multiversx seed 1",
|
|
15
|
+
apdus: `
|
|
16
|
+
=> ed030000080000000080000000
|
|
17
|
+
<= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000
|
|
18
|
+
=> ed030000080000000080000000
|
|
19
|
+
<= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000
|
|
20
|
+
=> ed030000080000000080000001
|
|
21
|
+
<= 3e65726431706d33676a65326c6d643576796c6463767579366a7078676465347261706a70756a76756a6b65653661376a77327a6d6834747172653739367a9000
|
|
22
|
+
`,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
accounts: [
|
|
26
|
+
{
|
|
27
|
+
raw: {
|
|
28
|
+
id: `js:2:multiversx:${TEST_ADDRESS}:`,
|
|
29
|
+
seedIdentifier: `${TEST_ADDRESS}`,
|
|
30
|
+
name: "MultiversX 1",
|
|
31
|
+
derivationMode: "",
|
|
32
|
+
index: 0,
|
|
33
|
+
freshAddress: `${TEST_ADDRESS}`,
|
|
34
|
+
freshAddressPath: "44'/508'/0'/0'/0'",
|
|
35
|
+
blockHeight: 0,
|
|
36
|
+
operations: [],
|
|
37
|
+
pendingOperations: [],
|
|
38
|
+
currencyId: "elrond",
|
|
39
|
+
lastSyncDate: "",
|
|
40
|
+
balance: "299569965",
|
|
41
|
+
subAccounts: [
|
|
42
|
+
{
|
|
43
|
+
// MEX account
|
|
44
|
+
id: `js:2:multiversx:${TEST_ADDRESS}:+4d45582d343535633537`,
|
|
45
|
+
balance: "100",
|
|
46
|
+
spendableBalance: "100",
|
|
47
|
+
type: "TokenAccountRaw",
|
|
48
|
+
tokenId: "multiversx/esdt/4d45582d343535633537",
|
|
49
|
+
parentId: `js:2:multiversx:${TEST_ADDRESS}:`,
|
|
50
|
+
operations: [],
|
|
51
|
+
pendingOperations: [],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
transactions: [
|
|
56
|
+
{
|
|
57
|
+
name: "recipient and sender must not be the same",
|
|
58
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
59
|
+
family: "multiversx",
|
|
60
|
+
recipient: `${TEST_ADDRESS}`,
|
|
61
|
+
amount: "100000000",
|
|
62
|
+
mode: "send",
|
|
63
|
+
fees: null,
|
|
64
|
+
gasLimit: 50000000,
|
|
65
|
+
}),
|
|
66
|
+
expectedStatus: {
|
|
67
|
+
amount: new bignumber_js_1.BigNumber("100000000"),
|
|
68
|
+
errors: {
|
|
69
|
+
recipient: new errors_1.InvalidAddressBecauseDestinationIsAlsoSource(),
|
|
70
|
+
},
|
|
71
|
+
warnings: {},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "Not enough balance",
|
|
76
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
77
|
+
family: "multiversx",
|
|
78
|
+
recipient: "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd",
|
|
79
|
+
amount: "1000000000000000000000000",
|
|
80
|
+
mode: "send",
|
|
81
|
+
fees: null,
|
|
82
|
+
gasLimit: 50000000,
|
|
83
|
+
}),
|
|
84
|
+
expectedStatus: {
|
|
85
|
+
errors: {
|
|
86
|
+
amount: new errors_1.NotEnoughBalance(),
|
|
87
|
+
},
|
|
88
|
+
warnings: {},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "Not enough balance (ESDT transfer)",
|
|
93
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
94
|
+
family: "multiversx",
|
|
95
|
+
recipient: "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd",
|
|
96
|
+
amount: "1000000000000000000000000",
|
|
97
|
+
mode: "send",
|
|
98
|
+
fees: null,
|
|
99
|
+
gasLimit: 50000000,
|
|
100
|
+
subAccountId: `js:2:multiversx:${TEST_ADDRESS}:+4d45582d343535633537`,
|
|
101
|
+
}),
|
|
102
|
+
expectedStatus: {
|
|
103
|
+
errors: {
|
|
104
|
+
amount: new errors_1.NotEnoughBalance(),
|
|
105
|
+
},
|
|
106
|
+
warnings: {},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "Send max",
|
|
111
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
112
|
+
family: "multiversx",
|
|
113
|
+
recipient: "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd",
|
|
114
|
+
useAllAmount: true,
|
|
115
|
+
amount: "0",
|
|
116
|
+
mode: "send",
|
|
117
|
+
fees: null,
|
|
118
|
+
gasLimit: 50000000,
|
|
119
|
+
}),
|
|
120
|
+
expectedStatus: (account, _, status) => {
|
|
121
|
+
return {
|
|
122
|
+
amount: account.balance.minus(status.estimatedFees),
|
|
123
|
+
warnings: {},
|
|
124
|
+
errors: {},
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
};
|
|
132
|
+
exports.dataset = {
|
|
133
|
+
implementations: ["js"],
|
|
134
|
+
currencies: {
|
|
135
|
+
// multiversx,
|
|
136
|
+
elrond,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
describe("MultiversX bridge", () => {
|
|
140
|
+
test.todo("This is an empty test to make jest command pass. Remove it once there is a real test.");
|
|
141
|
+
});
|
|
142
|
+
//# sourceMappingURL=bridge.dataset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.dataset.js","sourceRoot":"","sources":["../../src/test/bridge.dataset.ts"],"names":[],"mappings":";;;AAAA,6CAAkG;AAElG,+CAAyC;AAEzC,gDAAoD;AAGpD,MAAM,YAAY,GAAG,gEAAgE,CAAC;AAEtF,MAAM,MAAM,GAAgC;IAC1C,yBAAyB,EAAE;QACzB,YAAY,EAAE,2BAA2B;KAC1C;IACD,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE;;;;;;;KAOR;SACA;KACF;IACD,QAAQ,EAAE;QACR;YACE,GAAG,EAAE;gBACH,EAAE,EAAE,mBAAmB,YAAY,GAAG;gBACtC,cAAc,EAAE,GAAG,YAAY,EAAE;gBACjC,IAAI,EAAE,cAAc;gBACpB,cAAc,EAAE,EAAE;gBAClB,KAAK,EAAE,CAAC;gBACR,YAAY,EAAE,GAAG,YAAY,EAAE;gBAC/B,gBAAgB,EAAE,mBAAmB;gBACrC,WAAW,EAAE,CAAC;gBACd,UAAU,EAAE,EAAE;gBACd,iBAAiB,EAAE,EAAE;gBACrB,UAAU,EAAE,QAAQ;gBACpB,YAAY,EAAE,EAAE;gBAChB,OAAO,EAAE,WAAW;gBACpB,WAAW,EAAE;oBACX;wBACE,cAAc;wBACd,EAAE,EAAE,mBAAmB,YAAY,wBAAwB;wBAC3D,OAAO,EAAE,KAAK;wBACd,gBAAgB,EAAE,KAAK;wBACvB,IAAI,EAAE,iBAAiB;wBACvB,OAAO,EAAE,sCAAsC;wBAC/C,QAAQ,EAAE,mBAAmB,YAAY,GAAG;wBAC5C,UAAU,EAAE,EAAE;wBACd,iBAAiB,EAAE,EAAE;qBACtB;iBACF;aACF;YACD,YAAY,EAAE;gBACZ;oBACE,IAAI,EAAE,2CAA2C;oBACjD,WAAW,EAAE,IAA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E,YAAY;wBACpB,SAAS,EAAE,gEAAgE;wBAC3E,YAAY,EAAE,IAAI;wBAClB,MAAM,EAAE,GAAG;wBACX,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI;wBACV,QAAQ,EAAE,QAAQ;qBACnB,CAAC;oBACF,cAAc,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE;wBACrC,OAAO;4BACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC;4BACnD,QAAQ,EAAE,EAAE;4BACZ,MAAM,EAAE,EAAE;yBACX,CAAC;oBACJ,CAAC;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEW,QAAA,OAAO,GAA6B;IAC/C,eAAe,EAAE,CAAC,IAAI,CAAC;IACvB,UAAU,EAAE;QACV,cAAc;QACd,MAAM;KACP;CACF,CAAC;AAEF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,CAAC,IAAI,CACP,uFAAuF,CACxF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.dataset.d.ts","sourceRoot":"","sources":["../../src/test/bridge.dataset.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiI5C,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,WAAW,CAM5C,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { InvalidAddressBecauseDestinationIsAlsoSource, NotEnoughBalance } from "@ledgerhq/errors";
|
|
2
|
+
import { BigNumber } from "bignumber.js";
|
|
3
|
+
import { fromTransactionRaw } from "../transaction";
|
|
4
|
+
const TEST_ADDRESS = "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2";
|
|
5
|
+
const elrond = {
|
|
6
|
+
FIXME_ignorePreloadFields: [
|
|
7
|
+
"validators", // They are always changing
|
|
8
|
+
],
|
|
9
|
+
scanAccounts: [
|
|
10
|
+
{
|
|
11
|
+
name: "multiversx seed 1",
|
|
12
|
+
apdus: `
|
|
13
|
+
=> ed030000080000000080000000
|
|
14
|
+
<= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000
|
|
15
|
+
=> ed030000080000000080000000
|
|
16
|
+
<= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000
|
|
17
|
+
=> ed030000080000000080000001
|
|
18
|
+
<= 3e65726431706d33676a65326c6d643576796c6463767579366a7078676465347261706a70756a76756a6b65653661376a77327a6d6834747172653739367a9000
|
|
19
|
+
`,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
accounts: [
|
|
23
|
+
{
|
|
24
|
+
raw: {
|
|
25
|
+
id: `js:2:multiversx:${TEST_ADDRESS}:`,
|
|
26
|
+
seedIdentifier: `${TEST_ADDRESS}`,
|
|
27
|
+
name: "MultiversX 1",
|
|
28
|
+
derivationMode: "",
|
|
29
|
+
index: 0,
|
|
30
|
+
freshAddress: `${TEST_ADDRESS}`,
|
|
31
|
+
freshAddressPath: "44'/508'/0'/0'/0'",
|
|
32
|
+
blockHeight: 0,
|
|
33
|
+
operations: [],
|
|
34
|
+
pendingOperations: [],
|
|
35
|
+
currencyId: "elrond",
|
|
36
|
+
lastSyncDate: "",
|
|
37
|
+
balance: "299569965",
|
|
38
|
+
subAccounts: [
|
|
39
|
+
{
|
|
40
|
+
// MEX account
|
|
41
|
+
id: `js:2:multiversx:${TEST_ADDRESS}:+4d45582d343535633537`,
|
|
42
|
+
balance: "100",
|
|
43
|
+
spendableBalance: "100",
|
|
44
|
+
type: "TokenAccountRaw",
|
|
45
|
+
tokenId: "multiversx/esdt/4d45582d343535633537",
|
|
46
|
+
parentId: `js:2:multiversx:${TEST_ADDRESS}:`,
|
|
47
|
+
operations: [],
|
|
48
|
+
pendingOperations: [],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
transactions: [
|
|
53
|
+
{
|
|
54
|
+
name: "recipient and sender must not be the same",
|
|
55
|
+
transaction: fromTransactionRaw({
|
|
56
|
+
family: "multiversx",
|
|
57
|
+
recipient: `${TEST_ADDRESS}`,
|
|
58
|
+
amount: "100000000",
|
|
59
|
+
mode: "send",
|
|
60
|
+
fees: null,
|
|
61
|
+
gasLimit: 50000000,
|
|
62
|
+
}),
|
|
63
|
+
expectedStatus: {
|
|
64
|
+
amount: new BigNumber("100000000"),
|
|
65
|
+
errors: {
|
|
66
|
+
recipient: new InvalidAddressBecauseDestinationIsAlsoSource(),
|
|
67
|
+
},
|
|
68
|
+
warnings: {},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "Not enough balance",
|
|
73
|
+
transaction: fromTransactionRaw({
|
|
74
|
+
family: "multiversx",
|
|
75
|
+
recipient: "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd",
|
|
76
|
+
amount: "1000000000000000000000000",
|
|
77
|
+
mode: "send",
|
|
78
|
+
fees: null,
|
|
79
|
+
gasLimit: 50000000,
|
|
80
|
+
}),
|
|
81
|
+
expectedStatus: {
|
|
82
|
+
errors: {
|
|
83
|
+
amount: new NotEnoughBalance(),
|
|
84
|
+
},
|
|
85
|
+
warnings: {},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "Not enough balance (ESDT transfer)",
|
|
90
|
+
transaction: fromTransactionRaw({
|
|
91
|
+
family: "multiversx",
|
|
92
|
+
recipient: "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd",
|
|
93
|
+
amount: "1000000000000000000000000",
|
|
94
|
+
mode: "send",
|
|
95
|
+
fees: null,
|
|
96
|
+
gasLimit: 50000000,
|
|
97
|
+
subAccountId: `js:2:multiversx:${TEST_ADDRESS}:+4d45582d343535633537`,
|
|
98
|
+
}),
|
|
99
|
+
expectedStatus: {
|
|
100
|
+
errors: {
|
|
101
|
+
amount: new NotEnoughBalance(),
|
|
102
|
+
},
|
|
103
|
+
warnings: {},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "Send max",
|
|
108
|
+
transaction: fromTransactionRaw({
|
|
109
|
+
family: "multiversx",
|
|
110
|
+
recipient: "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd",
|
|
111
|
+
useAllAmount: true,
|
|
112
|
+
amount: "0",
|
|
113
|
+
mode: "send",
|
|
114
|
+
fees: null,
|
|
115
|
+
gasLimit: 50000000,
|
|
116
|
+
}),
|
|
117
|
+
expectedStatus: (account, _, status) => {
|
|
118
|
+
return {
|
|
119
|
+
amount: account.balance.minus(status.estimatedFees),
|
|
120
|
+
warnings: {},
|
|
121
|
+
errors: {},
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
export const dataset = {
|
|
130
|
+
implementations: ["js"],
|
|
131
|
+
currencies: {
|
|
132
|
+
// multiversx,
|
|
133
|
+
elrond,
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
describe("MultiversX bridge", () => {
|
|
137
|
+
test.todo("This is an empty test to make jest command pass. Remove it once there is a real test.");
|
|
138
|
+
});
|
|
139
|
+
//# sourceMappingURL=bridge.dataset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.dataset.js","sourceRoot":"","sources":["../../src/test/bridge.dataset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4CAA4C,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAElG,OAAO,EAA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;oBACF,cAAc,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE;wBACrC,OAAO;4BACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC;4BACnD,QAAQ,EAAE,EAAE;4BACZ,MAAM,EAAE,EAAE;yBACX,CAAC;oBACJ,CAAC;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAA6B;IAC/C,eAAe,EAAE,CAAC,IAAI,CAAC;IACvB,UAAU,EAAE;QACV,cAAc;QACd,MAAM;KACP;CACF,CAAC;AAEF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,CAAC,IAAI,CACP,uFAAuF,CACxF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/coin-multiversx",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1-nightly.0",
|
|
4
4
|
"description": "Ledger MultiversX Coin integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
"lodash": "^4.17.21",
|
|
53
53
|
"protobufjs": "^7.2.6",
|
|
54
54
|
"rxjs": "^7.8.1",
|
|
55
|
-
"@ledgerhq/coin-framework": "^6.7.
|
|
56
|
-
"@ledgerhq/cryptoassets": "^13.31.
|
|
57
|
-
"@ledgerhq/errors": "^6.27.0-nightly.0",
|
|
58
|
-
"@ledgerhq/live-env": "^2.19.0-nightly.2",
|
|
55
|
+
"@ledgerhq/coin-framework": "^6.7.1-nightly.0",
|
|
56
|
+
"@ledgerhq/cryptoassets": "^13.31.1-nightly.0",
|
|
59
57
|
"@ledgerhq/devices": "8.6.2-nightly.0",
|
|
60
|
-
"@ledgerhq/
|
|
61
|
-
"@ledgerhq/
|
|
58
|
+
"@ledgerhq/errors": "^6.27.0-nightly.0",
|
|
59
|
+
"@ledgerhq/live-env": "^2.19.0",
|
|
60
|
+
"@ledgerhq/live-network": "^2.0.20",
|
|
62
61
|
"@ledgerhq/live-promise": "^0.1.1",
|
|
63
|
-
"@ledgerhq/
|
|
64
|
-
"@ledgerhq/types-
|
|
62
|
+
"@ledgerhq/logs": "^6.13.0",
|
|
63
|
+
"@ledgerhq/types-cryptoassets": "^7.29.0",
|
|
64
|
+
"@ledgerhq/types-live": "^6.88.0-nightly.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/invariant": "^2.2.37",
|
|
@@ -2,8 +2,8 @@ import { InvalidAddressBecauseDestinationIsAlsoSource, NotEnoughBalance } from "
|
|
|
2
2
|
import type { CurrenciesData, DatasetTest } from "@ledgerhq/types-live";
|
|
3
3
|
import { BigNumber } from "bignumber.js";
|
|
4
4
|
|
|
5
|
-
import { fromTransactionRaw } from "
|
|
6
|
-
import type { Transaction } from "
|
|
5
|
+
import { fromTransactionRaw } from "../transaction";
|
|
6
|
+
import type { Transaction } from "../types";
|
|
7
7
|
|
|
8
8
|
const TEST_ADDRESS = "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2";
|
|
9
9
|
|