@ledgerhq/live-common 27.2.0-nightly.4 → 27.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/lib/bot/index.d.ts.map +1 -1
- package/lib/bot/index.js +3 -8
- package/lib/bot/index.js.map +1 -1
- package/lib/bot/specs.d.ts +0 -9
- package/lib/bot/specs.d.ts.map +1 -1
- package/lib/bot/specs.js +1 -49
- package/lib/bot/specs.js.map +1 -1
- package/lib/currencies/support.d.ts.map +1 -1
- package/lib/currencies/support.js +1 -2
- package/lib/currencies/support.js.map +1 -1
- package/lib/derivation.d.ts.map +1 -1
- package/lib/derivation.js +4 -2
- package/lib/derivation.js.map +1 -1
- package/lib/env.js +1 -1
- package/lib/exchange/swap/getExchangeRates.d.ts.map +1 -1
- package/lib/exchange/swap/getExchangeRates.js +1 -1
- package/lib/exchange/swap/getExchangeRates.js.map +1 -1
- package/lib/exchange/swap/getProviders.d.ts.map +1 -1
- package/lib/exchange/swap/getProviders.js +5 -45
- package/lib/exchange/swap/getProviders.js.map +1 -1
- package/lib/exchange/swap/index.d.ts +1 -2
- package/lib/exchange/swap/index.d.ts.map +1 -1
- package/lib/exchange/swap/index.js +1 -11
- package/lib/exchange/swap/index.js.map +1 -1
- package/lib/exchange/swap/index.test.js +0 -22
- package/lib/exchange/swap/index.test.js.map +1 -1
- package/lib/exchange/swap/mock.js +1 -1
- package/lib/exchange/swap/mock.js.map +1 -1
- package/lib/exchange/swap/types.d.ts +0 -14
- package/lib/exchange/swap/types.d.ts.map +1 -1
- package/lib/families/algorand/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/algorand/speculos-deviceActions.js +29 -2
- package/lib/families/algorand/speculos-deviceActions.js.map +1 -1
- package/lib/families/bitcoin/specs.d.ts.map +1 -1
- package/lib/families/bitcoin/specs.js +1 -0
- package/lib/families/bitcoin/specs.js.map +1 -1
- package/lib/families/bitcoin/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/bitcoin/speculos-deviceActions.js +22 -2
- package/lib/families/bitcoin/speculos-deviceActions.js.map +1 -1
- package/lib/families/cardano/specs.d.ts.map +1 -1
- package/lib/families/cardano/specs.js +3 -4
- package/lib/families/cardano/specs.js.map +1 -1
- package/lib/families/cardano/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/cardano/speculos-deviceActions.js +10 -2
- package/lib/families/cardano/speculos-deviceActions.js.map +1 -1
- package/lib/families/celo/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/celo/speculos-deviceActions.js +10 -3
- package/lib/families/celo/speculos-deviceActions.js.map +1 -1
- package/lib/families/elrond/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/elrond/speculos-deviceActions.js +8 -3
- package/lib/families/elrond/speculos-deviceActions.js.map +1 -1
- package/lib/families/ethereum/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/ethereum/speculos-deviceActions.js +33 -10
- package/lib/families/ethereum/speculos-deviceActions.js.map +1 -1
- package/lib/families/evm/specs.d.ts.map +1 -1
- package/lib/families/evm/specs.js +5 -9
- package/lib/families/evm/specs.js.map +1 -1
- package/lib/families/evm/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/evm/speculos-deviceActions.js +25 -5
- package/lib/families/evm/speculos-deviceActions.js.map +1 -1
- package/lib/families/filecoin/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/filecoin/speculos-deviceActions.js +7 -6
- package/lib/families/filecoin/speculos-deviceActions.js.map +1 -1
- package/lib/families/polkadot/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/polkadot/speculos-deviceActions.js +10 -3
- package/lib/families/polkadot/speculos-deviceActions.js.map +1 -1
- package/lib/families/ripple/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/ripple/speculos-deviceActions.js +22 -2
- package/lib/families/ripple/speculos-deviceActions.js.map +1 -1
- package/lib/families/solana/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/solana/speculos-deviceActions.js +7 -5
- package/lib/families/solana/speculos-deviceActions.js.map +1 -1
- package/lib/families/stellar/api/horizon.d.ts.map +1 -1
- package/lib/families/stellar/api/horizon.js +10 -15
- package/lib/families/stellar/api/horizon.js.map +1 -1
- package/lib/families/stellar/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/stellar/speculos-deviceActions.js +8 -4
- package/lib/families/stellar/speculos-deviceActions.js.map +1 -1
- package/lib/families/tezos/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/tezos/speculos-deviceActions.js +11 -6
- package/lib/families/tezos/speculos-deviceActions.js.map +1 -1
- package/lib/families/tron/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/tron/speculos-deviceActions.js +14 -2
- package/lib/families/tron/speculos-deviceActions.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +0 -3
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/hw/extractOnboardingState.d.ts +1 -5
- package/lib/hw/extractOnboardingState.d.ts.map +1 -1
- package/lib/hw/extractOnboardingState.js +9 -17
- package/lib/hw/extractOnboardingState.js.map +1 -1
- package/lib/hw/extractOnboardingState.test.js +11 -21
- package/lib/hw/extractOnboardingState.test.js.map +1 -1
- package/package.json +19 -23
- package/src/bot/index.ts +12 -11
- package/src/bot/specs.ts +0 -45
- package/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +35 -1
- package/src/currencies/support.ts +1 -2
- package/src/derivation.ts +4 -2
- package/src/env.ts +1 -1
- package/src/exchange/swap/getExchangeRates.ts +3 -7
- package/src/exchange/swap/getProviders.ts +8 -31
- package/src/exchange/swap/index.test.ts +1 -36
- package/src/exchange/swap/index.ts +0 -15
- package/src/exchange/swap/mock.ts +2 -2
- package/src/exchange/swap/types.ts +0 -11
- package/src/families/algorand/speculos-deviceActions.ts +35 -4
- package/src/families/bitcoin/specs.ts +1 -0
- package/src/families/bitcoin/speculos-deviceActions.ts +26 -3
- package/src/families/cardano/specs.ts +3 -4
- package/src/families/cardano/speculos-deviceActions.ts +14 -3
- package/src/families/celo/speculos-deviceActions.ts +14 -6
- package/src/families/elrond/speculos-deviceActions.ts +9 -4
- package/src/families/ethereum/speculos-deviceActions.ts +46 -16
- package/src/families/evm/specs.ts +8 -12
- package/src/families/evm/speculos-deviceActions.ts +35 -7
- package/src/families/filecoin/speculos-deviceActions.ts +8 -7
- package/src/families/polkadot/speculos-deviceActions.ts +16 -5
- package/src/families/ripple/speculos-deviceActions.ts +28 -3
- package/src/families/solana/speculos-deviceActions.ts +8 -6
- package/src/families/stellar/api/horizon.ts +6 -10
- package/src/families/stellar/speculos-deviceActions.ts +11 -5
- package/src/families/tezos/speculos-deviceActions.ts +16 -9
- package/src/families/tron/speculos-deviceActions.ts +12 -4
- package/src/featureFlags/defaultFeatures.ts +0 -3
- package/src/hw/extractOnboardingState.test.ts +12 -29
- package/src/hw/extractOnboardingState.ts +9 -17
- package/lib/exchange/swap/getProviders.test.d.ts +0 -2
- package/lib/exchange/swap/getProviders.test.d.ts.map +0 -1
- package/lib/exchange/swap/getProviders.test.js +0 -519
- package/lib/exchange/swap/getProviders.test.js.map +0 -1
- package/lib/postOnboarding/PostOnboardingProvider.d.ts +0 -20
- package/lib/postOnboarding/PostOnboardingProvider.d.ts.map +0 -1
- package/lib/postOnboarding/PostOnboardingProvider.js +0 -33
- package/lib/postOnboarding/PostOnboardingProvider.js.map +0 -1
- package/lib/postOnboarding/actions.d.ts +0 -20
- package/lib/postOnboarding/actions.d.ts.map +0 -1
- package/lib/postOnboarding/actions.js +0 -37
- package/lib/postOnboarding/actions.js.map +0 -1
- package/lib/postOnboarding/hooks/index.d.ts +0 -6
- package/lib/postOnboarding/hooks/index.d.ts.map +0 -1
- package/lib/postOnboarding/hooks/index.js +0 -22
- package/lib/postOnboarding/hooks/index.js.map +0 -1
- package/lib/postOnboarding/hooks/useAllPostOnboardingActionsCompleted.d.ts +0 -8
- package/lib/postOnboarding/hooks/useAllPostOnboardingActionsCompleted.d.ts.map +0 -1
- package/lib/postOnboarding/hooks/useAllPostOnboardingActionsCompleted.js +0 -16
- package/lib/postOnboarding/hooks/useAllPostOnboardingActionsCompleted.js.map +0 -1
- package/lib/postOnboarding/hooks/useAllPostOnboardingActionsCompleted.test.d.ts +0 -2
- package/lib/postOnboarding/hooks/useAllPostOnboardingActionsCompleted.test.d.ts.map +0 -1
- package/lib/postOnboarding/hooks/useAllPostOnboardingActionsCompleted.test.js +0 -75
- package/lib/postOnboarding/hooks/useAllPostOnboardingActionsCompleted.test.js.map +0 -1
- package/lib/postOnboarding/hooks/usePostOnboardingContext.d.ts +0 -3
- package/lib/postOnboarding/hooks/usePostOnboardingContext.d.ts.map +0 -1
- package/lib/postOnboarding/hooks/usePostOnboardingContext.js +0 -10
- package/lib/postOnboarding/hooks/usePostOnboardingContext.js.map +0 -1
- package/lib/postOnboarding/hooks/usePostOnboardingEntryPointVisibleOnWallet.d.ts +0 -8
- package/lib/postOnboarding/hooks/usePostOnboardingEntryPointVisibleOnWallet.d.ts.map +0 -1
- package/lib/postOnboarding/hooks/usePostOnboardingEntryPointVisibleOnWallet.js +0 -20
- package/lib/postOnboarding/hooks/usePostOnboardingEntryPointVisibleOnWallet.js.map +0 -1
- package/lib/postOnboarding/hooks/usePostOnboardingEntryPointVisibleOnWallet.test.d.ts +0 -2
- package/lib/postOnboarding/hooks/usePostOnboardingEntryPointVisibleOnWallet.test.d.ts.map +0 -1
- package/lib/postOnboarding/hooks/usePostOnboardingEntryPointVisibleOnWallet.test.js +0 -64
- package/lib/postOnboarding/hooks/usePostOnboardingEntryPointVisibleOnWallet.test.js.map +0 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.d.ts +0 -12
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +0 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js +0 -65
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js.map +0 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.test.d.ts +0 -2
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.test.d.ts.map +0 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.test.js +0 -129
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.test.js.map +0 -1
- package/lib/postOnboarding/hooks/useStartPostOnboardingCallback.d.ts +0 -13
- package/lib/postOnboarding/hooks/useStartPostOnboardingCallback.d.ts.map +0 -1
- package/lib/postOnboarding/hooks/useStartPostOnboardingCallback.js +0 -34
- package/lib/postOnboarding/hooks/useStartPostOnboardingCallback.js.map +0 -1
- package/lib/postOnboarding/mock.d.ts +0 -8
- package/lib/postOnboarding/mock.d.ts.map +0 -1
- package/lib/postOnboarding/mock.js +0 -46
- package/lib/postOnboarding/mock.js.map +0 -1
- package/lib/postOnboarding/reducer.d.ts +0 -22
- package/lib/postOnboarding/reducer.d.ts.map +0 -1
- package/lib/postOnboarding/reducer.js +0 -71
- package/lib/postOnboarding/reducer.js.map +0 -1
- package/lib/postOnboarding/reducer.test.d.ts +0 -2
- package/lib/postOnboarding/reducer.test.d.ts.map +0 -1
- package/lib/postOnboarding/reducer.test.js +0 -251
- package/lib/postOnboarding/reducer.test.js.map +0 -1
- package/src/exchange/swap/getProviders.test.ts +0 -450
- package/src/postOnboarding/PostOnboardingProvider.tsx +0 -49
- package/src/postOnboarding/actions.ts +0 -40
- package/src/postOnboarding/hooks/index.ts +0 -5
- package/src/postOnboarding/hooks/useAllPostOnboardingActionsCompleted.test.ts +0 -82
- package/src/postOnboarding/hooks/useAllPostOnboardingActionsCompleted.ts +0 -12
- package/src/postOnboarding/hooks/usePostOnboardingContext.ts +0 -9
- package/src/postOnboarding/hooks/usePostOnboardingEntryPointVisibleOnWallet.test.ts +0 -83
- package/src/postOnboarding/hooks/usePostOnboardingEntryPointVisibleOnWallet.ts +0 -22
- package/src/postOnboarding/hooks/usePostOnboardingHubState.test.ts +0 -184
- package/src/postOnboarding/hooks/usePostOnboardingHubState.ts +0 -56
- package/src/postOnboarding/hooks/useStartPostOnboardingCallback.ts +0 -38
- package/src/postOnboarding/mock.ts +0 -53
- package/src/postOnboarding/reducer.test.ts +0 -247
- package/src/postOnboarding/reducer.ts +0 -105
|
@@ -694,6 +694,7 @@ Array [
|
|
|
694
694
|
"ethereum/erc20/mark",
|
|
695
695
|
"ethereum/erc20/flip_token",
|
|
696
696
|
"ethereum/erc20/team",
|
|
697
|
+
"polygon/erc20/ig_orb_(pos)",
|
|
697
698
|
"ethereum/erc20/syncfab_manufacturing",
|
|
698
699
|
"ethereum/erc20/niobium",
|
|
699
700
|
"ethereum/erc20/bob_s_repair",
|
|
@@ -727,7 +728,7 @@ Array [
|
|
|
727
728
|
"ethereum/erc20/coinus",
|
|
728
729
|
"ethereum/erc20/rating",
|
|
729
730
|
"ethereum/erc20/uptrennd",
|
|
730
|
-
"
|
|
731
|
+
"stacks",
|
|
731
732
|
"ethereum/erc20/smartshare_token",
|
|
732
733
|
"ethereum/erc20/fti",
|
|
733
734
|
"ethereum/erc20/neurochain_clausius",
|
|
@@ -1578,6 +1579,7 @@ Array [
|
|
|
1578
1579
|
"ethereum/erc20/ape_stax",
|
|
1579
1580
|
"ethereum/erc20/apebullinu",
|
|
1580
1581
|
"ethereum/erc20/apecoin",
|
|
1582
|
+
"ethereum/erc20/apecoin_dev",
|
|
1581
1583
|
"ethereum/erc20/apehaven",
|
|
1582
1584
|
"ethereum/erc20/apenft",
|
|
1583
1585
|
"ethereum/erc20/apenftio",
|
|
@@ -1829,6 +1831,7 @@ Array [
|
|
|
1829
1831
|
"ethereum/erc20/bitboost",
|
|
1830
1832
|
"ethereum/erc20/bitcar_token",
|
|
1831
1833
|
"ethereum/erc20/bitcashpay",
|
|
1834
|
+
"ethereum/erc20/bitcci_cash",
|
|
1832
1835
|
"ethereum/erc20/bitcloud_token",
|
|
1833
1836
|
"ethereum/erc20/bitcoin_boutique",
|
|
1834
1837
|
"ethereum/erc20/bitcoin_zero",
|
|
@@ -2042,6 +2045,7 @@ Array [
|
|
|
2042
2045
|
"ethereum/erc20/capital_finance",
|
|
2043
2046
|
"ethereum/erc20/capitalsharetoken",
|
|
2044
2047
|
"ethereum/erc20/capsule_coin",
|
|
2048
|
+
"ethereum/erc20/captain_inu",
|
|
2045
2049
|
"ethereum/erc20/car_coin",
|
|
2046
2050
|
"ethereum/erc20/car_sharing_community",
|
|
2047
2051
|
"ethereum/erc20/carbcoin",
|
|
@@ -2066,6 +2070,7 @@ Array [
|
|
|
2066
2070
|
"ethereum/erc20/cat__blockcat_",
|
|
2067
2071
|
"ethereum/erc20/cat_trade",
|
|
2068
2072
|
"ethereum/erc20/catcoin",
|
|
2073
|
+
"ethereum/erc20/catecoin",
|
|
2069
2074
|
"ethereum/erc20/cavapoo",
|
|
2070
2075
|
"ethereum/erc20/cavo",
|
|
2071
2076
|
"ethereum/erc20/cbdao",
|
|
@@ -2104,6 +2109,7 @@ Array [
|
|
|
2104
2109
|
"ethereum/erc20/cherry_token",
|
|
2105
2110
|
"ethereum/erc20/chi_gastoken_by_1inch",
|
|
2106
2111
|
"ethereum/erc20/chicken",
|
|
2112
|
+
"ethereum/erc20/chihiro_inu",
|
|
2107
2113
|
"ethereum/erc20/chihua_token",
|
|
2108
2114
|
"ethereum/erc20/chihuahua",
|
|
2109
2115
|
"ethereum/erc20/chipz",
|
|
@@ -2255,6 +2261,7 @@ Array [
|
|
|
2255
2261
|
"ethereum/erc20/creedtoken",
|
|
2256
2262
|
"ethereum/erc20/cremit",
|
|
2257
2263
|
"ethereum/erc20/crespo",
|
|
2264
|
+
"ethereum/erc20/creverse",
|
|
2258
2265
|
"ethereum/erc20/criptoro_coin",
|
|
2259
2266
|
"ethereum/erc20/cro",
|
|
2260
2267
|
"ethereum/erc20/crossfi",
|
|
@@ -2681,6 +2688,7 @@ Array [
|
|
|
2681
2688
|
"ethereum/erc20/enkronostoken",
|
|
2682
2689
|
"ethereum/erc20/enreachdao",
|
|
2683
2690
|
"ethereum/erc20/entanmo",
|
|
2691
|
+
"ethereum/erc20/enter_governance_token",
|
|
2684
2692
|
"ethereum/erc20/entone",
|
|
2685
2693
|
"ethereum/erc20/entropy",
|
|
2686
2694
|
"ethereum/erc20/envicoin",
|
|
@@ -3019,6 +3027,7 @@ Array [
|
|
|
3019
3027
|
"ethereum/erc20/gera",
|
|
3020
3028
|
"ethereum/erc20/gerowallet",
|
|
3021
3029
|
"ethereum/erc20/geyser",
|
|
3030
|
+
"ethereum/erc20/gg_token",
|
|
3022
3031
|
"ethereum/erc20/ggcoin",
|
|
3023
3032
|
"ethereum/erc20/ggtoken",
|
|
3024
3033
|
"ethereum/erc20/ghoul",
|
|
@@ -3101,6 +3110,7 @@ Array [
|
|
|
3101
3110
|
"ethereum/erc20/grearn's_token",
|
|
3102
3111
|
"ethereum/erc20/green",
|
|
3103
3112
|
"ethereum/erc20/green_light_erc20",
|
|
3113
|
+
"ethereum/erc20/green_metaverse_token",
|
|
3104
3114
|
"ethereum/erc20/green_token",
|
|
3105
3115
|
"ethereum/erc20/greenmed",
|
|
3106
3116
|
"ethereum/erc20/grey_token",
|
|
@@ -3184,6 +3194,7 @@ Array [
|
|
|
3184
3194
|
"ethereum/erc20/hiz_finance",
|
|
3185
3195
|
"ethereum/erc20/hkg",
|
|
3186
3196
|
"ethereum/erc20/hlandtoken",
|
|
3197
|
+
"ethereum/erc20/hmmm",
|
|
3187
3198
|
"ethereum/erc20/hoard_token",
|
|
3188
3199
|
"ethereum/erc20/hobonickels",
|
|
3189
3200
|
"ethereum/erc20/hodlcoin",
|
|
@@ -3501,6 +3512,7 @@ Array [
|
|
|
3501
3512
|
"ethereum/erc20/libartysharetoken",
|
|
3502
3513
|
"ethereum/erc20/libera",
|
|
3503
3514
|
"ethereum/erc20/libereum",
|
|
3515
|
+
"ethereum/erc20/libero_financial_freedom",
|
|
3504
3516
|
"ethereum/erc20/libertas",
|
|
3505
3517
|
"ethereum/erc20/libfx",
|
|
3506
3518
|
"ethereum/erc20/libratoken",
|
|
@@ -3666,6 +3678,7 @@ Array [
|
|
|
3666
3678
|
"ethereum/erc20/meta_network",
|
|
3667
3679
|
"ethereum/erc20/metafabric",
|
|
3668
3680
|
"ethereum/erc20/metafactory",
|
|
3681
|
+
"ethereum/erc20/metafluence",
|
|
3669
3682
|
"ethereum/erc20/metaverse_index",
|
|
3670
3683
|
"ethereum/erc20/metaverse_nft_index",
|
|
3671
3684
|
"ethereum/erc20/metawhale_btc",
|
|
@@ -4250,6 +4263,7 @@ Array [
|
|
|
4250
4263
|
"ethereum/erc20/quannabu",
|
|
4251
4264
|
"ethereum/erc20/quantfury_data_token",
|
|
4252
4265
|
"ethereum/erc20/quantfury_token",
|
|
4266
|
+
"ethereum/erc20/quarashi",
|
|
4253
4267
|
"ethereum/erc20/quickmining_token",
|
|
4254
4268
|
"ethereum/erc20/quickswap",
|
|
4255
4269
|
"ethereum/erc20/quiverx",
|
|
@@ -4304,6 +4318,7 @@ Array [
|
|
|
4304
4318
|
"ethereum/erc20/reditoken",
|
|
4305
4319
|
"ethereum/erc20/reef_finance",
|
|
4306
4320
|
"ethereum/erc20/reeth_token",
|
|
4321
|
+
"ethereum/erc20/refi",
|
|
4307
4322
|
"ethereum/erc20/refine_medium_token",
|
|
4308
4323
|
"ethereum/erc20/reflect_finance",
|
|
4309
4324
|
"ethereum/erc20/reflector_finance",
|
|
@@ -4436,6 +4451,7 @@ Array [
|
|
|
4436
4451
|
"ethereum/erc20/savetoken",
|
|
4437
4452
|
"ethereum/erc20/savix",
|
|
4438
4453
|
"ethereum/erc20/scaleswaptoken",
|
|
4454
|
+
"ethereum/erc20/scallop",
|
|
4439
4455
|
"ethereum/erc20/scandiweb_coin",
|
|
4440
4456
|
"ethereum/erc20/scardust",
|
|
4441
4457
|
"ethereum/erc20/scatter_cx",
|
|
@@ -4445,12 +4461,14 @@ Array [
|
|
|
4445
4461
|
"ethereum/erc20/scifitoken",
|
|
4446
4462
|
"ethereum/erc20/scoobi-doge",
|
|
4447
4463
|
"ethereum/erc20/scott",
|
|
4464
|
+
"ethereum/erc20/scratchtoken",
|
|
4448
4465
|
"ethereum/erc20/scrl",
|
|
4449
4466
|
"ethereum/erc20/sdog",
|
|
4450
4467
|
"ethereum/erc20/sea_cucumber_chain",
|
|
4451
4468
|
"ethereum/erc20/sealblock_token",
|
|
4452
4469
|
"ethereum/erc20/sechain",
|
|
4453
4470
|
"ethereum/erc20/secret_finance",
|
|
4471
|
+
"ethereum/erc20/sector",
|
|
4454
4472
|
"ethereum/erc20/secure_pad",
|
|
4455
4473
|
"ethereum/erc20/securypto",
|
|
4456
4474
|
"ethereum/erc20/seed",
|
|
@@ -4841,6 +4859,7 @@ Array [
|
|
|
4841
4859
|
"ethereum/erc20/taklimakan_network",
|
|
4842
4860
|
"ethereum/erc20/talao",
|
|
4843
4861
|
"ethereum/erc20/talent_coin",
|
|
4862
|
+
"ethereum/erc20/talkado",
|
|
4844
4863
|
"ethereum/erc20/tama_egg_niftygotchi",
|
|
4845
4864
|
"ethereum/erc20/tamadoge",
|
|
4846
4865
|
"ethereum/erc20/tamy_token",
|
|
@@ -4934,6 +4953,7 @@ Array [
|
|
|
4934
4953
|
"ethereum/erc20/tingles",
|
|
4935
4954
|
"ethereum/erc20/tinku",
|
|
4936
4955
|
"ethereum/erc20/tio",
|
|
4956
|
+
"ethereum/erc20/titano",
|
|
4937
4957
|
"ethereum/erc20/titanswap",
|
|
4938
4958
|
"ethereum/erc20/tixl_token",
|
|
4939
4959
|
"ethereum/erc20/tknt",
|
|
@@ -5748,6 +5768,7 @@ Array [
|
|
|
5748
5768
|
"polygon/erc20/ground_coin",
|
|
5749
5769
|
"polygon/erc20/grumpy_cat",
|
|
5750
5770
|
"polygon/erc20/guaranteed_entrance_token",
|
|
5771
|
+
"polygon/erc20/guppy_treat_token",
|
|
5751
5772
|
"polygon/erc20/hashgard",
|
|
5752
5773
|
"polygon/erc20/hex",
|
|
5753
5774
|
"polygon/erc20/holotoken",
|
|
@@ -5763,6 +5784,10 @@ Array [
|
|
|
5763
5784
|
"polygon/erc20/instadapp_(pos)",
|
|
5764
5785
|
"polygon/erc20/internxt",
|
|
5765
5786
|
"polygon/erc20/inverse",
|
|
5787
|
+
"polygon/erc20/invictus_bitcoin_alpha",
|
|
5788
|
+
"polygon/erc20/invictus_crypto10_hedged",
|
|
5789
|
+
"polygon/erc20/invictus_crypto20",
|
|
5790
|
+
"polygon/erc20/invictus_stable_growth",
|
|
5766
5791
|
"polygon/erc20/iron_finance_ice_token",
|
|
5767
5792
|
"polygon/erc20/iron_stablecoin",
|
|
5768
5793
|
"polygon/erc20/iron_titanium_token",
|
|
@@ -5805,6 +5830,7 @@ Array [
|
|
|
5805
5830
|
"polygon/erc20/musd",
|
|
5806
5831
|
"polygon/erc20/museum_of_crypto_art",
|
|
5807
5832
|
"polygon/erc20/mysterium_(pos)",
|
|
5833
|
+
"polygon/erc20/nakamoto.games",
|
|
5808
5834
|
"polygon/erc20/napoleonx",
|
|
5809
5835
|
"polygon/erc20/neighbourhoods_token",
|
|
5810
5836
|
"polygon/erc20/neos_credits_(pos)",
|
|
@@ -5869,6 +5895,7 @@ Array [
|
|
|
5869
5895
|
"polygon/erc20/sand",
|
|
5870
5896
|
"polygon/erc20/sand_old",
|
|
5871
5897
|
"polygon/erc20/sapien_network",
|
|
5898
|
+
"polygon/erc20/sekuritance_(pos)",
|
|
5872
5899
|
"polygon/erc20/sentinel",
|
|
5873
5900
|
"polygon/erc20/serum",
|
|
5874
5901
|
"polygon/erc20/shiba_inu_(pos)",
|
|
@@ -6109,6 +6136,7 @@ Array [
|
|
|
6109
6136
|
"bsc/bep20/cartesi_token",
|
|
6110
6137
|
"bsc/bep20/catcoin",
|
|
6111
6138
|
"bsc/bep20/catecoin",
|
|
6139
|
+
"bsc/bep20/catecoin_old",
|
|
6112
6140
|
"bsc/bep20/ceek",
|
|
6113
6141
|
"bsc/bep20/cellframe_token",
|
|
6114
6142
|
"bsc/bep20/cerby_token",
|
|
@@ -6216,12 +6244,14 @@ Array [
|
|
|
6216
6244
|
"bsc/bep20/gamyfi",
|
|
6217
6245
|
"bsc/bep20/genta",
|
|
6218
6246
|
"bsc/bep20/gforce",
|
|
6247
|
+
"bsc/bep20/gg_token",
|
|
6219
6248
|
"bsc/bep20/gomining_token",
|
|
6220
6249
|
"bsc/bep20/goose_coin",
|
|
6221
6250
|
"bsc/bep20/goose_golden_egg",
|
|
6222
6251
|
"bsc/bep20/gorilladiamond",
|
|
6223
6252
|
"bsc/bep20/goswapp",
|
|
6224
6253
|
"bsc/bep20/gourmetgalaxy",
|
|
6254
|
+
"bsc/bep20/green_metaverse_token",
|
|
6225
6255
|
"bsc/bep20/gummy_bull_token",
|
|
6226
6256
|
"bsc/bep20/hachiro_inu",
|
|
6227
6257
|
"bsc/bep20/hacken_token",
|
|
@@ -6336,6 +6366,7 @@ Array [
|
|
|
6336
6366
|
"bsc/bep20/orbital_lps",
|
|
6337
6367
|
"bsc/bep20/orbs",
|
|
6338
6368
|
"bsc/bep20/oreo",
|
|
6369
|
+
"bsc/bep20/orica",
|
|
6339
6370
|
"bsc/bep20/ovr",
|
|
6340
6371
|
"bsc/bep20/paid_network",
|
|
6341
6372
|
"bsc/bep20/pancakeswap_token",
|
|
@@ -6371,6 +6402,7 @@ Array [
|
|
|
6371
6402
|
"bsc/bep20/puli_inu",
|
|
6372
6403
|
"bsc/bep20/qian_governance_token",
|
|
6373
6404
|
"bsc/bep20/qian_second_generation_dollar",
|
|
6405
|
+
"bsc/bep20/quarashi",
|
|
6374
6406
|
"bsc/bep20/quarkchain_token",
|
|
6375
6407
|
"bsc/bep20/qusd_stablecoin",
|
|
6376
6408
|
"bsc/bep20/rabbit_coin",
|
|
@@ -6441,6 +6473,7 @@ Array [
|
|
|
6441
6473
|
"bsc/bep20/swipe",
|
|
6442
6474
|
"bsc/bep20/switcheo_token",
|
|
6443
6475
|
"bsc/bep20/taco",
|
|
6476
|
+
"bsc/bep20/talkado",
|
|
6444
6477
|
"bsc/bep20/tbitcoin",
|
|
6445
6478
|
"bsc/bep20/tdogecoin",
|
|
6446
6479
|
"bsc/bep20/tenet",
|
|
@@ -6503,6 +6536,7 @@ Array [
|
|
|
6503
6536
|
"bsc/bep20/venus_xrp",
|
|
6504
6537
|
"bsc/bep20/venus_xvs",
|
|
6505
6538
|
"bsc/bep20/vfox",
|
|
6539
|
+
"bsc/bep20/volt_inu",
|
|
6506
6540
|
"bsc/bep20/vswap.fi",
|
|
6507
6541
|
"bsc/bep20/wall_street_games",
|
|
6508
6542
|
"bsc/bep20/wanaka_farm",
|
|
@@ -75,8 +75,7 @@ export function listSupportedFiats(): FiatCurrency[] {
|
|
|
75
75
|
return userSupportedFiats;
|
|
76
76
|
}
|
|
77
77
|
export function setSupportedCurrencies(ids: CryptoCurrencyIds[]) {
|
|
78
|
-
userSupportedCurrencies =
|
|
79
|
-
.map((id) => getCryptoCurrencyById(id));
|
|
78
|
+
userSupportedCurrencies = ids.map((id) => getCryptoCurrencyById(id));
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
function getExperimentalSupports() {
|
package/src/derivation.ts
CHANGED
|
@@ -156,14 +156,16 @@ const modes = Object.freeze({
|
|
|
156
156
|
polkadotbip44: {
|
|
157
157
|
overridesDerivation: "44'/354'/<account>'/0'/<address>'",
|
|
158
158
|
},
|
|
159
|
+
// glif legacy derivation
|
|
159
160
|
gliflegacy: {
|
|
160
161
|
overridesDerivation: "44'/1'/0'/0/<account>",
|
|
161
|
-
tag: "legacy",
|
|
162
|
+
tag: "glif-legacy",
|
|
162
163
|
},
|
|
164
|
+
// glif normal derivation
|
|
163
165
|
glif: {
|
|
164
166
|
overridesDerivation: "44'/461'/0'/0/<account>",
|
|
165
167
|
startsAt: 1,
|
|
166
|
-
tag: "
|
|
168
|
+
tag: "glif",
|
|
167
169
|
},
|
|
168
170
|
solanaMain: {
|
|
169
171
|
isNonIterable: true,
|
package/src/env.ts
CHANGED
|
@@ -13,12 +13,7 @@ import {
|
|
|
13
13
|
} from "../../errors";
|
|
14
14
|
import network from "../../network";
|
|
15
15
|
import type { Transaction } from "../../generated/types";
|
|
16
|
-
import {
|
|
17
|
-
getAvailableProviders,
|
|
18
|
-
getSwapAPIBaseURL,
|
|
19
|
-
getSwapAPIError,
|
|
20
|
-
getSwapAPIVersion,
|
|
21
|
-
} from "./";
|
|
16
|
+
import { getAvailableProviders, getSwapAPIBaseURL, getSwapAPIError } from "./";
|
|
22
17
|
import { mockGetExchangeRates } from "./mock";
|
|
23
18
|
import type { CustomMinOrMaxError, Exchange, GetExchangeRates } from "./types";
|
|
24
19
|
|
|
@@ -31,7 +26,8 @@ const getExchangeRates: GetExchangeRates = async (
|
|
|
31
26
|
if (getEnv("MOCK"))
|
|
32
27
|
return mockGetExchangeRates(exchange, transaction, currencyTo);
|
|
33
28
|
|
|
34
|
-
|
|
29
|
+
// Rely on the api base to determine the version logic
|
|
30
|
+
const usesV3 = getSwapAPIBaseURL().endsWith("v3");
|
|
35
31
|
const from = getAccountCurrency(exchange.fromAccount).id;
|
|
36
32
|
const unitFrom = getAccountUnit(exchange.fromAccount);
|
|
37
33
|
const unitTo =
|
|
@@ -2,52 +2,29 @@ import qs from "qs";
|
|
|
2
2
|
import { getEnv } from "../../env";
|
|
3
3
|
import { SwapNoAvailableProviders } from "../../errors";
|
|
4
4
|
import network from "../../network";
|
|
5
|
-
import {
|
|
6
|
-
getAvailableProviders,
|
|
7
|
-
getSwapAPIBaseURL,
|
|
8
|
-
getSwapAPIVersion,
|
|
9
|
-
} from "./";
|
|
5
|
+
import { getAvailableProviders, getSwapAPIBaseURL } from "./";
|
|
10
6
|
import { mockGetProviders } from "./mock";
|
|
11
|
-
import type { GetProviders
|
|
7
|
+
import type { GetProviders } from "./types";
|
|
12
8
|
|
|
13
9
|
const getProviders: GetProviders = async () => {
|
|
14
10
|
if (getEnv("MOCK")) return mockGetProviders();
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
// Rely on the api base to determine the version logic
|
|
13
|
+
const usesV3 = getSwapAPIBaseURL().endsWith("v3");
|
|
17
14
|
|
|
18
15
|
const res = await network({
|
|
19
16
|
method: "GET",
|
|
20
17
|
url: `${getSwapAPIBaseURL()}/providers`,
|
|
21
|
-
params:
|
|
18
|
+
params: usesV3 ? { whitelist: getAvailableProviders() } : undefined,
|
|
22
19
|
paramsSerializer: (params) =>
|
|
23
20
|
qs.stringify(params, { arrayFormat: "comma" }),
|
|
24
21
|
});
|
|
25
22
|
|
|
26
|
-
if (
|
|
27
|
-
if (!res.data.length) {
|
|
28
|
-
throw new SwapNoAvailableProviders();
|
|
29
|
-
}
|
|
30
|
-
return res.data;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const responseV4 = res.data as ProvidersResponseV4;
|
|
34
|
-
if (!responseV4.providers || !Object.keys(responseV4.providers).length) {
|
|
23
|
+
if (!res.data.length) {
|
|
35
24
|
throw new SwapNoAvailableProviders();
|
|
36
25
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
pairs: groups.flatMap((group) =>
|
|
40
|
-
group.methods.flatMap((tradeMethod) =>
|
|
41
|
-
Object.entries(group.pairs).flatMap(([from, toArray]) =>
|
|
42
|
-
(toArray as number[]).map((to) => ({
|
|
43
|
-
from: responseV4.currencies[from],
|
|
44
|
-
to: responseV4.currencies[to.toString()],
|
|
45
|
-
tradeMethod,
|
|
46
|
-
}))
|
|
47
|
-
)
|
|
48
|
-
)
|
|
49
|
-
),
|
|
50
|
-
}));
|
|
26
|
+
|
|
27
|
+
return res.data;
|
|
51
28
|
};
|
|
52
29
|
|
|
53
30
|
export default getProviders;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { isSwapOperationPending
|
|
2
|
-
|
|
3
|
-
import { getEnv, setEnv } from "../../env";
|
|
1
|
+
import { isSwapOperationPending } from ".";
|
|
4
2
|
|
|
5
3
|
describe("swap/index", () => {
|
|
6
4
|
describe("isSwapOperationPending", () => {
|
|
@@ -35,37 +33,4 @@ describe("swap/index", () => {
|
|
|
35
33
|
expect(result).toBe(true);
|
|
36
34
|
});
|
|
37
35
|
});
|
|
38
|
-
|
|
39
|
-
describe("getSwapAPIVersion", () => {
|
|
40
|
-
const DEFAULT_SWAP_API_BASE = getEnv("SWAP_API_BASE");
|
|
41
|
-
|
|
42
|
-
afterEach(() => {
|
|
43
|
-
// Restore DEFAULT_SWAP_API_BASE
|
|
44
|
-
setEnv("SWAP_API_BASE", DEFAULT_SWAP_API_BASE);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
test("should return version when SWAP_API_BASE contains one", () => {
|
|
48
|
-
const result = getSwapAPIVersion();
|
|
49
|
-
|
|
50
|
-
expect(result).toBe(4);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test("should throw an error if no version in SWAP_API_BASE", () => {
|
|
54
|
-
setEnv("SWAP_API_BASE", "https://swap.ledger.com");
|
|
55
|
-
|
|
56
|
-
expect(getSwapAPIVersion).toThrow(Error);
|
|
57
|
-
expect(getSwapAPIVersion).toThrow(
|
|
58
|
-
"Configured swap API base URL is invalid, should end with /v<number>"
|
|
59
|
-
);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test("should throw an error if version is NaN", () => {
|
|
63
|
-
setEnv("SWAP_API_BASE", "https://swap.ledger.com/vtest");
|
|
64
|
-
|
|
65
|
-
expect(getSwapAPIVersion).toThrow(Error);
|
|
66
|
-
expect(getSwapAPIVersion).toThrow(
|
|
67
|
-
"Configured swap API base URL is invalid, should end with /v<number>"
|
|
68
|
-
);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
36
|
});
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
JSONRPCResponseError,
|
|
12
12
|
NoIPHeaderError,
|
|
13
13
|
NotImplementedError,
|
|
14
|
-
SwapGenericAPIError,
|
|
15
14
|
TradeMethodNotSupportedError,
|
|
16
15
|
UnexpectedError,
|
|
17
16
|
ValidationError,
|
|
@@ -37,19 +36,6 @@ export const isSwapOperationPending: (status: string) => boolean = (status) =>
|
|
|
37
36
|
|
|
38
37
|
const getSwapAPIBaseURL: () => string = () => getEnv("SWAP_API_BASE");
|
|
39
38
|
|
|
40
|
-
const SWAP_API_BASE_PATTERN = /.*\/v(?<version>\d+)\/*$/;
|
|
41
|
-
const getSwapAPIVersion: () => number = () => {
|
|
42
|
-
const version = Number(
|
|
43
|
-
getSwapAPIBaseURL().match(SWAP_API_BASE_PATTERN)?.groups?.version
|
|
44
|
-
);
|
|
45
|
-
if (version == null || isNaN(version)) {
|
|
46
|
-
throw new SwapGenericAPIError(
|
|
47
|
-
"Configured swap API base URL is invalid, should end with /v<number>"
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
return version;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
39
|
const ftx = {
|
|
54
40
|
nameAndPubkey: Buffer.concat([
|
|
55
41
|
Buffer.from([3]),
|
|
@@ -193,7 +179,6 @@ export const getSwapAPIError = (errorCode: number, errorMessage?: string) => {
|
|
|
193
179
|
|
|
194
180
|
export {
|
|
195
181
|
getSwapAPIBaseURL,
|
|
196
|
-
getSwapAPIVersion,
|
|
197
182
|
getProviderConfig,
|
|
198
183
|
getProviders,
|
|
199
184
|
getExchangeRates,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
SwapExchangeRateAmountTooHigh,
|
|
8
8
|
SwapExchangeRateAmountTooLow,
|
|
9
9
|
} from "../../errors";
|
|
10
|
-
import {
|
|
10
|
+
import { getSwapAPIBaseURL } from "./";
|
|
11
11
|
import type {
|
|
12
12
|
CheckQuote,
|
|
13
13
|
Exchange,
|
|
@@ -129,7 +129,7 @@ export const mockInitSwap = (
|
|
|
129
129
|
export const mockGetProviders: GetProviders = async () => {
|
|
130
130
|
//Fake delay to show loading UI
|
|
131
131
|
await new Promise((r) => setTimeout(r, 800));
|
|
132
|
-
const usesV3 =
|
|
132
|
+
const usesV3 = getSwapAPIBaseURL().endsWith("v3");
|
|
133
133
|
|
|
134
134
|
return usesV3
|
|
135
135
|
? [
|
|
@@ -83,17 +83,6 @@ export type AvailableProviderV3 = {
|
|
|
83
83
|
pairs: Array<{ from: string; to: string; tradeMethod: string }>;
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
type TradeMethodGroup = {
|
|
87
|
-
methods: TradeMethod[];
|
|
88
|
-
pairs: {
|
|
89
|
-
[currencyIndex: number]: number[];
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
export type ProvidersResponseV4 = {
|
|
93
|
-
currencies: { [currencyIndex: number]: string };
|
|
94
|
-
providers: { [providerName: string]: TradeMethodGroup[] };
|
|
95
|
-
};
|
|
96
|
-
|
|
97
86
|
type CheckQuoteOkStatus = {
|
|
98
87
|
codeName: "RATE_VALID";
|
|
99
88
|
};
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import type { DeviceAction } from "../../bot/types";
|
|
2
2
|
import type { AlgorandTransaction } from "./types";
|
|
3
|
-
import { findTokenById } from "../../currencies";
|
|
4
|
-
import { deviceActionFlow
|
|
3
|
+
import { formatCurrencyUnit, findTokenById } from "../../currencies";
|
|
4
|
+
import { deviceActionFlow } from "../../bot/specs";
|
|
5
5
|
import { extractTokenId, addPrefixToken } from "./tokens";
|
|
6
6
|
import { displayTokenValue } from "./deviceTransactionConfig";
|
|
7
7
|
|
|
8
|
+
// Will be useful when unit is gonna be algo
|
|
9
|
+
const expectedAmount = ({ account, status }) =>
|
|
10
|
+
formatCurrencyUnit(
|
|
11
|
+
{
|
|
12
|
+
...account.unit,
|
|
13
|
+
code: account.currency.deviceTicker || account.unit.code,
|
|
14
|
+
prefixCode: true,
|
|
15
|
+
},
|
|
16
|
+
status.amount,
|
|
17
|
+
{
|
|
18
|
+
showCode: true,
|
|
19
|
+
disableRounding: true,
|
|
20
|
+
joinFragmentsSeparator: " ",
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
|
|
8
24
|
export const acceptTransaction: DeviceAction<AlgorandTransaction, any> =
|
|
9
25
|
deviceActionFlow({
|
|
10
26
|
steps: [
|
|
@@ -26,7 +42,19 @@ export const acceptTransaction: DeviceAction<AlgorandTransaction, any> =
|
|
|
26
42
|
title: "Fee",
|
|
27
43
|
button: "Rr",
|
|
28
44
|
expectedValue: ({ account, status }) =>
|
|
29
|
-
|
|
45
|
+
formatCurrencyUnit(
|
|
46
|
+
{
|
|
47
|
+
...account.unit,
|
|
48
|
+
code: account.currency.deviceTicker || account.unit.code,
|
|
49
|
+
prefixCode: true,
|
|
50
|
+
},
|
|
51
|
+
status.estimatedFees,
|
|
52
|
+
{
|
|
53
|
+
showCode: true,
|
|
54
|
+
disableRounding: true,
|
|
55
|
+
joinFragmentsSeparator: " ",
|
|
56
|
+
}
|
|
57
|
+
),
|
|
30
58
|
},
|
|
31
59
|
{
|
|
32
60
|
title: "Asset ID",
|
|
@@ -67,7 +95,10 @@ export const acceptTransaction: DeviceAction<AlgorandTransaction, any> =
|
|
|
67
95
|
expectedValue: ({ account, status, transaction }) =>
|
|
68
96
|
transaction.mode === "claimReward"
|
|
69
97
|
? "0"
|
|
70
|
-
:
|
|
98
|
+
: expectedAmount({
|
|
99
|
+
account,
|
|
100
|
+
status,
|
|
101
|
+
}),
|
|
71
102
|
},
|
|
72
103
|
{
|
|
73
104
|
title: "APPROVE",
|
|
@@ -310,6 +310,7 @@ const bitcoin: AppSpec<Transaction> = {
|
|
|
310
310
|
mutations: bitcoinLikeMutations(),
|
|
311
311
|
};
|
|
312
312
|
const bitcoinTestnet: AppSpec<Transaction> = {
|
|
313
|
+
multipleRuns: 2,
|
|
313
314
|
name: "Bitcoin Testnet",
|
|
314
315
|
currency: getCryptoCurrencyById("bitcoin_testnet"),
|
|
315
316
|
dependency: "Bitcoin",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DeviceAction } from "../../bot/types";
|
|
2
2
|
import type { Transaction } from "./types";
|
|
3
|
-
import {
|
|
3
|
+
import { formatCurrencyUnit } from "../../currencies";
|
|
4
|
+
import { deviceActionFlow } from "../../bot/specs";
|
|
4
5
|
import { perCoinLogic } from "./logic";
|
|
5
6
|
|
|
6
7
|
export const acceptTransaction: DeviceAction<Transaction, any> =
|
|
@@ -10,15 +11,37 @@ export const acceptTransaction: DeviceAction<Transaction, any> =
|
|
|
10
11
|
title: "Amount",
|
|
11
12
|
button: "Rr",
|
|
12
13
|
ignoreAssertionFailure: true,
|
|
14
|
+
// https://ledgerhq.atlassian.net/browse/LLC-676
|
|
13
15
|
expectedValue: ({ account, status }) =>
|
|
14
|
-
|
|
16
|
+
formatCurrencyUnit(
|
|
17
|
+
{
|
|
18
|
+
...account.unit,
|
|
19
|
+
code: account.currency.deviceTicker || account.unit.code,
|
|
20
|
+
},
|
|
21
|
+
status.amount,
|
|
22
|
+
{
|
|
23
|
+
showCode: true,
|
|
24
|
+
disableRounding: true,
|
|
25
|
+
}
|
|
26
|
+
).replace(/\s/g, " "),
|
|
15
27
|
},
|
|
16
28
|
{
|
|
17
29
|
title: "Fees",
|
|
18
30
|
button: "Rr",
|
|
19
31
|
ignoreAssertionFailure: true,
|
|
32
|
+
// https://ledgerhq.atlassian.net/browse/LLC-676
|
|
20
33
|
expectedValue: ({ account, status }) =>
|
|
21
|
-
|
|
34
|
+
formatCurrencyUnit(
|
|
35
|
+
{
|
|
36
|
+
...account.unit,
|
|
37
|
+
code: account.currency.deviceTicker || account.unit.code,
|
|
38
|
+
},
|
|
39
|
+
status.estimatedFees,
|
|
40
|
+
{
|
|
41
|
+
showCode: true,
|
|
42
|
+
disableRounding: true,
|
|
43
|
+
}
|
|
44
|
+
).replace(/\s/g, " "),
|
|
22
45
|
},
|
|
23
46
|
{
|
|
24
47
|
title: "Address",
|
|
@@ -12,7 +12,6 @@ import { parseCurrencyUnit } from "../../currencies";
|
|
|
12
12
|
import { SubAccount } from "@ledgerhq/types-live";
|
|
13
13
|
import { acceptTransaction } from "./speculos-deviceActions";
|
|
14
14
|
|
|
15
|
-
const maxAccounts = 5;
|
|
16
15
|
const currency = getCryptoCurrencyById("cardano");
|
|
17
16
|
const minBalanceRequired = parseCurrencyUnit(currency.units[0], "2.2");
|
|
18
17
|
const minBalanceRequiredForMaxSend = parseCurrencyUnit(currency.units[0], "1");
|
|
@@ -36,7 +35,7 @@ const cardano: AppSpec<Transaction> = {
|
|
|
36
35
|
maxRun: 1,
|
|
37
36
|
transaction: ({ account, siblings, bridge, maxSpendable }) => {
|
|
38
37
|
invariant(maxSpendable.gt(minBalanceRequired), "balance is too low");
|
|
39
|
-
const sibling = pickSiblings(siblings,
|
|
38
|
+
const sibling = pickSiblings(siblings, 3);
|
|
40
39
|
const recipient = sibling.freshAddress;
|
|
41
40
|
const transaction = bridge.createTransaction(account);
|
|
42
41
|
|
|
@@ -78,7 +77,7 @@ const cardano: AppSpec<Transaction> = {
|
|
|
78
77
|
maxSpendable.gt(minBalanceRequiredForMaxSend),
|
|
79
78
|
"balance is too low"
|
|
80
79
|
);
|
|
81
|
-
const sibling = pickSiblings(siblings,
|
|
80
|
+
const sibling = pickSiblings(siblings, 3);
|
|
82
81
|
const recipient = sibling.freshAddress;
|
|
83
82
|
const transaction = bridge.createTransaction(account);
|
|
84
83
|
|
|
@@ -118,7 +117,7 @@ const cardano: AppSpec<Transaction> = {
|
|
|
118
117
|
maxSpendable.gte(minSpendableRequiredForTokenTx),
|
|
119
118
|
"balance is too low"
|
|
120
119
|
);
|
|
121
|
-
const sibling = pickSiblings(siblings,
|
|
120
|
+
const sibling = pickSiblings(siblings, 3);
|
|
122
121
|
const recipient = sibling.freshAddress;
|
|
123
122
|
const transaction = bridge.createTransaction(account);
|
|
124
123
|
|