@ledgerhq/live-common 29.1.0 → 29.2.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/account/serialization.d.ts +0 -6
- package/lib/account/serialization.d.ts.map +1 -1
- package/lib/account/serialization.js +11 -50
- package/lib/account/serialization.js.map +1 -1
- package/lib/apps/hw.js +1 -1
- package/lib/apps/hw.js.map +1 -1
- package/lib/countervalues/react.d.ts.map +1 -1
- package/lib/countervalues/react.js +1 -1
- package/lib/countervalues/react.js.map +1 -1
- package/lib/data/icons/react/gm.d.ts +8 -0
- package/lib/data/icons/react/gm.d.ts.map +1 -0
- package/lib/data/icons/react/gm.js +36 -0
- package/lib/data/icons/react/gm.js.map +1 -0
- package/lib/data/icons/react/index.d.ts +1 -0
- package/lib/data/icons/react/index.d.ts.map +1 -1
- package/lib/data/icons/react/index.js +9 -7
- package/lib/data/icons/react/index.js.map +1 -1
- package/lib/data/icons/reactNative/gm.d.ts +8 -0
- package/lib/data/icons/reactNative/gm.d.ts.map +1 -0
- package/lib/data/icons/reactNative/gm.js +37 -0
- package/lib/data/icons/reactNative/gm.js.map +1 -0
- package/lib/data/icons/reactNative/index.d.ts +1 -0
- package/lib/data/icons/reactNative/index.d.ts.map +1 -1
- package/lib/data/icons/reactNative/index.js +9 -7
- package/lib/data/icons/reactNative/index.js.map +1 -1
- package/lib/families/algorand/bridge/js.d.ts.map +1 -1
- package/lib/families/algorand/bridge/js.js +0 -1
- package/lib/families/algorand/bridge/js.js.map +1 -1
- package/lib/families/algorand/bridge/mock.d.ts.map +1 -1
- package/lib/families/algorand/bridge/mock.js +0 -1
- package/lib/families/algorand/bridge/mock.js.map +1 -1
- package/lib/families/algorand/serialization.d.ts +0 -1
- package/lib/families/algorand/serialization.d.ts.map +1 -1
- package/lib/families/algorand/serialization.js +1 -16
- package/lib/families/algorand/serialization.js.map +1 -1
- package/lib/families/bitcoin/bridge/js.d.ts.map +1 -1
- package/lib/families/bitcoin/bridge/js.js +4 -1
- package/lib/families/bitcoin/bridge/js.js.map +1 -1
- package/lib/families/bitcoin/descriptor.test.js +2 -0
- package/lib/families/bitcoin/descriptor.test.js.map +1 -1
- package/lib/families/bitcoin/satstack.test.js +2 -0
- package/lib/families/bitcoin/satstack.test.js.map +1 -1
- package/lib/families/bitcoin/serialization.d.ts +3 -0
- package/lib/families/bitcoin/serialization.d.ts.map +1 -1
- package/lib/families/bitcoin/serialization.js +16 -1
- package/lib/families/bitcoin/serialization.js.map +1 -1
- package/lib/families/bitcoin/serialization.test.d.ts +2 -0
- package/lib/families/bitcoin/serialization.test.d.ts.map +1 -0
- package/lib/families/bitcoin/serialization.test.js +110 -0
- package/lib/families/bitcoin/serialization.test.js.map +1 -0
- package/lib/families/cardano/bridge/js.d.ts.map +1 -1
- package/lib/families/cardano/bridge/js.js +0 -1
- package/lib/families/cardano/bridge/js.js.map +1 -1
- package/lib/families/cardano/serialization.d.ts +0 -1
- package/lib/families/cardano/serialization.d.ts.map +1 -1
- package/lib/families/cardano/serialization.js +1 -18
- package/lib/families/cardano/serialization.js.map +1 -1
- package/lib/families/celo/bridge/js.d.ts.map +1 -1
- package/lib/families/celo/bridge/js.js +0 -1
- package/lib/families/celo/bridge/js.js.map +1 -1
- package/lib/families/celo/serialization.d.ts +0 -1
- package/lib/families/celo/serialization.d.ts.map +1 -1
- package/lib/families/celo/serialization.js +1 -15
- package/lib/families/celo/serialization.js.map +1 -1
- package/lib/families/cosmos/bridge/js.d.ts.map +1 -1
- package/lib/families/cosmos/bridge/js.js +0 -2
- package/lib/families/cosmos/bridge/js.js.map +1 -1
- package/lib/families/cosmos/js-synchronisation.d.ts +1 -3
- package/lib/families/cosmos/js-synchronisation.d.ts.map +1 -1
- package/lib/families/cosmos/js-synchronisation.js +1 -16
- package/lib/families/cosmos/js-synchronisation.js.map +1 -1
- package/lib/families/crypto_org/api/sdk.d.ts.map +1 -1
- package/lib/families/crypto_org/api/sdk.js +6 -9
- package/lib/families/crypto_org/api/sdk.js.map +1 -1
- package/lib/families/crypto_org/js-buildTransaction.d.ts.map +1 -1
- package/lib/families/crypto_org/js-buildTransaction.js +3 -2
- package/lib/families/crypto_org/js-buildTransaction.js.map +1 -1
- package/lib/families/crypto_org/js-signOperation.js +1 -1
- package/lib/families/crypto_org/js-signOperation.js.map +1 -1
- package/lib/families/crypto_org/logic.d.ts +0 -16
- package/lib/families/crypto_org/logic.d.ts.map +1 -1
- package/lib/families/crypto_org/logic.js +6 -20
- package/lib/families/crypto_org/logic.js.map +1 -1
- package/lib/families/elrond/bridge/js.d.ts.map +1 -1
- package/lib/families/elrond/bridge/js.js +0 -2
- package/lib/families/elrond/bridge/js.js.map +1 -1
- package/lib/families/elrond/js-synchronisation.d.ts +1 -3
- package/lib/families/elrond/js-synchronisation.d.ts.map +1 -1
- package/lib/families/elrond/js-synchronisation.js +1 -16
- package/lib/families/elrond/js-synchronisation.js.map +1 -1
- package/lib/families/ethereum/__tests__/nft.integration.test.js +0 -7
- package/lib/families/ethereum/__tests__/nft.integration.test.js.map +1 -1
- package/lib/families/hedera/api/mirror.d.ts.map +1 -1
- package/lib/families/hedera/api/mirror.js +40 -16
- package/lib/families/hedera/api/mirror.js.map +1 -1
- package/lib/families/hedera/api/network.js +6 -1
- package/lib/families/hedera/api/network.js.map +1 -1
- package/lib/families/hedera/bridge.integration.test.js +1 -2
- package/lib/families/hedera/bridge.integration.test.js.map +1 -1
- package/lib/families/hedera/js-estimateMaxSpendable.d.ts.map +1 -1
- package/lib/families/hedera/js-estimateMaxSpendable.js +55 -11
- package/lib/families/hedera/js-estimateMaxSpendable.js.map +1 -1
- package/lib/families/hedera/js-getTransactionStatus.d.ts.map +1 -1
- package/lib/families/hedera/js-getTransactionStatus.js +5 -2
- package/lib/families/hedera/js-getTransactionStatus.js.map +1 -1
- package/lib/families/hedera/js-signOperation.js +23 -16
- package/lib/families/hedera/js-signOperation.js.map +1 -1
- package/lib/families/hedera/tests/js-estimateMaxSpendable.integration.test.d.ts +2 -0
- package/lib/families/hedera/tests/js-estimateMaxSpendable.integration.test.d.ts.map +1 -0
- package/lib/families/hedera/tests/{js-estimateMaxSpendable.test.js → js-estimateMaxSpendable.integration.test.js} +27 -3
- package/lib/families/hedera/tests/js-estimateMaxSpendable.integration.test.js.map +1 -0
- package/lib/families/hedera/tests/utils.integration.test.d.ts +2 -0
- package/lib/families/hedera/tests/utils.integration.test.d.ts.map +1 -0
- package/lib/families/hedera/tests/{utils.test.js → utils.integration.test.js} +28 -4
- package/lib/families/hedera/tests/utils.integration.test.js.map +1 -0
- package/lib/families/hedera/utils.d.ts +1 -1
- package/lib/families/hedera/utils.d.ts.map +1 -1
- package/lib/families/hedera/utils.js +40 -14
- package/lib/families/hedera/utils.js.map +1 -1
- package/lib/families/near/bridge/js.d.ts.map +1 -1
- package/lib/families/near/bridge/js.js +1 -2
- package/lib/families/near/bridge/js.js.map +1 -1
- package/lib/families/near/serialization.d.ts +0 -1
- package/lib/families/near/serialization.d.ts.map +1 -1
- package/lib/families/near/serialization.js +1 -15
- package/lib/families/near/serialization.js.map +1 -1
- package/lib/families/solana/api/chain/web3.d.ts +1 -0
- package/lib/families/solana/api/chain/web3.d.ts.map +1 -1
- package/lib/families/solana/api/chain/web3.js +16 -1
- package/lib/families/solana/api/chain/web3.js.map +1 -1
- package/lib/families/solana/bridge/bridge.d.ts.map +1 -1
- package/lib/families/solana/bridge/bridge.js +0 -1
- package/lib/families/solana/bridge/bridge.js.map +1 -1
- package/lib/families/solana/bridge.integration.test.js +7 -4
- package/lib/families/solana/bridge.integration.test.js.map +1 -1
- package/lib/families/solana/js-estimateMaxSpendable.d.ts.map +1 -1
- package/lib/families/solana/js-estimateMaxSpendable.js +9 -6
- package/lib/families/solana/js-estimateMaxSpendable.js.map +1 -1
- package/lib/families/solana/js-prepareTransaction.d.ts.map +1 -1
- package/lib/families/solana/js-prepareTransaction.js +15 -8
- package/lib/families/solana/js-prepareTransaction.js.map +1 -1
- package/lib/families/solana/logic.d.ts +0 -1
- package/lib/families/solana/logic.d.ts.map +1 -1
- package/lib/families/solana/logic.js +1 -4
- package/lib/families/solana/logic.js.map +1 -1
- package/lib/families/solana/serialization.d.ts +0 -1
- package/lib/families/solana/serialization.d.ts.map +1 -1
- package/lib/families/solana/serialization.js +1 -15
- package/lib/families/solana/serialization.js.map +1 -1
- package/lib/families/tezos/bridge/js.d.ts.map +1 -1
- package/lib/families/tezos/bridge/js.js +0 -1
- package/lib/families/tezos/bridge/js.js.map +1 -1
- package/lib/families/tezos/serialization.d.ts +0 -1
- package/lib/families/tezos/serialization.d.ts.map +1 -1
- package/lib/families/tezos/serialization.js +1 -18
- package/lib/families/tezos/serialization.js.map +1 -1
- package/lib/families/tron/bridge/js.d.ts.map +1 -1
- package/lib/families/tron/bridge/js.js +0 -1
- package/lib/families/tron/bridge/js.js.map +1 -1
- package/lib/families/tron/serialization.d.ts +0 -1
- package/lib/families/tron/serialization.d.ts.map +1 -1
- package/lib/families/tron/serialization.js +1 -15
- package/lib/families/tron/serialization.js.map +1 -1
- package/lib/hw/deviceAccess.d.ts.map +1 -1
- package/lib/hw/deviceAccess.js +4 -2
- package/lib/hw/deviceAccess.js.map +1 -1
- package/lib/hw/extractOnboardingState.d.ts +5 -3
- package/lib/hw/extractOnboardingState.d.ts.map +1 -1
- package/lib/hw/extractOnboardingState.js +6 -2
- package/lib/hw/extractOnboardingState.js.map +1 -1
- package/lib/hw/extractOnboardingState.test.js +46 -16
- package/lib/hw/extractOnboardingState.test.js.map +1 -1
- package/lib/hw/getDeviceName.d.ts.map +1 -1
- package/lib/hw/getDeviceName.js +2 -0
- package/lib/hw/getDeviceName.js.map +1 -1
- package/lib/hw/getDeviceName.test.js +16 -0
- package/lib/hw/getDeviceName.test.js.map +1 -1
- package/lib/hw/getOnboardingStatePolling.d.ts.map +1 -1
- package/lib/hw/getOnboardingStatePolling.js +38 -58
- package/lib/hw/getOnboardingStatePolling.js.map +1 -1
- package/lib/hw/getOnboardingStatePolling.test.js +1 -1
- package/lib/hw/getOnboardingStatePolling.test.js.map +1 -1
- package/lib/hw/hooks/useGenuineCheck.d.ts.map +1 -1
- package/lib/hw/hooks/useGenuineCheck.js +1 -0
- package/lib/hw/hooks/useGenuineCheck.js.map +1 -1
- package/lib/migrations/accounts-dataset.js +1 -1
- package/lib/migrations/accounts-dataset.js.map +1 -1
- package/lib/platform/providers/RemoteLiveAppProvider/index.d.ts +1 -0
- package/lib/platform/providers/RemoteLiveAppProvider/index.d.ts.map +1 -1
- package/lib/platform/providers/RemoteLiveAppProvider/index.js +6 -1
- package/lib/platform/providers/RemoteLiveAppProvider/index.js.map +1 -1
- package/lib/platform/types.d.ts +1 -0
- package/lib/platform/types.d.ts.map +1 -1
- package/lib-es/account/serialization.d.ts +0 -6
- package/lib-es/account/serialization.d.ts.map +1 -1
- package/lib-es/account/serialization.js +0 -36
- package/lib-es/account/serialization.js.map +1 -1
- package/lib-es/apps/hw.js +1 -1
- package/lib-es/apps/hw.js.map +1 -1
- package/lib-es/countervalues/react.d.ts.map +1 -1
- package/lib-es/countervalues/react.js +1 -1
- package/lib-es/countervalues/react.js.map +1 -1
- package/lib-es/data/icons/react/gm.d.ts +8 -0
- package/lib-es/data/icons/react/gm.d.ts.map +1 -0
- package/lib-es/data/icons/react/gm.js +11 -0
- package/lib-es/data/icons/react/gm.js.map +1 -0
- package/lib-es/data/icons/react/index.d.ts +1 -0
- package/lib-es/data/icons/react/index.d.ts.map +1 -1
- package/lib-es/data/icons/react/index.js +1 -0
- package/lib-es/data/icons/react/index.js.map +1 -1
- package/lib-es/data/icons/reactNative/gm.d.ts +8 -0
- package/lib-es/data/icons/reactNative/gm.d.ts.map +1 -0
- package/lib-es/data/icons/reactNative/gm.js +12 -0
- package/lib-es/data/icons/reactNative/gm.js.map +1 -0
- package/lib-es/data/icons/reactNative/index.d.ts +1 -0
- package/lib-es/data/icons/reactNative/index.d.ts.map +1 -1
- package/lib-es/data/icons/reactNative/index.js +1 -0
- package/lib-es/data/icons/reactNative/index.js.map +1 -1
- package/lib-es/families/algorand/bridge/js.d.ts.map +1 -1
- package/lib-es/families/algorand/bridge/js.js +1 -2
- package/lib-es/families/algorand/bridge/js.js.map +1 -1
- package/lib-es/families/algorand/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/algorand/bridge/mock.js +1 -2
- package/lib-es/families/algorand/bridge/mock.js.map +1 -1
- package/lib-es/families/algorand/serialization.d.ts +0 -1
- package/lib-es/families/algorand/serialization.d.ts.map +1 -1
- package/lib-es/families/algorand/serialization.js +0 -11
- package/lib-es/families/algorand/serialization.js.map +1 -1
- package/lib-es/families/bitcoin/bridge/js.d.ts.map +1 -1
- package/lib-es/families/bitcoin/bridge/js.js +4 -1
- package/lib-es/families/bitcoin/bridge/js.js.map +1 -1
- package/lib-es/families/bitcoin/descriptor.test.js +2 -0
- package/lib-es/families/bitcoin/descriptor.test.js.map +1 -1
- package/lib-es/families/bitcoin/satstack.test.js +2 -0
- package/lib-es/families/bitcoin/satstack.test.js.map +1 -1
- package/lib-es/families/bitcoin/serialization.d.ts +3 -0
- package/lib-es/families/bitcoin/serialization.d.ts.map +1 -1
- package/lib-es/families/bitcoin/serialization.js +13 -0
- package/lib-es/families/bitcoin/serialization.js.map +1 -1
- package/lib-es/families/bitcoin/serialization.test.d.ts +2 -0
- package/lib-es/families/bitcoin/serialization.test.d.ts.map +1 -0
- package/lib-es/families/bitcoin/serialization.test.js +105 -0
- package/lib-es/families/bitcoin/serialization.test.js.map +1 -0
- package/lib-es/families/cardano/bridge/js.d.ts.map +1 -1
- package/lib-es/families/cardano/bridge/js.js +1 -2
- package/lib-es/families/cardano/bridge/js.js.map +1 -1
- package/lib-es/families/cardano/serialization.d.ts +0 -1
- package/lib-es/families/cardano/serialization.d.ts.map +1 -1
- package/lib-es/families/cardano/serialization.js +0 -13
- package/lib-es/families/cardano/serialization.js.map +1 -1
- package/lib-es/families/celo/bridge/js.d.ts.map +1 -1
- package/lib-es/families/celo/bridge/js.js +1 -2
- package/lib-es/families/celo/bridge/js.js.map +1 -1
- package/lib-es/families/celo/serialization.d.ts +0 -1
- package/lib-es/families/celo/serialization.d.ts.map +1 -1
- package/lib-es/families/celo/serialization.js +0 -13
- package/lib-es/families/celo/serialization.js.map +1 -1
- package/lib-es/families/cosmos/bridge/js.d.ts.map +1 -1
- package/lib-es/families/cosmos/bridge/js.js +0 -2
- package/lib-es/families/cosmos/bridge/js.js.map +1 -1
- package/lib-es/families/cosmos/js-synchronisation.d.ts +1 -3
- package/lib-es/families/cosmos/js-synchronisation.d.ts.map +1 -1
- package/lib-es/families/cosmos/js-synchronisation.js +0 -14
- package/lib-es/families/cosmos/js-synchronisation.js.map +1 -1
- package/lib-es/families/crypto_org/api/sdk.d.ts.map +1 -1
- package/lib-es/families/crypto_org/api/sdk.js +6 -9
- package/lib-es/families/crypto_org/api/sdk.js.map +1 -1
- package/lib-es/families/crypto_org/js-buildTransaction.d.ts.map +1 -1
- package/lib-es/families/crypto_org/js-buildTransaction.js +3 -2
- package/lib-es/families/crypto_org/js-buildTransaction.js.map +1 -1
- package/lib-es/families/crypto_org/js-signOperation.js +1 -1
- package/lib-es/families/crypto_org/js-signOperation.js.map +1 -1
- package/lib-es/families/crypto_org/logic.d.ts +0 -16
- package/lib-es/families/crypto_org/logic.d.ts.map +1 -1
- package/lib-es/families/crypto_org/logic.js +5 -19
- package/lib-es/families/crypto_org/logic.js.map +1 -1
- package/lib-es/families/elrond/bridge/js.d.ts.map +1 -1
- package/lib-es/families/elrond/bridge/js.js +0 -2
- package/lib-es/families/elrond/bridge/js.js.map +1 -1
- package/lib-es/families/elrond/js-synchronisation.d.ts +1 -3
- package/lib-es/families/elrond/js-synchronisation.d.ts.map +1 -1
- package/lib-es/families/elrond/js-synchronisation.js +0 -14
- package/lib-es/families/elrond/js-synchronisation.js.map +1 -1
- package/lib-es/families/ethereum/__tests__/nft.integration.test.js +1 -8
- package/lib-es/families/ethereum/__tests__/nft.integration.test.js.map +1 -1
- package/lib-es/families/hedera/api/mirror.d.ts.map +1 -1
- package/lib-es/families/hedera/api/mirror.js +40 -16
- package/lib-es/families/hedera/api/mirror.js.map +1 -1
- package/lib-es/families/hedera/api/network.js +6 -1
- package/lib-es/families/hedera/api/network.js.map +1 -1
- package/lib-es/families/hedera/bridge.integration.test.js +1 -2
- package/lib-es/families/hedera/bridge.integration.test.js.map +1 -1
- package/lib-es/families/hedera/js-estimateMaxSpendable.d.ts.map +1 -1
- package/lib-es/families/hedera/js-estimateMaxSpendable.js +56 -12
- package/lib-es/families/hedera/js-estimateMaxSpendable.js.map +1 -1
- package/lib-es/families/hedera/js-getTransactionStatus.d.ts.map +1 -1
- package/lib-es/families/hedera/js-getTransactionStatus.js +5 -2
- package/lib-es/families/hedera/js-getTransactionStatus.js.map +1 -1
- package/lib-es/families/hedera/js-signOperation.js +24 -17
- package/lib-es/families/hedera/js-signOperation.js.map +1 -1
- package/lib-es/families/hedera/tests/js-estimateMaxSpendable.integration.test.d.ts +2 -0
- package/lib-es/families/hedera/tests/js-estimateMaxSpendable.integration.test.d.ts.map +1 -0
- package/lib-es/families/hedera/tests/{js-estimateMaxSpendable.test.js → js-estimateMaxSpendable.integration.test.js} +27 -3
- package/lib-es/families/hedera/tests/js-estimateMaxSpendable.integration.test.js.map +1 -0
- package/lib-es/families/hedera/tests/utils.integration.test.d.ts +2 -0
- package/lib-es/families/hedera/tests/utils.integration.test.d.ts.map +1 -0
- package/lib-es/families/hedera/tests/{utils.test.js → utils.integration.test.js} +28 -4
- package/lib-es/families/hedera/tests/utils.integration.test.js.map +1 -0
- package/lib-es/families/hedera/utils.d.ts +1 -1
- package/lib-es/families/hedera/utils.d.ts.map +1 -1
- package/lib-es/families/hedera/utils.js +38 -13
- package/lib-es/families/hedera/utils.js.map +1 -1
- package/lib-es/families/near/bridge/js.d.ts.map +1 -1
- package/lib-es/families/near/bridge/js.js +2 -3
- package/lib-es/families/near/bridge/js.js.map +1 -1
- package/lib-es/families/near/serialization.d.ts +0 -1
- package/lib-es/families/near/serialization.d.ts.map +1 -1
- package/lib-es/families/near/serialization.js +0 -13
- package/lib-es/families/near/serialization.js.map +1 -1
- package/lib-es/families/solana/api/chain/web3.d.ts +1 -0
- package/lib-es/families/solana/api/chain/web3.d.ts.map +1 -1
- package/lib-es/families/solana/api/chain/web3.js +14 -0
- package/lib-es/families/solana/api/chain/web3.js.map +1 -1
- package/lib-es/families/solana/bridge/bridge.d.ts.map +1 -1
- package/lib-es/families/solana/bridge/bridge.js +1 -2
- package/lib-es/families/solana/bridge/bridge.js.map +1 -1
- package/lib-es/families/solana/bridge.integration.test.js +8 -5
- package/lib-es/families/solana/bridge.integration.test.js.map +1 -1
- package/lib-es/families/solana/js-estimateMaxSpendable.d.ts.map +1 -1
- package/lib-es/families/solana/js-estimateMaxSpendable.js +10 -7
- package/lib-es/families/solana/js-estimateMaxSpendable.js.map +1 -1
- package/lib-es/families/solana/js-prepareTransaction.d.ts.map +1 -1
- package/lib-es/families/solana/js-prepareTransaction.js +17 -10
- package/lib-es/families/solana/js-prepareTransaction.js.map +1 -1
- package/lib-es/families/solana/logic.d.ts +0 -1
- package/lib-es/families/solana/logic.d.ts.map +1 -1
- package/lib-es/families/solana/logic.js +1 -4
- package/lib-es/families/solana/logic.js.map +1 -1
- package/lib-es/families/solana/serialization.d.ts +0 -1
- package/lib-es/families/solana/serialization.d.ts.map +1 -1
- package/lib-es/families/solana/serialization.js +0 -13
- package/lib-es/families/solana/serialization.js.map +1 -1
- package/lib-es/families/tezos/bridge/js.d.ts.map +1 -1
- package/lib-es/families/tezos/bridge/js.js +1 -2
- package/lib-es/families/tezos/bridge/js.js.map +1 -1
- package/lib-es/families/tezos/serialization.d.ts +0 -1
- package/lib-es/families/tezos/serialization.d.ts.map +1 -1
- package/lib-es/families/tezos/serialization.js +0 -13
- package/lib-es/families/tezos/serialization.js.map +1 -1
- package/lib-es/families/tron/bridge/js.d.ts.map +1 -1
- package/lib-es/families/tron/bridge/js.js +1 -2
- package/lib-es/families/tron/bridge/js.js.map +1 -1
- package/lib-es/families/tron/serialization.d.ts +0 -1
- package/lib-es/families/tron/serialization.d.ts.map +1 -1
- package/lib-es/families/tron/serialization.js +0 -13
- package/lib-es/families/tron/serialization.js.map +1 -1
- package/lib-es/hw/deviceAccess.d.ts.map +1 -1
- package/lib-es/hw/deviceAccess.js +4 -2
- package/lib-es/hw/deviceAccess.js.map +1 -1
- package/lib-es/hw/extractOnboardingState.d.ts +5 -3
- package/lib-es/hw/extractOnboardingState.d.ts.map +1 -1
- package/lib-es/hw/extractOnboardingState.js +6 -2
- package/lib-es/hw/extractOnboardingState.js.map +1 -1
- package/lib-es/hw/extractOnboardingState.test.js +46 -16
- package/lib-es/hw/extractOnboardingState.test.js.map +1 -1
- package/lib-es/hw/getDeviceName.d.ts.map +1 -1
- package/lib-es/hw/getDeviceName.js +2 -0
- package/lib-es/hw/getDeviceName.js.map +1 -1
- package/lib-es/hw/getDeviceName.test.js +16 -0
- package/lib-es/hw/getDeviceName.test.js.map +1 -1
- package/lib-es/hw/getOnboardingStatePolling.d.ts.map +1 -1
- package/lib-es/hw/getOnboardingStatePolling.js +39 -59
- package/lib-es/hw/getOnboardingStatePolling.js.map +1 -1
- package/lib-es/hw/getOnboardingStatePolling.test.js +1 -1
- package/lib-es/hw/getOnboardingStatePolling.test.js.map +1 -1
- package/lib-es/hw/hooks/useGenuineCheck.d.ts.map +1 -1
- package/lib-es/hw/hooks/useGenuineCheck.js +1 -0
- package/lib-es/hw/hooks/useGenuineCheck.js.map +1 -1
- package/lib-es/migrations/accounts-dataset.js +1 -1
- package/lib-es/migrations/accounts-dataset.js.map +1 -1
- package/lib-es/platform/providers/RemoteLiveAppProvider/index.d.ts +1 -0
- package/lib-es/platform/providers/RemoteLiveAppProvider/index.d.ts.map +1 -1
- package/lib-es/platform/providers/RemoteLiveAppProvider/index.js +4 -0
- package/lib-es/platform/providers/RemoteLiveAppProvider/index.js.map +1 -1
- package/lib-es/platform/types.d.ts +1 -0
- package/lib-es/platform/types.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/account/serialization.ts +0 -55
- package/src/apps/hw.ts +1 -1
- package/src/bot/portfolio/__snapshots__/formatter.test.ts.snap +1 -1
- package/src/countervalues/react.tsx +2 -2
- package/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +34 -2
- package/src/data/icons/react/gm.tsx +14 -0
- package/src/data/icons/react/index.tsx +1 -0
- package/src/data/icons/reactNative/gm.tsx +15 -0
- package/src/data/icons/reactNative/index.tsx +1 -0
- package/src/data/icons/svg/GM.svg +4 -0
- package/src/families/algorand/bridge/js.ts +1 -6
- package/src/families/algorand/bridge/mock.ts +1 -6
- package/src/families/algorand/serialization.ts +0 -23
- package/src/families/bitcoin/bridge/js.ts +3 -0
- package/src/families/bitcoin/descriptor.test.ts +3 -0
- package/src/families/bitcoin/satstack.test.ts +3 -0
- package/src/families/bitcoin/serialization.test.ts +150 -0
- package/src/families/bitcoin/serialization.ts +22 -0
- package/src/families/cardano/bridge/js.ts +1 -6
- package/src/families/cardano/serialization.ts +0 -25
- package/src/families/celo/bridge/js.ts +1 -6
- package/src/families/celo/serialization.ts +0 -25
- package/src/families/cosmos/bridge/js.ts +0 -2
- package/src/families/cosmos/js-synchronisation.ts +1 -28
- package/src/families/crypto_org/api/sdk.ts +14 -18
- package/src/families/crypto_org/js-buildTransaction.ts +3 -2
- package/src/families/crypto_org/js-signOperation.ts +1 -1
- package/src/families/crypto_org/logic.ts +5 -19
- package/src/families/elrond/bridge/js.ts +0 -2
- package/src/families/elrond/js-synchronisation.ts +0 -28
- package/src/families/ethereum/__tests__/nft.integration.test.ts +1 -12
- package/src/families/hedera/api/mirror.ts +16 -15
- package/src/families/hedera/api/network.ts +9 -1
- package/src/families/hedera/bridge.integration.test.ts +1 -4
- package/src/families/hedera/js-estimateMaxSpendable.ts +4 -6
- package/src/families/hedera/js-getTransactionStatus.ts +3 -1
- package/src/families/hedera/js-signOperation.ts +2 -2
- package/src/families/hedera/tests/{js-estimateMaxSpendable.test.ts → js-estimateMaxSpendable.integration.test.ts} +17 -2
- package/src/families/hedera/tests/{utils.test.ts → utils.integration.test.ts} +18 -3
- package/src/families/hedera/utils.ts +17 -5
- package/src/families/near/bridge/js.ts +1 -6
- package/src/families/near/serialization.ts +0 -25
- package/src/families/solana/api/chain/web3.ts +11 -0
- package/src/families/solana/bridge/bridge.ts +1 -6
- package/src/families/solana/bridge.integration.test.ts +11 -5
- package/src/families/solana/js-estimateMaxSpendable.ts +14 -3
- package/src/families/solana/js-prepareTransaction.ts +23 -5
- package/src/families/solana/logic.ts +1 -6
- package/src/families/solana/serialization.ts +0 -26
- package/src/families/tezos/bridge/js.ts +1 -6
- package/src/families/tezos/serialization.ts +0 -25
- package/src/families/tron/bridge/js.ts +1 -6
- package/src/families/tron/serialization.ts +0 -25
- package/src/hw/deviceAccess.ts +6 -2
- package/src/hw/extractOnboardingState.test.ts +63 -16
- package/src/hw/extractOnboardingState.ts +6 -2
- package/src/hw/getDeviceName.test.ts +10 -0
- package/src/hw/getDeviceName.ts +2 -0
- package/src/hw/getOnboardingStatePolling.test.ts +1 -1
- package/src/hw/getOnboardingStatePolling.ts +13 -40
- package/src/hw/hooks/useGenuineCheck.ts +1 -0
- package/src/migrations/accounts-dataset.ts +1 -1
- package/src/platform/providers/RemoteLiveAppProvider/index.tsx +4 -0
- package/src/platform/types.ts +1 -0
- package/lib/__tests__/reconciliation.d.ts +0 -2
- package/lib/__tests__/reconciliation.d.ts.map +0 -1
- package/lib/__tests__/reconciliation.js +0 -51
- package/lib/__tests__/reconciliation.js.map +0 -1
- package/lib/families/hedera/tests/js-estimateMaxSpendable.test.d.ts +0 -2
- package/lib/families/hedera/tests/js-estimateMaxSpendable.test.d.ts.map +0 -1
- package/lib/families/hedera/tests/js-estimateMaxSpendable.test.js.map +0 -1
- package/lib/families/hedera/tests/utils.test.d.ts +0 -2
- package/lib/families/hedera/tests/utils.test.d.ts.map +0 -1
- package/lib/families/hedera/tests/utils.test.js.map +0 -1
- package/lib/reconciliation.d.ts +0 -9
- package/lib/reconciliation.d.ts.map +0 -1
- package/lib/reconciliation.js +0 -450
- package/lib/reconciliation.js.map +0 -1
- package/lib-es/__tests__/reconciliation.d.ts +0 -2
- package/lib-es/__tests__/reconciliation.d.ts.map +0 -1
- package/lib-es/__tests__/reconciliation.js +0 -49
- package/lib-es/__tests__/reconciliation.js.map +0 -1
- package/lib-es/families/hedera/tests/js-estimateMaxSpendable.test.d.ts +0 -2
- package/lib-es/families/hedera/tests/js-estimateMaxSpendable.test.d.ts.map +0 -1
- package/lib-es/families/hedera/tests/js-estimateMaxSpendable.test.js.map +0 -1
- package/lib-es/families/hedera/tests/utils.test.d.ts +0 -2
- package/lib-es/families/hedera/tests/utils.test.d.ts.map +0 -1
- package/lib-es/families/hedera/tests/utils.test.js.map +0 -1
- package/lib-es/reconciliation.d.ts +0 -9
- package/lib-es/reconciliation.d.ts.map +0 -1
- package/lib-es/reconciliation.js +0 -438
- package/lib-es/reconciliation.js.map +0 -1
- package/src/__tests__/reconciliation.ts +0 -40
- package/src/reconciliation.ts +0 -536
|
@@ -11,11 +11,7 @@ import signOperation from "../js-signOperation";
|
|
|
11
11
|
import broadcast from "../js-broadcast";
|
|
12
12
|
import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers";
|
|
13
13
|
import type { AccountBridge, CurrencyBridge } from "@ledgerhq/types-live";
|
|
14
|
-
import {
|
|
15
|
-
applyReconciliation,
|
|
16
|
-
assignToAccountRaw,
|
|
17
|
-
assignFromAccountRaw,
|
|
18
|
-
} from "../serialization";
|
|
14
|
+
import { assignToAccountRaw, assignFromAccountRaw } from "../serialization";
|
|
19
15
|
|
|
20
16
|
const receive = makeAccountBridgeReceive();
|
|
21
17
|
|
|
@@ -27,7 +23,6 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
27
23
|
prepareTransaction,
|
|
28
24
|
sync,
|
|
29
25
|
receive,
|
|
30
|
-
applyReconciliation,
|
|
31
26
|
assignToAccountRaw,
|
|
32
27
|
assignFromAccountRaw,
|
|
33
28
|
signOperation,
|
|
@@ -16,7 +16,6 @@ import type {
|
|
|
16
16
|
TokenRaw,
|
|
17
17
|
} from "./types";
|
|
18
18
|
import { Account, AccountRaw } from "@ledgerhq/types-live";
|
|
19
|
-
import isEqual from "lodash/isEqual";
|
|
20
19
|
|
|
21
20
|
function toTokenRaw({ assetName, policyId, amount }: Token): TokenRaw {
|
|
22
21
|
return {
|
|
@@ -182,30 +181,6 @@ export function fromCardanoResourceRaw(
|
|
|
182
181
|
};
|
|
183
182
|
}
|
|
184
183
|
|
|
185
|
-
export function applyReconciliation(
|
|
186
|
-
account: Account,
|
|
187
|
-
updatedRaw: AccountRaw,
|
|
188
|
-
next: Account
|
|
189
|
-
): boolean {
|
|
190
|
-
let changed = false;
|
|
191
|
-
const cardanoAcc = account as CardanoAccount;
|
|
192
|
-
const cardanoUpdatedRaw = updatedRaw as CardanoAccountRaw;
|
|
193
|
-
if (
|
|
194
|
-
cardanoUpdatedRaw.cardanoResources &&
|
|
195
|
-
(!cardanoAcc.cardanoResources ||
|
|
196
|
-
!isEqual(
|
|
197
|
-
toCardanoResourceRaw(cardanoAcc.cardanoResources),
|
|
198
|
-
cardanoUpdatedRaw.cardanoResources
|
|
199
|
-
))
|
|
200
|
-
) {
|
|
201
|
-
(next as CardanoAccount).cardanoResources = fromCardanoResourceRaw(
|
|
202
|
-
cardanoUpdatedRaw.cardanoResources
|
|
203
|
-
);
|
|
204
|
-
changed = true;
|
|
205
|
-
}
|
|
206
|
-
return changed;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
184
|
export function assignToAccountRaw(
|
|
210
185
|
account: Account,
|
|
211
186
|
accountRaw: AccountRaw
|
|
@@ -9,11 +9,7 @@ import broadcast from "../js-broadcast";
|
|
|
9
9
|
import estimateMaxSpendable from "../js-estimateMaxSpendable";
|
|
10
10
|
import prepareTransaction from "../js-prepareTransaction";
|
|
11
11
|
import createTransaction from "../js-createTransaction";
|
|
12
|
-
import {
|
|
13
|
-
applyReconciliation,
|
|
14
|
-
assignFromAccountRaw,
|
|
15
|
-
assignToAccountRaw,
|
|
16
|
-
} from "../serialization";
|
|
12
|
+
import { assignFromAccountRaw, assignToAccountRaw } from "../serialization";
|
|
17
13
|
|
|
18
14
|
const updateTransaction = (t, patch) => ({ ...t, ...patch });
|
|
19
15
|
|
|
@@ -35,7 +31,6 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
35
31
|
receive,
|
|
36
32
|
signOperation,
|
|
37
33
|
broadcast,
|
|
38
|
-
applyReconciliation,
|
|
39
34
|
assignFromAccountRaw,
|
|
40
35
|
assignToAccountRaw,
|
|
41
36
|
};
|
|
@@ -5,7 +5,6 @@ import type {
|
|
|
5
5
|
CeloResourcesRaw,
|
|
6
6
|
} from "./types";
|
|
7
7
|
import { BigNumber } from "bignumber.js";
|
|
8
|
-
import { isEqual } from "lodash";
|
|
9
8
|
import { Account, AccountRaw } from "@ledgerhq/types-live";
|
|
10
9
|
|
|
11
10
|
export function toCeloResourcesRaw(r: CeloResources): CeloResourcesRaw {
|
|
@@ -80,27 +79,3 @@ export function assignFromAccountRaw(accountRaw: AccountRaw, account: Account) {
|
|
|
80
79
|
(account as CeloAccount).celoResources =
|
|
81
80
|
fromCeloResourcesRaw(celoResourcesRaw);
|
|
82
81
|
}
|
|
83
|
-
|
|
84
|
-
export function applyReconciliation(
|
|
85
|
-
account: Account,
|
|
86
|
-
updatedRaw: AccountRaw,
|
|
87
|
-
next: Account
|
|
88
|
-
): boolean {
|
|
89
|
-
const celoAcc = account as CeloAccount;
|
|
90
|
-
const celoUpdatedRaw = updatedRaw as CeloAccountRaw;
|
|
91
|
-
let changed = false;
|
|
92
|
-
if (
|
|
93
|
-
celoUpdatedRaw.celoResources &&
|
|
94
|
-
(!celoAcc.celoResources ||
|
|
95
|
-
!isEqual(
|
|
96
|
-
toCeloResourcesRaw(celoAcc.celoResources),
|
|
97
|
-
celoUpdatedRaw.celoResources
|
|
98
|
-
))
|
|
99
|
-
) {
|
|
100
|
-
(next as CeloAccount).celoResources = fromCeloResourcesRaw(
|
|
101
|
-
celoUpdatedRaw.celoResources
|
|
102
|
-
);
|
|
103
|
-
changed = true;
|
|
104
|
-
}
|
|
105
|
-
return changed;
|
|
106
|
-
}
|
|
@@ -17,7 +17,6 @@ import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
|
17
17
|
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets";
|
|
18
18
|
import { CosmosValidatorsManager } from "../CosmosValidatorsManager";
|
|
19
19
|
import { assignFromAccountRaw, assignToAccountRaw } from "../serialization";
|
|
20
|
-
import { applyReconciliation } from "../js-synchronisation";
|
|
21
20
|
|
|
22
21
|
const receive = makeAccountBridgeReceive();
|
|
23
22
|
|
|
@@ -71,7 +70,6 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
71
70
|
signOperation,
|
|
72
71
|
assignFromAccountRaw,
|
|
73
72
|
assignToAccountRaw,
|
|
74
|
-
applyReconciliation,
|
|
75
73
|
broadcast: async ({ account, signedOperation }) => {
|
|
76
74
|
return new CosmosAPI(account.currency.id).broadcast({
|
|
77
75
|
signedOperation,
|
|
@@ -8,12 +8,9 @@ import {
|
|
|
8
8
|
import { encodeAccountId } from "../../account";
|
|
9
9
|
import { CosmosAPI } from "./api/Cosmos";
|
|
10
10
|
import { encodeOperationId } from "../../operation";
|
|
11
|
-
import {
|
|
11
|
+
import { CosmosDelegationInfo } from "./types";
|
|
12
12
|
import type { Operation, OperationType } from "@ledgerhq/types-live";
|
|
13
13
|
import { getMainMessage } from "./helpers";
|
|
14
|
-
import { isEqual } from "lodash";
|
|
15
|
-
import { Account, AccountRaw } from "@ledgerhq/types-live";
|
|
16
|
-
import { fromCosmosResourcesRaw, toCosmosResourcesRaw } from "./serialization";
|
|
17
14
|
|
|
18
15
|
const getBlankOperation = (tx, fees, id) => ({
|
|
19
16
|
id: "",
|
|
@@ -236,27 +233,3 @@ export const getAccountShape: GetAccountShape = async (info) => {
|
|
|
236
233
|
|
|
237
234
|
export const scanAccounts = makeScanAccounts({ getAccountShape });
|
|
238
235
|
export const sync = makeSync({ getAccountShape });
|
|
239
|
-
|
|
240
|
-
export function applyReconciliation(
|
|
241
|
-
account: Account,
|
|
242
|
-
updatedRaw: AccountRaw,
|
|
243
|
-
next: Account
|
|
244
|
-
): boolean {
|
|
245
|
-
let changed = false;
|
|
246
|
-
const cosmosAcc = account as CosmosAccount;
|
|
247
|
-
const cosmosUpdatedRaw = updatedRaw as CosmosAccountRaw;
|
|
248
|
-
if (
|
|
249
|
-
cosmosUpdatedRaw.cosmosResources &&
|
|
250
|
-
(!cosmosAcc.cosmosResources ||
|
|
251
|
-
!isEqual(
|
|
252
|
-
toCosmosResourcesRaw(cosmosAcc.cosmosResources),
|
|
253
|
-
cosmosUpdatedRaw.cosmosResources
|
|
254
|
-
))
|
|
255
|
-
) {
|
|
256
|
-
(next as CosmosAccount).cosmosResources = fromCosmosResourcesRaw(
|
|
257
|
-
cosmosUpdatedRaw.cosmosResources
|
|
258
|
-
);
|
|
259
|
-
changed = true;
|
|
260
|
-
}
|
|
261
|
-
return changed;
|
|
262
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { utils } from "@crypto-
|
|
1
|
+
import { utils } from "@crypto-org-chain/chain-jslib";
|
|
2
2
|
import {
|
|
3
3
|
CryptoOrgAccountTransaction,
|
|
4
4
|
CryptoOrgMsgSendContent,
|
|
@@ -196,23 +196,19 @@ export const getOperations = async (
|
|
|
196
196
|
const memoTransaction = memo || "";
|
|
197
197
|
|
|
198
198
|
for (let j = 0; j < msgs.length; j++) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
break;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
default:
|
|
199
|
+
const msgType: string = msgs[j].type;
|
|
200
|
+
if (msgType.includes(CryptoOrgAccountTransactionTypeEnum.MsgSend)) {
|
|
201
|
+
const msgSend: CryptoOrgMsgSendContent = msgs[j].content;
|
|
202
|
+
rawTransactions.push(
|
|
203
|
+
convertSendTransactionToOperation(
|
|
204
|
+
accountId,
|
|
205
|
+
addr,
|
|
206
|
+
msgSend,
|
|
207
|
+
accountTransactions[i],
|
|
208
|
+
currencyId,
|
|
209
|
+
memoTransaction
|
|
210
|
+
)
|
|
211
|
+
);
|
|
216
212
|
}
|
|
217
213
|
}
|
|
218
214
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Transaction } from "./types";
|
|
2
2
|
import type { Account } from "@ledgerhq/types-live";
|
|
3
|
-
import { Units, utils } from "@crypto-
|
|
3
|
+
import { Units, utils } from "@crypto-org-chain/chain-jslib";
|
|
4
|
+
import { SIGN_MODE } from "@crypto-org-chain/chain-jslib/lib/dist/transaction/types";
|
|
4
5
|
import { getAccountParams } from "./api/sdk";
|
|
5
6
|
import { getCroSdk } from "./logic";
|
|
6
7
|
|
|
@@ -56,7 +57,7 @@ export const buildTransaction = async (
|
|
|
56
57
|
publicKey: utils.Bytes.fromHexString(publicKey),
|
|
57
58
|
accountNumber: new utils.Big(accountNumber),
|
|
58
59
|
accountSequence: new utils.Big(sequence),
|
|
59
|
-
signMode:
|
|
60
|
+
signMode: SIGN_MODE.LEGACY_AMINO_JSON,
|
|
60
61
|
})
|
|
61
62
|
.toSignable();
|
|
62
63
|
return signableTx;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BigNumber } from "bignumber.js";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
|
-
import { utils } from "@crypto-
|
|
3
|
+
import { utils } from "@crypto-org-chain/chain-jslib";
|
|
4
4
|
import { FeeNotLoaded } from "@ledgerhq/errors";
|
|
5
5
|
import CryptoOrgApp from "@ledgerhq/hw-app-cosmos";
|
|
6
6
|
import {
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
import { CroNetwork, CroSDK, utils } from "@crypto-
|
|
1
|
+
import { CroNetwork, CroSDK, utils } from "@crypto-org-chain/chain-jslib";
|
|
2
2
|
export const TESTNET_CURRENCY_ID = "crypto_org_croeseid";
|
|
3
3
|
export const FIXED_GAS_PRICE = 0.025;
|
|
4
4
|
export const FIXED_DEFAULT_GAS_LIMIT = 200000;
|
|
5
|
-
export const TestnetCroeseid4 = {
|
|
6
|
-
defaultNodeUrl: "https://testnet-croeseid-4.crypto.org",
|
|
7
|
-
chainId: "testnet-croeseid-4",
|
|
8
|
-
addressPrefix: "tcro",
|
|
9
|
-
validatorAddressPrefix: "tcrocncl",
|
|
10
|
-
validatorPubKeyPrefix: "tcrocnclconspub",
|
|
11
|
-
coin: {
|
|
12
|
-
baseDenom: "basetcro",
|
|
13
|
-
croDenom: "tcro",
|
|
14
|
-
},
|
|
15
|
-
bip44Path: {
|
|
16
|
-
coinType: 1,
|
|
17
|
-
account: 0,
|
|
18
|
-
},
|
|
19
|
-
rpcUrl: "https://testnet-croeseid-4.crypto.org:26657",
|
|
20
|
-
};
|
|
21
5
|
const croSdks = {};
|
|
22
6
|
|
|
23
7
|
/**
|
|
@@ -37,7 +21,7 @@ export function getCroSdk(currencyId: string) {
|
|
|
37
21
|
if (!croSdks[currencyId]) {
|
|
38
22
|
croSdks[currencyId] = isTestNet(currencyId)
|
|
39
23
|
? CroSDK({
|
|
40
|
-
network: TestnetCroeseid4,
|
|
24
|
+
network: CroNetwork.TestnetCroeseid4,
|
|
41
25
|
})
|
|
42
26
|
: CroSDK({
|
|
43
27
|
network: CroNetwork.Mainnet,
|
|
@@ -58,7 +42,9 @@ export const isValidAddress = (
|
|
|
58
42
|
currencyId: string
|
|
59
43
|
): boolean => {
|
|
60
44
|
if (!address) return false;
|
|
61
|
-
const network = isTestNet(currencyId)
|
|
45
|
+
const network = isTestNet(currencyId)
|
|
46
|
+
? CroNetwork.TestnetCroeseid4
|
|
47
|
+
: CroNetwork.Mainnet;
|
|
62
48
|
const addressProps = {
|
|
63
49
|
address: address,
|
|
64
50
|
network: network,
|
|
@@ -13,7 +13,6 @@ import estimateMaxSpendable from "../js-estimateMaxSpendable";
|
|
|
13
13
|
import signOperation from "../js-signOperation";
|
|
14
14
|
import broadcast from "../js-broadcast";
|
|
15
15
|
import { assignFromAccountRaw, assignToAccountRaw } from "../serialization";
|
|
16
|
-
import { applyReconciliation } from "../js-synchronisation";
|
|
17
16
|
|
|
18
17
|
const receive = makeAccountBridgeReceive();
|
|
19
18
|
const currencyBridge: CurrencyBridge = {
|
|
@@ -32,7 +31,6 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
32
31
|
receive,
|
|
33
32
|
signOperation,
|
|
34
33
|
broadcast,
|
|
35
|
-
applyReconciliation,
|
|
36
34
|
assignFromAccountRaw,
|
|
37
35
|
assignToAccountRaw,
|
|
38
36
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TokenAccount } from "@ledgerhq/types-live";
|
|
2
|
-
import { isEqual } from "lodash";
|
|
3
2
|
import { encodeAccountId, inferSubOperations } from "../../account";
|
|
4
3
|
import type { GetAccountShape } from "../../bridge/jsHelpers";
|
|
5
4
|
import { makeScanAccounts, makeSync, mergeOps } from "../../bridge/jsHelpers";
|
|
@@ -12,9 +11,6 @@ import {
|
|
|
12
11
|
import elrondBuildESDTTokenAccounts from "./js-buildSubAccounts";
|
|
13
12
|
import { reconciliateSubAccounts } from "./js-reconciliation";
|
|
14
13
|
import { computeDelegationBalance } from "./logic";
|
|
15
|
-
import { fromElrondResourcesRaw, toElrondResourcesRaw } from "./serialization";
|
|
16
|
-
import { ElrondAccount, ElrondAccountRaw } from "./types";
|
|
17
|
-
import { Account, AccountRaw } from "@ledgerhq/types-live";
|
|
18
14
|
|
|
19
15
|
const getAccountShape: GetAccountShape = async (info, syncConfig) => {
|
|
20
16
|
const { address, initialAccount, currency, derivationMode } = info;
|
|
@@ -86,27 +82,3 @@ const getAccountShape: GetAccountShape = async (info, syncConfig) => {
|
|
|
86
82
|
|
|
87
83
|
export const scanAccounts = makeScanAccounts({ getAccountShape });
|
|
88
84
|
export const sync = makeSync({ getAccountShape });
|
|
89
|
-
|
|
90
|
-
export function applyReconciliation(
|
|
91
|
-
account: Account,
|
|
92
|
-
updatedRaw: AccountRaw,
|
|
93
|
-
next: Account
|
|
94
|
-
): boolean {
|
|
95
|
-
let changed = false;
|
|
96
|
-
const elrondAcc = account as ElrondAccount;
|
|
97
|
-
const elrondUpdatedRaw = updatedRaw as ElrondAccountRaw;
|
|
98
|
-
if (
|
|
99
|
-
elrondUpdatedRaw.elrondResources &&
|
|
100
|
-
(!elrondAcc.elrondResources ||
|
|
101
|
-
!isEqual(
|
|
102
|
-
toElrondResourcesRaw(elrondAcc.elrondResources),
|
|
103
|
-
elrondUpdatedRaw.elrondResources
|
|
104
|
-
))
|
|
105
|
-
) {
|
|
106
|
-
(next as ElrondAccount).elrondResources = fromElrondResourcesRaw(
|
|
107
|
-
elrondUpdatedRaw.elrondResources
|
|
108
|
-
);
|
|
109
|
-
changed = true;
|
|
110
|
-
}
|
|
111
|
-
return changed;
|
|
112
|
-
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "../../../__tests__/test-helpers/setup";
|
|
2
2
|
import { reduce } from "rxjs/operators";
|
|
3
|
-
import { fromAccountRaw
|
|
3
|
+
import { fromAccountRaw } from "../../../account";
|
|
4
4
|
import type { Account, AccountRaw } from "@ledgerhq/types-live";
|
|
5
5
|
import { getAccountBridge } from "../../../bridge";
|
|
6
6
|
import { makeBridgeCacheSystem } from "../../../bridge/cache";
|
|
7
|
-
import { patchAccount } from "../../../reconciliation";
|
|
8
7
|
|
|
9
8
|
jest.setTimeout(200000);
|
|
10
9
|
|
|
@@ -105,16 +104,6 @@ ethTestingAccounts.forEach((a) => {
|
|
|
105
104
|
expect(account.nfts?.find((n) => !n.amount.gt(0))).toEqual(undefined);
|
|
106
105
|
});
|
|
107
106
|
|
|
108
|
-
test("patchAccount restore new NFTs correctly", () => {
|
|
109
|
-
const copy = {
|
|
110
|
-
...account,
|
|
111
|
-
operations: [],
|
|
112
|
-
nfts: account.nfts?.slice(Math.ceil((account.nfts?.length || 0) / 2)),
|
|
113
|
-
};
|
|
114
|
-
const newAccount = patchAccount(copy, toAccountRaw(account));
|
|
115
|
-
expect(newAccount.nfts).toEqual(account.nfts);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
107
|
test("remove half NFTs will restore them with half operations", async () => {
|
|
119
108
|
const halfOps = Math.ceil(account.operations.length / 2);
|
|
120
109
|
const copy = {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import BigNumber from "bignumber.js";
|
|
2
2
|
import network from "../../../network";
|
|
3
|
-
import URL from "url";
|
|
4
3
|
import { getAccountBalance } from "./network";
|
|
5
4
|
import { Operation, OperationType } from "@ledgerhq/types-live";
|
|
6
5
|
import { encodeOperationId } from "../../../operation";
|
|
@@ -10,14 +9,12 @@ import { base64ToUrlSafeBase64 } from "../utils";
|
|
|
10
9
|
|
|
11
10
|
const getMirrorApiUrl = (): string => getEnv("API_HEDERA_MIRROR");
|
|
12
11
|
|
|
13
|
-
const fetch = (path
|
|
14
|
-
network({
|
|
12
|
+
const fetch = (path) => {
|
|
13
|
+
return network({
|
|
15
14
|
method: "GET",
|
|
16
|
-
url:
|
|
17
|
-
pathname: `${getMirrorApiUrl()}/api/v1${path}`,
|
|
18
|
-
query,
|
|
19
|
-
}),
|
|
15
|
+
url: `${getMirrorApiUrl()}${path}`,
|
|
20
16
|
});
|
|
17
|
+
};
|
|
21
18
|
|
|
22
19
|
export interface Account {
|
|
23
20
|
accountId: AccountId;
|
|
@@ -29,10 +26,9 @@ export async function getAccountsForPublicKey(
|
|
|
29
26
|
): Promise<Account[]> {
|
|
30
27
|
let r;
|
|
31
28
|
try {
|
|
32
|
-
r = await fetch(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
29
|
+
r = await fetch(
|
|
30
|
+
`/api/v1/accounts?account.publicKey=${publicKey}&balance=false`
|
|
31
|
+
);
|
|
36
32
|
} catch (e: any) {
|
|
37
33
|
if (e.name === "LedgerAPI4xx") return [];
|
|
38
34
|
throw e;
|
|
@@ -70,12 +66,17 @@ export async function getOperationsForAccount(
|
|
|
70
66
|
latestOperationTimestamp: string
|
|
71
67
|
): Promise<Operation[]> {
|
|
72
68
|
const operations: Operation[] = [];
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
69
|
+
let r = await fetch(
|
|
70
|
+
`/api/v1/transactions?account.id=${address}×tamp=gt:${latestOperationTimestamp}`
|
|
71
|
+
);
|
|
77
72
|
const rawOperations = r.data.transactions as HederaMirrorTransaction[];
|
|
78
73
|
|
|
74
|
+
while (r.data.links.next) {
|
|
75
|
+
r = await fetch(r.data.links.next);
|
|
76
|
+
const newOperations = r.data.transactions as HederaMirrorTransaction[];
|
|
77
|
+
rawOperations.push(...newOperations);
|
|
78
|
+
}
|
|
79
|
+
|
|
79
80
|
for (const raw of rawOperations) {
|
|
80
81
|
const { consensus_timestamp } = raw;
|
|
81
82
|
const timestamp = new Date(
|
|
@@ -43,7 +43,7 @@ export async function getAccountBalance(
|
|
|
43
43
|
try {
|
|
44
44
|
accountBalance = await new hedera.AccountBalanceQuery({
|
|
45
45
|
accountId,
|
|
46
|
-
}).execute(
|
|
46
|
+
}).execute(getBalanceClient());
|
|
47
47
|
} catch {
|
|
48
48
|
throw new HederaAddAccountError();
|
|
49
49
|
}
|
|
@@ -55,6 +55,8 @@ export async function getAccountBalance(
|
|
|
55
55
|
|
|
56
56
|
let _hederaClient: hedera.Client | null = null;
|
|
57
57
|
|
|
58
|
+
let _hederaBalanceClient: hedera.Client | null = null;
|
|
59
|
+
|
|
58
60
|
function getClient(): hedera.Client {
|
|
59
61
|
_hederaClient ??= hedera.Client.forMainnet().setMaxNodesPerTransaction(1);
|
|
60
62
|
|
|
@@ -62,3 +64,9 @@ function getClient(): hedera.Client {
|
|
|
62
64
|
|
|
63
65
|
return _hederaClient;
|
|
64
66
|
}
|
|
67
|
+
|
|
68
|
+
function getBalanceClient(): hedera.Client {
|
|
69
|
+
_hederaBalanceClient ??= hedera.Client.forMainnet();
|
|
70
|
+
|
|
71
|
+
return _hederaBalanceClient;
|
|
72
|
+
}
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
} from "@ledgerhq/errors";
|
|
10
10
|
|
|
11
11
|
import { fromTransactionRaw } from "./transaction";
|
|
12
|
-
import { estimatedFeeSafetyRate } from "./utils";
|
|
13
12
|
|
|
14
13
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
14
|
const hedera: CurrenciesData<Transaction> = {
|
|
@@ -94,9 +93,7 @@ const hedera: CurrenciesData<Transaction> = {
|
|
|
94
93
|
}),
|
|
95
94
|
expectedStatus: (account, _, status) => {
|
|
96
95
|
return {
|
|
97
|
-
amount: account.balance.minus(
|
|
98
|
-
status.estimatedFees.toNumber() * estimatedFeeSafetyRate
|
|
99
|
-
),
|
|
96
|
+
amount: account.balance.minus(status.estimatedFees),
|
|
100
97
|
errors: {},
|
|
101
98
|
warnings: {},
|
|
102
99
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import BigNumber from "bignumber.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getEstimatedFees } from "./utils";
|
|
3
3
|
import type { Account, AccountLike } from "@ledgerhq/types-live";
|
|
4
4
|
import type { Transaction } from "./types";
|
|
5
5
|
|
|
6
|
-
export default function estimateMaxSpendable({
|
|
6
|
+
export default async function estimateMaxSpendable({
|
|
7
7
|
account,
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
9
|
parentAccount,
|
|
@@ -16,11 +16,9 @@ export default function estimateMaxSpendable({
|
|
|
16
16
|
}): Promise<BigNumber> {
|
|
17
17
|
const balance = account.balance;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
// on the safe side here and double the estimate for "max spendable"
|
|
21
|
-
const estimatedFee = estimatedFees.multipliedBy(estimatedFeeSafetyRate);
|
|
19
|
+
const estimatedFees = await getEstimatedFees();
|
|
22
20
|
|
|
23
|
-
let maxSpendable = balance.minus(
|
|
21
|
+
let maxSpendable = balance.minus(estimatedFees);
|
|
24
22
|
|
|
25
23
|
// set max spendable to 0 if negative
|
|
26
24
|
// for cases where the user's account balance is smaller than the estimated fee
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import { AccountId } from "@hashgraph/sdk";
|
|
9
9
|
import type { Transaction, TransactionStatus } from "./types";
|
|
10
10
|
import type { Account } from "@ledgerhq/types-live";
|
|
11
|
-
import { calculateAmount,
|
|
11
|
+
import { calculateAmount, getEstimatedFees } from "./utils";
|
|
12
12
|
|
|
13
13
|
export default async function getTransactionStatus(
|
|
14
14
|
account: Account,
|
|
@@ -43,6 +43,8 @@ export default async function getTransactionStatus(
|
|
|
43
43
|
errors.amount = new NotEnoughBalance("");
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
const estimatedFees = await getEstimatedFees();
|
|
47
|
+
|
|
46
48
|
return {
|
|
47
49
|
amount,
|
|
48
50
|
errors,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { withDevice } from "../../hw/deviceAccess";
|
|
10
10
|
import { Transaction } from "./types";
|
|
11
11
|
import { buildUnsignedTransaction } from "./api/network";
|
|
12
|
-
import {
|
|
12
|
+
import { getEstimatedFees } from "./utils";
|
|
13
13
|
import Hedera from "./hw-app-hedera";
|
|
14
14
|
|
|
15
15
|
const signOperation = ({
|
|
@@ -84,7 +84,7 @@ async function buildOptimisticOperation({
|
|
|
84
84
|
hash: "",
|
|
85
85
|
type: "OUT",
|
|
86
86
|
value: transaction.amount,
|
|
87
|
-
fee:
|
|
87
|
+
fee: await getEstimatedFees(),
|
|
88
88
|
blockHash: null,
|
|
89
89
|
blockHeight: null,
|
|
90
90
|
senders: [account.freshAddress.toString()],
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import BigNumber from "bignumber.js";
|
|
2
2
|
import type { Account } from "@ledgerhq/types-live";
|
|
3
3
|
import estimateMaxSpendable from "../js-estimateMaxSpendable";
|
|
4
|
+
import network from "../../../network";
|
|
4
5
|
|
|
6
|
+
// Balance is 1 Hbar
|
|
5
7
|
const account: Account = {
|
|
6
8
|
type: "Account",
|
|
7
9
|
id: "",
|
|
@@ -14,7 +16,7 @@ const account: Account = {
|
|
|
14
16
|
name: "",
|
|
15
17
|
starred: false,
|
|
16
18
|
used: false,
|
|
17
|
-
balance: new BigNumber(
|
|
19
|
+
balance: new BigNumber(100000000),
|
|
18
20
|
spendableBalance: new BigNumber(0),
|
|
19
21
|
creationDate: new Date(),
|
|
20
22
|
blockHeight: 0,
|
|
@@ -51,7 +53,20 @@ const account: Account = {
|
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
describe("js-estimateMaxSpendable", () => {
|
|
54
|
-
|
|
56
|
+
let estimatedFees = new BigNumber("150200").multipliedBy(2); // 0.001502 ℏ (as of 2023-03-14)
|
|
57
|
+
|
|
58
|
+
it("should return hedera price if available", async () => {
|
|
59
|
+
// If get hedera price works, use real estimate, otherwise fallback to hard coded
|
|
60
|
+
try {
|
|
61
|
+
const { data } = await network({
|
|
62
|
+
method: "GET",
|
|
63
|
+
url: "https://countervalues.live.ledger.com/latest/direct?pairs=hbar:usd",
|
|
64
|
+
});
|
|
65
|
+
estimatedFees = new BigNumber(10000).dividedBy(data[0]);
|
|
66
|
+
} catch {
|
|
67
|
+
console.error("Could not fetch Hedera price");
|
|
68
|
+
}
|
|
69
|
+
});
|
|
55
70
|
|
|
56
71
|
test("estimateMaxSpendable", async () => {
|
|
57
72
|
const result = await estimateMaxSpendable({
|
|
@@ -2,7 +2,9 @@ import BigNumber from "bignumber.js";
|
|
|
2
2
|
import type { Account } from "@ledgerhq/types-live";
|
|
3
3
|
import type { Transaction } from "../types";
|
|
4
4
|
import { calculateAmount } from "../utils";
|
|
5
|
+
import network from "../../../network";
|
|
5
6
|
|
|
7
|
+
// Balance is 1 Hbar
|
|
6
8
|
const account: Account = {
|
|
7
9
|
type: "Account",
|
|
8
10
|
id: "",
|
|
@@ -15,7 +17,7 @@ const account: Account = {
|
|
|
15
17
|
name: "",
|
|
16
18
|
starred: false,
|
|
17
19
|
used: false,
|
|
18
|
-
balance: new BigNumber(
|
|
20
|
+
balance: new BigNumber(100000000),
|
|
19
21
|
spendableBalance: new BigNumber(0),
|
|
20
22
|
creationDate: new Date(),
|
|
21
23
|
blockHeight: 0,
|
|
@@ -59,12 +61,25 @@ const transaction: Transaction = {
|
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
describe("utils", () => {
|
|
62
|
-
|
|
64
|
+
let estimatedFees = new BigNumber("150200").multipliedBy(2); // 0.001502 ℏ (as of 2023-03-14)
|
|
65
|
+
|
|
66
|
+
it("should return hedera price if available", async () => {
|
|
67
|
+
// If get hedera price works, use real estimate, otherwise fallback to hard coded
|
|
68
|
+
try {
|
|
69
|
+
const { data } = await network({
|
|
70
|
+
method: "GET",
|
|
71
|
+
url: "https://countervalues.live.ledger.com/latest/direct?pairs=hbar:usd",
|
|
72
|
+
});
|
|
73
|
+
estimatedFees = new BigNumber(10000).dividedBy(data[0]);
|
|
74
|
+
} catch {
|
|
75
|
+
console.error("Could not fetch Hedera price");
|
|
76
|
+
}
|
|
77
|
+
});
|
|
63
78
|
|
|
64
79
|
test("calculateAmount transaction.useAllAmount = true", async () => {
|
|
65
80
|
transaction.useAllAmount = true;
|
|
66
81
|
|
|
67
|
-
const amount = account.balance.minus(estimatedFees
|
|
82
|
+
const amount = account.balance.minus(estimatedFees);
|
|
68
83
|
const totalSpent = amount.plus(estimatedFees);
|
|
69
84
|
const data = {
|
|
70
85
|
amount,
|