@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
package/src/currencies/index.ts
CHANGED
|
@@ -7,9 +7,7 @@ import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
|
|
7
7
|
import { findCurrencyByTicker } from "@ledgerhq/live-countervalues/findCurrencyByTicker";
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
10
|
-
setCryptoAssetsStoreForCoinFramework({
|
|
11
|
-
findTokenByTicker: (_: string) => undefined,
|
|
12
|
-
} as CryptoAssetsStore);
|
|
10
|
+
setCryptoAssetsStoreForCoinFramework({} as CryptoAssetsStore);
|
|
13
11
|
|
|
14
12
|
test("sortCurrenciesByIds snapshot", () => {
|
|
15
13
|
const list = [...listCryptoCurrencies(), ...listTokens()];
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# DaDa Client Migration Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Migrate from `listTokens()` and `listTokensForCryptoCurrency()` to the DaDa Client API.
|
|
6
|
+
|
|
7
|
+
> **Remove CAL Initiative ([LIVE-21487](https://ledgerhq.atlassian.net/browse/LIVE-21487))**: Replace static token lists with dynamic, server-managed asset data. Beware there are many usages of listTokens that actually are going to get dropped or moved to simpler solution than even using DaDa. This guide is for the usecases we still need to list tokens.
|
|
8
|
+
|
|
9
|
+
## Migration Scenarios
|
|
10
|
+
|
|
11
|
+
### 1. Basic Token Lists
|
|
12
|
+
|
|
13
|
+
**Before:**
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { listTokens } from "@ledgerhq/cryptoassets";
|
|
17
|
+
|
|
18
|
+
function TokenList() {
|
|
19
|
+
const tokens = listTokens();
|
|
20
|
+
return (
|
|
21
|
+
<div>
|
|
22
|
+
{tokens.map(token => <div key={token.id}>{token.name}</div>)}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**After:**
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { useAssetsData } from "@ledgerhq/live-common/dada-client/hooks/useAssetsData";
|
|
32
|
+
|
|
33
|
+
function TokenList() {
|
|
34
|
+
const { data, isLoading, loadNext } = useAssetsData({
|
|
35
|
+
product: "lld",
|
|
36
|
+
version: __APP_VERSION__,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
if (isLoading) return <div>Loading...</div>;
|
|
40
|
+
|
|
41
|
+
const tokens = Object.values(data?.cryptoOrTokenCurrencies || {})
|
|
42
|
+
.filter(currency => currency.type === "TokenCurrency");
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<InfiniteScrollList
|
|
46
|
+
data={tokens}
|
|
47
|
+
renderItem={(token, index) => (
|
|
48
|
+
<div key={token.id}>{token.name}</div>
|
|
49
|
+
)}
|
|
50
|
+
onScrollEnd={loadNext}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 2. Currency-Specific Tokens
|
|
57
|
+
|
|
58
|
+
**Before:**
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { listTokensForCryptoCurrency } from "@ledgerhq/cryptoassets";
|
|
62
|
+
|
|
63
|
+
function EthereumTokens({ currency }) {
|
|
64
|
+
const tokens = listTokensForCryptoCurrency(currency);
|
|
65
|
+
return (
|
|
66
|
+
<select>
|
|
67
|
+
{tokens.map(token => (
|
|
68
|
+
<option key={token.id} value={token.id}>{token.name}</option>
|
|
69
|
+
))}
|
|
70
|
+
</select>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**After:**
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
import { useAssetsData } from "@ledgerhq/live-common/dada-client/hooks/useAssetsData";
|
|
79
|
+
|
|
80
|
+
function EthereumTokens({ currency }) {
|
|
81
|
+
const { data, isLoading } = useAssetsData({
|
|
82
|
+
currencyIds: [currency.id],
|
|
83
|
+
areCurrenciesFiltered: true,
|
|
84
|
+
product: "lld",
|
|
85
|
+
version: __APP_VERSION__,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (isLoading) return <div>Loading...</div>;
|
|
89
|
+
|
|
90
|
+
const tokens = Object.values(data?.cryptoOrTokenCurrencies || {})
|
|
91
|
+
.filter(c => c.type === "TokenCurrency" && c.parentCurrency?.id === currency.id);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<select>
|
|
95
|
+
{tokens.map(token => (
|
|
96
|
+
<option key={token.id} value={token.id}>{token.name}</option>
|
|
97
|
+
))}
|
|
98
|
+
</select>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 3. Search
|
|
104
|
+
|
|
105
|
+
**Before:**
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { listTokens } from "@ledgerhq/cryptoassets";
|
|
109
|
+
|
|
110
|
+
function SearchableTokens({ searchQuery }) {
|
|
111
|
+
const allTokens = listTokens();
|
|
112
|
+
const filteredTokens = allTokens.filter(token =>
|
|
113
|
+
token.name.toLowerCase().includes(searchQuery.toLowerCase())
|
|
114
|
+
);
|
|
115
|
+
return (
|
|
116
|
+
<div>
|
|
117
|
+
{filteredTokens.map(token => <div key={token.id}>{token.name}</div>)}
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**After:**
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { useAssetsData } from "@ledgerhq/live-common/dada-client/hooks/useAssetsData";
|
|
127
|
+
|
|
128
|
+
function SearchableTokens({ searchQuery }) {
|
|
129
|
+
const { data, isLoading, loadNext } = useAssetsData({
|
|
130
|
+
search: searchQuery,
|
|
131
|
+
product: "lld",
|
|
132
|
+
version: __APP_VERSION__,
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
if (isLoading) return <div>Loading...</div>;
|
|
136
|
+
|
|
137
|
+
const tokens = Object.values(data?.cryptoOrTokenCurrencies || {})
|
|
138
|
+
.filter(currency => currency.type === "TokenCurrency");
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<InfiniteScrollList
|
|
142
|
+
data={tokens}
|
|
143
|
+
renderItem={(token) => <div key={token.id}>{token.name}</div>}
|
|
144
|
+
onScrollEnd={loadNext}
|
|
145
|
+
/>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Setup
|
|
151
|
+
|
|
152
|
+
Add DaDa Client to your Redux store:
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
import { configureStore } from "@reduxjs/toolkit";
|
|
156
|
+
import { assetsDataApi } from "@ledgerhq/live-common/dada-client/state-manager/api";
|
|
157
|
+
|
|
158
|
+
const store = configureStore({
|
|
159
|
+
reducer: {
|
|
160
|
+
[assetsDataApi.reducerPath]: assetsDataApi.reducer,
|
|
161
|
+
},
|
|
162
|
+
middleware: getDefaultMiddleware => getDefaultMiddleware().concat(assetsDataApi.middleware),
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Configuration
|
|
167
|
+
|
|
168
|
+
**Desktop (LLD):**
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
product: "lld";
|
|
172
|
+
version: __APP_VERSION__;
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Mobile (LLM):**
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
import { VersionNumber } from "react-native-version-number";
|
|
179
|
+
|
|
180
|
+
product: "llm";
|
|
181
|
+
version: VersionNumber.appVersion;
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Pagination Components
|
|
185
|
+
|
|
186
|
+
**Desktop (LLD):** Use `InfiniteScrollList` with `onScrollEnd={loadNext}`
|
|
187
|
+
|
|
188
|
+
**Mobile (LLM):** Use `BottomSheetVirtualizedList` or `FlatList` with `onEndReached={loadNext}`
|
|
189
|
+
|
|
190
|
+
## API Reference
|
|
191
|
+
|
|
192
|
+
### useAssetsData (Paginated)
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
const { data, isLoading, loadNext, error, refetch } = useAssetsData({
|
|
196
|
+
product: "lld" | "llm", // app identifier
|
|
197
|
+
version: string, // app version
|
|
198
|
+
search?: string, // server-side search query
|
|
199
|
+
currencyIds?: string[], // filter by parent currencies
|
|
200
|
+
areCurrenciesFiltered?: boolean, // required when using currencyIds
|
|
201
|
+
useCase?: string, // optimize server response
|
|
202
|
+
isStaging?: boolean, // use staging API
|
|
203
|
+
});
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### useAssetData (Single Page)
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
const { data, isLoading, error, refetch } = useAssetData({
|
|
210
|
+
product: "lld" | "llm", // app identifier
|
|
211
|
+
version: string, // app version
|
|
212
|
+
currencyIds?: string[], // filter by parent currencies
|
|
213
|
+
isStaging?: boolean, // use staging API
|
|
214
|
+
});
|
|
215
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
2
2
|
import type { ApiAsset } from "@ledgerhq/cryptoassets";
|
|
3
|
-
import { PartialMarketItemResponse } from "
|
|
3
|
+
import { PartialMarketItemResponse } from "../../market/utils/types";
|
|
4
4
|
|
|
5
5
|
// Types for crypto asset metadata
|
|
6
6
|
export interface CryptoAssetMeta {
|
package/src/e2e/enum/Account.ts
CHANGED
|
@@ -526,6 +526,19 @@ export class Account {
|
|
|
526
526
|
1,
|
|
527
527
|
);
|
|
528
528
|
|
|
529
|
+
static readonly SUI_1 = new Account(
|
|
530
|
+
Currency.SUI,
|
|
531
|
+
"Sui 1",
|
|
532
|
+
"0xc6169bcce8718609e43d179b087e6c1e2ac28e5325660af34d22fb5ce284031e",
|
|
533
|
+
0,
|
|
534
|
+
);
|
|
535
|
+
static readonly SUI_2 = new Account(
|
|
536
|
+
Currency.SUI,
|
|
537
|
+
"Sui 2",
|
|
538
|
+
"0x6644c1ce77c5e5ef8d8bd3ae2a4e18239e5d418a5e0800ed5037818399e3a7f6",
|
|
539
|
+
1,
|
|
540
|
+
);
|
|
541
|
+
|
|
529
542
|
static readonly EMPTY = new Account(Currency.BTC, "Empty", "", 0);
|
|
530
543
|
}
|
|
531
544
|
|
|
@@ -640,6 +653,24 @@ export class TokenAccount extends Account {
|
|
|
640
653
|
TokenType.TRC20,
|
|
641
654
|
Account.TRX_1,
|
|
642
655
|
);
|
|
656
|
+
|
|
657
|
+
static readonly SUI_USDC_1 = new TokenAccount(
|
|
658
|
+
Currency.SUI_USDC,
|
|
659
|
+
"SUI USDC 1",
|
|
660
|
+
Account.SUI_1.address,
|
|
661
|
+
0,
|
|
662
|
+
TokenType.ERC20,
|
|
663
|
+
Account.SUI_1,
|
|
664
|
+
);
|
|
665
|
+
|
|
666
|
+
static readonly SUI_USDC_2 = new TokenAccount(
|
|
667
|
+
Currency.SUI_USDC,
|
|
668
|
+
"SUI USDC 2",
|
|
669
|
+
Account.SUI_2.address,
|
|
670
|
+
1,
|
|
671
|
+
TokenType.ERC20,
|
|
672
|
+
Account.SUI_2,
|
|
673
|
+
);
|
|
643
674
|
}
|
|
644
675
|
|
|
645
676
|
export type AccountType = Account | TokenAccount;
|
package/src/e2e/enum/AppInfos.ts
CHANGED
package/src/e2e/enum/Currency.ts
CHANGED
|
@@ -207,4 +207,15 @@ export class Currency {
|
|
|
207
207
|
static readonly OP = new Currency("OP Mainnet", "OP", "optimism", AppInfos.ETHEREUM, [
|
|
208
208
|
Network.OPTIMISM,
|
|
209
209
|
]);
|
|
210
|
+
|
|
211
|
+
static readonly SUI = new Currency("Sui", "SUI", "sui", AppInfos.SUI, [Network.SUI]);
|
|
212
|
+
|
|
213
|
+
static readonly SUI_USDC = new Currency(
|
|
214
|
+
"USDC",
|
|
215
|
+
"USDC",
|
|
216
|
+
"sui/coin/usdc_0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::usdc",
|
|
217
|
+
AppInfos.SUI,
|
|
218
|
+
[Network.SUI],
|
|
219
|
+
"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7",
|
|
220
|
+
);
|
|
210
221
|
}
|
package/src/e2e/enum/Network.ts
CHANGED
package/src/e2e/speculos.ts
CHANGED
|
@@ -42,6 +42,7 @@ import { Swap } from "./models/Swap";
|
|
|
42
42
|
import { delegateOsmosis } from "./families/osmosis";
|
|
43
43
|
import { AppInfos } from "./enum/AppInfos";
|
|
44
44
|
import { DEVICE_LABELS_CONFIG } from "./data/deviceLabelsData";
|
|
45
|
+
import { sendSui } from "./families/sui";
|
|
45
46
|
|
|
46
47
|
const isSpeculosRemote = process.env.REMOTE_SPECULOS === "true";
|
|
47
48
|
|
|
@@ -344,6 +345,14 @@ export const specs: Specs = {
|
|
|
344
345
|
},
|
|
345
346
|
dependency: "",
|
|
346
347
|
},
|
|
348
|
+
Sui: {
|
|
349
|
+
currency: getCryptoCurrencyById("sui"),
|
|
350
|
+
appQuery: {
|
|
351
|
+
model: getSpeculosModel(),
|
|
352
|
+
appName: "Sui",
|
|
353
|
+
},
|
|
354
|
+
dependency: "",
|
|
355
|
+
},
|
|
347
356
|
};
|
|
348
357
|
|
|
349
358
|
export async function startSpeculos(
|
|
@@ -632,6 +641,10 @@ export async function goToSettings() {
|
|
|
632
641
|
await pressBoth();
|
|
633
642
|
}
|
|
634
643
|
|
|
644
|
+
export async function providePublicKey() {
|
|
645
|
+
await pressRightButton();
|
|
646
|
+
}
|
|
647
|
+
|
|
635
648
|
type DeviceLabelsReturn = {
|
|
636
649
|
delegateConfirmLabel: string;
|
|
637
650
|
delegateVerifyLabel: string;
|
|
@@ -660,6 +673,10 @@ export function getDeviceLabels(appInfo: AppInfos): DeviceLabelsReturn {
|
|
|
660
673
|
}
|
|
661
674
|
|
|
662
675
|
export async function expectValidAddressDevice(account: Account, addressDisplayed: string) {
|
|
676
|
+
if (account.currency === Currency.SUI_USDC) {
|
|
677
|
+
providePublicKey();
|
|
678
|
+
}
|
|
679
|
+
|
|
663
680
|
const { receiveVerifyLabel, receiveConfirmLabel } = getDeviceLabels(account.currency.speculosApp);
|
|
664
681
|
|
|
665
682
|
await waitFor(receiveVerifyLabel);
|
|
@@ -721,6 +738,12 @@ export async function signSendTransaction(tx: Transaction) {
|
|
|
721
738
|
case Currency.HBAR:
|
|
722
739
|
await sendHedera();
|
|
723
740
|
break;
|
|
741
|
+
case Currency.SUI:
|
|
742
|
+
await sendSui();
|
|
743
|
+
break;
|
|
744
|
+
case Currency.SUI_USDC:
|
|
745
|
+
await sendSui();
|
|
746
|
+
break;
|
|
724
747
|
default:
|
|
725
748
|
throw new Error(`Unsupported currency: ${currencyName.ticker}`);
|
|
726
749
|
}
|
|
@@ -140,9 +140,9 @@ const DEFAULT_SWAP_PROVIDERS: Record<string, ProviderConfig & Partial<Additional
|
|
|
140
140
|
type: "DEX",
|
|
141
141
|
needsKYC: false,
|
|
142
142
|
needsBearerToken: false,
|
|
143
|
-
termsOfUseUrl: "https://1inch.
|
|
144
|
-
supportUrl: "https://help.1inch.
|
|
145
|
-
mainUrl: "https://1inch.
|
|
143
|
+
termsOfUseUrl: "https://1inch.com/assets/Widget_1inch.com_Terms_of_Use.pdf",
|
|
144
|
+
supportUrl: "https://help.1inch.com/en/",
|
|
145
|
+
mainUrl: "https://1inch.com/",
|
|
146
146
|
},
|
|
147
147
|
paraswap: {
|
|
148
148
|
type: "DEX",
|
|
@@ -232,7 +232,7 @@ export const dexProvidersContractAddress: { [key: string]: string } = {
|
|
|
232
232
|
|
|
233
233
|
export const termsOfUse: { [key: string]: string } = {
|
|
234
234
|
paraswap: "https://paraswap.io/tos",
|
|
235
|
-
"1inch": "https://1inch.
|
|
235
|
+
"1inch": "https://1inch.com/assets/Widget_1inch.com_Terms_of_Use.pdf",
|
|
236
236
|
Uniswap: "https://uniswap.org/terms-of-service",
|
|
237
237
|
};
|
|
238
238
|
|
|
@@ -58,8 +58,7 @@ export const fetchRatesMock = (
|
|
|
58
58
|
{
|
|
59
59
|
provider: "oneinch",
|
|
60
60
|
providerType: "DEX",
|
|
61
|
-
providerURL:
|
|
62
|
-
"https://app.1inch.io/#/1/unified/swap/usdt/eth?ledgerLive=true&sourceTokenAmount=100",
|
|
61
|
+
providerURL: "https://1inch.com/swap/#/1/unified/swap/usdt/eth&sourceTokenAmount=100",
|
|
63
62
|
from: "ethereum/erc20/usd_tether__erc20_",
|
|
64
63
|
to: "ethereum",
|
|
65
64
|
amountFrom: "100",
|
|
@@ -103,7 +103,7 @@ export const mockGetExchangeRates = async (
|
|
|
103
103
|
providerType: "DEX",
|
|
104
104
|
expirationDate: new Date(),
|
|
105
105
|
tradeMethod: "float",
|
|
106
|
-
providerURL: `https://
|
|
106
|
+
providerURL: `https://1inch.com/swap/#/1/unified/swap/eth/usdt&sourceTokenAmount=${transaction.amount}`,
|
|
107
107
|
},
|
|
108
108
|
];
|
|
109
109
|
};
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
makeAccountBridgeReceive,
|
|
13
13
|
scanAccounts,
|
|
14
14
|
signOperation,
|
|
15
|
+
signRawOperation,
|
|
15
16
|
broadcast,
|
|
16
17
|
sync,
|
|
17
18
|
isInvalidRecipient,
|
|
@@ -106,6 +107,7 @@ const accountBridge: AccountBridge<AlgorandTransaction, any> = {
|
|
|
106
107
|
assignFromAccountRaw,
|
|
107
108
|
initAccount,
|
|
108
109
|
signOperation,
|
|
110
|
+
signRawOperation,
|
|
109
111
|
broadcast,
|
|
110
112
|
getSerializedAddressParameters,
|
|
111
113
|
};
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
makeAccountBridgeReceive,
|
|
13
13
|
scanAccounts,
|
|
14
14
|
signOperation,
|
|
15
|
+
signRawOperation,
|
|
15
16
|
broadcast,
|
|
16
17
|
sync,
|
|
17
18
|
isInvalidRecipient,
|
|
@@ -129,6 +130,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
129
130
|
sync,
|
|
130
131
|
receive,
|
|
131
132
|
signOperation,
|
|
133
|
+
signRawOperation,
|
|
132
134
|
broadcast,
|
|
133
135
|
getSerializedAddressParameters,
|
|
134
136
|
};
|
|
@@ -165,6 +165,9 @@ const accountBridge: AccountBridge<CantonTransaction> = {
|
|
|
165
165
|
sync,
|
|
166
166
|
receive,
|
|
167
167
|
signOperation,
|
|
168
|
+
signRawOperation: () => {
|
|
169
|
+
throw new Error("signRawOperation is not supported");
|
|
170
|
+
},
|
|
168
171
|
broadcast,
|
|
169
172
|
getSerializedAddressParameters,
|
|
170
173
|
};
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
scanAccounts,
|
|
27
27
|
signOperation,
|
|
28
|
+
signRawOperation,
|
|
28
29
|
broadcast,
|
|
29
30
|
sync,
|
|
30
31
|
makeAccountBridgeReceive,
|
|
@@ -168,6 +169,7 @@ const accountBridge: AccountBridge<CardanoTransaction> = {
|
|
|
168
169
|
sync,
|
|
169
170
|
receive,
|
|
170
171
|
signOperation,
|
|
172
|
+
signRawOperation,
|
|
171
173
|
broadcast,
|
|
172
174
|
getSerializedAddressParameters,
|
|
173
175
|
};
|
|
@@ -11,6 +11,7 @@ import type { Transaction, TransactionStatus } from "../types";
|
|
|
11
11
|
import {
|
|
12
12
|
scanAccounts,
|
|
13
13
|
signOperation,
|
|
14
|
+
signRawOperation,
|
|
14
15
|
broadcast,
|
|
15
16
|
sync,
|
|
16
17
|
makeAccountBridgeReceive,
|
|
@@ -167,6 +168,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
167
168
|
sync,
|
|
168
169
|
receive,
|
|
169
170
|
signOperation,
|
|
171
|
+
signRawOperation,
|
|
170
172
|
broadcast,
|
|
171
173
|
estimateMaxSpendable,
|
|
172
174
|
getSerializedAddressParameters,
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
makeAccountBridgeReceive,
|
|
33
33
|
scanAccounts,
|
|
34
34
|
signOperation,
|
|
35
|
+
signRawOperation,
|
|
35
36
|
sync,
|
|
36
37
|
} from "../../../bridge/mockHelpers";
|
|
37
38
|
import { getCurrencyConfiguration } from "../../../config";
|
|
@@ -126,6 +127,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
126
127
|
sync,
|
|
127
128
|
receive,
|
|
128
129
|
signOperation,
|
|
130
|
+
signRawOperation,
|
|
129
131
|
broadcast,
|
|
130
132
|
assignFromAccountRaw,
|
|
131
133
|
assignToAccountRaw,
|
|
@@ -6,6 +6,7 @@ import { getMainAccount } from "../../../account";
|
|
|
6
6
|
import {
|
|
7
7
|
scanAccounts,
|
|
8
8
|
signOperation,
|
|
9
|
+
signRawOperation,
|
|
9
10
|
broadcast,
|
|
10
11
|
sync,
|
|
11
12
|
makeAccountBridgeReceive,
|
|
@@ -118,6 +119,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
118
119
|
sync,
|
|
119
120
|
receive,
|
|
120
121
|
signOperation,
|
|
122
|
+
signRawOperation,
|
|
121
123
|
broadcast,
|
|
122
124
|
getSerializedAddressParameters,
|
|
123
125
|
};
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
scanAccounts,
|
|
11
11
|
signOperation,
|
|
12
|
+
signRawOperation,
|
|
12
13
|
broadcast,
|
|
13
14
|
sync,
|
|
14
15
|
isInvalidRecipient,
|
|
@@ -79,6 +80,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
79
80
|
sync,
|
|
80
81
|
receive,
|
|
81
82
|
signOperation,
|
|
83
|
+
signRawOperation,
|
|
82
84
|
broadcast,
|
|
83
85
|
getSerializedAddressParameters,
|
|
84
86
|
};
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
makeAccountBridgeReceive,
|
|
9
9
|
scanAccounts,
|
|
10
10
|
signOperation,
|
|
11
|
+
signRawOperation,
|
|
11
12
|
broadcast,
|
|
12
13
|
sync,
|
|
13
14
|
isInvalidRecipient,
|
|
@@ -99,6 +100,7 @@ const accountBridge: AccountBridge<Transaction, any> = {
|
|
|
99
100
|
assignToAccountRaw,
|
|
100
101
|
assignFromAccountRaw,
|
|
101
102
|
signOperation,
|
|
103
|
+
signRawOperation,
|
|
102
104
|
broadcast,
|
|
103
105
|
getSerializedAddressParameters,
|
|
104
106
|
};
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
makeAccountBridgeReceive,
|
|
9
9
|
scanAccounts,
|
|
10
10
|
signOperation,
|
|
11
|
+
signRawOperation,
|
|
11
12
|
broadcast,
|
|
12
13
|
sync,
|
|
13
14
|
isInvalidRecipient,
|
|
@@ -98,6 +99,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
98
99
|
assignToAccountRaw,
|
|
99
100
|
assignFromAccountRaw,
|
|
100
101
|
signOperation,
|
|
102
|
+
signRawOperation,
|
|
101
103
|
broadcast,
|
|
102
104
|
getSerializedAddressParameters,
|
|
103
105
|
};
|