@ledgerhq/coin-framework 0.3.3 → 0.3.4-next.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @ledgerhq/coin-framework
2
2
 
3
+ ## 0.3.4-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3306](https://github.com/LedgerHQ/ledger-live/pull/3306) [`77f990e207`](https://github.com/LedgerHQ/ledger-live/commit/77f990e2075c7c9a4be69b364e3754b449c7a546) Thanks [@chabroA](https://github.com/chabroA)! - Add optionnal headers field to network type
8
+
9
+ - Updated dependencies [[`77f990e207`](https://github.com/LedgerHQ/ledger-live/commit/77f990e2075c7c9a4be69b364e3754b449c7a546), [`817a8dd811`](https://github.com/LedgerHQ/ledger-live/commit/817a8dd8112ff7c4640852ab4e47ea0436df2ec1), [`22491091f7`](https://github.com/LedgerHQ/ledger-live/commit/22491091f7b4e06ee6a0cdf964498aa5b08d6eb0), [`745fbf2a54`](https://github.com/LedgerHQ/ledger-live/commit/745fbf2a54cdc34aea938d7fbe4c8b198dc36b54), [`7cf49e1919`](https://github.com/LedgerHQ/ledger-live/commit/7cf49e1919466836e9025693ed07b18ebf99041a)]:
10
+ - @ledgerhq/errors@6.12.6-next.0
11
+ - @ledgerhq/cryptoassets@9.6.0-next.0
12
+ - @ledgerhq/live-env@0.3.0-next.0
13
+ - @ledgerhq/types-live@6.34.1-next.0
14
+ - @ledgerhq/devices@8.0.3-next.0
15
+ - @ledgerhq/hw-transport@6.28.4-next.0
16
+ - @ledgerhq/live-portfolio@0.0.6-next.0
17
+
3
18
  ## 0.3.3
4
19
 
5
20
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/coin-framework",
3
- "version": "0.3.3",
3
+ "version": "0.3.4-next.0",
4
4
  "description": "Ledger framework for Coin integration",
5
5
  "keywords": [
6
6
  "Ledger",
@@ -61,16 +61,16 @@
61
61
  "prando": "^6.0.1",
62
62
  "rxjs": "^6.6.7",
63
63
  "rxjs-compat": "^6.6.7",
64
- "@ledgerhq/cryptoassets": "^9.5.0",
65
- "@ledgerhq/devices": "^8.0.2",
66
- "@ledgerhq/errors": "^6.12.5",
67
- "@ledgerhq/hw-transport": "^6.28.3",
68
- "@ledgerhq/live-env": "^0.2.0",
69
- "@ledgerhq/live-portfolio": "^0.0.5",
64
+ "@ledgerhq/cryptoassets": "^9.6.0-next.0",
65
+ "@ledgerhq/devices": "^8.0.3-next.0",
66
+ "@ledgerhq/errors": "^6.12.6-next.0",
67
+ "@ledgerhq/hw-transport": "^6.28.4-next.0",
68
+ "@ledgerhq/live-env": "^0.3.0-next.0",
69
+ "@ledgerhq/live-portfolio": "^0.0.6-next.0",
70
70
  "@ledgerhq/live-promise": "^0.0.1",
71
71
  "@ledgerhq/logs": "^6.10.1",
72
72
  "@ledgerhq/types-cryptoassets": "^7.2.0",
73
- "@ledgerhq/types-live": "^6.34.0"
73
+ "@ledgerhq/types-live": "^6.34.1-next.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/invariant": "^2.2.2",
package/src/bot/specs.ts CHANGED
@@ -13,6 +13,7 @@ import { Account, TransactionCommon } from "@ledgerhq/types-live";
13
13
  import { botTest } from "./bot-test-context";
14
14
  import { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
15
15
  import BigNumber from "bignumber.js";
16
+ import { DeviceModelId } from "@ledgerhq/devices";
16
17
 
17
18
  export { botTest };
18
19
 
@@ -94,10 +95,6 @@ export function deviceActionFlow<T extends TransactionCommon>(
94
95
  description: FlowDesc<T>
95
96
  ): DeviceAction<T, State<T>> {
96
97
  return (arg: DeviceActionArg<T, State<T>>) => {
97
- invariant(
98
- arg.appCandidate.model === "nanoS",
99
- "FIXME: stepper logic is only implemented for Nano S"
100
- );
101
98
  const { transport, event, state, disableStrictStepValueValidation } = arg;
102
99
  let { finalState, stepTitle, stepValue, acc, currentStep } = state || {
103
100
  finalState: false,
@@ -118,13 +115,20 @@ export function deviceActionFlow<T extends TransactionCommon>(
118
115
  currentStep.stepValueTransform || stepValueTransformDefault;
119
116
 
120
117
  if (!ignoreAssertionFailure && !disableStrictStepValueValidation) {
121
- botTest("deviceAction confirm step '" + stepTitle + "'", () =>
118
+ botTest("deviceAction confirm step '" + stepTitle + "'", () => {
122
119
  expect({
123
120
  [stepTitle]: stepValueTransform(stepValue),
124
121
  }).toMatchObject({
125
- [stepTitle]: expectedValue(arg, acc).trim(),
126
- })
127
- );
122
+ // FIXME: OCR of speculos couldn't retrieve S properly
123
+ // Issue on speculos repository : https://github.com/LedgerHQ/speculos/issues/204
124
+ [stepTitle]: expectedValue(arg, acc)
125
+ .replace(
126
+ /S/g,
127
+ arg.appCandidate.model === DeviceModelId.nanoS ? "S" : ""
128
+ )
129
+ .trim(),
130
+ });
131
+ });
128
132
  }
129
133
  }
130
134
 
package/src/network.ts CHANGED
@@ -3,4 +3,5 @@ export type NetworkRequestCall = (options: {
3
3
  method: MethodType;
4
4
  url?: string;
5
5
  data?: any;
6
+ headers?: any;
6
7
  }) => Promise<any>;