@ledgerhq/coin-module-boilerplate 4.9.0-nightly.1 → 4.9.0-nightly.2

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-module-boilerplate@4.8.1-nightly.0 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-module-boilerplate
2
+ > @ledgerhq/coin-module-boilerplate@4.9.0-nightly.1 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-module-boilerplate
3
3
  > tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @ledgerhq/coin-module-boilerplate
2
2
 
3
+ ## 4.9.0-nightly.2
4
+
5
+ ### Minor Changes
6
+
7
+ - [#12340](https://github.com/LedgerHQ/ledger-live/pull/12340) [`8d7c1f7`](https://github.com/LedgerHQ/ledger-live/commit/8d7c1f7a92489647399b0e780d4bb926508e8554) Thanks [@gre-ledger](https://github.com/gre-ledger)! - migrate getDeviceTransactionConfig to async
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`63e8f34`](https://github.com/LedgerHQ/ledger-live/commit/63e8f342f6b951ab77bb710b9971f033c05e579e), [`3d4188a`](https://github.com/LedgerHQ/ledger-live/commit/3d4188a26021d33b950129d82cb55d2c2e8d4358)]:
12
+ - @ledgerhq/cryptoassets@13.32.0-nightly.1
13
+ - @ledgerhq/coin-framework@6.8.0-nightly.2
14
+ - @ledgerhq/live-network@2.1.0-nightly.0
15
+ - @ledgerhq/types-live@6.88.0-nightly.1
16
+
3
17
  ## 4.9.0-nightly.1
4
18
 
5
19
  ### Minor Changes
@@ -6,6 +6,6 @@ declare function getDeviceTransactionConfig({ transaction: {}, status: { amount,
6
6
  parentAccount: Account | null | undefined;
7
7
  transaction: Transaction;
8
8
  status: TransactionStatus;
9
- }): Array<CommonDeviceTransactionField>;
9
+ }): Promise<Array<CommonDeviceTransactionField>>;
10
10
  export default getDeviceTransactionConfig;
11
11
  //# sourceMappingURL=deviceTransactionConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deviceTransactionConfig.d.ts","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAGhG,iBAAS,0BAA0B,CAAC,EAClC,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAClC,EAAE;IACD,OAAO,EAAE,WAAW,CAAC;IACrB,aAAa,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG,KAAK,CAAC,4BAA4B,CAAC,CAkBtC;AAED,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"deviceTransactionConfig.d.ts","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAGhG,iBAAe,0BAA0B,CAAC,EACxC,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAClC,EAAE;IACD,OAAO,EAAE,WAAW,CAAC;IACrB,aAAa,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAkB/C;AAED,eAAe,0BAA0B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // This method adds additional fields that need to be reviewed when signing a transaction on the device.
