@trezor/connect 9.0.0-beta.1
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/LICENSE.md +50 -0
- package/README.md +38 -0
- package/lib/api/applyFlags.d.ts +8 -0
- package/lib/api/applyFlags.js +37 -0
- package/lib/api/applySettings.d.ts +8 -0
- package/lib/api/applySettings.js +57 -0
- package/lib/api/authorizeCoinJoin.d.ts +7 -0
- package/lib/api/authorizeCoinJoin.js +45 -0
- package/lib/api/backupDevice.d.ts +7 -0
- package/lib/api/backupDevice.js +31 -0
- package/lib/api/binance/binanceSignTx.d.ts +6 -0
- package/lib/api/binance/binanceSignTx.js +91 -0
- package/lib/api/binanceGetAddress.d.ts +22 -0
- package/lib/api/binanceGetAddress.js +126 -0
- package/lib/api/binanceGetPublicKey.d.ts +10 -0
- package/lib/api/binanceGetPublicKey.js +72 -0
- package/lib/api/binanceSignTransaction.d.ts +12 -0
- package/lib/api/binanceSignTransaction.js +31 -0
- package/lib/api/bitcoin/Fees.d.ts +15 -0
- package/lib/api/bitcoin/Fees.js +175 -0
- package/lib/api/bitcoin/TransactionComposer.d.ts +36 -0
- package/lib/api/bitcoin/TransactionComposer.js +150 -0
- package/lib/api/bitcoin/__fixtures__/inputs.d.ts +112 -0
- package/lib/api/bitcoin/__fixtures__/inputs.js +102 -0
- package/lib/api/bitcoin/__fixtures__/signtxVerify.d.ts +147 -0
- package/lib/api/bitcoin/__fixtures__/signtxVerify.js +216 -0
- package/lib/api/bitcoin/enhanceSignTx.d.ts +4 -0
- package/lib/api/bitcoin/enhanceSignTx.js +63 -0
- package/lib/api/bitcoin/index.d.ts +10 -0
- package/lib/api/bitcoin/index.js +13 -0
- package/lib/api/bitcoin/inputs.d.ts +8 -0
- package/lib/api/bitcoin/inputs.js +60 -0
- package/lib/api/bitcoin/outputs.d.ts +8 -0
- package/lib/api/bitcoin/outputs.js +115 -0
- package/lib/api/bitcoin/refTx.d.ts +11 -0
- package/lib/api/bitcoin/refTx.js +220 -0
- package/lib/api/bitcoin/signtx.d.ts +25 -0
- package/lib/api/bitcoin/signtx.js +164 -0
- package/lib/api/bitcoin/signtxLegacy.d.ts +4 -0
- package/lib/api/bitcoin/signtxLegacy.js +136 -0
- package/lib/api/bitcoin/signtxVerify.d.ts +8 -0
- package/lib/api/bitcoin/signtxVerify.js +130 -0
- package/lib/api/blockchainDisconnect.d.ts +13 -0
- package/lib/api/blockchainDisconnect.js +34 -0
- package/lib/api/blockchainEstimateFee.d.ts +12 -0
- package/lib/api/blockchainEstimateFee.js +70 -0
- package/lib/api/blockchainGetAccountBalanceHistory.d.ts +12 -0
- package/lib/api/blockchainGetAccountBalanceHistory.js +41 -0
- package/lib/api/blockchainGetCurrentFiatRates.d.ts +15 -0
- package/lib/api/blockchainGetCurrentFiatRates.js +33 -0
- package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +17 -0
- package/lib/api/blockchainGetFiatRatesForTimestamps.js +33 -0
- package/lib/api/blockchainGetTransactions.d.ts +12 -0
- package/lib/api/blockchainGetTransactions.js +33 -0
- package/lib/api/blockchainSetCustomBackend.d.ts +11 -0
- package/lib/api/blockchainSetCustomBackend.js +38 -0
- package/lib/api/blockchainSubscribe.d.ts +14 -0
- package/lib/api/blockchainSubscribe.js +38 -0
- package/lib/api/blockchainSubscribeFiatRates.d.ts +14 -0
- package/lib/api/blockchainSubscribeFiatRates.js +33 -0
- package/lib/api/blockchainUnsubscribe.d.ts +14 -0
- package/lib/api/blockchainUnsubscribe.js +38 -0
- package/lib/api/blockchainUnsubscribeFiatRates.d.ts +13 -0
- package/lib/api/blockchainUnsubscribeFiatRates.js +29 -0
- package/lib/api/cardano/cardanoAddressParameters.d.ts +8 -0
- package/lib/api/cardano/cardanoAddressParameters.js +100 -0
- package/lib/api/cardano/cardanoAuxiliaryData.d.ts +6 -0
- package/lib/api/cardano/cardanoAuxiliaryData.js +51 -0
- package/lib/api/cardano/cardanoCertificate.d.ts +14 -0
- package/lib/api/cardano/cardanoCertificate.js +149 -0
- package/lib/api/cardano/cardanoInputs.d.ts +13 -0
- package/lib/api/cardano/cardanoInputs.js +34 -0
- package/lib/api/cardano/cardanoOutputs.d.ts +8 -0
- package/lib/api/cardano/cardanoOutputs.js +38 -0
- package/lib/api/cardano/cardanoTokenBundle.d.ts +8 -0
- package/lib/api/cardano/cardanoTokenBundle.js +36 -0
- package/lib/api/cardano/cardanoWitnesses.d.ts +5 -0
- package/lib/api/cardano/cardanoWitnesses.js +48 -0
- package/lib/api/cardanoGetAddress.d.ts +23 -0
- package/lib/api/cardanoGetAddress.js +158 -0
- package/lib/api/cardanoGetNativeScriptHash.d.ts +12 -0
- package/lib/api/cardanoGetNativeScriptHash.js +79 -0
- package/lib/api/cardanoGetPublicKey.d.ts +10 -0
- package/lib/api/cardanoGetPublicKey.js +78 -0
- package/lib/api/cardanoSignTransaction.d.ts +48 -0
- package/lib/api/cardanoSignTransaction.js +283 -0
- package/lib/api/changePin.d.ts +7 -0
- package/lib/api/changePin.js +22 -0
- package/lib/api/cipherKeyValue.d.ts +8 -0
- package/lib/api/cipherKeyValue.js +56 -0
- package/lib/api/common/Discovery.d.ts +35 -0
- package/lib/api/common/Discovery.js +113 -0
- package/lib/api/common/__fixtures__/paramsValidator.d.ts +596 -0
- package/lib/api/common/__fixtures__/paramsValidator.js +355 -0
- package/lib/api/common/paramsValidator.d.ts +14 -0
- package/lib/api/common/paramsValidator.js +140 -0
- package/lib/api/composeTransaction.d.ts +33 -0
- package/lib/api/composeTransaction.js +270 -0
- package/lib/api/customMessage.d.ts +13 -0
- package/lib/api/customMessage.js +56 -0
- package/lib/api/eos/eosSignTx.d.ts +17 -0
- package/lib/api/eos/eosSignTx.js +347 -0
- package/lib/api/eosGetPublicKey.d.ts +10 -0
- package/lib/api/eosGetPublicKey.js +73 -0
- package/lib/api/eosSignTransaction.d.ts +16 -0
- package/lib/api/eosSignTransaction.js +36 -0
- package/lib/api/ethereum/__fixtures__/ethereumSignTypedData.d.ts +225 -0
- package/lib/api/ethereum/__fixtures__/ethereumSignTypedData.js +341 -0
- package/lib/api/ethereum/ethereumSignTx.d.ts +13 -0
- package/lib/api/ethereum/ethereumSignTx.js +92 -0
- package/lib/api/ethereum/ethereumSignTypedData.d.ts +9 -0
- package/lib/api/ethereum/ethereumSignTypedData.js +120 -0
- package/lib/api/ethereumGetAddress.d.ts +28 -0
- package/lib/api/ethereumGetAddress.js +133 -0
- package/lib/api/ethereumGetPublicKey.d.ts +15 -0
- package/lib/api/ethereumGetPublicKey.js +79 -0
- package/lib/api/ethereumSignMessage.d.ts +7 -0
- package/lib/api/ethereumSignMessage.js +41 -0
- package/lib/api/ethereumSignTransaction.d.ts +20 -0
- package/lib/api/ethereumSignTransaction.js +82 -0
- package/lib/api/ethereumSignTypedData.d.ts +14 -0
- package/lib/api/ethereumSignTypedData.js +151 -0
- package/lib/api/ethereumVerifyMessage.d.ts +7 -0
- package/lib/api/ethereumVerifyMessage.js +34 -0
- package/lib/api/firmware/getBinary.d.ts +20 -0
- package/lib/api/firmware/getBinary.js +37 -0
- package/lib/api/firmware/modifyFirmware.d.ts +6 -0
- package/lib/api/firmware/modifyFirmware.js +18 -0
- package/lib/api/firmwareUpdate.d.ts +15 -0
- package/lib/api/firmwareUpdate.js +89 -0
- package/lib/api/getAccountInfo.d.ts +98 -0
- package/lib/api/getAccountInfo.js +326 -0
- package/lib/api/getAddress.d.ts +28 -0
- package/lib/api/getAddress.js +152 -0
- package/lib/api/getCoinInfo.d.ts +11 -0
- package/lib/api/getCoinInfo.js +27 -0
- package/lib/api/getDeviceState.d.ts +8 -0
- package/lib/api/getDeviceState.js +15 -0
- package/lib/api/getFeatures.d.ts +6 -0
- package/lib/api/getFeatures.js +18 -0
- package/lib/api/getOwnershipId.d.ts +10 -0
- package/lib/api/getOwnershipId.js +75 -0
- package/lib/api/getOwnershipProof.d.ts +14 -0
- package/lib/api/getOwnershipProof.js +86 -0
- package/lib/api/getPublicKey.d.ts +15 -0
- package/lib/api/getPublicKey.js +84 -0
- package/lib/api/getSettings.d.ts +6 -0
- package/lib/api/getSettings.js +16 -0
- package/lib/api/index.d.ts +64 -0
- package/lib/api/index.js +134 -0
- package/lib/api/management/uploadFirmware.d.ts +6 -0
- package/lib/api/management/uploadFirmware.js +49 -0
- package/lib/api/nem/nemSignTx.d.ts +4 -0
- package/lib/api/nem/nemSignTx.js +139 -0
- package/lib/api/nemGetAddress.d.ts +22 -0
- package/lib/api/nemGetAddress.js +144 -0
- package/lib/api/nemSignTransaction.d.ts +7 -0
- package/lib/api/nemSignTransaction.js +29 -0
- package/lib/api/pushTransaction.d.ts +14 -0
- package/lib/api/pushTransaction.js +40 -0
- package/lib/api/rebootToBootloader.d.ts +8 -0
- package/lib/api/rebootToBootloader.js +43 -0
- package/lib/api/recoveryDevice.d.ts +8 -0
- package/lib/api/recoveryDevice.js +57 -0
- package/lib/api/requestLogin.d.ts +12 -0
- package/lib/api/requestLogin.js +63 -0
- package/lib/api/resetDevice.d.ts +9 -0
- package/lib/api/resetDevice.js +59 -0
- package/lib/api/rippleGetAddress.d.ts +22 -0
- package/lib/api/rippleGetAddress.js +126 -0
- package/lib/api/rippleSignTransaction.d.ts +10 -0
- package/lib/api/rippleSignTransaction.js +54 -0
- package/lib/api/setProxy.d.ts +8 -0
- package/lib/api/setProxy.js +26 -0
- package/lib/api/signMessage.d.ts +7 -0
- package/lib/api/signMessage.js +51 -0
- package/lib/api/signTransaction.d.ts +21 -0
- package/lib/api/signTransaction.js +146 -0
- package/lib/api/stellar/stellarSignTx.d.ts +5 -0
- package/lib/api/stellar/stellarSignTx.js +198 -0
- package/lib/api/stellarGetAddress.d.ts +22 -0
- package/lib/api/stellarGetAddress.js +126 -0
- package/lib/api/stellarSignTransaction.d.ts +23 -0
- package/lib/api/stellarSignTransaction.js +62 -0
- package/lib/api/tezos/tezosSignTx.d.ts +4 -0
- package/lib/api/tezos/tezosSignTx.js +237 -0
- package/lib/api/tezosGetAddress.d.ts +22 -0
- package/lib/api/tezosGetAddress.js +126 -0
- package/lib/api/tezosGetPublicKey.d.ts +10 -0
- package/lib/api/tezosGetPublicKey.js +72 -0
- package/lib/api/tezosSignTransaction.d.ts +7 -0
- package/lib/api/tezosSignTransaction.js +30 -0
- package/lib/api/verifyMessage.d.ts +7 -0
- package/lib/api/verifyMessage.js +47 -0
- package/lib/api/wipeDevice.d.ts +8 -0
- package/lib/api/wipeDevice.js +41 -0
- package/lib/backend/BlockchainLink.d.ts +75 -0
- package/lib/backend/BlockchainLink.js +298 -0
- package/lib/constants/cardano.d.ts +9 -0
- package/lib/constants/cardano.js +14 -0
- package/lib/constants/errors.d.ts +49 -0
- package/lib/constants/errors.js +62 -0
- package/lib/constants/index.d.ts +6 -0
- package/lib/constants/index.js +10 -0
- package/lib/constants/nem.d.ts +22 -0
- package/lib/constants/nem.js +28 -0
- package/lib/constants/network.d.ts +13 -0
- package/lib/constants/network.js +15 -0
- package/lib/core/AbstractMethod.d.ts +59 -0
- package/lib/core/AbstractMethod.js +159 -0
- package/lib/core/index.d.ts +16 -0
- package/lib/core/index.js +671 -0
- package/lib/core/method.d.ts +6 -0
- package/lib/core/method.js +19 -0
- package/lib/data/DataManager.d.ts +31 -0
- package/lib/data/DataManager.js +98 -0
- package/lib/data/coinInfo.d.ts +37 -0
- package/lib/data/coinInfo.js +278 -0
- package/lib/data/config.d.ts +98 -0
- package/lib/data/config.js +201 -0
- package/lib/data/connectSettings.d.ts +6 -0
- package/lib/data/connectSettings.js +150 -0
- package/lib/data/firmwareInfo.d.ts +11 -0
- package/lib/data/firmwareInfo.js +148 -0
- package/lib/data/transportInfo.d.ts +4 -0
- package/lib/data/transportInfo.js +29 -0
- package/lib/data/udevInfo.d.ts +3 -0
- package/lib/data/udevInfo.js +21 -0
- package/lib/data/version.d.ts +3 -0
- package/lib/data/version.js +7 -0
- package/lib/device/AbortController.d.ts +21 -0
- package/lib/device/AbortController.js +40 -0
- package/lib/device/DescriptorStream.d.ts +28 -0
- package/lib/device/DescriptorStream.js +139 -0
- package/lib/device/Device.d.ts +105 -0
- package/lib/device/Device.js +527 -0
- package/lib/device/DeviceCommands.d.ts +63 -0
- package/lib/device/DeviceCommands.js +465 -0
- package/lib/device/DeviceList.d.ts +76 -0
- package/lib/device/DeviceList.js +411 -0
- package/lib/events/blockchain.d.ts +56 -0
- package/lib/events/blockchain.js +18 -0
- package/lib/events/call.d.ts +41 -0
- package/lib/events/call.js +14 -0
- package/lib/events/core.d.ts +20 -0
- package/lib/events/core.js +28 -0
- package/lib/events/device.d.ts +40 -0
- package/lib/events/device.js +28 -0
- package/lib/events/iframe.d.ts +39 -0
- package/lib/events/iframe.js +18 -0
- package/lib/events/index.d.ts +62 -0
- package/lib/events/index.js +21 -0
- package/lib/events/popup.d.ts +51 -0
- package/lib/events/popup.js +22 -0
- package/lib/events/transport.d.ts +62 -0
- package/lib/events/transport.js +21 -0
- package/lib/events/ui-promise.d.ts +12 -0
- package/lib/events/ui-promise.js +3 -0
- package/lib/events/ui-request.d.ts +180 -0
- package/lib/events/ui-request.js +50 -0
- package/lib/events/ui-response.d.ts +97 -0
- package/lib/events/ui-response.js +25 -0
- package/lib/exports.d.ts +5 -0
- package/lib/exports.js +10 -0
- package/lib/factory.d.ts +20 -0
- package/lib/factory.js +122 -0
- package/lib/index-browser.d.ts +4 -0
- package/lib/index-browser.js +29 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +236 -0
- package/lib/types/account.d.ts +37 -0
- package/lib/types/account.js +3 -0
- package/lib/types/api/applyFlags.d.ts +4 -0
- package/lib/types/api/applyFlags.js +3 -0
- package/lib/types/api/applySettings.d.ts +4 -0
- package/lib/types/api/applySettings.js +3 -0
- package/lib/types/api/authorizeCoinJoin.d.ts +14 -0
- package/lib/types/api/authorizeCoinJoin.js +3 -0
- package/lib/types/api/backupDevice.d.ts +4 -0
- package/lib/types/api/backupDevice.js +3 -0
- package/lib/types/api/binanceGetAddress.d.ts +4 -0
- package/lib/types/api/binanceGetAddress.js +3 -0
- package/lib/types/api/binanceGetPublicKey.d.ts +4 -0
- package/lib/types/api/binanceGetPublicKey.js +3 -0
- package/lib/types/api/binanceSignTransaction.d.ts +31 -0
- package/lib/types/api/binanceSignTransaction.js +3 -0
- package/lib/types/api/blockchainDisconnect.d.ts +5 -0
- package/lib/types/api/blockchainDisconnect.js +3 -0
- package/lib/types/api/blockchainEstimateFee.d.ts +29 -0
- package/lib/types/api/blockchainEstimateFee.js +3 -0
- package/lib/types/api/blockchainGetAccountBalanceHistory.d.ts +4 -0
- package/lib/types/api/blockchainGetAccountBalanceHistory.js +3 -0
- package/lib/types/api/blockchainGetCurrentFiatRates.d.ts +4 -0
- package/lib/types/api/blockchainGetCurrentFiatRates.js +3 -0
- package/lib/types/api/blockchainGetFiatRatesForTimestamps.d.ts +4 -0
- package/lib/types/api/blockchainGetFiatRatesForTimestamps.js +3 -0
- package/lib/types/api/blockchainGetTransactions.d.ts +7 -0
- package/lib/types/api/blockchainGetTransactions.js +3 -0
- package/lib/types/api/blockchainSetCustomBackend.d.ts +7 -0
- package/lib/types/api/blockchainSetCustomBackend.js +3 -0
- package/lib/types/api/blockchainSubscribe.d.ts +7 -0
- package/lib/types/api/blockchainSubscribe.js +3 -0
- package/lib/types/api/blockchainSubscribeFiatRates.d.ts +7 -0
- package/lib/types/api/blockchainSubscribeFiatRates.js +3 -0
- package/lib/types/api/blockchainUnsubscribe.d.ts +5 -0
- package/lib/types/api/blockchainUnsubscribe.js +3 -0
- package/lib/types/api/blockchainUnsubscribeFiatRates.d.ts +5 -0
- package/lib/types/api/blockchainUnsubscribeFiatRates.js +3 -0
- package/lib/types/api/cancel.d.ts +2 -0
- package/lib/types/api/cancel.js +3 -0
- package/lib/types/api/cardanoGetAddress.d.ts +35 -0
- package/lib/types/api/cardanoGetAddress.js +3 -0
- package/lib/types/api/cardanoGetNativeScriptHash.d.ts +21 -0
- package/lib/types/api/cardanoGetNativeScriptHash.js +3 -0
- package/lib/types/api/cardanoGetPublicKey.d.ts +16 -0
- package/lib/types/api/cardanoGetPublicKey.js +3 -0
- package/lib/types/api/cardanoSignTransaction.d.ts +130 -0
- package/lib/types/api/cardanoSignTransaction.js +3 -0
- package/lib/types/api/changePin.d.ts +4 -0
- package/lib/types/api/changePin.js +3 -0
- package/lib/types/api/cipherKeyValue.d.ts +17 -0
- package/lib/types/api/cipherKeyValue.js +3 -0
- package/lib/types/api/composeTransaction.d.ts +92 -0
- package/lib/types/api/composeTransaction.js +3 -0
- package/lib/types/api/customMessage.d.ts +12 -0
- package/lib/types/api/customMessage.js +3 -0
- package/lib/types/api/disableWebUSB.d.ts +2 -0
- package/lib/types/api/disableWebUSB.js +3 -0
- package/lib/types/api/dispose.d.ts +2 -0
- package/lib/types/api/dispose.js +3 -0
- package/lib/types/api/eosGetPublicKey.d.ts +14 -0
- package/lib/types/api/eosGetPublicKey.js +3 -0
- package/lib/types/api/eosSignTransaction.d.ts +111 -0
- package/lib/types/api/eosSignTransaction.js +3 -0
- package/lib/types/api/ethereumGetAddress.d.ts +4 -0
- package/lib/types/api/ethereumGetAddress.js +3 -0
- package/lib/types/api/ethereumGetPublicKey.d.ts +5 -0
- package/lib/types/api/ethereumGetPublicKey.js +3 -0
- package/lib/types/api/ethereumSignMessage.d.ts +9 -0
- package/lib/types/api/ethereumSignMessage.js +3 -0
- package/lib/types/api/ethereumSignTransaction.d.ts +40 -0
- package/lib/types/api/ethereumSignTransaction.js +3 -0
- package/lib/types/api/ethereumSignTypedData.d.ts +42 -0
- package/lib/types/api/ethereumSignTypedData.js +3 -0
- package/lib/types/api/ethereumVerifyMessage.d.ts +10 -0
- package/lib/types/api/ethereumVerifyMessage.js +3 -0
- package/lib/types/api/firmwareUpdate.d.ts +14 -0
- package/lib/types/api/firmwareUpdate.js +3 -0
- package/lib/types/api/getAccountInfo.d.ts +14 -0
- package/lib/types/api/getAccountInfo.js +3 -0
- package/lib/types/api/getAddress.d.ts +13 -0
- package/lib/types/api/getAddress.js +3 -0
- package/lib/types/api/getCoinInfo.d.ts +4 -0
- package/lib/types/api/getCoinInfo.js +3 -0
- package/lib/types/api/getDeviceState.d.ts +6 -0
- package/lib/types/api/getDeviceState.js +3 -0
- package/lib/types/api/getFeatures.d.ts +4 -0
- package/lib/types/api/getFeatures.js +3 -0
- package/lib/types/api/getOwnershipId.d.ts +15 -0
- package/lib/types/api/getOwnershipId.js +3 -0
- package/lib/types/api/getOwnershipProof.d.ts +19 -0
- package/lib/types/api/getOwnershipProof.js +3 -0
- package/lib/types/api/getPublicKey.d.ts +19 -0
- package/lib/types/api/getPublicKey.js +3 -0
- package/lib/types/api/getSettings.d.ts +4 -0
- package/lib/types/api/getSettings.js +3 -0
- package/lib/types/api/index.d.ts +149 -0
- package/lib/types/api/index.js +3 -0
- package/lib/types/api/init.d.ts +5 -0
- package/lib/types/api/init.js +3 -0
- package/lib/types/api/manifest.d.ts +3 -0
- package/lib/types/api/manifest.js +3 -0
- package/lib/types/api/nemGetAddress.d.ts +7 -0
- package/lib/types/api/nemGetAddress.js +3 -0
- package/lib/types/api/nemSignTransaction.d.ts +92 -0
- package/lib/types/api/nemSignTransaction.js +3 -0
- package/lib/types/api/off.d.ts +11 -0
- package/lib/types/api/off.js +3 -0
- package/lib/types/api/on.d.ts +14 -0
- package/lib/types/api/on.js +3 -0
- package/lib/types/api/pushTransaction.d.ts +10 -0
- package/lib/types/api/pushTransaction.js +3 -0
- package/lib/types/api/rebootToBootloader.d.ts +4 -0
- package/lib/types/api/rebootToBootloader.js +3 -0
- package/lib/types/api/recoveryDevice.d.ts +7 -0
- package/lib/types/api/recoveryDevice.js +3 -0
- package/lib/types/api/removeAllListeners.d.ts +3 -0
- package/lib/types/api/removeAllListeners.js +3 -0
- package/lib/types/api/renderWebUSBButton.d.ts +2 -0
- package/lib/types/api/renderWebUSBButton.js +3 -0
- package/lib/types/api/requestLogin.d.ts +20 -0
- package/lib/types/api/requestLogin.js +3 -0
- package/lib/types/api/resetDevice.d.ts +16 -0
- package/lib/types/api/resetDevice.js +3 -0
- package/lib/types/api/rippleGetAddress.d.ts +4 -0
- package/lib/types/api/rippleGetAddress.js +3 -0
- package/lib/types/api/rippleSignTransaction.d.ts +23 -0
- package/lib/types/api/rippleSignTransaction.js +3 -0
- package/lib/types/api/setProxy.d.ts +9 -0
- package/lib/types/api/setProxy.js +3 -0
- package/lib/types/api/signMessage.d.ts +11 -0
- package/lib/types/api/signMessage.js +3 -0
- package/lib/types/api/signTransaction.d.ts +70 -0
- package/lib/types/api/signTransaction.js +3 -0
- package/lib/types/api/stellarGetAddress.d.ts +4 -0
- package/lib/types/api/stellarGetAddress.js +3 -0
- package/lib/types/api/stellarSignTransaction.d.ts +182 -0
- package/lib/types/api/stellarSignTransaction.js +3 -0
- package/lib/types/api/tezosGetAddress.d.ts +4 -0
- package/lib/types/api/tezosGetAddress.js +3 -0
- package/lib/types/api/tezosGetPublicKey.d.ts +4 -0
- package/lib/types/api/tezosGetPublicKey.js +3 -0
- package/lib/types/api/tezosSignTransaction.d.ts +61 -0
- package/lib/types/api/tezosSignTransaction.js +3 -0
- package/lib/types/api/uiResponse.d.ts +3 -0
- package/lib/types/api/uiResponse.js +3 -0
- package/lib/types/api/verifyMessage.d.ts +11 -0
- package/lib/types/api/verifyMessage.js +3 -0
- package/lib/types/api/wipeDevice.d.ts +4 -0
- package/lib/types/api/wipeDevice.js +3 -0
- package/lib/types/coinInfo.d.ts +79 -0
- package/lib/types/coinInfo.js +3 -0
- package/lib/types/device.d.ts +92 -0
- package/lib/types/device.js +3 -0
- package/lib/types/firmware.d.ts +36 -0
- package/lib/types/firmware.js +3 -0
- package/lib/types/index.d.ts +15 -0
- package/lib/types/index.js +11 -0
- package/lib/types/params.d.ts +56 -0
- package/lib/types/params.js +3 -0
- package/lib/types/settings.d.ts +34 -0
- package/lib/types/settings.js +3 -0
- package/lib/types/utils.d.ts +15 -0
- package/lib/types/utils.js +3 -0
- package/lib/utils/__fixtures__/accountUtils.d.ts +4 -0
- package/lib/utils/__fixtures__/accountUtils.js +32 -0
- package/lib/utils/__fixtures__/addressUtils.d.ts +10 -0
- package/lib/utils/__fixtures__/addressUtils.js +214 -0
- package/lib/utils/__fixtures__/ethereumUtils.d.ts +3 -0
- package/lib/utils/__fixtures__/ethereumUtils.js +20 -0
- package/lib/utils/__fixtures__/formatUtils.d.ts +3 -0
- package/lib/utils/__fixtures__/formatUtils.js +15 -0
- package/lib/utils/__fixtures__/hdnodeUtils.d.ts +186 -0
- package/lib/utils/__fixtures__/hdnodeUtils.js +206 -0
- package/lib/utils/accountUtils.d.ts +11 -0
- package/lib/utils/accountUtils.js +99 -0
- package/lib/utils/addressUtils.d.ts +3 -0
- package/lib/utils/addressUtils.js +32 -0
- package/lib/utils/assets-browser.d.ts +2 -0
- package/lib/utils/assets-browser.js +21 -0
- package/lib/utils/assets.d.ts +2 -0
- package/lib/utils/assets.js +28 -0
- package/lib/utils/bip39.d.ts +3 -0
- package/lib/utils/bip39.js +2053 -0
- package/lib/utils/browserUtils.d.ts +21 -0
- package/lib/utils/browserUtils.js +100 -0
- package/lib/utils/bufferUtils.d.ts +3 -0
- package/lib/utils/bufferUtils.js +11 -0
- package/lib/utils/debug.d.ts +24 -0
- package/lib/utils/debug.js +90 -0
- package/lib/utils/deferred.d.ts +18 -0
- package/lib/utils/deferred.js +66 -0
- package/lib/utils/deviceFeaturesUtils.d.ts +6 -0
- package/lib/utils/deviceFeaturesUtils.js +115 -0
- package/lib/utils/ethereumUtils.d.ts +3 -0
- package/lib/utils/ethereumUtils.js +12 -0
- package/lib/utils/firmwareUtils.d.ts +7 -0
- package/lib/utils/firmwareUtils.js +28 -0
- package/lib/utils/formatUtils.d.ts +8 -0
- package/lib/utils/formatUtils.js +57 -0
- package/lib/utils/hdnodeUtils.d.ts +8 -0
- package/lib/utils/hdnodeUtils.js +80 -0
- package/lib/utils/interactionTimeout.d.ts +10 -0
- package/lib/utils/interactionTimeout.js +34 -0
- package/lib/utils/objectUtils.d.ts +10 -0
- package/lib/utils/objectUtils.js +37 -0
- package/lib/utils/pathUtils.d.ts +20 -0
- package/lib/utils/pathUtils.js +159 -0
- package/lib/utils/promiseUtils.d.ts +2 -0
- package/lib/utils/promiseUtils.js +8 -0
- package/lib/utils/urlUtils.d.ts +5 -0
- package/lib/utils/urlUtils.js +27 -0
- package/lib/utils/versionUtils.d.ts +6 -0
- package/lib/utils/versionUtils.js +72 -0
- package/lib/utils/windowsUtils.d.ts +2 -0
- package/lib/utils/windowsUtils.js +6 -0
- package/lib/workers/RNUsbPlugin.d.ts +31 -0
- package/lib/workers/RNUsbPlugin.js +65 -0
- package/lib/workers/workers-browser.d.ts +8 -0
- package/lib/workers/workers-browser.js +19 -0
- package/lib/workers/workers-react-native.d.ts +8 -0
- package/lib/workers/workers-react-native.js +19 -0
- package/lib/workers/workers.d.ts +10 -0
- package/lib/workers/workers.js +17 -0
- package/package.json +62 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("./common/paramsValidator");
|
|
5
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
6
|
+
const coinInfo_1 = require("../data/coinInfo");
|
|
7
|
+
const constants_1 = require("../constants");
|
|
8
|
+
const events_1 = require("../events");
|
|
9
|
+
class GetAddress extends AbstractMethod_1.AbstractMethod {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.progress = 0;
|
|
13
|
+
}
|
|
14
|
+
init() {
|
|
15
|
+
this.requiredPermissions = ['read'];
|
|
16
|
+
this.hasBundle = !!this.payload.bundle;
|
|
17
|
+
const payload = !this.payload.bundle
|
|
18
|
+
? { ...this.payload, bundle: [this.payload] }
|
|
19
|
+
: this.payload;
|
|
20
|
+
(0, paramsValidator_1.validateParams)(payload, [
|
|
21
|
+
{ name: 'bundle', type: 'array' },
|
|
22
|
+
{ name: 'useEventListener', type: 'boolean' },
|
|
23
|
+
]);
|
|
24
|
+
this.params = payload.bundle.map(batch => {
|
|
25
|
+
(0, paramsValidator_1.validateParams)(batch, [
|
|
26
|
+
{ name: 'path', required: true },
|
|
27
|
+
{ name: 'coin', type: 'string' },
|
|
28
|
+
{ name: 'address', type: 'string' },
|
|
29
|
+
{ name: 'showOnTrezor', type: 'boolean' },
|
|
30
|
+
{ name: 'multisig', type: 'object' },
|
|
31
|
+
{ name: 'scriptType', type: 'string' },
|
|
32
|
+
]);
|
|
33
|
+
const path = (0, pathUtils_1.validatePath)(batch.path, 1);
|
|
34
|
+
let coinInfo;
|
|
35
|
+
if (batch.coin) {
|
|
36
|
+
coinInfo = (0, coinInfo_1.getBitcoinNetwork)(batch.coin);
|
|
37
|
+
}
|
|
38
|
+
if (coinInfo && !batch.crossChain) {
|
|
39
|
+
(0, paramsValidator_1.validateCoinPath)(path, coinInfo);
|
|
40
|
+
}
|
|
41
|
+
else if (!coinInfo) {
|
|
42
|
+
coinInfo = (0, coinInfo_1.getBitcoinNetwork)(path);
|
|
43
|
+
}
|
|
44
|
+
if (!coinInfo) {
|
|
45
|
+
throw constants_1.ERRORS.TypedError('Method_UnknownCoin');
|
|
46
|
+
}
|
|
47
|
+
else if (coinInfo) {
|
|
48
|
+
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, coinInfo, this.firmwareRange);
|
|
49
|
+
}
|
|
50
|
+
coinInfo = (0, coinInfo_1.fixCoinInfoNetwork)(coinInfo, path);
|
|
51
|
+
return {
|
|
52
|
+
address_n: path,
|
|
53
|
+
address: batch.address,
|
|
54
|
+
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
55
|
+
multisig: batch.multisig,
|
|
56
|
+
script_type: batch.scriptType,
|
|
57
|
+
coinInfo,
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
const useEventListener = payload.useEventListener &&
|
|
61
|
+
this.params.length === 1 &&
|
|
62
|
+
typeof this.params[0].address === 'string' &&
|
|
63
|
+
this.params[0].show_display;
|
|
64
|
+
this.confirmed = useEventListener;
|
|
65
|
+
this.useUi = !useEventListener;
|
|
66
|
+
if (this.params.length === 1) {
|
|
67
|
+
this.info = (0, pathUtils_1.getLabel)('Export #NETWORK address', this.params[0].coinInfo);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const requestedNetworks = this.params.map(b => b.coinInfo);
|
|
71
|
+
const uniqNetworks = (0, coinInfo_1.getUniqueNetworks)(requestedNetworks);
|
|
72
|
+
if (uniqNetworks.length === 1 && uniqNetworks[0]) {
|
|
73
|
+
this.info = (0, pathUtils_1.getLabel)('Export multiple #NETWORK addresses', uniqNetworks[0]);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.info = 'Export multiple addresses';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
getButtonRequestData(code) {
|
|
81
|
+
if (code === 'ButtonRequest_Address') {
|
|
82
|
+
return {
|
|
83
|
+
type: 'address',
|
|
84
|
+
serializedPath: (0, pathUtils_1.getSerializedPath)(this.params[this.progress].address_n),
|
|
85
|
+
address: this.params[this.progress].address || 'not-set',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async confirmation() {
|
|
90
|
+
if (this.confirmed)
|
|
91
|
+
return true;
|
|
92
|
+
await this.getPopupPromise().promise;
|
|
93
|
+
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
94
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
95
|
+
view: 'export-address',
|
|
96
|
+
label: this.info,
|
|
97
|
+
}));
|
|
98
|
+
const uiResp = await uiPromise.promise;
|
|
99
|
+
this.confirmed = uiResp.payload;
|
|
100
|
+
return this.confirmed;
|
|
101
|
+
}
|
|
102
|
+
async noBackupConfirmation() {
|
|
103
|
+
await this.getPopupPromise().promise;
|
|
104
|
+
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
105
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
106
|
+
view: 'no-backup',
|
|
107
|
+
}));
|
|
108
|
+
const uiResp = await uiPromise.promise;
|
|
109
|
+
return uiResp.payload;
|
|
110
|
+
}
|
|
111
|
+
_call({ address_n, show_display, multisig, script_type, coinInfo }) {
|
|
112
|
+
const cmd = this.device.getCommands();
|
|
113
|
+
return cmd.getAddress({
|
|
114
|
+
address_n,
|
|
115
|
+
show_display,
|
|
116
|
+
multisig,
|
|
117
|
+
script_type,
|
|
118
|
+
}, coinInfo);
|
|
119
|
+
}
|
|
120
|
+
async run() {
|
|
121
|
+
const responses = [];
|
|
122
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
123
|
+
const batch = this.params[i];
|
|
124
|
+
if (batch.show_display) {
|
|
125
|
+
const silent = await this._call({
|
|
126
|
+
...batch,
|
|
127
|
+
show_display: false,
|
|
128
|
+
});
|
|
129
|
+
if (typeof batch.address === 'string') {
|
|
130
|
+
if (batch.address !== silent.address) {
|
|
131
|
+
throw constants_1.ERRORS.TypedError('Method_AddressNotMatch');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
batch.address = silent.address;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const response = await this._call(batch);
|
|
139
|
+
responses.push(response);
|
|
140
|
+
if (this.hasBundle) {
|
|
141
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.BUNDLE_PROGRESS, {
|
|
142
|
+
progress: i,
|
|
143
|
+
response,
|
|
144
|
+
}));
|
|
145
|
+
}
|
|
146
|
+
this.progress++;
|
|
147
|
+
}
|
|
148
|
+
return this.hasBundle ? responses : responses[0];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
exports.default = GetAddress;
|
|
152
|
+
//# sourceMappingURL=getAddress.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import type { CoinInfo } from '../types';
|
|
3
|
+
declare type Params = {
|
|
4
|
+
coinInfo: CoinInfo;
|
|
5
|
+
};
|
|
6
|
+
export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
|
|
7
|
+
init(): void;
|
|
8
|
+
run(): Promise<import("../types").BitcoinNetworkInfo | import("../types").EthereumNetworkInfo | import("../types").MiscNetworkInfo>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=getCoinInfo.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("./common/paramsValidator");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const coinInfo_1 = require("../data/coinInfo");
|
|
7
|
+
class GetCoinInfo extends AbstractMethod_1.AbstractMethod {
|
|
8
|
+
init() {
|
|
9
|
+
this.requiredPermissions = [];
|
|
10
|
+
this.useDevice = false;
|
|
11
|
+
this.useUi = false;
|
|
12
|
+
const { payload } = this;
|
|
13
|
+
(0, paramsValidator_1.validateParams)(payload, [{ name: 'coin', type: 'string', required: true }]);
|
|
14
|
+
const coinInfo = (0, coinInfo_1.getCoinInfo)(payload.coin);
|
|
15
|
+
if (!coinInfo) {
|
|
16
|
+
throw constants_1.ERRORS.TypedError('Method_UnknownCoin');
|
|
17
|
+
}
|
|
18
|
+
this.params = {
|
|
19
|
+
coinInfo,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
run() {
|
|
23
|
+
return Promise.resolve(this.params.coinInfo);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = GetCoinInfo;
|
|
27
|
+
//# sourceMappingURL=getCoinInfo.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
class GetDeviceState extends AbstractMethod_1.AbstractMethod {
|
|
5
|
+
init() {
|
|
6
|
+
this.requiredPermissions = [];
|
|
7
|
+
}
|
|
8
|
+
run() {
|
|
9
|
+
return Promise.resolve({
|
|
10
|
+
state: this.device.getExternalState(),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = GetDeviceState;
|
|
15
|
+
//# sourceMappingURL=getDeviceState.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
export default class GetFeatures extends AbstractMethod<'getFeatures'> {
|
|
3
|
+
init(): void;
|
|
4
|
+
run(): Promise<import("packages/transport/lib/types/messages").Features>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=getFeatures.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
const events_1 = require("../events");
|
|
5
|
+
class GetFeatures extends AbstractMethod_1.AbstractMethod {
|
|
6
|
+
init() {
|
|
7
|
+
this.requiredPermissions = [];
|
|
8
|
+
this.useUi = false;
|
|
9
|
+
this.allowDeviceMode = [...this.allowDeviceMode, events_1.UI.INITIALIZE, events_1.UI.BOOTLOADER];
|
|
10
|
+
this.useDeviceState = false;
|
|
11
|
+
this.skipFirmwareCheck = true;
|
|
12
|
+
}
|
|
13
|
+
run() {
|
|
14
|
+
return Promise.resolve(this.device.features);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = GetFeatures;
|
|
18
|
+
//# sourceMappingURL=getFeatures.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import { PROTO } from '../constants';
|
|
3
|
+
export default class GetOwnershipId extends AbstractMethod<'getOwnershipId', PROTO.GetOwnershipId[]> {
|
|
4
|
+
hasBundle?: boolean;
|
|
5
|
+
confirmed?: boolean;
|
|
6
|
+
init(): void;
|
|
7
|
+
confirmation(): Promise<boolean>;
|
|
8
|
+
run(): Promise<import("../types/api/getOwnershipId").OwnershipId | import("../types/api/getOwnershipId").OwnershipId[]>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=getOwnershipId.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("./common/paramsValidator");
|
|
5
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
6
|
+
const coinInfo_1 = require("../data/coinInfo");
|
|
7
|
+
const events_1 = require("../events");
|
|
8
|
+
class GetOwnershipId extends AbstractMethod_1.AbstractMethod {
|
|
9
|
+
init() {
|
|
10
|
+
this.requiredPermissions = ['read'];
|
|
11
|
+
this.info = 'Export ownership id';
|
|
12
|
+
this.hasBundle = !!this.payload.bundle;
|
|
13
|
+
const payload = !this.payload.bundle
|
|
14
|
+
? { ...this.payload, bundle: [this.payload] }
|
|
15
|
+
: this.payload;
|
|
16
|
+
(0, paramsValidator_1.validateParams)(payload, [{ name: 'bundle', type: 'array' }]);
|
|
17
|
+
this.params = payload.bundle.map(batch => {
|
|
18
|
+
(0, paramsValidator_1.validateParams)(batch, [
|
|
19
|
+
{ name: 'path', required: true },
|
|
20
|
+
{ name: 'coin', type: 'string' },
|
|
21
|
+
{ name: 'multisig', type: 'object' },
|
|
22
|
+
{ name: 'scriptType', type: 'string' },
|
|
23
|
+
]);
|
|
24
|
+
const address_n = (0, pathUtils_1.validatePath)(batch.path, 1);
|
|
25
|
+
const coinInfo = (0, coinInfo_1.getBitcoinNetwork)(batch.coin || address_n);
|
|
26
|
+
const script_type = batch.scriptType || (0, pathUtils_1.getScriptType)(address_n);
|
|
27
|
+
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, coinInfo, this.firmwareRange);
|
|
28
|
+
return {
|
|
29
|
+
address_n,
|
|
30
|
+
coin_name: coinInfo ? coinInfo.name : undefined,
|
|
31
|
+
multisig: batch.multisig,
|
|
32
|
+
script_type,
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async confirmation() {
|
|
37
|
+
if (this.confirmed)
|
|
38
|
+
return true;
|
|
39
|
+
await this.getPopupPromise().promise;
|
|
40
|
+
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION, this.device);
|
|
41
|
+
let label = this.info;
|
|
42
|
+
if (this.params.length > 1) {
|
|
43
|
+
label = 'Export multiple ownership proof ids';
|
|
44
|
+
}
|
|
45
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
46
|
+
view: 'export-address',
|
|
47
|
+
label,
|
|
48
|
+
}));
|
|
49
|
+
const uiResp = await uiPromise.promise;
|
|
50
|
+
this.confirmed = uiResp.payload;
|
|
51
|
+
return this.confirmed;
|
|
52
|
+
}
|
|
53
|
+
async run() {
|
|
54
|
+
const responses = [];
|
|
55
|
+
const cmd = this.device.getCommands();
|
|
56
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
57
|
+
const batch = this.params[i];
|
|
58
|
+
const { message } = await cmd.typedCall('GetOwnershipId', 'OwnershipId', batch);
|
|
59
|
+
responses.push({
|
|
60
|
+
...message,
|
|
61
|
+
path: batch.address_n,
|
|
62
|
+
serializedPath: (0, pathUtils_1.getSerializedPath)(batch.address_n),
|
|
63
|
+
});
|
|
64
|
+
if (this.hasBundle) {
|
|
65
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.BUNDLE_PROGRESS, {
|
|
66
|
+
progress: i,
|
|
67
|
+
response: message,
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return this.hasBundle ? responses : responses[0];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.default = GetOwnershipId;
|
|
75
|
+
//# sourceMappingURL=getOwnershipId.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import { PROTO } from '../constants';
|
|
3
|
+
interface Params extends PROTO.GetOwnershipProof {
|
|
4
|
+
preauthorized?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default class GetOwnershipProof extends AbstractMethod<'getOwnershipProof', Params[]> {
|
|
7
|
+
hasBundle?: boolean;
|
|
8
|
+
confirmed?: boolean;
|
|
9
|
+
init(): void;
|
|
10
|
+
confirmation(): Promise<boolean>;
|
|
11
|
+
run(): Promise<import("../types/api/getOwnershipProof").OwnershipProof | import("../types/api/getOwnershipProof").OwnershipProof[]>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=getOwnershipProof.d.ts.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("./common/paramsValidator");
|
|
5
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
6
|
+
const coinInfo_1 = require("../data/coinInfo");
|
|
7
|
+
const events_1 = require("../events");
|
|
8
|
+
class GetOwnershipProof extends AbstractMethod_1.AbstractMethod {
|
|
9
|
+
init() {
|
|
10
|
+
this.requiredPermissions = ['read'];
|
|
11
|
+
this.info = 'Export ownership proof';
|
|
12
|
+
this.hasBundle = !!this.payload.bundle;
|
|
13
|
+
const payload = !this.payload.bundle
|
|
14
|
+
? { ...this.payload, bundle: [this.payload] }
|
|
15
|
+
: this.payload;
|
|
16
|
+
(0, paramsValidator_1.validateParams)(payload, [{ name: 'bundle', type: 'array' }]);
|
|
17
|
+
this.params = payload.bundle.map(batch => {
|
|
18
|
+
(0, paramsValidator_1.validateParams)(batch, [
|
|
19
|
+
{ name: 'path', required: true },
|
|
20
|
+
{ name: 'coin', type: 'string' },
|
|
21
|
+
{ name: 'multisig', type: 'object' },
|
|
22
|
+
{ name: 'scriptType', type: 'string' },
|
|
23
|
+
{ name: 'userConfirmation', type: 'boolean' },
|
|
24
|
+
{ name: 'ownershipIds', type: 'array' },
|
|
25
|
+
{ name: 'commitmentData', type: 'string' },
|
|
26
|
+
{ name: 'preauthorized', type: 'boolean' },
|
|
27
|
+
]);
|
|
28
|
+
const address_n = (0, pathUtils_1.validatePath)(batch.path, 1);
|
|
29
|
+
const coinInfo = (0, coinInfo_1.getBitcoinNetwork)(batch.coin || address_n);
|
|
30
|
+
const script_type = batch.scriptType || (0, pathUtils_1.getScriptType)(address_n);
|
|
31
|
+
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, coinInfo, this.firmwareRange);
|
|
32
|
+
return {
|
|
33
|
+
address_n,
|
|
34
|
+
coin_name: coinInfo ? coinInfo.name : undefined,
|
|
35
|
+
multisig: batch.multisig,
|
|
36
|
+
script_type,
|
|
37
|
+
user_confirmation: batch.userConfirmation,
|
|
38
|
+
ownership_ids: batch.ownershipIds,
|
|
39
|
+
commitment_data: batch.commitmentData,
|
|
40
|
+
preauthorized: batch.preauthorized,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async confirmation() {
|
|
45
|
+
if (this.confirmed)
|
|
46
|
+
return true;
|
|
47
|
+
await this.getPopupPromise().promise;
|
|
48
|
+
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION, this.device);
|
|
49
|
+
let label = this.info;
|
|
50
|
+
if (this.params.length > 1) {
|
|
51
|
+
label = 'Export multiple ownership proofs';
|
|
52
|
+
}
|
|
53
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
54
|
+
view: 'export-address',
|
|
55
|
+
label,
|
|
56
|
+
}));
|
|
57
|
+
const uiResp = await uiPromise.promise;
|
|
58
|
+
this.confirmed = uiResp.payload;
|
|
59
|
+
return this.confirmed;
|
|
60
|
+
}
|
|
61
|
+
async run() {
|
|
62
|
+
const responses = [];
|
|
63
|
+
const cmd = this.device.getCommands();
|
|
64
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
65
|
+
const batch = this.params[i];
|
|
66
|
+
if (batch.preauthorized) {
|
|
67
|
+
await cmd.typedCall('DoPreauthorized', 'PreauthorizedRequest', {});
|
|
68
|
+
}
|
|
69
|
+
const { message } = await cmd.typedCall('GetOwnershipProof', 'OwnershipProof', batch);
|
|
70
|
+
responses.push({
|
|
71
|
+
...message,
|
|
72
|
+
path: batch.address_n,
|
|
73
|
+
serializedPath: (0, pathUtils_1.getSerializedPath)(batch.address_n),
|
|
74
|
+
});
|
|
75
|
+
if (this.hasBundle) {
|
|
76
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.BUNDLE_PROGRESS, {
|
|
77
|
+
progress: i,
|
|
78
|
+
response: message,
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return this.hasBundle ? responses : responses[0];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.default = GetOwnershipProof;
|
|
86
|
+
//# sourceMappingURL=getOwnershipProof.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import type { BitcoinNetworkInfo } from '../types';
|
|
3
|
+
import type { PROTO } from '../constants';
|
|
4
|
+
declare type Params = PROTO.GetPublicKey & {
|
|
5
|
+
coinInfo?: BitcoinNetworkInfo;
|
|
6
|
+
};
|
|
7
|
+
export default class GetPublicKey extends AbstractMethod<'getPublicKey', Params[]> {
|
|
8
|
+
hasBundle?: boolean;
|
|
9
|
+
confirmed?: boolean;
|
|
10
|
+
init(): void;
|
|
11
|
+
confirmation(): Promise<boolean>;
|
|
12
|
+
run(): Promise<import("../types/api/getPublicKey").HDNodeResponse | import("../types/api/getPublicKey").HDNodeResponse[]>;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=getPublicKey.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("./common/paramsValidator");
|
|
5
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
6
|
+
const events_1 = require("../events");
|
|
7
|
+
const coinInfo_1 = require("../data/coinInfo");
|
|
8
|
+
const accountUtils_1 = require("../utils/accountUtils");
|
|
9
|
+
class GetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
10
|
+
init() {
|
|
11
|
+
this.requiredPermissions = ['read'];
|
|
12
|
+
this.info = 'Export public key';
|
|
13
|
+
this.hasBundle = !!this.payload.bundle;
|
|
14
|
+
const payload = !this.payload.bundle
|
|
15
|
+
? { ...this.payload, bundle: [this.payload] }
|
|
16
|
+
: this.payload;
|
|
17
|
+
(0, paramsValidator_1.validateParams)(payload, [{ name: 'bundle', type: 'array' }]);
|
|
18
|
+
this.params = payload.bundle.map(batch => {
|
|
19
|
+
(0, paramsValidator_1.validateParams)(batch, [
|
|
20
|
+
{ name: 'path', required: true },
|
|
21
|
+
{ name: 'coin', type: 'string' },
|
|
22
|
+
{ name: 'crossChain', type: 'boolean' },
|
|
23
|
+
{ name: 'showOnTrezor', type: 'boolean' },
|
|
24
|
+
]);
|
|
25
|
+
let coinInfo;
|
|
26
|
+
if (batch.coin) {
|
|
27
|
+
coinInfo = (0, coinInfo_1.getBitcoinNetwork)(batch.coin);
|
|
28
|
+
}
|
|
29
|
+
const path = (0, pathUtils_1.validatePath)(batch.path, coinInfo ? 3 : 0);
|
|
30
|
+
if (coinInfo && !batch.crossChain) {
|
|
31
|
+
(0, paramsValidator_1.validateCoinPath)(path, coinInfo);
|
|
32
|
+
}
|
|
33
|
+
else if (!coinInfo) {
|
|
34
|
+
coinInfo = (0, coinInfo_1.getBitcoinNetwork)(path);
|
|
35
|
+
}
|
|
36
|
+
if (coinInfo) {
|
|
37
|
+
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, coinInfo, this.firmwareRange);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
address_n: path,
|
|
41
|
+
coinInfo,
|
|
42
|
+
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : false,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async confirmation() {
|
|
47
|
+
if (this.confirmed)
|
|
48
|
+
return true;
|
|
49
|
+
await this.getPopupPromise().promise;
|
|
50
|
+
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
51
|
+
let label;
|
|
52
|
+
if (this.params.length > 1) {
|
|
53
|
+
label = 'Export multiple public keys';
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
label = (0, accountUtils_1.getPublicKeyLabel)(this.params[0].address_n, this.params[0].coinInfo);
|
|
57
|
+
}
|
|
58
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
59
|
+
view: 'export-xpub',
|
|
60
|
+
label,
|
|
61
|
+
}));
|
|
62
|
+
const uiResp = await uiPromise.promise;
|
|
63
|
+
this.confirmed = uiResp.payload;
|
|
64
|
+
return this.confirmed;
|
|
65
|
+
}
|
|
66
|
+
async run() {
|
|
67
|
+
const responses = [];
|
|
68
|
+
const cmd = this.device.getCommands();
|
|
69
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
70
|
+
const batch = this.params[i];
|
|
71
|
+
const response = await cmd.getHDNode(batch.address_n, batch.coinInfo, true, batch.show_display);
|
|
72
|
+
responses.push(response);
|
|
73
|
+
if (this.hasBundle) {
|
|
74
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.BUNDLE_PROGRESS, {
|
|
75
|
+
progress: i,
|
|
76
|
+
response,
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return this.hasBundle ? responses : responses[0];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.default = GetPublicKey;
|
|
84
|
+
//# sourceMappingURL=getPublicKey.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
const DataManager_1 = require("../data/DataManager");
|
|
5
|
+
class GetSettings extends AbstractMethod_1.AbstractMethod {
|
|
6
|
+
init() {
|
|
7
|
+
this.requiredPermissions = [];
|
|
8
|
+
this.useDevice = false;
|
|
9
|
+
this.useUi = false;
|
|
10
|
+
}
|
|
11
|
+
run() {
|
|
12
|
+
return Promise.resolve(DataManager_1.DataManager.getSettings());
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = GetSettings;
|
|
16
|
+
//# sourceMappingURL=getSettings.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export { default as applyFlags } from './applyFlags';
|
|
2
|
+
export { default as applySettings } from './applySettings';
|
|
3
|
+
export { default as authorizeCoinJoin } from './authorizeCoinJoin';
|
|
4
|
+
export { default as backupDevice } from './backupDevice';
|
|
5
|
+
export { default as binanceGetAddress } from './binanceGetAddress';
|
|
6
|
+
export { default as binanceGetPublicKey } from './binanceGetPublicKey';
|
|
7
|
+
export { default as binanceSignTransaction } from './binanceSignTransaction';
|
|
8
|
+
export { default as blockchainDisconnect } from './blockchainDisconnect';
|
|
9
|
+
export { default as blockchainEstimateFee } from './blockchainEstimateFee';
|
|
10
|
+
export { default as blockchainGetAccountBalanceHistory } from './blockchainGetAccountBalanceHistory';
|
|
11
|
+
export { default as blockchainGetCurrentFiatRates } from './blockchainGetCurrentFiatRates';
|
|
12
|
+
export { default as blockchainGetFiatRatesForTimestamps } from './blockchainGetFiatRatesForTimestamps';
|
|
13
|
+
export { default as blockchainGetTransactions } from './blockchainGetTransactions';
|
|
14
|
+
export { default as blockchainSetCustomBackend } from './blockchainSetCustomBackend';
|
|
15
|
+
export { default as blockchainSubscribe } from './blockchainSubscribe';
|
|
16
|
+
export { default as blockchainSubscribeFiatRates } from './blockchainSubscribeFiatRates';
|
|
17
|
+
export { default as blockchainUnsubscribe } from './blockchainUnsubscribe';
|
|
18
|
+
export { default as blockchainUnsubscribeFiatRates } from './blockchainUnsubscribeFiatRates';
|
|
19
|
+
export { default as cardanoGetAddress } from './cardanoGetAddress';
|
|
20
|
+
export { default as cardanoGetNativeScriptHash } from './cardanoGetNativeScriptHash';
|
|
21
|
+
export { default as cardanoGetPublicKey } from './cardanoGetPublicKey';
|
|
22
|
+
export { default as cardanoSignTransaction } from './cardanoSignTransaction';
|
|
23
|
+
export { default as changePin } from './changePin';
|
|
24
|
+
export { default as cipherKeyValue } from './cipherKeyValue';
|
|
25
|
+
export { default as composeTransaction } from './composeTransaction';
|
|
26
|
+
export { default as customMessage } from './customMessage';
|
|
27
|
+
export { default as eosGetPublicKey } from './eosGetPublicKey';
|
|
28
|
+
export { default as eosSignTransaction } from './eosSignTransaction';
|
|
29
|
+
export { default as ethereumGetAddress } from './ethereumGetAddress';
|
|
30
|
+
export { default as ethereumGetPublicKey } from './ethereumGetPublicKey';
|
|
31
|
+
export { default as ethereumSignMessage } from './ethereumSignMessage';
|
|
32
|
+
export { default as ethereumSignTransaction } from './ethereumSignTransaction';
|
|
33
|
+
export { default as ethereumSignTypedData } from './ethereumSignTypedData';
|
|
34
|
+
export { default as ethereumVerifyMessage } from './ethereumVerifyMessage';
|
|
35
|
+
export { default as firmwareUpdate } from './firmwareUpdate';
|
|
36
|
+
export { default as getAccountInfo } from './getAccountInfo';
|
|
37
|
+
export { default as getAddress } from './getAddress';
|
|
38
|
+
export { default as getCoinInfo } from './getCoinInfo';
|
|
39
|
+
export { default as getDeviceState } from './getDeviceState';
|
|
40
|
+
export { default as getFeatures } from './getFeatures';
|
|
41
|
+
export { default as getOwnershipId } from './getOwnershipId';
|
|
42
|
+
export { default as getOwnershipProof } from './getOwnershipProof';
|
|
43
|
+
export { default as getPublicKey } from './getPublicKey';
|
|
44
|
+
export { default as getSettings } from './getSettings';
|
|
45
|
+
export { default as nemGetAddress } from './nemGetAddress';
|
|
46
|
+
export { default as nemSignTransaction } from './nemSignTransaction';
|
|
47
|
+
export { default as pushTransaction } from './pushTransaction';
|
|
48
|
+
export { default as rebootToBootloader } from './rebootToBootloader';
|
|
49
|
+
export { default as recoveryDevice } from './recoveryDevice';
|
|
50
|
+
export { default as requestLogin } from './requestLogin';
|
|
51
|
+
export { default as resetDevice } from './resetDevice';
|
|
52
|
+
export { default as rippleGetAddress } from './rippleGetAddress';
|
|
53
|
+
export { default as rippleSignTransaction } from './rippleSignTransaction';
|
|
54
|
+
export { default as setProxy } from './setProxy';
|
|
55
|
+
export { default as signMessage } from './signMessage';
|
|
56
|
+
export { default as signTransaction } from './signTransaction';
|
|
57
|
+
export { default as stellarGetAddress } from './stellarGetAddress';
|
|
58
|
+
export { default as stellarSignTransaction } from './stellarSignTransaction';
|
|
59
|
+
export { default as tezosGetAddress } from './tezosGetAddress';
|
|
60
|
+
export { default as tezosGetPublicKey } from './tezosGetPublicKey';
|
|
61
|
+
export { default as tezosSignTransaction } from './tezosSignTransaction';
|
|
62
|
+
export { default as verifyMessage } from './verifyMessage';
|
|
63
|
+
export { default as wipeDevice } from './wipeDevice';
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|