@ledgerhq/coin-cardano 0.13.0-nightly.9 → 0.13.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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @ledgerhq/coin-cardano@0.13.0-nightly.8 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-cardano
2
+ > @ledgerhq/coin-cardano@0.13.0 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-cardano
3
3
  > tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es
4
4
 
@@ -25,7 +25,8 @@
25
25
  "src/postSyncPatch.ts",
26
26
  "src/serialization.ts",
27
27
  "src/signer.ts",
28
- "src/synchronisation.unit.test.ts"
28
+ "src/synchronisation.unit.test.ts",
29
+ "src/test/bridge.dataset.ts"
29
30
  ],
30
31
  "ignoreUnresolved": [],
31
32
  "ignoreUnused": []
package/CHANGELOG.md CHANGED
@@ -1,102 +1,40 @@
1
1
  # @ledgerhq/coin-cardano
2
2
 
3
- ## 0.13.0-nightly.9
3
+ ## 0.13.1-nightly.0
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [[`da750a1`](https://github.com/LedgerHQ/ledger-live/commit/da750a16ee5f2c083114569b8ae3c708cceba06c), [`36e5168`](https://github.com/LedgerHQ/ledger-live/commit/36e5168397eaec2a5f425038392a4400f60571d0), [`d9305e8`](https://github.com/LedgerHQ/ledger-live/commit/d9305e8a4d8364366aaba05dd698396d28b539dc)]:
8
- - @ledgerhq/types-cryptoassets@7.29.0-nightly.1
9
- - @ledgerhq/cryptoassets@13.31.0-nightly.8
10
- - @ledgerhq/coin-framework@6.7.0-nightly.9
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.13.0-nightly.8
12
+ ## 0.13.0
14
13
 
15
14
  ### Minor Changes
16
15
 
17
- - [#12297](https://github.com/LedgerHQ/ledger-live/pull/12297) [`c96d73f`](https://github.com/LedgerHQ/ledger-live/commit/c96d73fed0a75a9c208f78d51c34b742703a7dda) Thanks [@Justkant](https://github.com/Justkant)! - feat(coin-framework): add postSync support to scanAccounts and apply across coins [LIVE-21755]
18
-
19
- Adds optional postSync hook to makeScanAccounts (invoked after account shape build).
20
- Applies postSync in bitcoin, cardano, evm, and tron currency bridges.
21
- Exports tron postSync so it can be passed during scanning.
22
- Ensures scanAccounts benefits from the same normalization/cleanup logic as sync without breaking existing callers (default no-op).
23
-
24
- ### Patch Changes
25
-
26
- - Updated dependencies [[`c96d73f`](https://github.com/LedgerHQ/ledger-live/commit/c96d73fed0a75a9c208f78d51c34b742703a7dda)]:
27
- - @ledgerhq/coin-framework@6.7.0-nightly.8
28
-
29
- ## 0.13.0-nightly.7
30
-
31
- ### Patch Changes
32
-
33
- - 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)]:
34
- - @ledgerhq/cryptoassets@13.31.0-nightly.7
35
- - @ledgerhq/types-live@6.87.0-nightly.5
36
- - @ledgerhq/live-env@2.19.0-nightly.2
37
- - @ledgerhq/coin-framework@6.7.0-nightly.7
38
- - @ledgerhq/live-network@2.0.20-nightly.3
39
-
40
- ## 0.13.0-nightly.6
41
-
42
- ### Patch Changes
43
-
44
- - Updated dependencies [[`51995e9`](https://github.com/LedgerHQ/ledger-live/commit/51995e96a9e1fafe14c7cbe45ce0b1ec8ebd106b)]:
45
- - @ledgerhq/types-live@6.87.0-nightly.4
46
- - @ledgerhq/coin-framework@6.7.0-nightly.6
47
- - @ledgerhq/cryptoassets@13.31.0-nightly.6
48
-
49
- ## 0.13.0-nightly.5
50
-
51
- ### Patch Changes
52
-
53
- - Updated dependencies [[`cadf2e1`](https://github.com/LedgerHQ/ledger-live/commit/cadf2e1dfb09248d3f77d96f94ae774425dbca75)]:
54
- - @ledgerhq/live-env@2.19.0-nightly.1
55
- - @ledgerhq/coin-framework@6.7.0-nightly.5
56
- - @ledgerhq/cryptoassets@13.31.0-nightly.5
57
- - @ledgerhq/live-network@2.0.20-nightly.2
58
-
59
- ## 0.13.0-nightly.4
60
-
61
- ### Patch Changes
62
-
63
- - Updated dependencies [[`7744980`](https://github.com/LedgerHQ/ledger-live/commit/774498090411f1a6d6c06395dda1fc7cd24adf24), [`759064d`](https://github.com/LedgerHQ/ledger-live/commit/759064d4815c636af2d73ba548a85b4f53e7b491)]:
64
- - @ledgerhq/types-live@6.87.0-nightly.3
65
- - @ledgerhq/errors@6.27.0-nightly.0
66
- - @ledgerhq/coin-framework@6.7.0-nightly.4
67
- - @ledgerhq/cryptoassets@13.31.0-nightly.4
68
- - @ledgerhq/devices@8.6.2-nightly.0
69
- - @ledgerhq/live-network@2.0.20-nightly.1
70
-
71
- ## 0.13.0-nightly.3
72
-
73
- ### Patch Changes
74
-
75
- - Updated dependencies [[`8645f01`](https://github.com/LedgerHQ/ledger-live/commit/8645f016191d29a55f6b0ca6e4b1d1909fd35445)]:
76
- - @ledgerhq/types-live@6.87.0-nightly.2
77
- - @ledgerhq/coin-framework@6.7.0-nightly.3
78
- - @ledgerhq/cryptoassets@13.31.0-nightly.3
79
-
80
- ## 0.13.0-nightly.2
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
81
17
 
82
18
  ### Patch Changes
83
19
 
84
- - Updated dependencies [[`c6a676f`](https://github.com/LedgerHQ/ledger-live/commit/c6a676ff80581ac19b896adf44d54812983b72da), [`565da80`](https://github.com/LedgerHQ/ledger-live/commit/565da807b1ebbfc830fd0e47b3d8856f88d410a6)]:
85
- - @ledgerhq/coin-framework@6.7.0-nightly.2
86
- - @ledgerhq/cryptoassets@13.31.0-nightly.2
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
87
27
 
88
- ## 0.13.0-nightly.1
28
+ ## 0.13.0-next.1
89
29
 
90
30
  ### Patch Changes
91
31
 
92
- - Updated dependencies [[`ea16f59`](https://github.com/LedgerHQ/ledger-live/commit/ea16f592e85019a1b77287a7f2b975c6fcffc74c), [`a9aacdb`](https://github.com/LedgerHQ/ledger-live/commit/a9aacdb330700f0a294833f7d77de17f179229b2), [`f1f3845`](https://github.com/LedgerHQ/ledger-live/commit/f1f3845942e4cbce9c585dc65f6170ddbc319f19), [`89ac0ed`](https://github.com/LedgerHQ/ledger-live/commit/89ac0eddc145dcf5c7cf240aa8be4301372c8f33), [`db25e21`](https://github.com/LedgerHQ/ledger-live/commit/db25e212b87dea426b153c6f1d988cead63c8c46)]:
93
- - @ledgerhq/cryptoassets@13.31.0-nightly.1
94
- - @ledgerhq/types-live@6.87.0-nightly.1
95
- - @ledgerhq/live-env@2.19.0-nightly.0
96
- - @ledgerhq/coin-framework@6.7.0-nightly.1
97
- - @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
98
36
 
99
- ## 0.13.0-nightly.0
37
+ ## 0.13.0-next.0
100
38
 
101
39
  ### Minor Changes
102
40
 
@@ -104,11 +42,13 @@
104
42
 
105
43
  ### Patch Changes
106
44
 
107
- - 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)]:
108
- - @ledgerhq/cryptoassets@13.31.0-nightly.0
109
- - @ledgerhq/types-live@6.87.0-nightly.0
110
- - @ledgerhq/coin-framework@6.7.0-nightly.0
111
- - @ledgerhq/types-cryptoassets@7.29.0-nightly.0
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
112
52
 
113
53
  ## 0.12.3
114
54
 
@@ -0,0 +1,4 @@
1
+ import type { Transaction } from "../types";
2
+ import type { DatasetTest } from "@ledgerhq/types-live";
3
+ export declare const dataset: DatasetTest<Transaction>;
4
+ //# sourceMappingURL=bridge.dataset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge.dataset.d.ts","sourceRoot":"","sources":["../../src/test/bridge.dataset.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAUxD,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,WAAW,CAkG5C,CAAC"}
@@ -0,0 +1,120 @@
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 bignumber_js_1 = __importDefault(require("bignumber.js"));
8
+ const rawAccount_1_1 = require("../datasets/rawAccount.1");
9
+ const scanAccounts_1 = require("../datasets/scanAccounts");
10
+ const errors_1 = require("../errors");
11
+ const transaction_1 = require("../transaction");
12
+ const buffer_1 = require("buffer");
13
+ // NOTE: overrides polyfill set here libs/ledger-live-common/jest.polyfills.js
14
+ Object.defineProperty(globalThis, "Buffer", {
15
+ value: buffer_1.Buffer,
16
+ writable: true,
17
+ configurable: true,
18
+ });
19
+ exports.dataset = {
20
+ implementations: ["js"],
21
+ currencies: {
22
+ cardano_testnet: {
23
+ scanAccounts: scanAccounts_1.cardanoScanAccounts,
24
+ accounts: [
25
+ {
26
+ raw: rawAccount_1_1.cardanoRawAccount1,
27
+ transactions: [
28
+ {
29
+ name: "amount less then minimum",
30
+ transaction: (0, transaction_1.fromTransactionRaw)({
31
+ family: "cardano",
32
+ recipient: "addr_test1qpl90kc2jl5kr9tev0s7vays9yhwcdnq8nlylyk4dqsdq3g466elxnxwrzwq72pvp5akenj30t5s9et7frfvrxxx8xcsxrzs87",
33
+ amount: "0.1",
34
+ mode: "send",
35
+ poolId: undefined,
36
+ }),
37
+ expectedStatus: {
38
+ amount: new bignumber_js_1.default("0.1"),
39
+ errors: {
40
+ amount: new errors_1.CardanoMinAmountError(),
41
+ },
42
+ },
43
+ },
44
+ /* // FIXME broken test
45
+ {
46
+ name: "token amount more than balance",
47
+ transaction: fromTransactionRaw({
48
+ family: "cardano",
49
+ recipient:
50
+ "addr_test1qpl90kc2jl5kr9tev0s7vays9yhwcdnq8nlylyk4dqsdq3g466elxnxwrzwq72pvp5akenj30t5s9et7frfvrxxx8xcsxrzs87",
51
+ amount: "101",
52
+ subAccountId:
53
+ "js:2:cardano_testnet:806499588e0c4a58f4119f7e6e096bf42c3f774a528d2acec9e82ceebf87d1ceb3d4f3622dd2c77c65cc89c123f79337db22cf8a69f122e36dab1bf5083bf82d:cardano+cardano_testnet%2Fnative%2F47be64fcc8a7fe5321b976282ce4e43e4d29015f6613cfabcea28eab54657374",
54
+ mode: "send",
55
+ poolId: undefined,
56
+ }),
57
+ expectedStatus: {
58
+ amount: new BigNumber("101"),
59
+ errors: {
60
+ amount: new NotEnoughBalance(),
61
+ },
62
+ },
63
+ },
64
+ {
65
+ name: "send max token",
66
+ transaction: fromTransactionRaw({
67
+ family: "cardano",
68
+ recipient:
69
+ "addr_test1qpl90kc2jl5kr9tev0s7vays9yhwcdnq8nlylyk4dqsdq3g466elxnxwrzwq72pvp5akenj30t5s9et7frfvrxxx8xcsxrzs87",
70
+ amount: "0",
71
+ subAccountId:
72
+ "js:2:cardano_testnet:806499588e0c4a58f4119f7e6e096bf42c3f774a528d2acec9e82ceebf87d1ceb3d4f3622dd2c77c65cc89c123f79337db22cf8a69f122e36dab1bf5083bf82d:cardano+cardano_testnet%2Fnative%2F47be64fcc8a7fe5321b976282ce4e43e4d29015f6613cfabcea28eab54657374",
73
+ mode: "send",
74
+ useAllAmount: true,
75
+ poolId: undefined,
76
+ }),
77
+ expectedStatus: {
78
+ amount: new BigNumber("100"),
79
+ totalSpent: new BigNumber("100"),
80
+ errors: {},
81
+ warnings: {},
82
+ },
83
+ },
84
+ */
85
+ {
86
+ name: "delegate to invalid poolId",
87
+ transaction: (0, transaction_1.fromTransactionRaw)({
88
+ family: "cardano",
89
+ recipient: "",
90
+ amount: "0",
91
+ mode: "delegate",
92
+ poolId: "efae72c07a26e4542ba55ef59d35ad45ffaaac312865e3a758ede",
93
+ }),
94
+ expectedStatus: {
95
+ errors: {
96
+ poolId: new errors_1.CardanoInvalidPoolId(),
97
+ },
98
+ },
99
+ },
100
+ {
101
+ name: "delegate valid poolId",
102
+ transaction: (0, transaction_1.fromTransactionRaw)({
103
+ family: "cardano",
104
+ recipient: "",
105
+ amount: "0",
106
+ mode: "delegate",
107
+ poolId: "efae72c07a26e4542ba55ef59d35ad45ffaaac312865e3a758ede997",
108
+ }),
109
+ expectedStatus: {},
110
+ },
111
+ ],
112
+ },
113
+ ],
114
+ },
115
+ },
116
+ };
117
+ describe("Cardano bridge", () => {
118
+ test.todo("This is an empty test to make jest command pass. Remove it once there is a real test.");
119
+ });
120
+ //# 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,gEAAqC;AACrC,2DAA8D;AAC9D,2DAA+D;AAC/D,sCAAwE;AACxE,gDAAoD;AAGpD,mCAAkD;AAElD,8EAA8E;AAC9E,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE;IAC1C,KAAK,EAAE,eAAc;IACrB,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AAEU,QAAA,OAAO,GAA6B;IAC/C,eAAe,EAAE,CAAC,IAAI,CAAC;IACvB,UAAU,EAAE;QACV,eAAe,EAAE;YACf,YAAY,EAAE,kCAAmB;YACjC,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,iCAAkB;oBACvB,YAAY,EAAE;wBACZ;4BACE,IAAI,EAAE,0BAA0B;4BAChC,WAAW,EAAE,IAAA,gCAAkB,EAAC;gCAC9B,MAAM,EAAE,SAAS;gCACjB,SAAS,EACP,8GAA8G;gCAChH,MAAM,EAAE,KAAK;gCACb,IAAI,EAAE,MAAM;gCACZ,MAAM,EAAE,SAAS;6BAClB,CAAC;4BACF,cAAc,EAAE;gCACd,MAAM,EAAE,IAAI,sBAAS,CAAC,KAAK,CAAC;gCAC5B,MAAM,EAAE;oCACN,MAAM,EAAE,IAAI,8BAAqB,EAAE;iCACpC;6BACF;yBACF;wBACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAwCE;wBACF;4BACE,IAAI,EAAE,4BAA4B;4BAClC,WAAW,EAAE,IAAA,gCAAkB,EAAC;gCAC9B,MAAM,EAAE,SAAS;gCACjB,SAAS,EAAE,EAAE;gCACb,MAAM,EAAE,GAAG;gCACX,IAAI,EAAE,UAAU;gCAChB,MAAM,EAAE,uDAAuD;6BAChE,CAAC;4BACF,cAAc,EAAE;gCACd,MAAM,EAAE;oCACN,MAAM,EAAE,IAAI,6BAAoB,EAAE;iCACnC;6BACF;yBACF;wBACD;4BACE,IAAI,EAAE,uBAAuB;4BAC7B,WAAW,EAAE,IAAA,gCAAkB,EAAC;gCAC9B,MAAM,EAAE,SAAS;gCACjB,SAAS,EAAE,EAAE;gCACb,MAAM,EAAE,GAAG;gCACX,IAAI,EAAE,UAAU;gCAChB,MAAM,EAAE,0DAA0D;6BACnE,CAAC;4BACF,cAAc,EAAE,EAAE;yBACnB;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,CAAC,IAAI,CACP,uFAAuF,CACxF,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Transaction } from "../types";
2
+ import type { DatasetTest } from "@ledgerhq/types-live";
3
+ export declare const dataset: DatasetTest<Transaction>;
4
+ //# sourceMappingURL=bridge.dataset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge.dataset.d.ts","sourceRoot":"","sources":["../../src/test/bridge.dataset.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAUxD,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,WAAW,CAkG5C,CAAC"}
@@ -0,0 +1,114 @@
1
+ import BigNumber from "bignumber.js";
2
+ import { cardanoRawAccount1 } from "../datasets/rawAccount.1";
3
+ import { cardanoScanAccounts } from "../datasets/scanAccounts";
4
+ import { CardanoInvalidPoolId, CardanoMinAmountError } from "../errors";
5
+ import { fromTransactionRaw } from "../transaction";
6
+ import { Buffer as OriginalBuffer } from "buffer";
7
+ // NOTE: overrides polyfill set here libs/ledger-live-common/jest.polyfills.js
8
+ Object.defineProperty(globalThis, "Buffer", {
9
+ value: OriginalBuffer,
10
+ writable: true,
11
+ configurable: true,
12
+ });
13
+ export const dataset = {
14
+ implementations: ["js"],
15
+ currencies: {
16
+ cardano_testnet: {
17
+ scanAccounts: cardanoScanAccounts,
18
+ accounts: [
19
+ {
20
+ raw: cardanoRawAccount1,
21
+ transactions: [
22
+ {
23
+ name: "amount less then minimum",
24
+ transaction: fromTransactionRaw({
25
+ family: "cardano",
26
+ recipient: "addr_test1qpl90kc2jl5kr9tev0s7vays9yhwcdnq8nlylyk4dqsdq3g466elxnxwrzwq72pvp5akenj30t5s9et7frfvrxxx8xcsxrzs87",
27
+ amount: "0.1",
28
+ mode: "send",
29
+ poolId: undefined,
30
+ }),
31
+ expectedStatus: {
32
+ amount: new BigNumber("0.1"),
33
+ errors: {
34
+ amount: new CardanoMinAmountError(),
35
+ },
36
+ },
37
+ },
38
+ /* // FIXME broken test
39
+ {
40
+ name: "token amount more than balance",
41
+ transaction: fromTransactionRaw({
42
+ family: "cardano",
43
+ recipient:
44
+ "addr_test1qpl90kc2jl5kr9tev0s7vays9yhwcdnq8nlylyk4dqsdq3g466elxnxwrzwq72pvp5akenj30t5s9et7frfvrxxx8xcsxrzs87",
45
+ amount: "101",
46
+ subAccountId:
47
+ "js:2:cardano_testnet:806499588e0c4a58f4119f7e6e096bf42c3f774a528d2acec9e82ceebf87d1ceb3d4f3622dd2c77c65cc89c123f79337db22cf8a69f122e36dab1bf5083bf82d:cardano+cardano_testnet%2Fnative%2F47be64fcc8a7fe5321b976282ce4e43e4d29015f6613cfabcea28eab54657374",
48
+ mode: "send",
49
+ poolId: undefined,
50
+ }),
51
+ expectedStatus: {
52
+ amount: new BigNumber("101"),
53
+ errors: {
54
+ amount: new NotEnoughBalance(),
55
+ },
56
+ },
57
+ },
58
+ {
59
+ name: "send max token",
60
+ transaction: fromTransactionRaw({
61
+ family: "cardano",
62
+ recipient:
63
+ "addr_test1qpl90kc2jl5kr9tev0s7vays9yhwcdnq8nlylyk4dqsdq3g466elxnxwrzwq72pvp5akenj30t5s9et7frfvrxxx8xcsxrzs87",
64
+ amount: "0",
65
+ subAccountId:
66
+ "js:2:cardano_testnet:806499588e0c4a58f4119f7e6e096bf42c3f774a528d2acec9e82ceebf87d1ceb3d4f3622dd2c77c65cc89c123f79337db22cf8a69f122e36dab1bf5083bf82d:cardano+cardano_testnet%2Fnative%2F47be64fcc8a7fe5321b976282ce4e43e4d29015f6613cfabcea28eab54657374",
67
+ mode: "send",
68
+ useAllAmount: true,
69
+ poolId: undefined,
70
+ }),
71
+ expectedStatus: {
72
+ amount: new BigNumber("100"),
73
+ totalSpent: new BigNumber("100"),
74
+ errors: {},
75
+ warnings: {},
76
+ },
77
+ },
78
+ */
79
+ {
80
+ name: "delegate to invalid poolId",
81
+ transaction: fromTransactionRaw({
82
+ family: "cardano",
83
+ recipient: "",
84
+ amount: "0",
85
+ mode: "delegate",
86
+ poolId: "efae72c07a26e4542ba55ef59d35ad45ffaaac312865e3a758ede",
87
+ }),
88
+ expectedStatus: {
89
+ errors: {
90
+ poolId: new CardanoInvalidPoolId(),
91
+ },
92
+ },
93
+ },
94
+ {
95
+ name: "delegate valid poolId",
96
+ transaction: fromTransactionRaw({
97
+ family: "cardano",
98
+ recipient: "",
99
+ amount: "0",
100
+ mode: "delegate",
101
+ poolId: "efae72c07a26e4542ba55ef59d35ad45ffaaac312865e3a758ede997",
102
+ }),
103
+ expectedStatus: {},
104
+ },
105
+ ],
106
+ },
107
+ ],
108
+ },
109
+ },
110
+ };
111
+ describe("Cardano bridge", () => {
112
+ test.todo("This is an empty test to make jest command pass. Remove it once there is a real test.");
113
+ });
114
+ //# 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,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,QAAQ,CAAC;AAElD,8EAA8E;AAC9E,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE;IAC1C,KAAK,EAAE,cAAc;IACrB,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAA6B;IAC/C,eAAe,EAAE,CAAC,IAAI,CAAC;IACvB,UAAU,EAAE;QACV,eAAe,EAAE;YACf,YAAY,EAAE,mBAAmB;YACjC,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,kBAAkB;oBACvB,YAAY,EAAE;wBACZ;4BACE,IAAI,EAAE,0BAA0B;4BAChC,WAAW,EAAE,kBAAkB,CAAC;gCAC9B,MAAM,EAAE,SAAS;gCACjB,SAAS,EACP,8GAA8G;gCAChH,MAAM,EAAE,KAAK;gCACb,IAAI,EAAE,MAAM;gCACZ,MAAM,EAAE,SAAS;6BAClB,CAAC;4BACF,cAAc,EAAE;gCACd,MAAM,EAAE,IAAI,SAAS,CAAC,KAAK,CAAC;gCAC5B,MAAM,EAAE;oCACN,MAAM,EAAE,IAAI,qBAAqB,EAAE;iCACpC;6BACF;yBACF;wBACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAwCE;wBACF;4BACE,IAAI,EAAE,4BAA4B;4BAClC,WAAW,EAAE,kBAAkB,CAAC;gCAC9B,MAAM,EAAE,SAAS;gCACjB,SAAS,EAAE,EAAE;gCACb,MAAM,EAAE,GAAG;gCACX,IAAI,EAAE,UAAU;gCAChB,MAAM,EAAE,uDAAuD;6BAChE,CAAC;4BACF,cAAc,EAAE;gCACd,MAAM,EAAE;oCACN,MAAM,EAAE,IAAI,oBAAoB,EAAE;iCACnC;6BACF;yBACF;wBACD;4BACE,IAAI,EAAE,uBAAuB;4BAC7B,WAAW,EAAE,kBAAkB,CAAC;gCAC9B,MAAM,EAAE,SAAS;gCACjB,SAAS,EAAE,EAAE;gCACb,MAAM,EAAE,GAAG;gCACX,IAAI,EAAE,UAAU;gCAChB,MAAM,EAAE,0DAA0D;6BACnE,CAAC;4BACF,cAAc,EAAE,EAAE;yBACnB;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,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-cardano",
3
- "version": "0.13.0-nightly.9",
3
+ "version": "0.13.1-nightly.0",
4
4
  "description": "Ledger Cardano Coin integration",
5
5
  "keywords": [
6
6
  "Ledger",
@@ -59,15 +59,15 @@
59
59
  "invariant": "^2.2.2",
60
60
  "lodash": "^4.17.21",
61
61
  "rxjs": "^7.8.1",
62
- "@ledgerhq/coin-framework": "^6.7.0-nightly.9",
63
- "@ledgerhq/cryptoassets": "^13.31.0-nightly.8",
62
+ "@ledgerhq/coin-framework": "^6.7.1-nightly.0",
63
+ "@ledgerhq/cryptoassets": "^13.31.1-nightly.0",
64
64
  "@ledgerhq/devices": "8.6.2-nightly.0",
65
65
  "@ledgerhq/errors": "^6.27.0-nightly.0",
66
- "@ledgerhq/live-env": "^2.19.0-nightly.2",
67
- "@ledgerhq/live-network": "^2.0.20-nightly.3",
66
+ "@ledgerhq/live-env": "^2.19.0",
67
+ "@ledgerhq/live-network": "^2.0.20",
68
68
  "@ledgerhq/logs": "^6.13.0",
69
- "@ledgerhq/types-cryptoassets": "^7.29.0-nightly.1",
70
- "@ledgerhq/types-live": "^6.87.0-nightly.5"
69
+ "@ledgerhq/types-cryptoassets": "^7.29.0",
70
+ "@ledgerhq/types-live": "^6.88.0-nightly.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/invariant": "^2.2.2",
@@ -1,9 +1,9 @@
1
1
  import BigNumber from "bignumber.js";
2
- import { cardanoRawAccount1 } from "./datasets/rawAccount.1";
3
- import { cardanoScanAccounts } from "./datasets/scanAccounts";
4
- import { CardanoInvalidPoolId, CardanoMinAmountError } from "./errors";
5
- import { fromTransactionRaw } from "./transaction";
6
- import type { Transaction } from "./types";
2
+ import { cardanoRawAccount1 } from "../datasets/rawAccount.1";
3
+ import { cardanoScanAccounts } from "../datasets/scanAccounts";
4
+ import { CardanoInvalidPoolId, CardanoMinAmountError } from "../errors";
5
+ import { fromTransactionRaw } from "../transaction";
6
+ import type { Transaction } from "../types";
7
7
  import type { DatasetTest } from "@ledgerhq/types-live";
8
8
  import { Buffer as OriginalBuffer } from "buffer";
9
9