@ledgerhq/coin-polkadot 0.1.4 → 0.1.5-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,19 @@
1
1
  # @ledgerhq/coin-polkadot
2
2
 
3
+ ## 0.1.5-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`77f990e207`](https://github.com/LedgerHQ/ledger-live/commit/77f990e2075c7c9a4be69b364e3754b449c7a546), [`817a8dd811`](https://github.com/LedgerHQ/ledger-live/commit/817a8dd8112ff7c4640852ab4e47ea0436df2ec1), [`77f990e207`](https://github.com/LedgerHQ/ledger-live/commit/77f990e2075c7c9a4be69b364e3754b449c7a546), [`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)]:
8
+ - @ledgerhq/errors@6.12.6-next.0
9
+ - @ledgerhq/cryptoassets@9.6.0-next.0
10
+ - @ledgerhq/coin-framework@0.3.4-next.0
11
+ - @ledgerhq/live-env@0.3.0-next.0
12
+ - @ledgerhq/types-live@6.34.1-next.0
13
+ - @ledgerhq/devices@8.0.3-next.0
14
+ - @ledgerhq/hw-app-polkadot@6.27.15-next.0
15
+ - @ledgerhq/live-portfolio@0.0.6-next.0
16
+
3
17
  ## 0.1.4
4
18
 
5
19
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/coin-polkadot",
3
- "version": "0.1.4",
3
+ "version": "0.1.5-next.0",
4
4
  "description": "Ledger Polkadot Coin integration",
5
5
  "keywords": [
6
6
  "Ledger",
@@ -54,17 +54,17 @@
54
54
  "invariant": "^2.2.2",
55
55
  "lodash": "^4.17.21",
56
56
  "rxjs": "^6.6.7",
57
- "@ledgerhq/coin-framework": "^0.3.3",
58
- "@ledgerhq/cryptoassets": "^9.5.0",
59
- "@ledgerhq/devices": "^8.0.2",
60
- "@ledgerhq/errors": "^6.12.5",
61
- "@ledgerhq/hw-app-polkadot": "^6.27.14",
62
- "@ledgerhq/live-env": "^0.2.0",
63
- "@ledgerhq/live-portfolio": "^0.0.5",
57
+ "@ledgerhq/coin-framework": "^0.3.4-next.0",
58
+ "@ledgerhq/cryptoassets": "^9.6.0-next.0",
59
+ "@ledgerhq/devices": "^8.0.3-next.0",
60
+ "@ledgerhq/errors": "^6.12.6-next.0",
61
+ "@ledgerhq/hw-app-polkadot": "^6.27.15-next.0",
62
+ "@ledgerhq/live-env": "^0.3.0-next.0",
63
+ "@ledgerhq/live-portfolio": "^0.0.6-next.0",
64
64
  "@ledgerhq/live-promise": "^0.0.1",
65
65
  "@ledgerhq/logs": "^6.10.1",
66
66
  "@ledgerhq/types-cryptoassets": "^7.2.0",
67
- "@ledgerhq/types-live": "^6.34.0"
67
+ "@ledgerhq/types-live": "^6.34.1-next.0"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/invariant": "^2.2.2",
package/src/specs.ts CHANGED
@@ -77,9 +77,11 @@ const polkadot: AppSpec<Transaction> = {
77
77
  .div(1.9 + 0.2 * Math.random())
78
78
  .integerValue();
79
79
 
80
- if (!sibling.used && amount.lt(EXISTENTIAL_DEPOSIT)) {
80
+ invariant(amount.gte(0), "not enough balance to do a transfer");
81
+
82
+ if (sibling.balance.eq(0) && amount.lt(EXISTENTIAL_DEPOSIT)) {
81
83
  invariant(
82
- account.spendableBalance.gt(
84
+ account.spendableBalance.gte(
83
85
  EXISTENTIAL_DEPOSIT.plus(POLKADOT_MIN_SAFE)
84
86
  ),
85
87
  "send is too low to activate account"
@@ -123,6 +125,12 @@ const polkadot: AppSpec<Transaction> = {
123
125
  );
124
126
  const sibling = pickSiblings(siblings, maxAccounts);
125
127
 
128
+ invariant(
129
+ sibling.balance.eq(0) &&
130
+ account.spendableBalance.lte(EXISTENTIAL_DEPOSIT),
131
+ "send is too low to activate account"
132
+ );
133
+
126
134
  return {
127
135
  transaction: bridge.createTransaction(account),
128
136
  updates: [
@@ -9,6 +9,14 @@ import {
9
9
  export const acceptTransaction: DeviceAction<Transaction, any> =
10
10
  deviceActionFlow({
11
11
  steps: [
12
+ {
13
+ title: "Please",
14
+ button: SpeculosButton.RIGHT,
15
+ },
16
+ {
17
+ title: "Review",
18
+ button: SpeculosButton.RIGHT,
19
+ },
12
20
  {
13
21
  title: "Staking",
14
22
  button: SpeculosButton.RIGHT,