@ledgerhq/live-common 34.51.0-nightly.1 → 34.51.0-nightly.3
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/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib/bridge/crypto-assets/index.js +0 -2
- package/lib/bridge/crypto-assets/index.js.map +1 -1
- package/lib/bridge/crypto-assets/index.test.js +0 -4
- package/lib/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/accountBridge.js +2 -0
- package/lib/bridge/generic-alpaca/accountBridge.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +1 -0
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +3 -0
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.js +37 -45
- package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.js +0 -20
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib/bridge/generic-alpaca/signRawOperation.d.ts +8 -0
- package/lib/bridge/generic-alpaca/signRawOperation.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/signRawOperation.js +55 -0
- package/lib/bridge/generic-alpaca/signRawOperation.js.map +1 -0
- package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js +1 -0
- package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js +186 -88
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +1 -0
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/mockHelpers.d.ts +1 -0
- package/lib/bridge/mockHelpers.d.ts.map +1 -1
- package/lib/bridge/mockHelpers.js +53 -1
- package/lib/bridge/mockHelpers.js.map +1 -1
- package/lib/bridge/react/BridgeSync.d.ts +1 -0
- package/lib/bridge/react/BridgeSync.d.ts.map +1 -1
- package/lib/bridge/react/BridgeSync.js +19 -16
- package/lib/bridge/react/BridgeSync.js.map +1 -1
- package/lib/bridge/react/BridgeSync.test.js +403 -66
- package/lib/bridge/react/BridgeSync.test.js.map +1 -1
- package/lib/currencies/index.d.ts +1 -1
- package/lib/currencies/index.d.ts.map +1 -1
- package/lib/currencies/index.js +2 -3
- package/lib/currencies/index.js.map +1 -1
- package/lib/currencies/sortByMarketcap.test.js +1 -3
- package/lib/currencies/sortByMarketcap.test.js.map +1 -1
- package/lib/dada-client/entities/index.d.ts +1 -1
- package/lib/dada-client/entities/index.d.ts.map +1 -1
- package/lib/e2e/enum/Account.d.ts +4 -0
- package/lib/e2e/enum/Account.d.ts.map +1 -1
- package/lib/e2e/enum/Account.js +4 -0
- package/lib/e2e/enum/Account.js.map +1 -1
- package/lib/e2e/enum/AppInfos.d.ts +1 -0
- package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
- package/lib/e2e/enum/AppInfos.js +1 -0
- package/lib/e2e/enum/AppInfos.js.map +1 -1
- package/lib/e2e/enum/Currency.d.ts +2 -0
- package/lib/e2e/enum/Currency.d.ts.map +1 -1
- package/lib/e2e/enum/Currency.js +2 -0
- package/lib/e2e/enum/Currency.js.map +1 -1
- package/lib/e2e/enum/Network.d.ts +2 -1
- package/lib/e2e/enum/Network.d.ts.map +1 -1
- package/lib/e2e/enum/Network.js +1 -0
- package/lib/e2e/enum/Network.js.map +1 -1
- package/lib/e2e/enum/TokenType.d.ts +2 -1
- package/lib/e2e/enum/TokenType.d.ts.map +1 -1
- package/lib/e2e/enum/TokenType.js +1 -0
- package/lib/e2e/enum/TokenType.js.map +1 -1
- package/lib/e2e/enum/TransactionStatus.d.ts +4 -1
- package/lib/e2e/enum/TransactionStatus.d.ts.map +1 -1
- package/lib/e2e/enum/TransactionStatus.js +3 -0
- package/lib/e2e/enum/TransactionStatus.js.map +1 -1
- package/lib/e2e/families/sui.d.ts +2 -0
- package/lib/e2e/families/sui.d.ts.map +1 -0
- package/lib/e2e/families/sui.js +11 -0
- package/lib/e2e/families/sui.js.map +1 -0
- package/lib/e2e/index.d.ts +11 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +1 -0
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +23 -1
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/exchange/providers/swap.js +4 -4
- package/lib/exchange/providers/swap.js.map +1 -1
- package/lib/exchange/swap/api/v5/__mocks__/fetchRates.mocks.d.ts.map +1 -1
- package/lib/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js +1 -1
- package/lib/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js.map +1 -1
- package/lib/exchange/swap/mock.js +1 -1
- package/lib/exchange/swap/mock.js.map +1 -1
- package/lib/families/algorand/bridge/mock.d.ts.map +1 -1
- package/lib/families/algorand/bridge/mock.js +1 -0
- package/lib/families/algorand/bridge/mock.js.map +1 -1
- package/lib/families/bitcoin/bridge/mock.d.ts.map +1 -1
- package/lib/families/bitcoin/bridge/mock.js +1 -0
- package/lib/families/bitcoin/bridge/mock.js.map +1 -1
- package/lib/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib/families/canton/bridge/mock.js +3 -0
- package/lib/families/canton/bridge/mock.js.map +1 -1
- package/lib/families/cardano/bridge/mock.d.ts.map +1 -1
- package/lib/families/cardano/bridge/mock.js +1 -0
- package/lib/families/cardano/bridge/mock.js.map +1 -1
- package/lib/families/casper/bridge/mock.d.ts.map +1 -1
- package/lib/families/casper/bridge/mock.js +1 -0
- package/lib/families/casper/bridge/mock.js.map +1 -1
- package/lib/families/cosmos/bridge/mock.d.ts.map +1 -1
- package/lib/families/cosmos/bridge/mock.js +1 -0
- package/lib/families/cosmos/bridge/mock.js.map +1 -1
- package/lib/families/evm/bridge/mock.d.ts.map +1 -1
- package/lib/families/evm/bridge/mock.js +1 -0
- package/lib/families/evm/bridge/mock.js.map +1 -1
- package/lib/families/icon/bridge/mock.d.ts.map +1 -1
- package/lib/families/icon/bridge/mock.js +1 -0
- package/lib/families/icon/bridge/mock.js.map +1 -1
- package/lib/families/multiversx/bridge/mock.d.ts.map +1 -1
- package/lib/families/multiversx/bridge/mock.js +1 -0
- package/lib/families/multiversx/bridge/mock.js.map +1 -1
- package/lib/families/polkadot/bridge/mock.d.ts.map +1 -1
- package/lib/families/polkadot/bridge/mock.js +1 -0
- package/lib/families/polkadot/bridge/mock.js.map +1 -1
- package/lib/families/polkadot/config.d.ts.map +1 -1
- package/lib/families/polkadot/config.js +84 -0
- package/lib/families/polkadot/config.js.map +1 -1
- package/lib/families/polkadot/setup.d.ts.map +1 -1
- package/lib/families/polkadot/setup.js +5 -4
- package/lib/families/polkadot/setup.js.map +1 -1
- package/lib/families/solana/bridge/mock.d.ts +1 -0
- package/lib/families/solana/bridge/mock.d.ts.map +1 -1
- package/lib/families/stellar/bridge/mock.d.ts.map +1 -1
- package/lib/families/stellar/bridge/mock.js +1 -0
- package/lib/families/stellar/bridge/mock.js.map +1 -1
- package/lib/families/tezos/bridge/mock.d.ts.map +1 -1
- package/lib/families/tezos/bridge/mock.js +1 -0
- package/lib/families/tezos/bridge/mock.js.map +1 -1
- package/lib/families/tron/bridge/mock.d.ts.map +1 -1
- package/lib/families/tron/bridge/mock.js +1 -0
- package/lib/families/tron/bridge/mock.js.map +1 -1
- package/lib/families/xrp/bridge/mock.d.ts.map +1 -1
- package/lib/families/xrp/bridge/mock.js +1 -0
- package/lib/families/xrp/bridge/mock.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +3 -0
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +14 -1
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/generated/bridge/mock.d.ts +1 -0
- package/lib/generated/bridge/mock.d.ts.map +1 -1
- package/lib/hooks/useManifestWithSessionId.d.ts +12 -0
- package/lib/hooks/useManifestWithSessionId.d.ts.map +1 -0
- package/lib/hooks/useManifestWithSessionId.js +67 -0
- package/lib/hooks/useManifestWithSessionId.js.map +1 -0
- package/lib/hooks/useManifestWithSessionId.test.d.ts +2 -0
- package/lib/hooks/useManifestWithSessionId.test.d.ts.map +1 -0
- package/lib/hooks/useManifestWithSessionId.test.js +71 -0
- package/lib/hooks/useManifestWithSessionId.test.js.map +1 -0
- package/lib/hw/actions/rawTransaction.d.ts +37 -0
- package/lib/hw/actions/rawTransaction.d.ts.map +1 -0
- package/lib/hw/actions/rawTransaction.js +107 -0
- package/lib/hw/actions/rawTransaction.js.map +1 -0
- package/lib/market/utils/index.d.ts +1 -0
- package/lib/market/utils/index.d.ts.map +1 -1
- package/lib/market/utils/index.js +16 -0
- package/lib/market/utils/index.js.map +1 -1
- package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts +2 -0
- package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js +350 -0
- package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js.map +1 -0
- package/lib/modularDrawer/hooks/index.d.ts +2 -0
- package/lib/modularDrawer/hooks/index.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/index.js +6 -0
- package/lib/modularDrawer/hooks/index.js.map +1 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +9 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib/modularDrawer/hooks/useDetailedAccountsCore.d.ts +14 -0
- package/lib/modularDrawer/hooks/useDetailedAccountsCore.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/useDetailedAccountsCore.js +119 -0
- package/lib/modularDrawer/hooks/useDetailedAccountsCore.js.map +1 -0
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js +9 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +6 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +12 -4
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -1
- package/lib/modularDrawer/index.d.ts +4 -0
- package/lib/modularDrawer/index.d.ts.map +1 -0
- package/lib/modularDrawer/index.js +20 -0
- package/lib/modularDrawer/index.js.map +1 -0
- package/lib/modularDrawer/types/detailedAccount.d.ts +46 -0
- package/lib/modularDrawer/types/detailedAccount.d.ts.map +1 -0
- package/lib/modularDrawer/types/detailedAccount.js +3 -0
- package/lib/modularDrawer/types/detailedAccount.js.map +1 -0
- package/lib/modularDrawer/types/index.d.ts +2 -0
- package/lib/modularDrawer/types/index.d.ts.map +1 -0
- package/lib/modularDrawer/types/index.js +18 -0
- package/lib/modularDrawer/types/index.js.map +1 -0
- package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts +2 -0
- package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts.map +1 -0
- package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js +106 -0
- package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js.map +1 -0
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +3 -4
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -1
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +7 -0
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -1
- package/lib/modularDrawer/utils/index.d.ts +1 -0
- package/lib/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib/modularDrawer/utils/index.js +3 -1
- package/lib/modularDrawer/utils/index.js.map +1 -1
- package/lib/modularDrawer/utils/sortAccountsByFiatValue.d.ts +8 -0
- package/lib/modularDrawer/utils/sortAccountsByFiatValue.d.ts.map +1 -0
- package/lib/modularDrawer/utils/sortAccountsByFiatValue.js +17 -0
- package/lib/modularDrawer/utils/sortAccountsByFiatValue.js.map +1 -0
- package/lib/modularDrawer/utils/type.d.ts +2 -2
- package/lib/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib/platform/providers/RemoteLiveAppProvider/api/mock.json +3 -3
- package/lib/wallet-api/logic.d.ts +1 -0
- package/lib/wallet-api/logic.d.ts.map +1 -1
- package/lib/wallet-api/logic.js +21 -1
- package/lib/wallet-api/logic.js.map +1 -1
- package/lib/wallet-api/react.d.ts +9 -1
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +60 -2
- package/lib/wallet-api/react.js.map +1 -1
- package/lib/wallet-api/tracking.d.ts +3 -0
- package/lib/wallet-api/tracking.d.ts.map +1 -1
- package/lib/wallet-api/tracking.js +12 -0
- package/lib/wallet-api/tracking.js.map +1 -1
- package/lib/wallet-api/useDappLogic.js +1 -1
- package/lib/wallet-api/useDappLogic.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib-es/bridge/crypto-assets/index.js +0 -2
- package/lib-es/bridge/crypto-assets/index.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.test.js +0 -4
- package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.js +2 -0
- package/lib-es/bridge/generic-alpaca/accountBridge.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +1 -0
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +3 -0
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js +37 -45
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.js +0 -17
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signRawOperation.d.ts +8 -0
- package/lib-es/bridge/generic-alpaca/signRawOperation.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/signRawOperation.js +48 -0
- package/lib-es/bridge/generic-alpaca/signRawOperation.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js +1 -0
- package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js +163 -88
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +1 -0
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/bridge/mockHelpers.d.ts +1 -0
- package/lib-es/bridge/mockHelpers.d.ts.map +1 -1
- package/lib-es/bridge/mockHelpers.js +51 -0
- package/lib-es/bridge/mockHelpers.js.map +1 -1
- package/lib-es/bridge/react/BridgeSync.d.ts +1 -0
- package/lib-es/bridge/react/BridgeSync.d.ts.map +1 -1
- package/lib-es/bridge/react/BridgeSync.js +17 -15
- package/lib-es/bridge/react/BridgeSync.js.map +1 -1
- package/lib-es/bridge/react/BridgeSync.test.js +382 -65
- package/lib-es/bridge/react/BridgeSync.test.js.map +1 -1
- package/lib-es/currencies/index.d.ts +1 -1
- package/lib-es/currencies/index.d.ts.map +1 -1
- package/lib-es/currencies/index.js +1 -1
- package/lib-es/currencies/index.js.map +1 -1
- package/lib-es/currencies/sortByMarketcap.test.js +1 -3
- package/lib-es/currencies/sortByMarketcap.test.js.map +1 -1
- package/lib-es/dada-client/entities/index.d.ts +1 -1
- package/lib-es/dada-client/entities/index.d.ts.map +1 -1
- package/lib-es/e2e/enum/Account.d.ts +4 -0
- package/lib-es/e2e/enum/Account.d.ts.map +1 -1
- package/lib-es/e2e/enum/Account.js +4 -0
- package/lib-es/e2e/enum/Account.js.map +1 -1
- package/lib-es/e2e/enum/AppInfos.d.ts +1 -0
- package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
- package/lib-es/e2e/enum/AppInfos.js +1 -0
- package/lib-es/e2e/enum/AppInfos.js.map +1 -1
- package/lib-es/e2e/enum/Currency.d.ts +2 -0
- package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
- package/lib-es/e2e/enum/Currency.js +2 -0
- package/lib-es/e2e/enum/Currency.js.map +1 -1
- package/lib-es/e2e/enum/Network.d.ts +2 -1
- package/lib-es/e2e/enum/Network.d.ts.map +1 -1
- package/lib-es/e2e/enum/Network.js +1 -0
- package/lib-es/e2e/enum/Network.js.map +1 -1
- package/lib-es/e2e/enum/TokenType.d.ts +2 -1
- package/lib-es/e2e/enum/TokenType.d.ts.map +1 -1
- package/lib-es/e2e/enum/TokenType.js +1 -0
- package/lib-es/e2e/enum/TokenType.js.map +1 -1
- package/lib-es/e2e/enum/TransactionStatus.d.ts +4 -1
- package/lib-es/e2e/enum/TransactionStatus.d.ts.map +1 -1
- package/lib-es/e2e/enum/TransactionStatus.js +3 -0
- package/lib-es/e2e/enum/TransactionStatus.js.map +1 -1
- package/lib-es/e2e/families/sui.d.ts +2 -0
- package/lib-es/e2e/families/sui.d.ts.map +1 -0
- package/lib-es/e2e/families/sui.js +7 -0
- package/lib-es/e2e/families/sui.js.map +1 -0
- package/lib-es/e2e/index.d.ts +11 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +1 -0
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +21 -0
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/env.react.d.ts +1 -1
- package/lib-es/env.react.d.ts.map +1 -1
- package/lib-es/exchange/providers/swap.js +4 -4
- package/lib-es/exchange/providers/swap.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/__mocks__/fetchRates.mocks.d.ts.map +1 -1
- package/lib-es/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js +1 -1
- package/lib-es/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js.map +1 -1
- package/lib-es/exchange/swap/mock.js +1 -1
- package/lib-es/exchange/swap/mock.js.map +1 -1
- package/lib-es/families/algorand/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/algorand/bridge/mock.js +2 -1
- package/lib-es/families/algorand/bridge/mock.js.map +1 -1
- package/lib-es/families/bitcoin/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/bitcoin/bridge/mock.js +2 -1
- package/lib-es/families/bitcoin/bridge/mock.js.map +1 -1
- package/lib-es/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/canton/bridge/mock.js +3 -0
- package/lib-es/families/canton/bridge/mock.js.map +1 -1
- package/lib-es/families/cardano/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/cardano/bridge/mock.js +2 -1
- package/lib-es/families/cardano/bridge/mock.js.map +1 -1
- package/lib-es/families/casper/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/casper/bridge/mock.js +2 -1
- package/lib-es/families/casper/bridge/mock.js.map +1 -1
- package/lib-es/families/cosmos/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/cosmos/bridge/mock.js +2 -1
- package/lib-es/families/cosmos/bridge/mock.js.map +1 -1
- package/lib-es/families/evm/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/evm/bridge/mock.js +2 -1
- package/lib-es/families/evm/bridge/mock.js.map +1 -1
- package/lib-es/families/icon/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/icon/bridge/mock.js +2 -1
- package/lib-es/families/icon/bridge/mock.js.map +1 -1
- package/lib-es/families/multiversx/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/multiversx/bridge/mock.js +2 -1
- package/lib-es/families/multiversx/bridge/mock.js.map +1 -1
- package/lib-es/families/polkadot/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/polkadot/bridge/mock.js +2 -1
- package/lib-es/families/polkadot/bridge/mock.js.map +1 -1
- package/lib-es/families/polkadot/config.d.ts.map +1 -1
- package/lib-es/families/polkadot/config.js +84 -0
- package/lib-es/families/polkadot/config.js.map +1 -1
- package/lib-es/families/polkadot/setup.d.ts.map +1 -1
- package/lib-es/families/polkadot/setup.js +5 -4
- package/lib-es/families/polkadot/setup.js.map +1 -1
- package/lib-es/families/solana/bridge/mock.d.ts +1 -0
- package/lib-es/families/solana/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/stellar/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/stellar/bridge/mock.js +2 -1
- package/lib-es/families/stellar/bridge/mock.js.map +1 -1
- package/lib-es/families/tezos/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/tezos/bridge/mock.js +2 -1
- package/lib-es/families/tezos/bridge/mock.js.map +1 -1
- package/lib-es/families/tron/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/tron/bridge/mock.js +2 -1
- package/lib-es/families/tron/bridge/mock.js.map +1 -1
- package/lib-es/families/xrp/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/xrp/bridge/mock.js +2 -1
- package/lib-es/families/xrp/bridge/mock.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +3 -0
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +14 -1
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/generated/bridge/mock.d.ts +1 -0
- package/lib-es/generated/bridge/mock.d.ts.map +1 -1
- package/lib-es/hooks/useManifestWithSessionId.d.ts +12 -0
- package/lib-es/hooks/useManifestWithSessionId.d.ts.map +1 -0
- package/lib-es/hooks/useManifestWithSessionId.js +60 -0
- package/lib-es/hooks/useManifestWithSessionId.js.map +1 -0
- package/lib-es/hooks/useManifestWithSessionId.test.d.ts +2 -0
- package/lib-es/hooks/useManifestWithSessionId.test.d.ts.map +1 -0
- package/lib-es/hooks/useManifestWithSessionId.test.js +69 -0
- package/lib-es/hooks/useManifestWithSessionId.test.js.map +1 -0
- package/lib-es/hw/actions/rawTransaction.d.ts +37 -0
- package/lib-es/hw/actions/rawTransaction.d.ts.map +1 -0
- package/lib-es/hw/actions/rawTransaction.js +103 -0
- package/lib-es/hw/actions/rawTransaction.js.map +1 -0
- package/lib-es/market/utils/index.d.ts +1 -0
- package/lib-es/market/utils/index.d.ts.map +1 -1
- package/lib-es/market/utils/index.js +2 -0
- package/lib-es/market/utils/index.js.map +1 -1
- package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts +2 -0
- package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js +345 -0
- package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js.map +1 -0
- package/lib-es/modularDrawer/hooks/index.d.ts +2 -0
- package/lib-es/modularDrawer/hooks/index.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/index.js +2 -0
- package/lib-es/modularDrawer/hooks/index.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +9 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.d.ts +14 -0
- package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.js +115 -0
- package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +6 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +6 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +9 -4
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -1
- package/lib-es/modularDrawer/index.d.ts +4 -0
- package/lib-es/modularDrawer/index.d.ts.map +1 -0
- package/lib-es/modularDrawer/index.js +4 -0
- package/lib-es/modularDrawer/index.js.map +1 -0
- package/lib-es/modularDrawer/types/detailedAccount.d.ts +46 -0
- package/lib-es/modularDrawer/types/detailedAccount.d.ts.map +1 -0
- package/lib-es/modularDrawer/types/detailedAccount.js +2 -0
- package/lib-es/modularDrawer/types/detailedAccount.js.map +1 -0
- package/lib-es/modularDrawer/types/index.d.ts +2 -0
- package/lib-es/modularDrawer/types/index.d.ts.map +1 -0
- package/lib-es/modularDrawer/types/index.js +2 -0
- package/lib-es/modularDrawer/types/index.js.map +1 -0
- package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts +2 -0
- package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js +101 -0
- package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js.map +1 -0
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +3 -4
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +4 -0
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -1
- package/lib-es/modularDrawer/utils/index.d.ts +1 -0
- package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/index.js +1 -0
- package/lib-es/modularDrawer/utils/index.js.map +1 -1
- package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.d.ts +8 -0
- package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.js +13 -0
- package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.js.map +1 -0
- package/lib-es/modularDrawer/utils/type.d.ts +2 -2
- package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib-es/platform/providers/RemoteLiveAppProvider/api/mock.json +3 -3
- package/lib-es/wallet-api/logic.d.ts +1 -0
- package/lib-es/wallet-api/logic.d.ts.map +1 -1
- package/lib-es/wallet-api/logic.js +19 -0
- package/lib-es/wallet-api/logic.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts +9 -1
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +61 -3
- package/lib-es/wallet-api/react.js.map +1 -1
- package/lib-es/wallet-api/tracking.d.ts +3 -0
- package/lib-es/wallet-api/tracking.d.ts.map +1 -1
- package/lib-es/wallet-api/tracking.js +12 -0
- package/lib-es/wallet-api/tracking.js.map +1 -1
- package/lib-es/wallet-api/useDappLogic.js +2 -2
- package/lib-es/wallet-api/useDappLogic.js.map +1 -1
- package/package.json +59 -59
- package/src/bridge/crypto-assets/index.test.ts +0 -4
- package/src/bridge/crypto-assets/index.ts +0 -2
- package/src/bridge/generic-alpaca/accountBridge.ts +2 -0
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +8 -0
- package/src/bridge/generic-alpaca/prepareTransaction.ts +46 -69
- package/src/bridge/generic-alpaca/signOperation.ts +0 -20
- package/src/bridge/generic-alpaca/signRawOperation.ts +86 -0
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +1 -0
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +191 -109
- package/src/bridge/generic-alpaca/utils.ts +1 -0
- package/src/bridge/mockHelpers.ts +57 -0
- package/src/bridge/react/BridgeSync.test.tsx +513 -82
- package/src/bridge/react/BridgeSync.tsx +18 -17
- package/src/currencies/index.ts +1 -2
- package/src/currencies/sortByMarketcap.test.ts +1 -3
- package/src/dada-client/MIGRATION_GUIDE.md +215 -0
- package/src/dada-client/entities/index.ts +1 -1
- package/src/e2e/enum/Account.ts +31 -0
- package/src/e2e/enum/AppInfos.ts +2 -0
- package/src/e2e/enum/Currency.ts +11 -0
- package/src/e2e/enum/Network.ts +1 -0
- package/src/e2e/enum/TokenType.ts +1 -0
- package/src/e2e/enum/TransactionStatus.ts +3 -0
- package/src/e2e/families/sui.ts +7 -0
- package/src/e2e/speculos.ts +23 -0
- package/src/exchange/providers/swap.ts +4 -4
- package/src/exchange/swap/api/v5/__mocks__/fetchRates.mocks.ts +1 -2
- package/src/exchange/swap/mock.ts +1 -1
- package/src/families/algorand/bridge/mock.ts +2 -0
- package/src/families/bitcoin/bridge/mock.ts +2 -0
- package/src/families/canton/bridge/mock.ts +3 -0
- package/src/families/cardano/bridge/mock.ts +2 -0
- package/src/families/casper/bridge/mock.ts +2 -0
- package/src/families/cosmos/bridge/mock.ts +2 -0
- package/src/families/evm/bridge/mock.ts +2 -0
- package/src/families/icon/bridge/mock.ts +2 -0
- package/src/families/multiversx/bridge/mock.ts +2 -0
- package/src/families/polkadot/bridge/mock.ts +2 -0
- package/src/families/polkadot/config.ts +84 -0
- package/src/families/polkadot/setup.ts +6 -4
- package/src/families/stellar/bridge/mock.ts +2 -0
- package/src/families/tezos/bridge/mock.ts +2 -0
- package/src/families/tron/bridge/mock.ts +2 -0
- package/src/families/xrp/bridge/mock.ts +2 -0
- package/src/featureFlags/defaultFeatures.ts +15 -1
- package/src/hooks/useManifestWithSessionId.test.ts +105 -0
- package/src/hooks/useManifestWithSessionId.ts +83 -0
- package/src/hw/actions/rawTransaction.ts +190 -0
- package/src/market/utils/index.ts +3 -0
- package/src/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.ts +472 -0
- package/src/modularDrawer/hooks/index.ts +1 -0
- package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +9 -0
- package/src/modularDrawer/hooks/useDetailedAccountsCore.ts +146 -0
- package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +5 -1
- package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +10 -4
- package/src/modularDrawer/index.ts +3 -0
- package/src/modularDrawer/types/detailedAccount.ts +49 -0
- package/src/modularDrawer/types/index.ts +1 -0
- package/src/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.ts +117 -0
- package/src/modularDrawer/utils/getBalanceAndFiatValueByAssets.ts +6 -3
- package/src/modularDrawer/utils/index.ts +1 -0
- package/src/modularDrawer/utils/sortAccountsByFiatValue.ts +14 -0
- package/src/modularDrawer/utils/type.ts +3 -2
- package/src/platform/providers/RemoteLiveAppProvider/api/mock.json +3 -3
- package/src/wallet-api/logic.ts +35 -0
- package/src/wallet-api/react.ts +87 -1
- package/src/wallet-api/tracking.ts +15 -0
- package/src/wallet-api/useDappLogic.ts +3 -3
|
@@ -12,6 +12,9 @@ export const polkadotConfig: Record<string, ConfigInfo> = {
|
|
|
12
12
|
url: getEnv("API_POLKADOT_SIDECAR"),
|
|
13
13
|
credentials: getEnv("API_POLKADOT_SIDECAR_CREDENTIALS"),
|
|
14
14
|
},
|
|
15
|
+
indexer: {
|
|
16
|
+
url: getEnv("API_POLKADOT_INDEXER"),
|
|
17
|
+
},
|
|
15
18
|
node: {
|
|
16
19
|
url: getEnv("API_POLKADOT_NODE"),
|
|
17
20
|
},
|
|
@@ -20,9 +23,90 @@ export const polkadotConfig: Record<string, ConfigInfo> = {
|
|
|
20
23
|
},
|
|
21
24
|
metadataShortener: {
|
|
22
25
|
url: "https://polkadot-metadata-shortener.api.live.ledger.com/transaction/metadata",
|
|
26
|
+
id: "dot",
|
|
23
27
|
},
|
|
24
28
|
metadataHash: {
|
|
25
29
|
url: "https://polkadot-metadata-shortener.api.live.ledger.com/node/metadata/hash",
|
|
30
|
+
id: "dot",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
config_currency_assethub_polkadot: {
|
|
35
|
+
type: "object",
|
|
36
|
+
default: {
|
|
37
|
+
status: {
|
|
38
|
+
type: "active",
|
|
39
|
+
},
|
|
40
|
+
sidecar: {
|
|
41
|
+
url: "https://polkadot-asset-hub-sidecar.coin.ledger.com",
|
|
42
|
+
},
|
|
43
|
+
node: {
|
|
44
|
+
url: "https://polkadot-asset-hub-fullnodes.api.live.ledger.com",
|
|
45
|
+
},
|
|
46
|
+
staking: {
|
|
47
|
+
electionStatusThreshold: getEnv("POLKADOT_ELECTION_STATUS_THRESHOLD"),
|
|
48
|
+
},
|
|
49
|
+
indexer: {
|
|
50
|
+
url: "https://explorers.api.live.ledger.com/blockchain/dot_asset_hub",
|
|
51
|
+
},
|
|
52
|
+
metadataShortener: {
|
|
53
|
+
url: "https://polkadot-metadata-shortener.api.live.ledger.com/transaction/metadata",
|
|
54
|
+
id: "dot-hub",
|
|
55
|
+
},
|
|
56
|
+
metadataHash: {
|
|
57
|
+
url: "https://polkadot-metadata-shortener.api.live.ledger.com/node/metadata/hash",
|
|
58
|
+
id: "dot-hub",
|
|
59
|
+
},
|
|
60
|
+
hasBeenMigrated: false,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
config_currency_westend: {
|
|
64
|
+
type: "object",
|
|
65
|
+
default: {
|
|
66
|
+
status: {
|
|
67
|
+
type: "active",
|
|
68
|
+
},
|
|
69
|
+
sidecar: {
|
|
70
|
+
url: "https://polkadot-westend-sidecar.coin.ledger.com/rc",
|
|
71
|
+
},
|
|
72
|
+
node: {
|
|
73
|
+
url: "https://polkadot-westend-fullnodes.api.live.ledger.com",
|
|
74
|
+
},
|
|
75
|
+
indexer: {
|
|
76
|
+
url: "https://explorers.api.live.ledger.com/blockchain/dot_westend",
|
|
77
|
+
},
|
|
78
|
+
metadataShortener: {
|
|
79
|
+
url: "https://polkadot-westend-metadata-shortener.api.live.ledger.com/transaction/metadata",
|
|
80
|
+
id: "dot-hub",
|
|
81
|
+
},
|
|
82
|
+
metadataHash: {
|
|
83
|
+
url: "https://polkadot-westend-metadata-shortener.api.live.ledger.com/node/metadata/hash",
|
|
84
|
+
id: "dot-hub",
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
config_currency_assethub_westend: {
|
|
89
|
+
type: "object",
|
|
90
|
+
default: {
|
|
91
|
+
status: {
|
|
92
|
+
type: "active",
|
|
93
|
+
},
|
|
94
|
+
sidecar: {
|
|
95
|
+
url: "https://polkadot-westend-sidecar.coin.ledger.com",
|
|
96
|
+
},
|
|
97
|
+
node: {
|
|
98
|
+
url: "https://polkadot-westend-asset-hub-fullnodes.api.live.ledger.com",
|
|
99
|
+
},
|
|
100
|
+
indexer: {
|
|
101
|
+
url: "https://explorers.api.live.ledger.com/blockchain/dot_asset_hub_westend",
|
|
102
|
+
},
|
|
103
|
+
metadataShortener: {
|
|
104
|
+
url: "https://polkadot-westend-metadata-shortener.api.live.ledger.com/transaction/metadata",
|
|
105
|
+
id: "dot-hub",
|
|
106
|
+
},
|
|
107
|
+
metadataHash: {
|
|
108
|
+
url: "https://polkadot-westend-metadata-shortener.api.live.ledger.com/node/metadata/hash",
|
|
109
|
+
id: "dot-hub",
|
|
26
110
|
},
|
|
27
111
|
},
|
|
28
112
|
},
|
|
@@ -15,15 +15,17 @@ import makeCliTools, { type CliTools } from "@ledgerhq/coin-polkadot/test/cli";
|
|
|
15
15
|
import { CreateSigner, createResolver, executeWithSigner } from "../../bridge/setup";
|
|
16
16
|
import { Resolver } from "../../hw/getAddress/types";
|
|
17
17
|
import { getCurrencyConfiguration } from "../../config";
|
|
18
|
-
import {
|
|
18
|
+
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
19
19
|
|
|
20
20
|
const createSigner: CreateSigner<Polkadot> = (transport: Transport) => {
|
|
21
21
|
return new Polkadot(transport);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const getCurrencyConfig = (currency?: CryptoCurrency): PolkadotCoinConfig => {
|
|
25
|
+
if (!currency) {
|
|
26
|
+
throw new Error("No currency provided");
|
|
27
|
+
}
|
|
28
|
+
return getCurrencyConfiguration<PolkadotCoinConfig>(currency);
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
const bridge: Bridge<Transaction, PolkadotAccount, TransactionStatus> = createBridges(
|
|
@@ -19,6 +19,7 @@ import { formatCurrencyUnit } from "../../../currencies";
|
|
|
19
19
|
import {
|
|
20
20
|
scanAccounts,
|
|
21
21
|
signOperation,
|
|
22
|
+
signRawOperation,
|
|
22
23
|
broadcast,
|
|
23
24
|
sync,
|
|
24
25
|
isInvalidRecipient,
|
|
@@ -217,6 +218,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
217
218
|
sync,
|
|
218
219
|
receive,
|
|
219
220
|
signOperation,
|
|
221
|
+
signRawOperation,
|
|
220
222
|
broadcast,
|
|
221
223
|
estimateMaxSpendable,
|
|
222
224
|
getSerializedAddressParameters,
|
|
@@ -18,6 +18,7 @@ import { getMainAccount } from "../../../account";
|
|
|
18
18
|
import {
|
|
19
19
|
scanAccounts,
|
|
20
20
|
signOperation,
|
|
21
|
+
signRawOperation,
|
|
21
22
|
broadcast,
|
|
22
23
|
sync,
|
|
23
24
|
isInvalidRecipient,
|
|
@@ -205,6 +206,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
205
206
|
sync,
|
|
206
207
|
receive,
|
|
207
208
|
signOperation,
|
|
209
|
+
signRawOperation,
|
|
208
210
|
broadcast,
|
|
209
211
|
getSerializedAddressParameters,
|
|
210
212
|
};
|
|
@@ -6,6 +6,7 @@ import { getSerializedAddressParameters } from "@ledgerhq/coin-framework/bridge/
|
|
|
6
6
|
import {
|
|
7
7
|
scanAccounts,
|
|
8
8
|
signOperation,
|
|
9
|
+
signRawOperation,
|
|
9
10
|
broadcast,
|
|
10
11
|
sync,
|
|
11
12
|
isInvalidRecipient,
|
|
@@ -114,6 +115,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
114
115
|
sync,
|
|
115
116
|
receive,
|
|
116
117
|
signOperation,
|
|
118
|
+
signRawOperation,
|
|
117
119
|
broadcast,
|
|
118
120
|
getSerializedAddressParameters,
|
|
119
121
|
};
|
|
@@ -20,6 +20,7 @@ import { formatCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index";
|
|
|
20
20
|
import {
|
|
21
21
|
scanAccounts,
|
|
22
22
|
signOperation,
|
|
23
|
+
signRawOperation,
|
|
23
24
|
broadcast,
|
|
24
25
|
sync,
|
|
25
26
|
isInvalidRecipient,
|
|
@@ -143,6 +144,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
143
144
|
sync,
|
|
144
145
|
receive,
|
|
145
146
|
signOperation,
|
|
147
|
+
signRawOperation,
|
|
146
148
|
broadcast,
|
|
147
149
|
getSerializedAddressParameters,
|
|
148
150
|
};
|
|
@@ -99,6 +99,9 @@ export const CURRENCY_DEFAULT_FEATURES = {
|
|
|
99
99
|
currencyKaspa: DEFAULT_FEATURE,
|
|
100
100
|
currencyEthereumHoodi: DEFAULT_FEATURE,
|
|
101
101
|
currencyCore: DEFAULT_FEATURE,
|
|
102
|
+
currencyWestend: DEFAULT_FEATURE,
|
|
103
|
+
currencyAssetHubPolkadot: DEFAULT_FEATURE,
|
|
104
|
+
currencyAssetHubWestend: DEFAULT_FEATURE,
|
|
102
105
|
};
|
|
103
106
|
|
|
104
107
|
/**
|
|
@@ -106,6 +109,7 @@ export const CURRENCY_DEFAULT_FEATURES = {
|
|
|
106
109
|
*/
|
|
107
110
|
export const DEFAULT_FEATURES: Features = {
|
|
108
111
|
...CURRENCY_DEFAULT_FEATURES,
|
|
112
|
+
welcomeScreenVideoCarousel: DEFAULT_FEATURE,
|
|
109
113
|
portfolioExchangeBanner: DEFAULT_FEATURE,
|
|
110
114
|
postOnboardingAssetsTransfer: DEFAULT_FEATURE,
|
|
111
115
|
counterValue: DEFAULT_FEATURE,
|
|
@@ -113,7 +117,6 @@ export const DEFAULT_FEATURES: Features = {
|
|
|
113
117
|
ptxServiceCtaExchangeDrawer: DEFAULT_FEATURE,
|
|
114
118
|
ptxServiceCtaScreens: DEFAULT_FEATURE,
|
|
115
119
|
ptxSwapReceiveTRC20WithoutTrx: DEFAULT_FEATURE,
|
|
116
|
-
ptxSwapDetailedView: DEFAULT_FEATURE,
|
|
117
120
|
disableNftLedgerMarket: DEFAULT_FEATURE,
|
|
118
121
|
disableNftRaribleOpensea: DEFAULT_FEATURE,
|
|
119
122
|
disableNftSend: DEFAULT_FEATURE,
|
|
@@ -127,6 +130,12 @@ export const DEFAULT_FEATURES: Features = {
|
|
|
127
130
|
brazePushNotifications: initFeature(),
|
|
128
131
|
stakeAccountBanner: initFeature(),
|
|
129
132
|
|
|
133
|
+
ptxSwapDetailedView: initFeature({
|
|
134
|
+
enabled: false,
|
|
135
|
+
params: {
|
|
136
|
+
variant: ABTestingVariants.variantA,
|
|
137
|
+
},
|
|
138
|
+
}),
|
|
130
139
|
buyDeviceFromLive: {
|
|
131
140
|
enabled: false,
|
|
132
141
|
params: { debug: false, url: null },
|
|
@@ -430,6 +439,11 @@ export const DEFAULT_FEATURES: Features = {
|
|
|
430
439
|
},
|
|
431
440
|
},
|
|
432
441
|
|
|
442
|
+
ptxEarnDrawerApy: {
|
|
443
|
+
enabled: false,
|
|
444
|
+
params: {},
|
|
445
|
+
},
|
|
446
|
+
|
|
433
447
|
ptxSwapLiveAppMobile: {
|
|
434
448
|
enabled: false,
|
|
435
449
|
params: {
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
import { renderHook, waitFor } from "@testing-library/react";
|
|
5
|
+
import { useManifestWithSessionId } from "./useManifestWithSessionId";
|
|
6
|
+
import { LiveAppManifest } from "../platform/types";
|
|
7
|
+
|
|
8
|
+
const mockFetch = jest.fn();
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
10
|
+
global.fetch = mockFetch as any;
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
13
|
+
const baseManifest = {
|
|
14
|
+
id: "test-app",
|
|
15
|
+
name: "Test App",
|
|
16
|
+
url: "https://example.com",
|
|
17
|
+
} as LiveAppManifest;
|
|
18
|
+
|
|
19
|
+
describe("useManifestWithSessionId", () => {
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
jest.clearAllMocks();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("returns null manifest during loading", async () => {
|
|
25
|
+
mockFetch.mockResolvedValueOnce({
|
|
26
|
+
ok: true,
|
|
27
|
+
json: async () => ({ providerSessionId: "abc123" }),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const { result } = renderHook(() =>
|
|
31
|
+
useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
expect(result.current.loading).toBe(true);
|
|
35
|
+
expect(result.current.manifest).toBeNull();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("returns manifest with externalID after success", async () => {
|
|
39
|
+
mockFetch.mockResolvedValueOnce({
|
|
40
|
+
ok: true,
|
|
41
|
+
json: async () => ({ providerSessionId: "abc123" }),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const { result } = renderHook(() =>
|
|
45
|
+
useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
await waitFor(() =>
|
|
49
|
+
expect(result.current.manifest).toEqual({
|
|
50
|
+
...baseManifest,
|
|
51
|
+
url: "https://example.com/?externalID=abc123",
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
expect(result.current.loading).toBe(false);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("falls back to original manifest if fetch rejects", async () => {
|
|
59
|
+
mockFetch.mockRejectedValueOnce(new Error("network error"));
|
|
60
|
+
|
|
61
|
+
const { result } = renderHook(() =>
|
|
62
|
+
useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
await waitFor(() => {
|
|
66
|
+
expect(result.current.manifest).toEqual(baseManifest);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
expect(result.current.loading).toBe(false);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("falls back to original manifest if response is not ok", async () => {
|
|
73
|
+
mockFetch.mockResolvedValueOnce({ ok: false });
|
|
74
|
+
|
|
75
|
+
const { result } = renderHook(() =>
|
|
76
|
+
useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
await waitFor(() => {
|
|
80
|
+
expect(result.current.manifest).toEqual(baseManifest);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
expect(result.current.loading).toBe(false);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("returns null if manifest is not provided", async () => {
|
|
87
|
+
const { result } = renderHook(() =>
|
|
88
|
+
useManifestWithSessionId({ manifest: null, shareAnalytics: true }),
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
expect(mockFetch).not.toHaveBeenCalled();
|
|
92
|
+
expect(result.current.manifest).toBeNull();
|
|
93
|
+
expect(result.current.loading).toBe(false);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("skips fetch if shareAnalytics is false and just returns manifest", () => {
|
|
97
|
+
const { result } = renderHook(() =>
|
|
98
|
+
useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: false }),
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
expect(mockFetch).not.toHaveBeenCalled();
|
|
102
|
+
expect(result.current.manifest).toEqual(baseManifest);
|
|
103
|
+
expect(result.current.loading).toBe(false);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { appendQueryParamsToManifestURL } from "../wallet-api/utils/appendQueryParamsToManifestURL";
|
|
3
|
+
import { LiveAppManifest } from "../platform/types";
|
|
4
|
+
import { getEnv } from "@ledgerhq/live-env";
|
|
5
|
+
|
|
6
|
+
type Options = {
|
|
7
|
+
manifest: LiveAppManifest | null | undefined;
|
|
8
|
+
shareAnalytics: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type HookResult = {
|
|
12
|
+
manifest?: LiveAppManifest | null;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function useManifestWithSessionId({ manifest, shareAnalytics }: Options): HookResult {
|
|
17
|
+
const [id, setId] = React.useState<string | null>(null);
|
|
18
|
+
const [loading, setLoading] = React.useState<boolean>(false);
|
|
19
|
+
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
let cancelled = false;
|
|
22
|
+
|
|
23
|
+
async function fetchId() {
|
|
24
|
+
if (!shareAnalytics || !manifest) {
|
|
25
|
+
setId(null);
|
|
26
|
+
setLoading(false);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
setLoading(true);
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const response = await fetch(getEnv("PROVIDER_SESSION_ID_ENDPOINT"), {
|
|
34
|
+
method: "GET",
|
|
35
|
+
headers: {
|
|
36
|
+
Accept: "application/json",
|
|
37
|
+
"Content-Type": "application/json",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (!response.ok) throw new Error("Failed to fetch session ID");
|
|
42
|
+
|
|
43
|
+
const { providerSessionId } = await response.json();
|
|
44
|
+
|
|
45
|
+
if (!cancelled) {
|
|
46
|
+
setId(providerSessionId);
|
|
47
|
+
setLoading(false);
|
|
48
|
+
}
|
|
49
|
+
} catch {
|
|
50
|
+
if (!cancelled) {
|
|
51
|
+
setId(null);
|
|
52
|
+
setLoading(false);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
fetchId();
|
|
58
|
+
|
|
59
|
+
return () => {
|
|
60
|
+
cancelled = true; // avoid setting state after unmount
|
|
61
|
+
};
|
|
62
|
+
}, [shareAnalytics]);
|
|
63
|
+
|
|
64
|
+
const customizedManifest = React.useMemo(() => {
|
|
65
|
+
if (!manifest) return null;
|
|
66
|
+
|
|
67
|
+
if (loading) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (id) {
|
|
72
|
+
const url = appendQueryParamsToManifestURL(manifest, {
|
|
73
|
+
externalID: id,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return url ? { ...manifest, url: url.toString() } : manifest;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return manifest;
|
|
80
|
+
}, [manifest, id, loading]);
|
|
81
|
+
|
|
82
|
+
return { manifest: customizedManifest, loading };
|
|
83
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { of, Observable } from "rxjs";
|
|
2
|
+
import { scan, catchError, tap } from "rxjs/operators";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { log } from "@ledgerhq/logs";
|
|
5
|
+
import { TransportStatusError } from "@ledgerhq/errors";
|
|
6
|
+
import { TransactionRefusedOnDevice } from "../../errors";
|
|
7
|
+
import { getMainAccount } from "../../account";
|
|
8
|
+
import { getAccountBridge } from "../../bridge";
|
|
9
|
+
import type { ConnectAppEvent, Input as ConnectAppInput } from "../connectApp";
|
|
10
|
+
import type { Action, Device } from "./types";
|
|
11
|
+
import type { AppRequest, AppState } from "./app";
|
|
12
|
+
import { createAction as createAppAction } from "./app";
|
|
13
|
+
import type {
|
|
14
|
+
Account,
|
|
15
|
+
AccountLike,
|
|
16
|
+
SignedOperation,
|
|
17
|
+
SignOperationEvent,
|
|
18
|
+
} from "@ledgerhq/types-live";
|
|
19
|
+
|
|
20
|
+
type State = {
|
|
21
|
+
signedOperation: SignedOperation | null | undefined;
|
|
22
|
+
deviceSignatureRequested: boolean;
|
|
23
|
+
deviceStreamingProgress: number | null | undefined;
|
|
24
|
+
transactionSignError: Error | null | undefined;
|
|
25
|
+
transactionChecksOptInTriggered: boolean;
|
|
26
|
+
transactionChecksOptIn: boolean | null;
|
|
27
|
+
manifestId?: string;
|
|
28
|
+
manifestName?: string;
|
|
29
|
+
};
|
|
30
|
+
type RawTransactionState = AppState & State;
|
|
31
|
+
type RawTransactionRequest = {
|
|
32
|
+
parentAccount: Account | null | undefined;
|
|
33
|
+
account: AccountLike;
|
|
34
|
+
transaction: string;
|
|
35
|
+
appName?: string;
|
|
36
|
+
dependencies?: AppRequest[];
|
|
37
|
+
requireLatestFirmware?: boolean;
|
|
38
|
+
manifestId?: string;
|
|
39
|
+
manifestName?: string;
|
|
40
|
+
};
|
|
41
|
+
export type RawTransactionResult =
|
|
42
|
+
| {
|
|
43
|
+
signedOperation: SignedOperation;
|
|
44
|
+
device: Device;
|
|
45
|
+
swapId?: string;
|
|
46
|
+
}
|
|
47
|
+
| {
|
|
48
|
+
transactionSignError: Error;
|
|
49
|
+
};
|
|
50
|
+
type TransactionAction = Action<RawTransactionRequest, RawTransactionState, RawTransactionResult>;
|
|
51
|
+
|
|
52
|
+
const mapResult = ({
|
|
53
|
+
device,
|
|
54
|
+
signedOperation,
|
|
55
|
+
transactionSignError,
|
|
56
|
+
}: RawTransactionState): RawTransactionResult | null | undefined =>
|
|
57
|
+
signedOperation && device
|
|
58
|
+
? {
|
|
59
|
+
signedOperation,
|
|
60
|
+
device,
|
|
61
|
+
}
|
|
62
|
+
: transactionSignError
|
|
63
|
+
? {
|
|
64
|
+
transactionSignError,
|
|
65
|
+
}
|
|
66
|
+
: null;
|
|
67
|
+
|
|
68
|
+
type Event =
|
|
69
|
+
| SignOperationEvent
|
|
70
|
+
| {
|
|
71
|
+
type: "error";
|
|
72
|
+
error: Error;
|
|
73
|
+
};
|
|
74
|
+
const initialState = {
|
|
75
|
+
signedOperation: null,
|
|
76
|
+
deviceSignatureRequested: false,
|
|
77
|
+
deviceStreamingProgress: null,
|
|
78
|
+
transactionSignError: null,
|
|
79
|
+
transactionChecksOptInTriggered: false,
|
|
80
|
+
transactionChecksOptIn: null,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const reducer = (state: State, e: Event): State => {
|
|
84
|
+
switch (e.type) {
|
|
85
|
+
case "error": {
|
|
86
|
+
const { error } = e;
|
|
87
|
+
const transactionSignError =
|
|
88
|
+
error instanceof TransportStatusError && error.statusCode === 0x6985
|
|
89
|
+
? new TransactionRefusedOnDevice()
|
|
90
|
+
: error;
|
|
91
|
+
return { ...initialState, transactionSignError };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
case "signed":
|
|
95
|
+
return { ...state, signedOperation: e.signedOperation };
|
|
96
|
+
|
|
97
|
+
case "device-signature-requested":
|
|
98
|
+
return { ...state, deviceSignatureRequested: true };
|
|
99
|
+
|
|
100
|
+
case "device-signature-granted":
|
|
101
|
+
return { ...state, deviceSignatureRequested: false };
|
|
102
|
+
|
|
103
|
+
case "device-streaming":
|
|
104
|
+
return { ...state, deviceStreamingProgress: e.progress };
|
|
105
|
+
|
|
106
|
+
case "transaction-checks-opt-in-triggered":
|
|
107
|
+
return { ...state, transactionChecksOptInTriggered: true };
|
|
108
|
+
|
|
109
|
+
case "transaction-checks-opt-in":
|
|
110
|
+
return { ...state, transactionChecksOptIn: true };
|
|
111
|
+
|
|
112
|
+
case "transaction-checks-opt-out":
|
|
113
|
+
return { ...state, transactionChecksOptIn: false };
|
|
114
|
+
|
|
115
|
+
default:
|
|
116
|
+
return state;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const createAction = (
|
|
121
|
+
connectAppExec: (arg0: ConnectAppInput) => Observable<ConnectAppEvent>,
|
|
122
|
+
): TransactionAction => {
|
|
123
|
+
const useHook = (
|
|
124
|
+
reduxDevice: Device | null | undefined,
|
|
125
|
+
{
|
|
126
|
+
account,
|
|
127
|
+
parentAccount,
|
|
128
|
+
transaction,
|
|
129
|
+
appName,
|
|
130
|
+
dependencies,
|
|
131
|
+
requireLatestFirmware,
|
|
132
|
+
manifestId,
|
|
133
|
+
manifestName,
|
|
134
|
+
}: RawTransactionRequest,
|
|
135
|
+
): RawTransactionState => {
|
|
136
|
+
const mainAccount = getMainAccount(account, parentAccount);
|
|
137
|
+
const appState = createAppAction(connectAppExec).useHook(reduxDevice, {
|
|
138
|
+
account: mainAccount,
|
|
139
|
+
appName,
|
|
140
|
+
dependencies,
|
|
141
|
+
requireLatestFirmware,
|
|
142
|
+
});
|
|
143
|
+
const { device, opened, inWrongDeviceForAccount, error } = appState;
|
|
144
|
+
const [state, setState] = useState(initialState);
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (!device || !opened || inWrongDeviceForAccount || error) {
|
|
147
|
+
setState(initialState);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const bridge = getAccountBridge(mainAccount);
|
|
152
|
+
const sub = bridge
|
|
153
|
+
.signRawOperation({
|
|
154
|
+
account: mainAccount,
|
|
155
|
+
transaction,
|
|
156
|
+
deviceId: device.deviceId,
|
|
157
|
+
deviceModelId: device.modelId,
|
|
158
|
+
})
|
|
159
|
+
.pipe(
|
|
160
|
+
catchError(error =>
|
|
161
|
+
of<{ type: "error"; error: Error }>({
|
|
162
|
+
type: "error",
|
|
163
|
+
error,
|
|
164
|
+
}),
|
|
165
|
+
),
|
|
166
|
+
tap((e: Event) => log("actions-transaction-event", e.type, e)),
|
|
167
|
+
scan(reducer, initialState),
|
|
168
|
+
)
|
|
169
|
+
.subscribe((x: any) => setState(x));
|
|
170
|
+
return () => {
|
|
171
|
+
sub.unsubscribe();
|
|
172
|
+
};
|
|
173
|
+
}, [device, mainAccount, transaction, opened, inWrongDeviceForAccount, error]);
|
|
174
|
+
return {
|
|
175
|
+
...appState,
|
|
176
|
+
...state,
|
|
177
|
+
manifestId,
|
|
178
|
+
manifestName,
|
|
179
|
+
deviceStreamingProgress:
|
|
180
|
+
state.signedOperation || state.transactionSignError
|
|
181
|
+
? null // when good app is opened, we start the progress so it doesn't "blink"
|
|
182
|
+
: state.deviceStreamingProgress || (appState.opened ? 0 : null),
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
return {
|
|
187
|
+
useHook,
|
|
188
|
+
mapResult,
|
|
189
|
+
};
|
|
190
|
+
};
|