4
- function getDeviceTransactionConfig({ transaction: {}, status: { amount, estimatedFees }, }) {
4
+ async function getDeviceTransactionConfig({ transaction: {}, status: { amount, estimatedFees }, }) {
5
5
  const fields = [];
6
6
  if (!amount.isZero()) {
7
7
  fields.push({
@@ -1 +1 @@
1
- {"version":3,"file":"deviceTransactionConfig.js","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":";;AAIA,wGAAwG;AACxG,SAAS,0BAA0B,CAAC,EAClC,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAMlC;IACC,MAAM,MAAM,GAAwC,EAAE,CAAC;IAEvD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,kBAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"deviceTransactionConfig.js","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":";;AAIA,wGAAwG;AACxG,KAAK,UAAU,0BAA0B,CAAC,EACxC,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAMlC;IACC,MAAM,MAAM,GAAwC,EAAE,CAAC;IAEvD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,kBAAe,0BAA0B,CAAC"}
@@ -6,6 +6,6 @@ declare function getDeviceTransactionConfig({ transaction: {}, status: { amount,
6
6
  parentAccount: Account | null | undefined;
7
7
  transaction: Transaction;
8
8
  status: TransactionStatus;
9
- }): Array<CommonDeviceTransactionField>;
9
+ }): Promise<Array<CommonDeviceTransactionField>>;
10
10
  export default getDeviceTransactionConfig;
11
11
  //# sourceMappingURL=deviceTransactionConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deviceTransactionConfig.d.ts","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAGhG,iBAAS,0BAA0B,CAAC,EAClC,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAClC,EAAE;IACD,OAAO,EAAE,WAAW,CAAC;IACrB,aAAa,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG,KAAK,CAAC,4BAA4B,CAAC,CAkBtC;AAED,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"deviceTransactionConfig.d.ts","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAGhG,iBAAe,0BAA0B,CAAC,EACxC,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAClC,EAAE;IACD,OAAO,EAAE,WAAW,CAAC;IACrB,aAAa,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAkB/C;AAED,eAAe,0BAA0B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // This method adds additional fields that need to be reviewed when signing a transaction on the device.
2
- function getDeviceTransactionConfig({ transaction: {}, status: { amount, estimatedFees }, }) {
2
+ async function getDeviceTransactionConfig({ transaction: {}, status: { amount, estimatedFees }, }) {
3
3
  const fields = [];
4
4
  if (!amount.isZero()) {
5
5
  fields.push({
@@ -1 +1 @@
1
- {"version":3,"file":"deviceTransactionConfig.js","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":"AAIA,wGAAwG;AACxG,SAAS,0BAA0B,CAAC,EAClC,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAMlC;IACC,MAAM,MAAM,GAAwC,EAAE,CAAC;IAEvD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"deviceTransactionConfig.js","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":"AAIA,wGAAwG;AACxG,KAAK,UAAU,0BAA0B,CAAC,EACxC,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAMlC;IACC,MAAM,MAAM,GAAwC,EAAE,CAAC;IAEvD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,eAAe,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/coin-module-boilerplate",
3
- "version": "4.9.0-nightly.1",
3
+ "version": "4.9.0-nightly.2",
4
4
  "description": "Boilerplate coin integration",
5
5
  "keywords": [
6
6
  "Ledger",
@@ -101,13 +101,13 @@
101
101
  "bignumber.js": "^9.1.2",
102
102
  "invariant": "^2.2.4",
103
103
  "rxjs": "^7.8.1",
104
- "@ledgerhq/coin-framework": "^6.8.0-nightly.1",
105
- "@ledgerhq/cryptoassets": "^13.31.1-nightly.0",
104
+ "@ledgerhq/coin-framework": "^6.8.0-nightly.2",
105
+ "@ledgerhq/cryptoassets": "^13.32.0-nightly.1",
106
106
  "@ledgerhq/devices": "8.6.2-nightly.0",
107
107
  "@ledgerhq/errors": "^6.27.0-nightly.0",
108
108
  "@ledgerhq/live-env": "^2.19.0",
109
- "@ledgerhq/live-network": "^2.0.20",
110
- "@ledgerhq/types-live": "^6.88.0-nightly.0"
109
+ "@ledgerhq/live-network": "^2.1.0-nightly.0",
110
+ "@ledgerhq/types-live": "^6.88.0-nightly.1"
111
111
  },
112
112
  "devDependencies": {
113
113
  "@types/invariant": "^2.2.37",
@@ -118,7 +118,7 @@
118
118
  "ts-jest": "^29.1.1",
119
119
  "typescript": "^5.4.5",
120
120
  "@ledgerhq/types-cryptoassets": "^7.29.0",
121
- "@ledgerhq/disable-network-setup": "^0.0.0"
121
+ "@ledgerhq/disable-network-setup": "^0.1.0-nightly.0"
122
122
  },
123
123
  "scripts": {
124
124
  "clean": "rimraf lib lib-es",
@@ -2,21 +2,19 @@ import getDeviceTransactionConfig from "./deviceTransactionConfig";
2
2
  import BigNumber from "bignumber.js";
3
3
 
4
4
  describe("getDeviceTransactionConfig", () => {
5
- it("should return amount field when it's more than 0", () => {
6
- expect(
7
- getDeviceTransactionConfig({
8
- transaction: {},
9
- status: { amount: new BigNumber(1), estimatedFees: new BigNumber(0) },
10
- } as any)[0],
11
- ).toEqual({ type: "amount", label: "Amount" });
5
+ it("should return amount field when it's more than 0", async () => {
6
+ const result = await getDeviceTransactionConfig({
7
+ transaction: {},
8
+ status: { amount: new BigNumber(1), estimatedFees: new BigNumber(0) },
9
+ } as any);
10
+ expect(result[0]).toEqual({ type: "amount", label: "Amount" });
12
11
  });
13
12
 
14
- it("should return fee field when it's more than 0", () => {
15
- expect(
16
- getDeviceTransactionConfig({
17
- transaction: {},
18
- status: { amount: new BigNumber(0), estimatedFees: new BigNumber(1) },
19
- } as any)[0],
20
- ).toEqual({ type: "fees", label: "Fees" });
13
+ it("should return fee field when it's more than 0", async () => {
14
+ const result = await getDeviceTransactionConfig({
15
+ transaction: {},
16
+ status: { amount: new BigNumber(0), estimatedFees: new BigNumber(1) },
17
+ } as any);
18
+ expect(result[0]).toEqual({ type: "fees", label: "Fees" });
21
19
  });
22
20
  });
@@ -3,7 +3,7 @@ import type { Transaction, TransactionStatus } from "../types";
3
3
  import type { CommonDeviceTransactionField } from "@ledgerhq/coin-framework/transaction/common";
4
4
 
5
5
  // This method adds additional fields that need to be reviewed when signing a transaction on the device.
6
- function getDeviceTransactionConfig({
6
+ async function getDeviceTransactionConfig({
7
7
  transaction: {},
8
8
  status: { amount, estimatedFees },
9
9
  }: {
@@ -11,7 +11,7 @@ function getDeviceTransactionConfig({
11
11
  parentAccount: Account | null | undefined;
12
12
  transaction: Transaction;
13
13
  status: TransactionStatus;
14
- }): Array<CommonDeviceTransactionField> {
14
+ }): Promise<Array<CommonDeviceTransactionField>> {
15
15
  const fields: Array<CommonDeviceTransactionField> = [];
16
16
 
17
17
  if (!amount.isZero()) {