@ledgerhq/live-common 21.32.0 → 21.32.4
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/lib/__tests__/families/bitcoin/wallet-btc/wallet.integration.test.js +1 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/wallet.integration.test.js.map +1 -1
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.d.ts +2 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.d.ts.map +1 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.js +126 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.js.map +1 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.js +0 -10
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.js.map +1 -1
- package/lib/api/Ethereum.d.ts.map +1 -1
- package/lib/api/Ethereum.js +1 -0
- package/lib/api/Ethereum.js.map +1 -1
- package/lib/apps/logic.d.ts.map +1 -1
- package/lib/apps/logic.js +7 -5
- package/lib/apps/logic.js.map +1 -1
- package/lib/apps/polyfill.d.ts.map +1 -1
- package/lib/apps/polyfill.js +1 -0
- package/lib/apps/polyfill.js.map +1 -1
- package/lib/bot/engine.d.ts.map +1 -1
- package/lib/bot/engine.js +3 -0
- package/lib/bot/engine.js.map +1 -1
- package/lib/env.d.ts +10 -5
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +5 -0
- package/lib/env.js.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/errors.d.ts +3 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +3 -2
- package/lib/errors.js.map +1 -1
- package/lib/exchange/platform/transfer/index.d.ts.map +1 -1
- package/lib/exchange/platform/transfer/index.js +15 -1
- package/lib/exchange/platform/transfer/index.js.map +1 -1
- package/lib/families/algorand/buildTransaction.d.ts +2 -2
- package/lib/families/algorand/buildTransaction.d.ts.map +1 -1
- package/lib/families/algorand/buildTransaction.js +13 -19
- package/lib/families/algorand/buildTransaction.js.map +1 -1
- package/lib/families/algorand/js-getFeesForTransaction.js +4 -6
- package/lib/families/algorand/js-getFeesForTransaction.js.map +1 -1
- package/lib/families/algorand/js-signOperation.js +3 -7
- package/lib/families/algorand/js-signOperation.js.map +1 -1
- package/lib/families/algorand/js-synchronization.d.ts.map +1 -1
- package/lib/families/algorand/js-synchronization.js +1 -0
- package/lib/families/algorand/js-synchronization.js.map +1 -1
- package/lib/families/bitcoin/js-signOperation.d.ts.map +1 -1
- package/lib/families/bitcoin/js-signOperation.js +3 -5
- package/lib/families/bitcoin/js-signOperation.js.map +1 -1
- package/lib/families/bitcoin/js-synchronisation.js +4 -4
- package/lib/families/bitcoin/js-synchronisation.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/base.d.ts +4 -3
- package/lib/families/bitcoin/wallet-btc/crypto/base.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/base.js +8 -7
- package/lib/families/bitcoin/wallet-btc/crypto/base.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bip32.js +2 -2
- package/lib/families/bitcoin/wallet-btc/crypto/bip32.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.d.ts +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.js +3 -7
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.d.ts +3 -4
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js +27 -53
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/decred.d.ts +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/decred.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/decred.js +2 -7
- package/lib/families/bitcoin/wallet-btc/crypto/decred.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.d.ts +1 -6
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js +0 -51
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/types.d.ts +1 -0
- package/lib/families/bitcoin/wallet-btc/crypto/types.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zec.d.ts +5 -6
- package/lib/families/bitcoin/wallet-btc/crypto/zec.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zec.js +63 -33
- package/lib/families/bitcoin/wallet-btc/crypto/zec.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zen.d.ts +3 -5
- package/lib/families/bitcoin/wallet-btc/crypto/zen.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zen.js +77 -46
- package/lib/families/bitcoin/wallet-btc/crypto/zen.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/explorer/index.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/explorer/index.js +20 -0
- package/lib/families/bitcoin/wallet-btc/explorer/index.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/storage/types.d.ts +0 -1
- package/lib/families/bitcoin/wallet-btc/storage/types.d.ts.map +1 -1
- package/lib/families/celo/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/celo/speculos-deviceActions.js +1 -2
- package/lib/families/celo/speculos-deviceActions.js.map +1 -1
- package/lib/families/ethereum/signOperation.d.ts.map +1 -1
- package/lib/families/ethereum/signOperation.js +26 -15
- package/lib/families/ethereum/signOperation.js.map +1 -1
- package/lib/families/ethereum/specs.d.ts.map +1 -1
- package/lib/families/ethereum/specs.js +2 -4
- package/lib/families/ethereum/specs.js.map +1 -1
- package/lib/families/ethereum/transaction.d.ts +4 -1
- package/lib/families/ethereum/transaction.d.ts.map +1 -1
- package/lib/families/ethereum/transaction.js +15 -27
- package/lib/families/ethereum/transaction.js.map +1 -1
- package/lib/families/solana/api/chain/instruction/token/types.d.ts +1 -1
- package/lib/families/solana/specs.js +1 -1
- package/lib/families/solana/specs.js.map +1 -1
- package/lib/families/solana/test-dataset.d.ts.map +1 -1
- package/lib/families/solana/test-dataset.js +1 -2
- package/lib/families/solana/test-dataset.js.map +1 -1
- package/lib/families/tezos/bakers.whitelist-default.d.ts.map +1 -1
- package/lib/families/tezos/bakers.whitelist-default.js +1 -1
- package/lib/families/tezos/bakers.whitelist-default.js.map +1 -1
- package/lib/families/tezos/bridge/js.d.ts.map +1 -1
- package/lib/families/tezos/bridge/js.js +2 -1
- package/lib/families/tezos/bridge/js.js.map +1 -1
- package/lib/families/tezos/synchronisation.d.ts.map +1 -1
- package/lib/families/tezos/synchronisation.js +2 -0
- package/lib/families/tezos/synchronisation.js.map +1 -1
- package/lib/families/tezos/test-specifics.d.ts.map +1 -1
- package/lib/families/tezos/test-specifics.js +1 -0
- package/lib/families/tezos/test-specifics.js.map +1 -1
- package/lib/families/tron/synchronisation.test.js +1 -0
- package/lib/families/tron/synchronisation.test.js.map +1 -1
- package/lib/featureFlags/FeatureToggle.js +2 -2
- package/lib/featureFlags/FeatureToggle.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +1 -1
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/types.d.ts +1 -1
- package/lib/featureFlags/types.d.ts.map +1 -1
- package/lib/load/speculos.d.ts +7 -0
- package/lib/load/speculos.d.ts.map +1 -1
- package/lib/load/speculos.js +27 -11
- package/lib/load/speculos.js.map +1 -1
- package/lib/platform/PlatformAppProvider/helpers.d.ts +1 -0
- package/lib/platform/PlatformAppProvider/helpers.d.ts.map +1 -1
- package/lib/platform/PlatformAppProvider/helpers.js +23 -1
- package/lib/platform/PlatformAppProvider/helpers.js.map +1 -1
- package/lib/platform/PlatformAppProvider/index.d.ts.map +1 -1
- package/lib/platform/PlatformAppProvider/index.js +2 -1
- package/lib/platform/PlatformAppProvider/index.js.map +1 -1
- package/package.json +21 -21
- package/src/__tests__/__snapshots__/all.libcore.ts.snap +109 -23
- package/src/__tests__/families/bitcoin/wallet-btc/wallet.integration.test.ts +2 -0
- package/src/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.ts +78 -0
- package/src/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.ts +0 -11
- package/src/api/Ethereum.ts +1 -0
- package/src/apps/logic.ts +6 -3
- package/src/apps/polyfill.ts +1 -0
- package/src/bot/engine.ts +3 -0
- package/src/env.ts +5 -0
- package/src/errors.ts +3 -0
- package/src/exchange/platform/transfer/index.ts +21 -1
- package/src/families/algorand/buildTransaction.ts +4 -8
- package/src/families/algorand/js-getFeesForTransaction.ts +1 -1
- package/src/families/algorand/js-signOperation.ts +2 -2
- package/src/families/algorand/js-synchronization.ts +1 -0
- package/src/families/bitcoin/js-signOperation.ts +3 -5
- package/src/families/bitcoin/js-synchronisation.ts +4 -4
- package/src/families/bitcoin/wallet-btc/crypto/base.ts +31 -18
- package/src/families/bitcoin/wallet-btc/crypto/bip32.ts +2 -2
- package/src/families/bitcoin/wallet-btc/crypto/bitcoin.ts +3 -17
- package/src/families/bitcoin/wallet-btc/crypto/bitcoincash.ts +5 -39
- package/src/families/bitcoin/wallet-btc/crypto/decred.ts +2 -15
- package/src/families/bitcoin/wallet-btc/crypto/litecoin.ts +1 -71
- package/src/families/bitcoin/wallet-btc/crypto/types.ts +7 -0
- package/src/families/bitcoin/wallet-btc/crypto/zec.ts +23 -41
- package/src/families/bitcoin/wallet-btc/crypto/zen.ts +30 -49
- package/src/families/bitcoin/wallet-btc/explorer/index.ts +20 -0
- package/src/families/bitcoin/wallet-btc/storage/types.ts +0 -1
- package/src/families/celo/speculos-deviceActions.ts +0 -1
- package/src/families/ethereum/signOperation.ts +21 -20
- package/src/families/ethereum/specs.ts +0 -2
- package/src/families/ethereum/transaction.ts +10 -24
- package/src/families/solana/specs.ts +1 -1
- package/src/families/solana/test-dataset.ts +3 -4
- package/src/families/tezos/bakers.whitelist-default.ts +0 -2
- package/src/families/tezos/bridge/js.ts +6 -1
- package/src/families/tezos/synchronisation.ts +2 -0
- package/src/families/tezos/test-specifics.ts +1 -0
- package/src/families/tron/synchronisation.test.ts +2 -0
- package/src/featureFlags/FeatureToggle.tsx +2 -2
- package/src/featureFlags/defaultFeatures.ts +1 -1
- package/src/featureFlags/types.ts +1 -1
- package/src/load/speculos.ts +23 -10
- package/src/platform/PlatformAppProvider/helpers.ts +29 -0
- package/src/platform/PlatformAppProvider/index.tsx +3 -2
- package/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +0 -6195
|
@@ -852,7 +852,6 @@ Array [
|
|
|
852
852
|
"bc1q73ngvy3pxn92d5zx8pwdxwelczqk5r9ceyka8a",
|
|
853
853
|
"bc1qhzzzm86w9j5fvhr4pql303ehrhqnzk63npc0ge",
|
|
854
854
|
"bc1qyanx2ql0yjxuzhaqe7tkqj5spx548sv04mpyfq",
|
|
855
|
-
"bc1qyanx2ql0yjxuzhaqe7tkqj5spx548sv04mpyfq",
|
|
856
855
|
],
|
|
857
856
|
"standard": undefined,
|
|
858
857
|
"tokenId": undefined,
|
|
@@ -1176,7 +1175,6 @@ Array [
|
|
|
1176
1175
|
],
|
|
1177
1176
|
"senders": Array [
|
|
1178
1177
|
"bc1q9m02yv9c53enxk247lxkgj5dgn6hm27f0rc34p",
|
|
1179
|
-
"bc1q9m02yv9c53enxk247lxkgj5dgn6hm27f0rc34p",
|
|
1180
1178
|
],
|
|
1181
1179
|
"standard": undefined,
|
|
1182
1180
|
"tokenId": undefined,
|
|
@@ -1670,7 +1668,6 @@ Array [
|
|
|
1670
1668
|
"bc1qkq3uad6kyje3sh4eqvlgudnzp2xc4y27maep7e",
|
|
1671
1669
|
"bc1qsckgz236lhuh42v6nfrky4fn3hs9crhguw3cyl",
|
|
1672
1670
|
"bc1q38wn8h2rxn56f02lulkyjantegnr7906ej0gdh",
|
|
1673
|
-
"bc1q38wn8h2rxn56f02lulkyjantegnr7906ej0gdh",
|
|
1674
1671
|
"bc1qff6tj478qzr6gl30pmfvy3h09ev20ta4x6y8sd",
|
|
1675
1672
|
],
|
|
1676
1673
|
"standard": undefined,
|
|
@@ -2958,7 +2955,6 @@ Array [
|
|
|
2958
2955
|
"bc1qwqfns0rs5zxrrwf80k4xlp4lpnuyc69feh2r3d",
|
|
2959
2956
|
"bc1qpjgn3l5g6j8ry3jkfdwytxdd022ss4gxsll2pp",
|
|
2960
2957
|
"bc1qq42nl3tdcl7zfgkvpa6fm7r899emv7n5ap7tup",
|
|
2961
|
-
"bc1qq42nl3tdcl7zfgkvpa6fm7r899emv7n5ap7tup",
|
|
2962
2958
|
],
|
|
2963
2959
|
"standard": undefined,
|
|
2964
2960
|
"tokenId": undefined,
|
|
@@ -5710,7 +5706,6 @@ Array [
|
|
|
5710
5706
|
],
|
|
5711
5707
|
"senders": Array [
|
|
5712
5708
|
"bc1q9m02yv9c53enxk247lxkgj5dgn6hm27f0rc34p",
|
|
5713
|
-
"bc1q9m02yv9c53enxk247lxkgj5dgn6hm27f0rc34p",
|
|
5714
5709
|
],
|
|
5715
5710
|
"standard": undefined,
|
|
5716
5711
|
"tokenId": undefined,
|
|
@@ -7133,8 +7128,6 @@ Array [
|
|
|
7133
7128
|
"senders": Array [
|
|
7134
7129
|
"1B9ib6VK7ZoZ74nCHjktFnV7G1tdrXEd41",
|
|
7135
7130
|
"1Q8hwXu7Tw551AR3zYf72gZ8pAJpUXFNDY",
|
|
7136
|
-
"1B9ib6VK7ZoZ74nCHjktFnV7G1tdrXEd41",
|
|
7137
|
-
"1B9ib6VK7ZoZ74nCHjktFnV7G1tdrXEd41",
|
|
7138
7131
|
"19zHW8VQ6MZsKWQfzwgPca4qfVLaKgDY4Q",
|
|
7139
7132
|
"1NhBVwi2tWFh3yWmTUSG73NnTXiBbunoig",
|
|
7140
7133
|
],
|
|
@@ -9694,7 +9687,6 @@ Array [
|
|
|
9694
9687
|
"bc1qwqfns0rs5zxrrwf80k4xlp4lpnuyc69feh2r3d",
|
|
9695
9688
|
"bc1qpjgn3l5g6j8ry3jkfdwytxdd022ss4gxsll2pp",
|
|
9696
9689
|
"bc1qq42nl3tdcl7zfgkvpa6fm7r899emv7n5ap7tup",
|
|
9697
|
-
"bc1qq42nl3tdcl7zfgkvpa6fm7r899emv7n5ap7tup",
|
|
9698
9690
|
],
|
|
9699
9691
|
"standard": undefined,
|
|
9700
9692
|
"tokenId": undefined,
|
|
@@ -9991,8 +9983,6 @@ Array [
|
|
|
9991
9983
|
"senders": Array [
|
|
9992
9984
|
"1B9ib6VK7ZoZ74nCHjktFnV7G1tdrXEd41",
|
|
9993
9985
|
"1Q8hwXu7Tw551AR3zYf72gZ8pAJpUXFNDY",
|
|
9994
|
-
"1B9ib6VK7ZoZ74nCHjktFnV7G1tdrXEd41",
|
|
9995
|
-
"1B9ib6VK7ZoZ74nCHjktFnV7G1tdrXEd41",
|
|
9996
9986
|
"19zHW8VQ6MZsKWQfzwgPca4qfVLaKgDY4Q",
|
|
9997
9987
|
"1NhBVwi2tWFh3yWmTUSG73NnTXiBbunoig",
|
|
9998
9988
|
],
|
|
@@ -11209,7 +11199,6 @@ Array [
|
|
|
11209
11199
|
"bc1qkq3uad6kyje3sh4eqvlgudnzp2xc4y27maep7e",
|
|
11210
11200
|
"bc1qsckgz236lhuh42v6nfrky4fn3hs9crhguw3cyl",
|
|
11211
11201
|
"bc1q38wn8h2rxn56f02lulkyjantegnr7906ej0gdh",
|
|
11212
|
-
"bc1q38wn8h2rxn56f02lulkyjantegnr7906ej0gdh",
|
|
11213
11202
|
"bc1qff6tj478qzr6gl30pmfvy3h09ev20ta4x6y8sd",
|
|
11214
11203
|
],
|
|
11215
11204
|
"standard": undefined,
|
|
@@ -13465,7 +13454,6 @@ Array [
|
|
|
13465
13454
|
],
|
|
13466
13455
|
"senders": Array [
|
|
13467
13456
|
"SfbEne7vYyByW6XAcHDJCqFGHAHp9XUUnk",
|
|
13468
|
-
"SfbEne7vYyByW6XAcHDJCqFGHAHp9XUUnk",
|
|
13469
13457
|
],
|
|
13470
13458
|
"standard": undefined,
|
|
13471
13459
|
"tokenId": undefined,
|
|
@@ -18477,7 +18465,6 @@ Array [
|
|
|
18477
18465
|
"RJXH5iiDG9GGP3uFN4y9nZznWm4H7WRpZr",
|
|
18478
18466
|
"RNBip2PqrD9xhkoK613VptMqjfS1Sdwa2p",
|
|
18479
18467
|
"RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj",
|
|
18480
|
-
"RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj",
|
|
18481
18468
|
"RHQeF3BUrN1ub5PqdQhWTAbJB2pv7xukML",
|
|
18482
18469
|
"RKSuhHTzgmc5gnFDCdSJt3U8HWeNYnPuK6",
|
|
18483
18470
|
"RRmshus5KvRKRY1oT56imffSFuxPUPS7s1",
|
|
@@ -18975,7 +18962,6 @@ Array [
|
|
|
18975
18962
|
"senders": Array [
|
|
18976
18963
|
"RLYGtUx7btUCBVZXu7NNYWZ7b8sBAuPrYw",
|
|
18977
18964
|
"RSwtr8GTRhb7DaMxLxsHpJtSwKVvgQykMV",
|
|
18978
|
-
"RSwtr8GTRhb7DaMxLxsHpJtSwKVvgQykMV",
|
|
18979
18965
|
"RWcX7eETAYi5kY6tdnFUnB2Ym91ys8nDS3",
|
|
18980
18966
|
"RL9A3qSt1sFmN53CFhgmgVfbqNcEQr3vb9",
|
|
18981
18967
|
"RSLN3e8R5EAxxpQrTo7DnA28GS1vWWdMrg",
|
|
@@ -21624,7 +21610,6 @@ Array [
|
|
|
21624
21610
|
"RJXH5iiDG9GGP3uFN4y9nZznWm4H7WRpZr",
|
|
21625
21611
|
"RNBip2PqrD9xhkoK613VptMqjfS1Sdwa2p",
|
|
21626
21612
|
"RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj",
|
|
21627
|
-
"RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj",
|
|
21628
21613
|
"RHQeF3BUrN1ub5PqdQhWTAbJB2pv7xukML",
|
|
21629
21614
|
"RKSuhHTzgmc5gnFDCdSJt3U8HWeNYnPuK6",
|
|
21630
21615
|
"RRmshus5KvRKRY1oT56imffSFuxPUPS7s1",
|
|
@@ -23091,7 +23076,6 @@ Array [
|
|
|
23091
23076
|
],
|
|
23092
23077
|
"senders": Array [
|
|
23093
23078
|
"ltc1qpx9fcj5qht64vymj469cfyun73tllcch7qeuwq",
|
|
23094
|
-
"ltc1qpx9fcj5qht64vymj469cfyun73tllcch7qeuwq",
|
|
23095
23079
|
],
|
|
23096
23080
|
"standard": undefined,
|
|
23097
23081
|
"tokenId": undefined,
|
|
@@ -23115,7 +23099,6 @@ Array [
|
|
|
23115
23099
|
],
|
|
23116
23100
|
"senders": Array [
|
|
23117
23101
|
"ltc1qpx9fcj5qht64vymj469cfyun73tllcch7qeuwq",
|
|
23118
|
-
"ltc1qpx9fcj5qht64vymj469cfyun73tllcch7qeuwq",
|
|
23119
23102
|
],
|
|
23120
23103
|
"standard": undefined,
|
|
23121
23104
|
"tokenId": undefined,
|
|
@@ -24010,7 +23993,6 @@ Array [
|
|
|
24010
23993
|
"LRSwoGzTUJicczVJq9UzGG5GAdFg7BkDRn",
|
|
24011
23994
|
],
|
|
24012
23995
|
"senders": Array [
|
|
24013
|
-
"MFjxjn5xQxwyaq6TG8iTsQtDuYxrRoFNUP",
|
|
24014
23996
|
"MFjxjn5xQxwyaq6TG8iTsQtDuYxrRoFNUP",
|
|
24015
23997
|
"MGzg47wRQzhznkqa2zfFMeP6pgtnBx5jox",
|
|
24016
23998
|
],
|
|
@@ -24947,7 +24929,6 @@ Array [
|
|
|
24947
24929
|
"LRSwoGzTUJicczVJq9UzGG5GAdFg7BkDRn",
|
|
24948
24930
|
],
|
|
24949
24931
|
"senders": Array [
|
|
24950
|
-
"MFjxjn5xQxwyaq6TG8iTsQtDuYxrRoFNUP",
|
|
24951
24932
|
"MFjxjn5xQxwyaq6TG8iTsQtDuYxrRoFNUP",
|
|
24952
24933
|
"MGzg47wRQzhznkqa2zfFMeP6pgtnBx5jox",
|
|
24953
24934
|
],
|
|
@@ -26644,7 +26625,6 @@ Array [
|
|
|
26644
26625
|
"QandudfUt26efFQJ8KkUgadiiWUBEbFmtb",
|
|
26645
26626
|
"QUte92ZdeDrscFk369jJNWMeUyMwj6fz21",
|
|
26646
26627
|
"QgFuPJMkucK8mvFdMi2hUENpCervNY9dBt",
|
|
26647
|
-
"QgFuPJMkucK8mvFdMi2hUENpCervNY9dBt",
|
|
26648
26628
|
"QUMmwEdDC2ps2HRetdaboLeakSCWyCK4ja",
|
|
26649
26629
|
],
|
|
26650
26630
|
"standard": undefined,
|
|
@@ -28598,7 +28578,6 @@ Array [
|
|
|
28598
28578
|
"QandudfUt26efFQJ8KkUgadiiWUBEbFmtb",
|
|
28599
28579
|
"QUte92ZdeDrscFk369jJNWMeUyMwj6fz21",
|
|
28600
28580
|
"QgFuPJMkucK8mvFdMi2hUENpCervNY9dBt",
|
|
28601
|
-
"QgFuPJMkucK8mvFdMi2hUENpCervNY9dBt",
|
|
28602
28581
|
"QUMmwEdDC2ps2HRetdaboLeakSCWyCK4ja",
|
|
28603
28582
|
],
|
|
28604
28583
|
"standard": undefined,
|
|
@@ -28728,6 +28707,115 @@ Array [
|
|
|
28728
28707
|
]
|
|
28729
28708
|
`;
|
|
28730
28709
|
|
|
28710
|
+
exports[`solana currency bridge scanAccounts solana seed 1 1`] = `
|
|
28711
|
+
Array [
|
|
28712
|
+
Object {
|
|
28713
|
+
"balance": "83389840",
|
|
28714
|
+
"currencyId": "solana",
|
|
28715
|
+
"derivationMode": "solanaMain",
|
|
28716
|
+
"freshAddress": "AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh",
|
|
28717
|
+
"freshAddressPath": "44'/501'",
|
|
28718
|
+
"freshAddresses": Array [
|
|
28719
|
+
Object {
|
|
28720
|
+
"address": "AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh",
|
|
28721
|
+
"derivationPath": "44'/501'",
|
|
28722
|
+
},
|
|
28723
|
+
],
|
|
28724
|
+
"id": "js:2:solana:AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh:solanaMain",
|
|
28725
|
+
"index": 0,
|
|
28726
|
+
"name": "Solana 1",
|
|
28727
|
+
"nfts": undefined,
|
|
28728
|
+
"operationsCount": 2,
|
|
28729
|
+
"pendingOperations": Array [],
|
|
28730
|
+
"seedIdentifier": "AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh",
|
|
28731
|
+
"spendableBalance": "83389840",
|
|
28732
|
+
"starred": false,
|
|
28733
|
+
"swapHistory": Array [],
|
|
28734
|
+
"syncHash": undefined,
|
|
28735
|
+
"unitMagnitude": 9,
|
|
28736
|
+
"used": true,
|
|
28737
|
+
},
|
|
28738
|
+
Object {
|
|
28739
|
+
"balance": "0",
|
|
28740
|
+
"currencyId": "solana",
|
|
28741
|
+
"derivationMode": "solanaSub",
|
|
28742
|
+
"freshAddress": "6rEgdtB3sgjKJnRE172YEr9z6qUyr4nFW28vJokuD36A",
|
|
28743
|
+
"freshAddressPath": "44'/501'/0'",
|
|
28744
|
+
"freshAddresses": Array [
|
|
28745
|
+
Object {
|
|
28746
|
+
"address": "6rEgdtB3sgjKJnRE172YEr9z6qUyr4nFW28vJokuD36A",
|
|
28747
|
+
"derivationPath": "44'/501'/0'",
|
|
28748
|
+
},
|
|
28749
|
+
],
|
|
28750
|
+
"id": "js:2:solana:6rEgdtB3sgjKJnRE172YEr9z6qUyr4nFW28vJokuD36A:solanaSub",
|
|
28751
|
+
"index": 0,
|
|
28752
|
+
"name": "Solana 1",
|
|
28753
|
+
"nfts": undefined,
|
|
28754
|
+
"operationsCount": 0,
|
|
28755
|
+
"pendingOperations": Array [],
|
|
28756
|
+
"seedIdentifier": "AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh",
|
|
28757
|
+
"spendableBalance": "0",
|
|
28758
|
+
"starred": false,
|
|
28759
|
+
"swapHistory": Array [],
|
|
28760
|
+
"syncHash": undefined,
|
|
28761
|
+
"unitMagnitude": 9,
|
|
28762
|
+
"used": false,
|
|
28763
|
+
},
|
|
28764
|
+
]
|
|
28765
|
+
`;
|
|
28766
|
+
|
|
28767
|
+
exports[`solana currency bridge scanAccounts solana seed 1 2`] = `
|
|
28768
|
+
Array [
|
|
28769
|
+
Array [
|
|
28770
|
+
Object {
|
|
28771
|
+
"accountId": "js:2:solana:AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh:solanaMain",
|
|
28772
|
+
"blockHash": "4NSL4VrfWd2eUccMD95dLQsdy5UGz8yhokpfH1et1R2c",
|
|
28773
|
+
"blockHeight": 108520722,
|
|
28774
|
+
"contract": undefined,
|
|
28775
|
+
"extra": Object {},
|
|
28776
|
+
"fee": "0",
|
|
28777
|
+
"hasFailed": false,
|
|
28778
|
+
"hash": "25KWBvKtVgKR3yoRmozTY6wmiW8atwrnzAnTXdsms8jqg5aR8GnCDxdJzWXtzMZPvbsE6SUuBkGFXudy2mrcTYna",
|
|
28779
|
+
"id": "js:2:solana:AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh:solanaMain-25KWBvKtVgKR3yoRmozTY6wmiW8atwrnzAnTXdsms8jqg5aR8GnCDxdJzWXtzMZPvbsE6SUuBkGFXudy2mrcTYna-IN",
|
|
28780
|
+
"operator": undefined,
|
|
28781
|
+
"recipients": Array [
|
|
28782
|
+
"AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh",
|
|
28783
|
+
],
|
|
28784
|
+
"senders": Array [
|
|
28785
|
+
"7CZgkK494jMdoY8xpXY3ViLjpDGMbNikCzMtAT5cAjKk",
|
|
28786
|
+
],
|
|
28787
|
+
"standard": undefined,
|
|
28788
|
+
"tokenId": undefined,
|
|
28789
|
+
"type": "IN",
|
|
28790
|
+
"value": "93394840",
|
|
28791
|
+
},
|
|
28792
|
+
Object {
|
|
28793
|
+
"accountId": "js:2:solana:AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh:solanaMain",
|
|
28794
|
+
"blockHash": "9tPbgLaETEenufCt5SzXMuWijgFJj549W9j5cJLbaogn",
|
|
28795
|
+
"blockHeight": 108521109,
|
|
28796
|
+
"contract": undefined,
|
|
28797
|
+
"extra": Object {},
|
|
28798
|
+
"fee": "5000",
|
|
28799
|
+
"hasFailed": false,
|
|
28800
|
+
"hash": "A29zPnK1jPr2tGziTnaAvSnadYR2kLCv9sPywj9FJsaEFjtpwmUonspN3WJgz4u6XWmjtVpoFsDrygEnvW51cgk",
|
|
28801
|
+
"id": "js:2:solana:AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh:solanaMain-A29zPnK1jPr2tGziTnaAvSnadYR2kLCv9sPywj9FJsaEFjtpwmUonspN3WJgz4u6XWmjtVpoFsDrygEnvW51cgk-OUT",
|
|
28802
|
+
"operator": undefined,
|
|
28803
|
+
"recipients": Array [
|
|
28804
|
+
"8RtwWeqdFz4EFuZU3MAadfYMWSdRMamjFrfq6BXkHuNN",
|
|
28805
|
+
],
|
|
28806
|
+
"senders": Array [
|
|
28807
|
+
"AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh",
|
|
28808
|
+
],
|
|
28809
|
+
"standard": undefined,
|
|
28810
|
+
"tokenId": undefined,
|
|
28811
|
+
"type": "OUT",
|
|
28812
|
+
"value": "10005000",
|
|
28813
|
+
},
|
|
28814
|
+
],
|
|
28815
|
+
Array [],
|
|
28816
|
+
]
|
|
28817
|
+
`;
|
|
28818
|
+
|
|
28731
28819
|
exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
28732
28820
|
Array [
|
|
28733
28821
|
Object {
|
|
@@ -31722,7 +31810,6 @@ Array [
|
|
|
31722
31810
|
],
|
|
31723
31811
|
"senders": Array [
|
|
31724
31812
|
"Vhbc9ZzzH89S8fkEbqRWuatEzwPCRf3Uyp",
|
|
31725
|
-
"Vhbc9ZzzH89S8fkEbqRWuatEzwPCRf3Uyp",
|
|
31726
31813
|
],
|
|
31727
31814
|
"standard": undefined,
|
|
31728
31815
|
"tokenId": undefined,
|
|
@@ -32003,7 +32090,6 @@ Array [
|
|
|
32003
32090
|
],
|
|
32004
32091
|
"senders": Array [
|
|
32005
32092
|
"Vhbc9ZzzH89S8fkEbqRWuatEzwPCRf3Uyp",
|
|
32006
|
-
"Vhbc9ZzzH89S8fkEbqRWuatEzwPCRf3Uyp",
|
|
32007
32093
|
],
|
|
32008
32094
|
"standard": undefined,
|
|
32009
32095
|
"tokenId": undefined,
|
|
@@ -5,6 +5,8 @@ import { Account } from "../../../../families/bitcoin/wallet-btc/account";
|
|
|
5
5
|
import { Merge } from "../../../../families/bitcoin/wallet-btc/pickingstrategies/Merge";
|
|
6
6
|
import MockBtc from "../../../../mock/Btc";
|
|
7
7
|
|
|
8
|
+
jest.setTimeout(180000);
|
|
9
|
+
|
|
8
10
|
describe("testing wallet", () => {
|
|
9
11
|
const wallet = new BitcoinLikeWallet();
|
|
10
12
|
let account: Account;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { DerivationModes } from "../../../../families/bitcoin/wallet-btc";
|
|
2
|
+
import BitcoinLikeStorage from "../../../../families/bitcoin/wallet-btc/storage";
|
|
3
|
+
import BitcoinLikeExplorer from "../../../../families/bitcoin/wallet-btc/explorer";
|
|
4
|
+
import Xpub from "../../../../families/bitcoin/wallet-btc/xpub";
|
|
5
|
+
import coininfo from "coininfo";
|
|
6
|
+
import BCHCrypto from "../../../../families/bitcoin/wallet-btc/crypto/bitcoincash";
|
|
7
|
+
import BTCCrypto from "../../../../families/bitcoin/wallet-btc/crypto/bitcoin";
|
|
8
|
+
import ZECCrypto from "../../../../families/bitcoin/wallet-btc/crypto/zec";
|
|
9
|
+
import ZENCrypto from "../../../../families/bitcoin/wallet-btc/crypto/zen";
|
|
10
|
+
|
|
11
|
+
describe("Unit tests for getAddress", () => {
|
|
12
|
+
it("Test getAddress for bch and btc", async () => {
|
|
13
|
+
const bchCrypto = new BCHCrypto({
|
|
14
|
+
network: coininfo.bitcoincash.main.toBitcoinJS(),
|
|
15
|
+
});
|
|
16
|
+
const btcCrypto = new BTCCrypto({
|
|
17
|
+
network: coininfo.bitcoin.main.toBitcoinJS(),
|
|
18
|
+
});
|
|
19
|
+
const bchxpub = new Xpub({
|
|
20
|
+
storage: new BitcoinLikeStorage(),
|
|
21
|
+
explorer: new BitcoinLikeExplorer({
|
|
22
|
+
explorerURI: "https://explorers.api.vault.ledger.com/blockchain/v3/bch",
|
|
23
|
+
explorerVersion: "v3",
|
|
24
|
+
}),
|
|
25
|
+
crypto: bchCrypto,
|
|
26
|
+
xpub: "xpub6BtWBf3Pu6hYwJBKvEwG7JtrTxxDrSGy39HaTgZz6GTSaFWFdoCtuEXSQtoKGaYdz1emg8xTXKYwjhu3xXRPzFnYS1z4yjKj7hLDQyNeDZr",
|
|
27
|
+
derivationMode: DerivationModes.LEGACY,
|
|
28
|
+
});
|
|
29
|
+
await bchxpub.syncAddress(0, 0);
|
|
30
|
+
let addresses = await bchxpub.getXpubAddresses();
|
|
31
|
+
expect(addresses[0].address).toEqual(
|
|
32
|
+
"bitcoincash:qrgwhfg7tn4xs9pg2vu5rhkud490j9yfnqd63uk64m"
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const btcxpub = new Xpub({
|
|
36
|
+
storage: new BitcoinLikeStorage(),
|
|
37
|
+
explorer: new BitcoinLikeExplorer({
|
|
38
|
+
explorerURI: "https://explorers.api.vault.ledger.com/blockchain/v3/btc",
|
|
39
|
+
explorerVersion: "v3",
|
|
40
|
+
}),
|
|
41
|
+
crypto: btcCrypto,
|
|
42
|
+
xpub: "xpub6BtWBf3Pu6hYwJBKvEwG7JtrTxxDrSGy39HaTgZz6GTSaFWFdoCtuEXSQtoKGaYdz1emg8xTXKYwjhu3xXRPzFnYS1z4yjKj7hLDQyNeDZr",
|
|
43
|
+
derivationMode: DerivationModes.LEGACY,
|
|
44
|
+
});
|
|
45
|
+
await btcxpub.syncAddress(0, 0);
|
|
46
|
+
addresses = await btcxpub.getXpubAddresses();
|
|
47
|
+
expect(addresses[0].address).toEqual("1L3fqoWstvLqEA6TgXkuLoXX8xG1xhirG3");
|
|
48
|
+
}, 60000);
|
|
49
|
+
|
|
50
|
+
it("Test getoutputScriptFromAddress for btc, zcash and zen", async () => {
|
|
51
|
+
const btcCrypto = new BTCCrypto({
|
|
52
|
+
network: coininfo.bitcoin.main.toBitcoinJS(),
|
|
53
|
+
});
|
|
54
|
+
const zecCrypto = new ZECCrypto({
|
|
55
|
+
network: coininfo.zcash.main.toBitcoinJS(),
|
|
56
|
+
});
|
|
57
|
+
const zenCrypto = new ZENCrypto({
|
|
58
|
+
network: coininfo.zcash.main.toBitcoinJS(),
|
|
59
|
+
});
|
|
60
|
+
expect(
|
|
61
|
+
btcCrypto
|
|
62
|
+
.toOutputScript("1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX")
|
|
63
|
+
.toString("hex")
|
|
64
|
+
).toEqual("76a91499bc78ba577a95a11f1a344d4d2ae55f2f857b9888ac");
|
|
65
|
+
expect(
|
|
66
|
+
zecCrypto
|
|
67
|
+
.toOutputScript("t1T5XJvzQhh2gTsi3c5Vn9x5SMhpSWLSnVy")
|
|
68
|
+
.toString("hex")
|
|
69
|
+
).toEqual("76a91464fa33fb6f8d72455af2a4e73ae30412af2c97ba88ac");
|
|
70
|
+
expect(
|
|
71
|
+
zenCrypto
|
|
72
|
+
.toOutputScript("znjbHth4PxBJM8FmHgvXYHkuq99nKFkWvMg")
|
|
73
|
+
.toString("hex")
|
|
74
|
+
).toEqual(
|
|
75
|
+
"76a914cb009bf12fc17d28e61527951101fdabfeaa187288ac209ec9845acb02fab24e1c0368b3b517c1a4488fba97f0e3459ac053ea0100000003c01f02b4"
|
|
76
|
+
);
|
|
77
|
+
}, 30000);
|
|
78
|
+
});
|
package/src/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.ts
CHANGED
|
@@ -67,7 +67,6 @@ describe("testing xpub legacy transactions", () => {
|
|
|
67
67
|
output_index: 0,
|
|
68
68
|
value: "5000000000",
|
|
69
69
|
address: "mwXTtHo8Yy3aNKUUZLkBDrTcKT9qG9TqLb",
|
|
70
|
-
script_hex: "76a914af9ab6987aa41b37c8bcb7c61154165d23f09e3488ac",
|
|
71
70
|
output_hash:
|
|
72
71
|
"9e1b337875c21f751e70ee2c2c6ee93d8a6733d0f3ba6d139ae6a0479ebcefb0",
|
|
73
72
|
block_height: 1,
|
|
@@ -77,8 +76,6 @@ describe("testing xpub legacy transactions", () => {
|
|
|
77
76
|
output_index: 1,
|
|
78
77
|
value: "0",
|
|
79
78
|
address: "<unknown>",
|
|
80
|
-
script_hex:
|
|
81
|
-
"6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9",
|
|
82
79
|
output_hash:
|
|
83
80
|
"9e1b337875c21f751e70ee2c2c6ee93d8a6733d0f3ba6d139ae6a0479ebcefb0",
|
|
84
81
|
block_height: 1,
|
|
@@ -112,7 +109,6 @@ describe("testing xpub legacy transactions", () => {
|
|
|
112
109
|
output_index: 0,
|
|
113
110
|
value: "300000000",
|
|
114
111
|
address: "mwXTtHo8Yy3aNKUUZLkBDrTcKT9qG9TqLb",
|
|
115
|
-
script_hex: "76a914af9ab6987aa41b37c8bcb7c61154165d23f09e3488ac",
|
|
116
112
|
output_hash:
|
|
117
113
|
"0b9f98d07eb418fa20573112d3cba6b871d429a06c724a7888ff0886be5213d1",
|
|
118
114
|
block_height: 120,
|
|
@@ -122,7 +118,6 @@ describe("testing xpub legacy transactions", () => {
|
|
|
122
118
|
output_index: 1,
|
|
123
119
|
value: "4699983200",
|
|
124
120
|
address: "2MynSTpze5SDcuLr1DekSV7RVrFpQCo3LeP",
|
|
125
|
-
script_hex: "a91447b810238a31777fc4e4de474419464c46aadf8187",
|
|
126
121
|
output_hash:
|
|
127
122
|
"0b9f98d07eb418fa20573112d3cba6b871d429a06c724a7888ff0886be5213d1",
|
|
128
123
|
block_height: 120,
|
|
@@ -209,7 +204,6 @@ describe("testing xpub legacy transactions", () => {
|
|
|
209
204
|
output_index: 0,
|
|
210
205
|
value: "4599966400",
|
|
211
206
|
address: "2NCSYYp4bWdHDYf9nYP1NDKb1GMBqa8e57H",
|
|
212
|
-
script_hex: "a914d28e7592fc2657433296eafc89e4a8d29289ebf087",
|
|
213
207
|
output_hash:
|
|
214
208
|
"8f30fe84da5a5846d668b4bad260730f2b0125fa66fb2633fa1cee23c6b11053",
|
|
215
209
|
block_height: 122,
|
|
@@ -219,7 +213,6 @@ describe("testing xpub legacy transactions", () => {
|
|
|
219
213
|
output_index: 1,
|
|
220
214
|
value: "100000000",
|
|
221
215
|
address: "mwXTtHo8Yy3aNKUUZLkBDrTcKT9qG9TqLb",
|
|
222
|
-
script_hex: "76a914af9ab6987aa41b37c8bcb7c61154165d23f09e3488ac",
|
|
223
216
|
output_hash:
|
|
224
217
|
"8f30fe84da5a5846d668b4bad260730f2b0125fa66fb2633fa1cee23c6b11053",
|
|
225
218
|
block_height: 122,
|
|
@@ -253,7 +246,6 @@ describe("testing xpub legacy transactions", () => {
|
|
|
253
246
|
output_index: 0,
|
|
254
247
|
value: "4399949600",
|
|
255
248
|
address: "2NFToPiLBtuKiqzZj43nPXknN8d4xNySe3o",
|
|
256
|
-
script_hex: "a914f3b3a49bd90e6e9ae30882a2b7e9b7edfe579a8c87",
|
|
257
249
|
output_hash:
|
|
258
250
|
"2f90f3312ffd4dce490cb2f7429c586a43ef68c99fc2f8e549127b72af7b4209",
|
|
259
251
|
block_height: 123,
|
|
@@ -263,7 +255,6 @@ describe("testing xpub legacy transactions", () => {
|
|
|
263
255
|
output_index: 1,
|
|
264
256
|
value: "200000000",
|
|
265
257
|
address: "mwXTtHo8Yy3aNKUUZLkBDrTcKT9qG9TqLb",
|
|
266
|
-
script_hex: "76a914af9ab6987aa41b37c8bcb7c61154165d23f09e3488ac",
|
|
267
258
|
output_hash:
|
|
268
259
|
"2f90f3312ffd4dce490cb2f7429c586a43ef68c99fc2f8e549127b72af7b4209",
|
|
269
260
|
block_height: 123,
|
|
@@ -297,7 +288,6 @@ describe("testing xpub legacy transactions", () => {
|
|
|
297
288
|
output_index: 0,
|
|
298
289
|
value: "600000000",
|
|
299
290
|
address: "mwXTtHo8Yy3aNKUUZLkBDrTcKT9qG9TqLb",
|
|
300
|
-
script_hex: "76a914af9ab6987aa41b37c8bcb7c61154165d23f09e3488ac",
|
|
301
291
|
output_hash:
|
|
302
292
|
"2fee0c4b55e08583aa5bc565d7e428f7cdcbd2b73262f62208a6a72a74e2c945",
|
|
303
293
|
block_height: 124,
|
|
@@ -307,7 +297,6 @@ describe("testing xpub legacy transactions", () => {
|
|
|
307
297
|
output_index: 1,
|
|
308
298
|
value: "3799932800",
|
|
309
299
|
address: "2N53XuFRxqbShpK4XKwC1VXT4zu1wCzbAMU",
|
|
310
|
-
script_hex: "a914816b7896ce2c4f21c39c865030fe07e7a042a9c687",
|
|
311
300
|
output_hash:
|
|
312
301
|
"2fee0c4b55e08583aa5bc565d7e428f7cdcbd2b73262f62208a6a72a74e2c945",
|
|
313
302
|
block_height: 124,
|
package/src/api/Ethereum.ts
CHANGED
package/src/apps/logic.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { $Shape } from "utility-types";
|
|
2
2
|
import { Subject } from "rxjs";
|
|
3
3
|
import flatMap from "lodash/flatMap";
|
|
4
|
-
import invariant from "invariant";
|
|
5
4
|
import semver from "semver";
|
|
6
5
|
import { getDeviceModel } from "@ledgerhq/devices";
|
|
7
6
|
import type { App } from "../types/manager";
|
|
@@ -17,7 +16,7 @@ import {
|
|
|
17
16
|
findCryptoCurrencyById,
|
|
18
17
|
isCurrencySupported,
|
|
19
18
|
} from "../currencies";
|
|
20
|
-
import { LatestFirmwareVersionRequired } from "../errors";
|
|
19
|
+
import { LatestFirmwareVersionRequired, NoSuchAppOnProvider } from "../errors";
|
|
21
20
|
|
|
22
21
|
export const initState = (
|
|
23
22
|
{
|
|
@@ -292,6 +291,7 @@ export const reducer = (state: State, action: Action): State => {
|
|
|
292
291
|
// No app found but fw update is available
|
|
293
292
|
if (
|
|
294
293
|
!depApp &&
|
|
294
|
+
state.firmware?.updateAvailable?.final?.version &&
|
|
295
295
|
semver.lt(
|
|
296
296
|
state.deviceInfo.version,
|
|
297
297
|
state.firmware?.updateAvailable?.final?.version
|
|
@@ -306,7 +306,10 @@ export const reducer = (state: State, action: Action): State => {
|
|
|
306
306
|
);
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
|
|
309
|
+
if (!depApp) {
|
|
310
|
+
throw new NoSuchAppOnProvider("", { appName: name });
|
|
311
|
+
}
|
|
312
|
+
|
|
310
313
|
const deps = depApp.dependencies;
|
|
311
314
|
const dependentsOfDep = flatMap(deps, (dep) =>
|
|
312
315
|
findDependents(state.appByName, dep)
|
package/src/apps/polyfill.ts
CHANGED
|
@@ -53,6 +53,7 @@ export const whitelistDependencies = ["Decred", "Decred Testnet"];
|
|
|
53
53
|
["POAP", "Ethereum"],
|
|
54
54
|
["OlympusDAO", "Ethereum"],
|
|
55
55
|
["Rarible", "Ethereum"],
|
|
56
|
+
["Ricochet", "Ethereum"],
|
|
56
57
|
].forEach(([name, dep]) => declareDep(name, dep));
|
|
57
58
|
export const getDependencies = (appName: string): string[] =>
|
|
58
59
|
directDep[appName] || [];
|
package/src/bot/engine.ts
CHANGED
|
@@ -81,6 +81,9 @@ export async function runWithAppSpec<T extends Transaction>(
|
|
|
81
81
|
const mutationReports: MutationReport<T>[] = [];
|
|
82
82
|
const { appQuery, currency, dependency } = spec;
|
|
83
83
|
const appCandidate = findAppCandidate(appCandidates, appQuery);
|
|
84
|
+
if (!appCandidate) {
|
|
85
|
+
console.warn("no app found for " + spec.name, { appQuery, appCandidates });
|
|
86
|
+
}
|
|
84
87
|
invariant(
|
|
85
88
|
appCandidate,
|
|
86
89
|
"%s: no app found. Are you sure your COINAPPS is up to date?",
|
package/src/env.ts
CHANGED
|
@@ -540,6 +540,11 @@ const envDefinitions = {
|
|
|
540
540
|
parser: stringParser,
|
|
541
541
|
desc: "url used to fetch platform app manifests (staging)",
|
|
542
542
|
},
|
|
543
|
+
PLATFORM_LOCAL_MANIFEST_JSON: {
|
|
544
|
+
def: "",
|
|
545
|
+
parser: stringParser,
|
|
546
|
+
desc: 'json manifest for a local (test) platform app manifests. How to use: PLATFORM_LOCAL_MANIFEST_JSON="$(cat /path/to/file.json)"',
|
|
547
|
+
},
|
|
543
548
|
PLATFORM_API_URL: {
|
|
544
549
|
def: "",
|
|
545
550
|
parser: stringParser,
|
package/src/errors.ts
CHANGED
|
@@ -141,6 +141,9 @@ export const SatStackDescriptorNotImported = createCustomErrorClass(
|
|
|
141
141
|
export const SwapNoAvailableProviders = createCustomErrorClass(
|
|
142
142
|
"SwapNoAvailableProviders"
|
|
143
143
|
);
|
|
144
|
+
export const NoSuchAppOnProvider = createCustomErrorClass(
|
|
145
|
+
"NoSuchAppOnProvider"
|
|
146
|
+
);
|
|
144
147
|
export const SwapExchangeRateAmountTooLow = createCustomErrorClass(
|
|
145
148
|
"SwapExchangeRateAmountTooLow"
|
|
146
149
|
);
|
|
@@ -32,7 +32,27 @@ const fundProviders: Record<
|
|
|
32
32
|
curve: string;
|
|
33
33
|
}
|
|
34
34
|
> = {
|
|
35
|
-
|
|
35
|
+
baanx: {
|
|
36
|
+
/**
|
|
37
|
+
* nameAndPubkey is the concatenation of:
|
|
38
|
+
* - an empty buffer of the size of the partner name
|
|
39
|
+
* - a buffer created from the partner name string in ascii encoding
|
|
40
|
+
* - a buffer created from the hexadecimal version of the partner public key
|
|
41
|
+
*/
|
|
42
|
+
nameAndPubkey: Buffer.concat([
|
|
43
|
+
Buffer.from([5]),
|
|
44
|
+
Buffer.from("Baanx", "ascii"),
|
|
45
|
+
Buffer.from(
|
|
46
|
+
"04551878b446b6a711949fa51cc5a8685602f8ffb1dfd08f6ab869019d7c125d7737a79e8b5022d860ec7dfbe062d510fec3b5fe0f6ebb1f5e55a074bb7e5dbc4e",
|
|
47
|
+
"hex"
|
|
48
|
+
),
|
|
49
|
+
]),
|
|
50
|
+
signature: Buffer.from(
|
|
51
|
+
"304402200345c39e93a22c5ac3f1e70f8b9938b3a60d3a4906067443cf11095af0e685a502201ee5d88dd5539ce36341e49e2505c2a1659e26d8ff08801ed33c50a9126aedd1",
|
|
52
|
+
"hex"
|
|
53
|
+
),
|
|
54
|
+
curve: "secp256r1",
|
|
55
|
+
},
|
|
36
56
|
};
|
|
37
57
|
|
|
38
58
|
const getProvider = (
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { encode as msgpackEncode } from "algo-msgpack-with-bigint";
|
|
2
2
|
import type {
|
|
3
|
-
SuggestedParams as AlgoSuggestedParams,
|
|
4
3
|
Transaction as AlgoTransaction,
|
|
5
4
|
EncodedTransaction as AlgoTransactionPayload,
|
|
6
5
|
EncodedSignedTransaction as AlgoSignedTransactionPayload,
|
|
@@ -28,8 +27,7 @@ export const buildTransactionPayload = async (
|
|
|
28
27
|
|
|
29
28
|
const note = memo ? new TextEncoder().encode(memo) : undefined;
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
const params = (await getTransactionParams()) as AlgoSuggestedParams;
|
|
30
|
+
const params = await getTransactionParams();
|
|
33
31
|
|
|
34
32
|
let algoTxn: AlgoTransaction;
|
|
35
33
|
if (subAccount || (assetId && mode === "optIn")) {
|
|
@@ -78,18 +76,16 @@ export const buildTransactionPayload = async (
|
|
|
78
76
|
return sorted;
|
|
79
77
|
};
|
|
80
78
|
|
|
81
|
-
export const encodeToSign =
|
|
82
|
-
payload: AlgoTransactionPayload
|
|
83
|
-
): Promise<string> => {
|
|
79
|
+
export const encodeToSign = (payload: AlgoTransactionPayload): string => {
|
|
84
80
|
const msgPackEncoded = msgpackEncode(payload);
|
|
85
81
|
|
|
86
82
|
return Buffer.from(msgPackEncoded).toString("hex");
|
|
87
83
|
};
|
|
88
84
|
|
|
89
|
-
export const encodeToBroadcast =
|
|
85
|
+
export const encodeToBroadcast = (
|
|
90
86
|
payload: AlgoTransactionPayload,
|
|
91
87
|
signature: Buffer
|
|
92
|
-
):
|
|
88
|
+
): Buffer => {
|
|
93
89
|
const signedPayload: AlgoSignedTransactionPayload = {
|
|
94
90
|
sig: signature,
|
|
95
91
|
txn: payload,
|
|
@@ -17,7 +17,7 @@ export const getEstimatedFees = async (
|
|
|
17
17
|
let suggestedFees = 0;
|
|
18
18
|
if (params.fee) {
|
|
19
19
|
const payload = await buildTransactionPayload(account, transaction);
|
|
20
|
-
const encoded =
|
|
20
|
+
const encoded = encodeToSign(payload);
|
|
21
21
|
suggestedFees =
|
|
22
22
|
params.fee * (Buffer.from(encoded, "hex").length + SINGLE_SIGNATURE_SIZE);
|
|
23
23
|
}
|
|
@@ -36,7 +36,7 @@ export const signOperation = ({
|
|
|
36
36
|
|
|
37
37
|
const algoTx = await buildTransactionPayload(account, transaction);
|
|
38
38
|
|
|
39
|
-
const toSign =
|
|
39
|
+
const toSign = encodeToSign(algoTx);
|
|
40
40
|
|
|
41
41
|
const hwApp = new Algorand(transport);
|
|
42
42
|
const { freshAddressPath } = account;
|
|
@@ -53,7 +53,7 @@ export const signOperation = ({
|
|
|
53
53
|
throw new Error("No signature");
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const toBroadcast =
|
|
56
|
+
const toBroadcast = encodeToBroadcast(algoTx, signature);
|
|
57
57
|
|
|
58
58
|
const operation = buildOptimisticOperation(account, transaction);
|
|
59
59
|
|
|
@@ -32,7 +32,7 @@ const signOperation = ({
|
|
|
32
32
|
try {
|
|
33
33
|
log("hw", `signTransaction ${currency.id} for account ${account.id}`);
|
|
34
34
|
const txInfo = await buildTransaction(account, transaction);
|
|
35
|
-
let senders
|
|
35
|
+
let senders = new Set<string>();
|
|
36
36
|
let recipients: string[] = [];
|
|
37
37
|
let fee = new BigNumber(0);
|
|
38
38
|
// Maybe better not re-calculate these fields here, instead include them
|
|
@@ -41,9 +41,7 @@ const signOperation = ({
|
|
|
41
41
|
account,
|
|
42
42
|
transaction,
|
|
43
43
|
}).then((res) => {
|
|
44
|
-
senders = res.txInputs
|
|
45
|
-
.map((i) => i.address)
|
|
46
|
-
.filter(Boolean) as string[];
|
|
44
|
+
senders = new Set(res.txInputs.map((i) => i.address).filter(Boolean));
|
|
47
45
|
recipients = res.txOutputs
|
|
48
46
|
.filter((o) => o.address && !o.isChange)
|
|
49
47
|
.map((o) => o.address) as string[];
|
|
@@ -140,7 +138,7 @@ const signOperation = ({
|
|
|
140
138
|
fee,
|
|
141
139
|
blockHash: null,
|
|
142
140
|
blockHeight: null,
|
|
143
|
-
senders,
|
|
141
|
+
senders: Array.from(senders),
|
|
144
142
|
recipients,
|
|
145
143
|
accountId: account.id,
|
|
146
144
|
date: new Date(),
|