@ledgerhq/coin-polkadot 0.2.0-notarizer.0 → 0.2.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/CHANGELOG.md +31 -10
- package/package.json +11 -8
- package/src/bridge/js.ts +12 -14
- package/src/hw-getAddress.ts +9 -16
- package/src/js-signOperation.ts +65 -66
- package/lib/account.d.ts +0 -15
- package/lib/account.d.ts.map +0 -1
- package/lib/account.js +0 -112
- package/lib/account.js.map +0 -1
- package/lib/address.d.ts +0 -7
- package/lib/address.d.ts.map +0 -1
- package/lib/address.js +0 -25
- package/lib/address.js.map +0 -1
- package/lib/api/bisontrails.d.ts +0 -13
- package/lib/api/bisontrails.d.ts.map +0 -1
- package/lib/api/bisontrails.js +0 -250
- package/lib/api/bisontrails.js.map +0 -1
- package/lib/api/common.d.ts +0 -12
- package/lib/api/common.d.ts.map +0 -1
- package/lib/api/common.js +0 -41
- package/lib/api/common.js.map +0 -1
- package/lib/api/index.d.ts +0 -61
- package/lib/api/index.d.ts.map +0 -1
- package/lib/api/index.js +0 -167
- package/lib/api/index.js.map +0 -1
- package/lib/api/sidecar.d.ts +0 -177
- package/lib/api/sidecar.d.ts.map +0 -1
- package/lib/api/sidecar.js +0 -577
- package/lib/api/sidecar.js.map +0 -1
- package/lib/api/sidecar.types.d.ts +0 -163
- package/lib/api/sidecar.types.d.ts.map +0 -1
- package/lib/api/sidecar.types.js +0 -3
- package/lib/api/sidecar.types.js.map +0 -1
- package/lib/api/sidecar.unit.test.d.ts +0 -2
- package/lib/api/sidecar.unit.test.d.ts.map +0 -1
- package/lib/api/sidecar.unit.test.js +0 -60
- package/lib/api/sidecar.unit.test.js.map +0 -1
- package/lib/bridge/js.d.ts +0 -13
- package/lib/bridge/js.d.ts.map +0 -1
- package/lib/bridge/js.js +0 -85
- package/lib/bridge/js.js.map +0 -1
- package/lib/bridge.integration.test.d.ts +0 -4
- package/lib/bridge.integration.test.d.ts.map +0 -1
- package/lib/bridge.integration.test.js +0 -728
- package/lib/bridge.integration.test.js.map +0 -1
- package/lib/cli-transaction.d.ts +0 -46
- package/lib/cli-transaction.d.ts.map +0 -1
- package/lib/cli-transaction.js +0 -133
- package/lib/cli-transaction.js.map +0 -1
- package/lib/deviceTransactionConfig.d.ts +0 -16
- package/lib/deviceTransactionConfig.d.ts.map +0 -1
- package/lib/deviceTransactionConfig.js +0 -165
- package/lib/deviceTransactionConfig.js.map +0 -1
- package/lib/errors.d.ts +0 -37
- package/lib/errors.d.ts.map +0 -1
- package/lib/errors.js +0 -17
- package/lib/errors.js.map +0 -1
- package/lib/hw-getAddress.d.ts +0 -6
- package/lib/hw-getAddress.d.ts.map +0 -1
- package/lib/hw-getAddress.js +0 -23
- package/lib/hw-getAddress.js.map +0 -1
- package/lib/js-buildTransaction.d.ts +0 -26
- package/lib/js-buildTransaction.d.ts.map +0 -1
- package/lib/js-buildTransaction.js +0 -188
- package/lib/js-buildTransaction.js.map +0 -1
- package/lib/js-buildTransaction.test.d.ts +0 -2
- package/lib/js-buildTransaction.test.d.ts.map +0 -1
- package/lib/js-buildTransaction.test.js +0 -190
- package/lib/js-buildTransaction.test.js.map +0 -1
- package/lib/js-createTransaction.d.ts +0 -9
- package/lib/js-createTransaction.d.ts.map +0 -1
- package/lib/js-createTransaction.js +0 -22
- package/lib/js-createTransaction.js.map +0 -1
- package/lib/js-estimateMaxSpendable.d.ts +0 -16
- package/lib/js-estimateMaxSpendable.d.ts.map +0 -1
- package/lib/js-estimateMaxSpendable.js +0 -39
- package/lib/js-estimateMaxSpendable.js.map +0 -1
- package/lib/js-getFeesForTransaction.d.ts +0 -15
- package/lib/js-getFeesForTransaction.d.ts.map +0 -1
- package/lib/js-getFeesForTransaction.js +0 -40
- package/lib/js-getFeesForTransaction.js.map +0 -1
- package/lib/js-getTransactionStatus.d.ts +0 -19
- package/lib/js-getTransactionStatus.d.ts.map +0 -1
- package/lib/js-getTransactionStatus.js +0 -250
- package/lib/js-getTransactionStatus.js.map +0 -1
- package/lib/js-prepareTransaction.d.ts +0 -10
- package/lib/js-prepareTransaction.d.ts.map +0 -1
- package/lib/js-prepareTransaction.js +0 -36
- package/lib/js-prepareTransaction.js.map +0 -1
- package/lib/js-signOperation.d.ts +0 -29
- package/lib/js-signOperation.d.ts.map +0 -1
- package/lib/js-signOperation.js +0 -167
- package/lib/js-signOperation.js.map +0 -1
- package/lib/js-synchronisation.d.ts +0 -4
- package/lib/js-synchronisation.d.ts.map +0 -1
- package/lib/js-synchronisation.js +0 -54
- package/lib/js-synchronisation.js.map +0 -1
- package/lib/logic.d.ts +0 -107
- package/lib/logic.d.ts.map +0 -1
- package/lib/logic.js +0 -240
- package/lib/logic.js.map +0 -1
- package/lib/platformAdapter.d.ts +0 -11
- package/lib/platformAdapter.d.ts.map +0 -1
- package/lib/platformAdapter.js +0 -14
- package/lib/platformAdapter.js.map +0 -1
- package/lib/platformAdapter.test.d.ts +0 -2
- package/lib/platformAdapter.test.d.ts.map +0 -1
- package/lib/platformAdapter.test.js +0 -51
- package/lib/platformAdapter.test.js.map +0 -1
- package/lib/polkadot-crypto.d.ts +0 -2
- package/lib/polkadot-crypto.d.ts.map +0 -1
- package/lib/polkadot-crypto.js +0 -14
- package/lib/polkadot-crypto.js.map +0 -1
- package/lib/preload.d.ts +0 -15
- package/lib/preload.d.ts.map +0 -1
- package/lib/preload.js +0 -124
- package/lib/preload.js.map +0 -1
- package/lib/serialization.d.ts +0 -7
- package/lib/serialization.d.ts.map +0 -1
- package/lib/serialization.js +0 -64
- package/lib/serialization.js.map +0 -1
- package/lib/signer.d.ts +0 -14
- package/lib/signer.d.ts.map +0 -1
- package/lib/signer.js +0 -3
- package/lib/signer.js.map +0 -1
- package/lib/specs.d.ts +0 -7
- package/lib/specs.d.ts.map +0 -1
- package/lib/specs.js +0 -231
- package/lib/specs.js.map +0 -1
- package/lib/speculos-deviceActions.d.ts +0 -4
- package/lib/speculos-deviceActions.d.ts.map +0 -1
- package/lib/speculos-deviceActions.js +0 -85
- package/lib/speculos-deviceActions.js.map +0 -1
- package/lib/transaction.d.ts +0 -15
- package/lib/transaction.d.ts.map +0 -1
- package/lib/transaction.js +0 -38
- package/lib/transaction.js.map +0 -1
- package/lib/types.d.ts +0 -96
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -3
- package/lib/types.js.map +0 -1
- package/lib-es/account.d.ts +0 -15
- package/lib-es/account.d.ts.map +0 -1
- package/lib-es/account.js +0 -104
- package/lib-es/account.js.map +0 -1
- package/lib-es/address.d.ts +0 -7
- package/lib-es/address.d.ts.map +0 -1
- package/lib-es/address.js +0 -21
- package/lib-es/address.js.map +0 -1
- package/lib-es/api/bisontrails.d.ts +0 -13
- package/lib-es/api/bisontrails.d.ts.map +0 -1
- package/lib-es/api/bisontrails.js +0 -243
- package/lib-es/api/bisontrails.js.map +0 -1
- package/lib-es/api/common.d.ts +0 -12
- package/lib-es/api/common.d.ts.map +0 -1
- package/lib-es/api/common.js +0 -37
- package/lib-es/api/common.js.map +0 -1
- package/lib-es/api/index.d.ts +0 -61
- package/lib-es/api/index.d.ts.map +0 -1
- package/lib-es/api/index.js +0 -163
- package/lib-es/api/index.js.map +0 -1
- package/lib-es/api/sidecar.d.ts +0 -177
- package/lib-es/api/sidecar.d.ts.map +0 -1
- package/lib-es/api/sidecar.js +0 -557
- package/lib-es/api/sidecar.js.map +0 -1
- package/lib-es/api/sidecar.types.d.ts +0 -163
- package/lib-es/api/sidecar.types.d.ts.map +0 -1
- package/lib-es/api/sidecar.types.js +0 -2
- package/lib-es/api/sidecar.types.js.map +0 -1
- package/lib-es/api/sidecar.unit.test.d.ts +0 -2
- package/lib-es/api/sidecar.unit.test.d.ts.map +0 -1
- package/lib-es/api/sidecar.unit.test.js +0 -55
- package/lib-es/api/sidecar.unit.test.js.map +0 -1
- package/lib-es/bridge/js.d.ts +0 -13
- package/lib-es/bridge/js.d.ts.map +0 -1
- package/lib-es/bridge/js.js +0 -76
- package/lib-es/bridge/js.js.map +0 -1
- package/lib-es/bridge.integration.test.d.ts +0 -4
- package/lib-es/bridge.integration.test.d.ts.map +0 -1
- package/lib-es/bridge.integration.test.js +0 -725
- package/lib-es/bridge.integration.test.js.map +0 -1
- package/lib-es/cli-transaction.d.ts +0 -46
- package/lib-es/cli-transaction.d.ts.map +0 -1
- package/lib-es/cli-transaction.js +0 -127
- package/lib-es/cli-transaction.js.map +0 -1
- package/lib-es/deviceTransactionConfig.d.ts +0 -16
- package/lib-es/deviceTransactionConfig.d.ts.map +0 -1
- package/lib-es/deviceTransactionConfig.js +0 -163
- package/lib-es/deviceTransactionConfig.js.map +0 -1
- package/lib-es/errors.d.ts +0 -37
- package/lib-es/errors.d.ts.map +0 -1
- package/lib-es/errors.js +0 -14
- package/lib-es/errors.js.map +0 -1
- package/lib-es/hw-getAddress.d.ts +0 -6
- package/lib-es/hw-getAddress.d.ts.map +0 -1
- package/lib-es/hw-getAddress.js +0 -21
- package/lib-es/hw-getAddress.js.map +0 -1
- package/lib-es/js-buildTransaction.d.ts +0 -26
- package/lib-es/js-buildTransaction.d.ts.map +0 -1
- package/lib-es/js-buildTransaction.js +0 -184
- package/lib-es/js-buildTransaction.js.map +0 -1
- package/lib-es/js-buildTransaction.test.d.ts +0 -2
- package/lib-es/js-buildTransaction.test.d.ts.map +0 -1
- package/lib-es/js-buildTransaction.test.js +0 -185
- package/lib-es/js-buildTransaction.test.js.map +0 -1
- package/lib-es/js-createTransaction.d.ts +0 -9
- package/lib-es/js-createTransaction.d.ts.map +0 -1
- package/lib-es/js-createTransaction.js +0 -20
- package/lib-es/js-createTransaction.js.map +0 -1
- package/lib-es/js-estimateMaxSpendable.d.ts +0 -16
- package/lib-es/js-estimateMaxSpendable.d.ts.map +0 -1
- package/lib-es/js-estimateMaxSpendable.js +0 -34
- package/lib-es/js-estimateMaxSpendable.js.map +0 -1
- package/lib-es/js-getFeesForTransaction.d.ts +0 -15
- package/lib-es/js-getFeesForTransaction.d.ts.map +0 -1
- package/lib-es/js-getFeesForTransaction.js +0 -38
- package/lib-es/js-getFeesForTransaction.js.map +0 -1
- package/lib-es/js-getTransactionStatus.d.ts +0 -19
- package/lib-es/js-getTransactionStatus.d.ts.map +0 -1
- package/lib-es/js-getTransactionStatus.js +0 -248
- package/lib-es/js-getTransactionStatus.js.map +0 -1
- package/lib-es/js-prepareTransaction.d.ts +0 -10
- package/lib-es/js-prepareTransaction.d.ts.map +0 -1
- package/lib-es/js-prepareTransaction.js +0 -31
- package/lib-es/js-prepareTransaction.js.map +0 -1
- package/lib-es/js-signOperation.d.ts +0 -29
- package/lib-es/js-signOperation.d.ts.map +0 -1
- package/lib-es/js-signOperation.js +0 -162
- package/lib-es/js-signOperation.js.map +0 -1
- package/lib-es/js-synchronisation.d.ts +0 -4
- package/lib-es/js-synchronisation.d.ts.map +0 -1
- package/lib-es/js-synchronisation.js +0 -50
- package/lib-es/js-synchronisation.js.map +0 -1
- package/lib-es/logic.d.ts +0 -107
- package/lib-es/logic.d.ts.map +0 -1
- package/lib-es/logic.js +0 -220
- package/lib-es/logic.js.map +0 -1
- package/lib-es/platformAdapter.d.ts +0 -11
- package/lib-es/platformAdapter.d.ts.map +0 -1
- package/lib-es/platformAdapter.js +0 -12
- package/lib-es/platformAdapter.js.map +0 -1
- package/lib-es/platformAdapter.test.d.ts +0 -2
- package/lib-es/platformAdapter.test.d.ts.map +0 -1
- package/lib-es/platformAdapter.test.js +0 -46
- package/lib-es/platformAdapter.test.js.map +0 -1
- package/lib-es/polkadot-crypto.d.ts +0 -2
- package/lib-es/polkadot-crypto.d.ts.map +0 -1
- package/lib-es/polkadot-crypto.js +0 -10
- package/lib-es/polkadot-crypto.js.map +0 -1
- package/lib-es/preload.d.ts +0 -15
- package/lib-es/preload.d.ts.map +0 -1
- package/lib-es/preload.js +0 -115
- package/lib-es/preload.js.map +0 -1
- package/lib-es/serialization.d.ts +0 -7
- package/lib-es/serialization.d.ts.map +0 -1
- package/lib-es/serialization.js +0 -57
- package/lib-es/serialization.js.map +0 -1
- package/lib-es/signer.d.ts +0 -14
- package/lib-es/signer.d.ts.map +0 -1
- package/lib-es/signer.js +0 -2
- package/lib-es/signer.js.map +0 -1
- package/lib-es/specs.d.ts +0 -7
- package/lib-es/specs.d.ts.map +0 -1
- package/lib-es/specs.js +0 -226
- package/lib-es/specs.js.map +0 -1
- package/lib-es/speculos-deviceActions.d.ts +0 -4
- package/lib-es/speculos-deviceActions.d.ts.map +0 -1
- package/lib-es/speculos-deviceActions.js +0 -82
- package/lib-es/speculos-deviceActions.js.map +0 -1
- package/lib-es/transaction.d.ts +0 -15
- package/lib-es/transaction.d.ts.map +0 -1
- package/lib-es/transaction.js +0 -32
- package/lib-es/transaction.js.map +0 -1
- package/lib-es/types.d.ts +0 -96
- package/lib-es/types.d.ts.map +0 -1
- package/lib-es/types.js +0 -2
- package/lib-es/types.js.map +0 -1
- package/src/signer.ts +0 -13
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,42 @@
|
|
|
1
1
|
# @ledgerhq/coin-polkadot
|
|
2
2
|
|
|
3
|
-
## 0.2.0
|
|
3
|
+
## 0.2.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
7
|
+
- [#3660](https://github.com/LedgerHQ/ledger-live/pull/3660) [`895205e898`](https://github.com/LedgerHQ/ledger-live/commit/895205e8981612616d3147de9261d19051dbc0b2) Thanks [@live-github-bot](https://github.com/apps/live-github-bot)! - Update lockedbalance retrieval polkadot
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
|
-
- Updated dependencies [[`
|
|
12
|
-
- @ledgerhq/
|
|
13
|
-
- @ledgerhq/cryptoassets@9.8.0
|
|
14
|
-
- @ledgerhq/
|
|
15
|
-
- @ledgerhq/types-
|
|
16
|
-
- @ledgerhq/
|
|
17
|
-
- @ledgerhq/
|
|
18
|
-
- @ledgerhq/
|
|
11
|
+
- Updated dependencies [[`9adc1862dd`](https://github.com/LedgerHQ/ledger-live/commit/9adc1862dda605a722d19f3b6895bd324834c914), [`4a1454beb3`](https://github.com/LedgerHQ/ledger-live/commit/4a1454beb3f86405ba2686e07879c12a7d35ad8e), [`809065c571`](https://github.com/LedgerHQ/ledger-live/commit/809065c57198646a49adea112b9d799e35a57d25), [`d1aa522db7`](https://github.com/LedgerHQ/ledger-live/commit/d1aa522db75f7ea850efe412abaa4dc7d37af6b7), [`ebe5b07afe`](https://github.com/LedgerHQ/ledger-live/commit/ebe5b07afec441ea3e2d9103da9e1175972add47)]:
|
|
12
|
+
- @ledgerhq/errors@6.12.7
|
|
13
|
+
- @ledgerhq/cryptoassets@9.8.0
|
|
14
|
+
- @ledgerhq/types-cryptoassets@7.2.1
|
|
15
|
+
- @ledgerhq/types-live@6.35.1
|
|
16
|
+
- @ledgerhq/coin-framework@0.3.6
|
|
17
|
+
- @ledgerhq/devices@8.0.4
|
|
18
|
+
- @ledgerhq/hw-app-polkadot@6.27.16
|
|
19
|
+
- @ledgerhq/live-portfolio@0.0.8
|
|
20
|
+
|
|
21
|
+
## 0.2.0-next.1
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- [#3660](https://github.com/LedgerHQ/ledger-live/pull/3660) [`895205e898`](https://github.com/LedgerHQ/ledger-live/commit/895205e8981612616d3147de9261d19051dbc0b2) Thanks [@live-github-bot](https://github.com/apps/live-github-bot)! - Update lockedbalance retrieval polkadot
|
|
26
|
+
|
|
27
|
+
## 0.1.7-next.0
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`9adc1862dd`](https://github.com/LedgerHQ/ledger-live/commit/9adc1862dda605a722d19f3b6895bd324834c914), [`4a1454beb3`](https://github.com/LedgerHQ/ledger-live/commit/4a1454beb3f86405ba2686e07879c12a7d35ad8e), [`809065c571`](https://github.com/LedgerHQ/ledger-live/commit/809065c57198646a49adea112b9d799e35a57d25), [`d1aa522db7`](https://github.com/LedgerHQ/ledger-live/commit/d1aa522db75f7ea850efe412abaa4dc7d37af6b7), [`ebe5b07afe`](https://github.com/LedgerHQ/ledger-live/commit/ebe5b07afec441ea3e2d9103da9e1175972add47)]:
|
|
32
|
+
- @ledgerhq/errors@6.12.7-next.0
|
|
33
|
+
- @ledgerhq/cryptoassets@9.8.0-next.0
|
|
34
|
+
- @ledgerhq/types-cryptoassets@7.2.1-next.0
|
|
35
|
+
- @ledgerhq/types-live@6.35.1-next.0
|
|
36
|
+
- @ledgerhq/coin-framework@0.3.6-next.0
|
|
37
|
+
- @ledgerhq/devices@8.0.4-next.0
|
|
38
|
+
- @ledgerhq/hw-app-polkadot@6.27.16-next.0
|
|
39
|
+
- @ledgerhq/live-portfolio@0.0.8-next.0
|
|
19
40
|
|
|
20
41
|
## 0.1.6
|
|
21
42
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/coin-polkadot",
|
|
3
|
-
"version": "0.2.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Ledger Polkadot Coin integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -54,14 +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.6
|
|
58
|
-
"@ledgerhq/cryptoassets": "^9.8.0
|
|
59
|
-
"@ledgerhq/devices": "^8.0.4
|
|
60
|
-
"@ledgerhq/errors": "^6.12.7
|
|
61
|
-
"@ledgerhq/
|
|
57
|
+
"@ledgerhq/coin-framework": "^0.3.6",
|
|
58
|
+
"@ledgerhq/cryptoassets": "^9.8.0",
|
|
59
|
+
"@ledgerhq/devices": "^8.0.4",
|
|
60
|
+
"@ledgerhq/errors": "^6.12.7",
|
|
61
|
+
"@ledgerhq/hw-app-polkadot": "^6.27.16",
|
|
62
|
+
"@ledgerhq/live-env": "^0.3.0",
|
|
63
|
+
"@ledgerhq/live-portfolio": "^0.0.8",
|
|
64
|
+
"@ledgerhq/live-promise": "^0.0.1",
|
|
62
65
|
"@ledgerhq/logs": "^6.10.1",
|
|
63
|
-
"@ledgerhq/types-cryptoassets": "^7.
|
|
64
|
-
"@ledgerhq/types-live": "^6.
|
|
66
|
+
"@ledgerhq/types-cryptoassets": "^7.2.1",
|
|
67
|
+
"@ledgerhq/types-live": "^6.35.1"
|
|
65
68
|
},
|
|
66
69
|
"devDependencies": {
|
|
67
70
|
"@types/invariant": "^2.2.2",
|
package/src/bridge/js.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import getAddressWrapper from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
|
|
2
2
|
import {
|
|
3
|
+
DeviceCommunication,
|
|
3
4
|
makeAccountBridgeReceive,
|
|
4
5
|
makeScanAccounts,
|
|
5
6
|
makeSync,
|
|
6
7
|
} from "@ledgerhq/coin-framework/bridge/jsHelpers";
|
|
7
8
|
import type { NetworkRequestCall } from "@ledgerhq/coin-framework/network";
|
|
8
9
|
import { patchOperationWithHash } from "@ledgerhq/coin-framework/operation";
|
|
9
|
-
import { LRUCacheFn } from "@ledgerhq/coin-framework/cache";
|
|
10
|
-
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
|
11
10
|
import type {
|
|
12
11
|
AccountBridge,
|
|
13
12
|
CurrencyBridge,
|
|
@@ -15,7 +14,7 @@ import type {
|
|
|
15
14
|
SignedOperation,
|
|
16
15
|
} from "@ledgerhq/types-live";
|
|
17
16
|
import { PolkadotAPI } from "../api";
|
|
18
|
-
import
|
|
17
|
+
import getAddress from "../hw-getAddress";
|
|
19
18
|
import createTransaction from "../js-createTransaction";
|
|
20
19
|
import estimateMaxSpendable from "../js-estimateMaxSpendable";
|
|
21
20
|
import getTransactionStatus from "../js-getTransactionStatus";
|
|
@@ -26,7 +25,7 @@ import { loadPolkadotCrypto } from "../polkadot-crypto";
|
|
|
26
25
|
import { assignFromAccountRaw, assignToAccountRaw } from "../serialization";
|
|
27
26
|
import { getPreloadStrategy, hydrate, preload } from "../preload";
|
|
28
27
|
import type { Transaction } from "../types";
|
|
29
|
-
import {
|
|
28
|
+
import { LRUCacheFn } from "@ledgerhq/coin-framework/cache";
|
|
30
29
|
|
|
31
30
|
const updateTransaction = (t: Transaction, patch: Partial<Transaction>) => ({
|
|
32
31
|
...t,
|
|
@@ -50,17 +49,17 @@ const broadcast =
|
|
|
50
49
|
};
|
|
51
50
|
|
|
52
51
|
export function buildCurrencyBridge(
|
|
53
|
-
|
|
52
|
+
deviceCommunication: DeviceCommunication,
|
|
54
53
|
network: NetworkRequestCall,
|
|
55
54
|
cacheFn: LRUCacheFn,
|
|
56
55
|
): CurrencyBridge {
|
|
57
56
|
const polkadotAPI = new PolkadotAPI(network, cacheFn);
|
|
58
|
-
const getAddress = resolver(signerContext);
|
|
59
57
|
|
|
60
58
|
const getAccountShape = makeGetAccountShape(polkadotAPI);
|
|
61
59
|
const scanAccounts = makeScanAccounts({
|
|
62
60
|
getAccountShape,
|
|
63
|
-
|
|
61
|
+
deviceCommunication,
|
|
62
|
+
getAddressFn: getAddress,
|
|
64
63
|
});
|
|
65
64
|
|
|
66
65
|
return {
|
|
@@ -72,15 +71,14 @@ export function buildCurrencyBridge(
|
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
export function buildAccountBridge(
|
|
75
|
-
|
|
74
|
+
deviceCommunication: DeviceCommunication,
|
|
76
75
|
network: NetworkRequestCall,
|
|
77
76
|
cacheFn: LRUCacheFn,
|
|
78
77
|
): AccountBridge<Transaction> {
|
|
79
78
|
const polkadotAPI = new PolkadotAPI(network, cacheFn);
|
|
80
|
-
const getAddress = resolver(signerContext);
|
|
81
79
|
|
|
82
|
-
const receive = makeAccountBridgeReceive(getAddressWrapper(getAddress));
|
|
83
|
-
const signOperation = buildSignOperation(
|
|
80
|
+
const receive = makeAccountBridgeReceive(getAddressWrapper(getAddress), deviceCommunication);
|
|
81
|
+
const signOperation = buildSignOperation(deviceCommunication, polkadotAPI);
|
|
84
82
|
const getAccountShape = makeGetAccountShape(polkadotAPI);
|
|
85
83
|
const sync = makeSync({ getAccountShape });
|
|
86
84
|
|
|
@@ -100,12 +98,12 @@ export function buildAccountBridge(
|
|
|
100
98
|
}
|
|
101
99
|
|
|
102
100
|
export function createBridges(
|
|
103
|
-
|
|
101
|
+
deviceCommunication: DeviceCommunication,
|
|
104
102
|
network: NetworkRequestCall,
|
|
105
103
|
cacheFn: LRUCacheFn,
|
|
106
104
|
) {
|
|
107
105
|
return {
|
|
108
|
-
currencyBridge: buildCurrencyBridge(
|
|
109
|
-
accountBridge: buildAccountBridge(
|
|
106
|
+
currencyBridge: buildCurrencyBridge(deviceCommunication, network, cacheFn),
|
|
107
|
+
accountBridge: buildAccountBridge(deviceCommunication, network, cacheFn),
|
|
110
108
|
};
|
|
111
109
|
}
|
package/src/hw-getAddress.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { GetAddressOptions } from "@ledgerhq/coin-framework/derivation";
|
|
4
|
-
import { PolkadotAddress, PolkadotSignature, PolkadotSigner } from "./signer";
|
|
1
|
+
import Polkadot from "@ledgerhq/hw-app-polkadot";
|
|
2
|
+
import type { Resolver } from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
|
|
5
3
|
|
|
6
|
-
const resolver = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
address: r.address,
|
|
15
|
-
publicKey: r.pubKey,
|
|
16
|
-
path,
|
|
17
|
-
};
|
|
4
|
+
const resolver: Resolver = async (transport, { path, verify }) => {
|
|
5
|
+
const polkadot = new Polkadot(transport);
|
|
6
|
+
const r = await polkadot.getAddress(path, verify);
|
|
7
|
+
return {
|
|
8
|
+
address: r.address,
|
|
9
|
+
publicKey: r.pubKey,
|
|
10
|
+
path,
|
|
18
11
|
};
|
|
19
12
|
};
|
|
20
13
|
|
package/src/js-signOperation.ts
CHANGED
|
@@ -3,22 +3,20 @@ import { Observable } from "rxjs";
|
|
|
3
3
|
import { TypeRegistry } from "@polkadot/types";
|
|
4
4
|
import { u8aConcat } from "@polkadot/util";
|
|
5
5
|
import { FeeNotLoaded } from "@ledgerhq/errors";
|
|
6
|
+
import Polkadot from "@ledgerhq/hw-app-polkadot";
|
|
6
7
|
import type { PolkadotAccount, Transaction } from "./types";
|
|
7
8
|
import type {
|
|
8
9
|
Account,
|
|
9
|
-
DeviceId,
|
|
10
10
|
Operation,
|
|
11
11
|
OperationType,
|
|
12
12
|
SignOperationEvent,
|
|
13
13
|
SignOperationFnSignature,
|
|
14
14
|
} from "@ledgerhq/types-live";
|
|
15
|
+
import { DeviceCommunication } from "@ledgerhq/coin-framework/bridge/jsHelpers";
|
|
15
16
|
import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
|
|
16
|
-
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
|
17
17
|
import { buildTransaction } from "./js-buildTransaction";
|
|
18
18
|
import { calculateAmount, getNonce, isFirstBond } from "./logic";
|
|
19
19
|
import { PolkadotAPI } from "./api";
|
|
20
|
-
import { PolkadotAddress, PolkadotSignature, PolkadotSigner } from "./signer";
|
|
21
|
-
|
|
22
20
|
const MODE_TO_TYPE = {
|
|
23
21
|
send: "OUT",
|
|
24
22
|
bond: "BOND",
|
|
@@ -145,7 +143,7 @@ export const fakeSignExtrinsic = async (
|
|
|
145
143
|
*/
|
|
146
144
|
const buildSignOperation =
|
|
147
145
|
(
|
|
148
|
-
|
|
146
|
+
withDevice: DeviceCommunication,
|
|
149
147
|
polkadotAPI: PolkadotAPI,
|
|
150
148
|
): SignOperationFnSignature<Transaction> =>
|
|
151
149
|
({
|
|
@@ -154,68 +152,69 @@ const buildSignOperation =
|
|
|
154
152
|
transaction,
|
|
155
153
|
}: {
|
|
156
154
|
account: Account;
|
|
157
|
-
deviceId:
|
|
155
|
+
deviceId: any;
|
|
158
156
|
transaction: Transaction;
|
|
159
157
|
}): Observable<SignOperationEvent> =>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
o
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
158
|
+
withDevice(deviceId)(
|
|
159
|
+
transport =>
|
|
160
|
+
new Observable(o => {
|
|
161
|
+
async function main() {
|
|
162
|
+
o.next({
|
|
163
|
+
type: "device-signature-requested",
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
if (!transaction.fees) {
|
|
167
|
+
throw new FeeNotLoaded();
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Ensure amount is filled when useAllAmount
|
|
171
|
+
const transactionToSign = {
|
|
172
|
+
...transaction,
|
|
173
|
+
amount: calculateAmount({
|
|
174
|
+
a: account as PolkadotAccount,
|
|
175
|
+
t: transaction,
|
|
176
|
+
}),
|
|
177
|
+
};
|
|
178
|
+
const { unsigned, registry } = await buildTransaction(polkadotAPI)(
|
|
179
|
+
account as PolkadotAccount,
|
|
180
|
+
transactionToSign,
|
|
181
|
+
true,
|
|
182
|
+
);
|
|
183
|
+
const payload = registry
|
|
184
|
+
.createType("ExtrinsicPayload", unsigned, {
|
|
185
|
+
version: unsigned.version,
|
|
186
|
+
})
|
|
187
|
+
.toU8a({
|
|
188
|
+
method: true,
|
|
189
|
+
});
|
|
190
|
+
// Sign by device
|
|
191
|
+
const polkadot = new Polkadot(transport);
|
|
192
|
+
// FIXME: the type of payload Uint8Array is not compatible with the signature of sign which accept a string
|
|
193
|
+
const r = await polkadot.sign(account.freshAddressPath, payload as any);
|
|
194
|
+
const signed = await signExtrinsic(unsigned, r.signature, registry);
|
|
195
|
+
o.next({
|
|
196
|
+
type: "device-signature-granted",
|
|
197
|
+
});
|
|
198
|
+
const operation = buildOptimisticOperation(
|
|
199
|
+
account as PolkadotAccount,
|
|
200
|
+
transactionToSign,
|
|
201
|
+
transactionToSign.fees ?? new BigNumber(0),
|
|
202
|
+
);
|
|
203
|
+
o.next({
|
|
204
|
+
type: "signed",
|
|
205
|
+
signedOperation: {
|
|
206
|
+
operation,
|
|
207
|
+
signature: signed,
|
|
208
|
+
expirationDate: null,
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
main().then(
|
|
214
|
+
() => o.complete(),
|
|
215
|
+
e => o.error(e),
|
|
216
|
+
);
|
|
217
|
+
}),
|
|
218
|
+
);
|
|
220
219
|
|
|
221
220
|
export default buildSignOperation;
|
package/lib/account.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Operation } from "@ledgerhq/types-live";
|
|
2
|
-
import { PolkadotAccount } from "./types";
|
|
3
|
-
import type { Unit } from "@ledgerhq/types-cryptoassets";
|
|
4
|
-
declare function formatOperationSpecifics(op: Operation, unit: Unit | null | undefined): string;
|
|
5
|
-
declare function formatAccountSpecifics(account: PolkadotAccount): string;
|
|
6
|
-
export declare function fromOperationExtraRaw(extra: Record<string, any> | null | undefined): Record<string, any> | null | undefined;
|
|
7
|
-
export declare function toOperationExtraRaw(extra: Record<string, any> | null | undefined): Record<string, any> | null | undefined;
|
|
8
|
-
declare const _default: {
|
|
9
|
-
formatAccountSpecifics: typeof formatAccountSpecifics;
|
|
10
|
-
formatOperationSpecifics: typeof formatOperationSpecifics;
|
|
11
|
-
fromOperationExtraRaw: typeof fromOperationExtraRaw;
|
|
12
|
-
toOperationExtraRaw: typeof toOperationExtraRaw;
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
|
15
|
-
//# sourceMappingURL=account.d.ts.map
|
package/lib/account.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAqB,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEzD,iBAAS,wBAAwB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAoCtF;AAED,iBAAS,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAmChE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,0CA0BlF;AACD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,0CA0BhF;;;;;;;AACD,wBAKE"}
|
package/lib/account.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
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.toOperationExtraRaw = exports.fromOperationExtraRaw = void 0;
|
|
7
|
-
const invariant_1 = __importDefault(require("invariant"));
|
|
8
|
-
const bignumber_js_1 = require("bignumber.js");
|
|
9
|
-
const index_1 = require("@ledgerhq/coin-framework/account/index");
|
|
10
|
-
const index_2 = require("@ledgerhq/coin-framework/currencies/index");
|
|
11
|
-
function formatOperationSpecifics(op, unit) {
|
|
12
|
-
const { validators, bondedAmount, unbondedAmount, withdrawUnbondedAmount, validatorStash, amount, } = op.extra;
|
|
13
|
-
let str = (validators || []).map((v) => `\n ${v}`).join("");
|
|
14
|
-
const formatConfig = {
|
|
15
|
-
disableRounding: true,
|
|
16
|
-
alwaysShowSign: false,
|
|
17
|
-
showCode: true,
|
|
18
|
-
};
|
|
19
|
-
str +=
|
|
20
|
-
bondedAmount && !bondedAmount.isNaN()
|
|
21
|
-
? `\n bondedAmount: ${unit ? (0, index_2.formatCurrencyUnit)(unit, bondedAmount, formatConfig) : bondedAmount}`
|
|
22
|
-
: unbondedAmount && !unbondedAmount.isNaN()
|
|
23
|
-
? `\n unbondedAmount: ${unit ? (0, index_2.formatCurrencyUnit)(unit, unbondedAmount, formatConfig) : unbondedAmount}`
|
|
24
|
-
: withdrawUnbondedAmount && !withdrawUnbondedAmount.isNaN()
|
|
25
|
-
? `\n withdrawUnbondedAmount: ${unit
|
|
26
|
-
? (0, index_2.formatCurrencyUnit)(unit, withdrawUnbondedAmount, formatConfig)
|
|
27
|
-
: withdrawUnbondedAmount}`
|
|
28
|
-
: "";
|
|
29
|
-
str += validatorStash ? `\n validatorStash: ${validatorStash}` : "";
|
|
30
|
-
str += amount
|
|
31
|
-
? `\n amount: ${unit ? (0, index_2.formatCurrencyUnit)(unit, amount, formatConfig) : amount}`
|
|
32
|
-
: "";
|
|
33
|
-
return str;
|
|
34
|
-
}
|
|
35
|
-
function formatAccountSpecifics(account) {
|
|
36
|
-
var _a;
|
|
37
|
-
const polkadotResources = account.polkadotResources;
|
|
38
|
-
(0, invariant_1.default)(polkadotResources, "polkadot account expected");
|
|
39
|
-
const unit = (0, index_1.getAccountUnit)(account);
|
|
40
|
-
const formatConfig = {
|
|
41
|
-
disableRounding: true,
|
|
42
|
-
alwaysShowSign: false,
|
|
43
|
-
showCode: true,
|
|
44
|
-
};
|
|
45
|
-
let str = " ";
|
|
46
|
-
str += (0, index_2.formatCurrencyUnit)(unit, account.spendableBalance, formatConfig) + " spendable. ";
|
|
47
|
-
if (polkadotResources.lockedBalance.gt(0)) {
|
|
48
|
-
str += (0, index_2.formatCurrencyUnit)(unit, polkadotResources.lockedBalance, formatConfig) + " locked. ";
|
|
49
|
-
}
|
|
50
|
-
if (polkadotResources.unlockedBalance.gt(0)) {
|
|
51
|
-
str +=
|
|
52
|
-
(0, index_2.formatCurrencyUnit)(unit, polkadotResources.unlockedBalance, formatConfig) + " unlocked. ";
|
|
53
|
-
}
|
|
54
|
-
if (polkadotResources.stash) {
|
|
55
|
-
str += "\nstash : " + polkadotResources.stash;
|
|
56
|
-
}
|
|
57
|
-
if (polkadotResources.controller) {
|
|
58
|
-
str += "\ncontroller : " + polkadotResources.controller;
|
|
59
|
-
}
|
|
60
|
-
if ((_a = polkadotResources.nominations) === null || _a === void 0 ? void 0 : _a.length) {
|
|
61
|
-
str += "\nNominations\n";
|
|
62
|
-
str += polkadotResources.nominations.map(v => ` to ${v.address}`).join("\n");
|
|
63
|
-
}
|
|
64
|
-
return str;
|
|
65
|
-
}
|
|
66
|
-
function fromOperationExtraRaw(extra) {
|
|
67
|
-
if (extra && extra.transferAmount) {
|
|
68
|
-
extra = Object.assign(Object.assign({}, extra), { transferAmount: extra.transferAmount.toString() });
|
|
69
|
-
}
|
|
70
|
-
if (extra && extra.bondedAmount) {
|
|
71
|
-
return Object.assign(Object.assign({}, extra), { bondedAmount: new bignumber_js_1.BigNumber(extra.bondedAmount) });
|
|
72
|
-
}
|
|
73
|
-
if (extra && extra.unbondedAmount) {
|
|
74
|
-
return Object.assign(Object.assign({}, extra), { unbondedAmount: new bignumber_js_1.BigNumber(extra.unbondedAmount) });
|
|
75
|
-
}
|
|
76
|
-
if (extra && extra.withdrawUnbondedAmount) {
|
|
77
|
-
return Object.assign(Object.assign({}, extra), { withdrawUnbondedAmount: new bignumber_js_1.BigNumber(extra.withdrawUnbondedAmount) });
|
|
78
|
-
}
|
|
79
|
-
// for subscan reward & slash
|
|
80
|
-
if (extra && extra.amount) {
|
|
81
|
-
return Object.assign(Object.assign({}, extra), { amount: new bignumber_js_1.BigNumber(extra.amount) });
|
|
82
|
-
}
|
|
83
|
-
return extra;
|
|
84
|
-
}
|
|
85
|
-
exports.fromOperationExtraRaw = fromOperationExtraRaw;
|
|
86
|
-
function toOperationExtraRaw(extra) {
|
|
87
|
-
if (extra && extra.transferAmount) {
|
|
88
|
-
extra = Object.assign(Object.assign({}, extra), { transferAmount: extra.transferAmount.toString() });
|
|
89
|
-
}
|
|
90
|
-
if (extra && extra.bondedAmount) {
|
|
91
|
-
return Object.assign(Object.assign({}, extra), { bondedAmount: extra.bondedAmount.toString() });
|
|
92
|
-
}
|
|
93
|
-
if (extra && extra.unbondedAmount) {
|
|
94
|
-
return Object.assign(Object.assign({}, extra), { unbondedAmount: extra.unbondedAmount.toString() });
|
|
95
|
-
}
|
|
96
|
-
if (extra && extra.withdrawUnbondedAmount) {
|
|
97
|
-
return Object.assign(Object.assign({}, extra), { withdrawUnbondedAmount: extra.withdrawUnbondedAmount.toString() });
|
|
98
|
-
}
|
|
99
|
-
// for subscan reward & slash
|
|
100
|
-
if (extra && extra.amount) {
|
|
101
|
-
return Object.assign(Object.assign({}, extra), { amount: extra.amount.toString() });
|
|
102
|
-
}
|
|
103
|
-
return extra;
|
|
104
|
-
}
|
|
105
|
-
exports.toOperationExtraRaw = toOperationExtraRaw;
|
|
106
|
-
exports.default = {
|
|
107
|
-
formatAccountSpecifics,
|
|
108
|
-
formatOperationSpecifics,
|
|
109
|
-
fromOperationExtraRaw,
|
|
110
|
-
toOperationExtraRaw,
|
|
111
|
-
};
|
|
112
|
-
//# sourceMappingURL=account.js.map
|
package/lib/account.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"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"}
|
package/lib/address.d.ts
DELETED
package/lib/address.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AAEH,eAAO,MAAM,cAAc,YAChB,MAAM,eACH,MAAM,KACjB,OASF,CAAC"}
|
package/lib/address.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidAddress = void 0;
|
|
4
|
-
const util_crypto_1 = require("@polkadot/util-crypto");
|
|
5
|
-
const util_1 = require("@polkadot/util");
|
|
6
|
-
const POLKADOT_SS58_PREFIX = 0;
|
|
7
|
-
/**
|
|
8
|
-
* Returns true if address is valid, false if it's invalid (can't parse or wrong checksum)
|
|
9
|
-
*
|
|
10
|
-
* @param {*} address
|
|
11
|
-
*/
|
|
12
|
-
// TODO Cache this to improve perf
|
|
13
|
-
const isValidAddress = (address, ss58Format = POLKADOT_SS58_PREFIX) => {
|
|
14
|
-
if (!address)
|
|
15
|
-
return false;
|
|
16
|
-
try {
|
|
17
|
-
(0, util_crypto_1.encodeAddress)((0, util_1.isHex)(address) ? (0, util_1.hexToU8a)(address) : (0, util_crypto_1.decodeAddress)(address, false, ss58Format));
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
exports.isValidAddress = isValidAddress;
|
|
25
|
-
//# sourceMappingURL=address.js.map
|
package/lib/address.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":";;;AAAA,uDAAqE;AACrE,yCAAiD;AAEjD,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B;;;;GAIG;AACH,kCAAkC;AAC3B,MAAM,cAAc,GAAG,CAC5B,OAAe,EACf,aAAqB,oBAAoB,EAChC,EAAE;IACX,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAE3B,IAAI;QACF,IAAA,2BAAa,EAAC,IAAA,YAAK,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,eAAQ,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,2BAAa,EAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;QAC9F,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;AACH,CAAC,CAAC;AAZW,QAAA,cAAc,kBAYzB"}
|
package/lib/api/bisontrails.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { NetworkRequestCall } from "@ledgerhq/coin-framework/network";
|
|
2
|
-
import type { Operation } from "@ledgerhq/types-live";
|
|
3
|
-
/**
|
|
4
|
-
* Fetch all operations for a single account from indexer
|
|
5
|
-
*
|
|
6
|
-
* @param {string} accountId
|
|
7
|
-
* @param {string} addr
|
|
8
|
-
* @param {number} startAt - blockHeight after which you fetch this op (included)
|
|
9
|
-
*
|
|
10
|
-
* @return {Operation[]}
|
|
11
|
-
*/
|
|
12
|
-
export declare const getOperations: (network: NetworkRequestCall) => (accountId: string, addr: string, startAt?: number) => Promise<Operation[]>;
|
|
13
|
-
//# sourceMappingURL=bisontrails.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bisontrails.d.ts","sourceRoot":"","sources":["../../src/api/bisontrails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAM3E,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAoSrE;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,YACd,kBAAkB,iBACV,MAAM,QAAQ,MAAM,2CAErC,CAAC"}
|