@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
package/lib/api/index.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.nemSignTransaction = exports.nemGetAddress = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.firmwareUpdate = exports.ethereumVerifyMessage = exports.ethereumSignTypedData = exports.ethereumSignTransaction = exports.ethereumSignMessage = exports.ethereumGetPublicKey = exports.ethereumGetAddress = exports.eosSignTransaction = exports.eosGetPublicKey = exports.customMessage = exports.composeTransaction = exports.cipherKeyValue = exports.changePin = exports.cardanoSignTransaction = exports.cardanoGetPublicKey = exports.cardanoGetNativeScriptHash = exports.cardanoGetAddress = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.binanceSignTransaction = exports.binanceGetPublicKey = exports.binanceGetAddress = exports.backupDevice = exports.authorizeCoinJoin = exports.applySettings = exports.applyFlags = void 0;
|
|
7
|
+
exports.wipeDevice = exports.verifyMessage = exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = exports.stellarSignTransaction = exports.stellarGetAddress = exports.signTransaction = exports.signMessage = exports.setProxy = exports.rippleSignTransaction = exports.rippleGetAddress = exports.resetDevice = void 0;
|
|
8
|
+
var applyFlags_1 = require("./applyFlags");
|
|
9
|
+
Object.defineProperty(exports, "applyFlags", { enumerable: true, get: function () { return __importDefault(applyFlags_1).default; } });
|
|
10
|
+
var applySettings_1 = require("./applySettings");
|
|
11
|
+
Object.defineProperty(exports, "applySettings", { enumerable: true, get: function () { return __importDefault(applySettings_1).default; } });
|
|
12
|
+
var authorizeCoinJoin_1 = require("./authorizeCoinJoin");
|
|
13
|
+
Object.defineProperty(exports, "authorizeCoinJoin", { enumerable: true, get: function () { return __importDefault(authorizeCoinJoin_1).default; } });
|
|
14
|
+
var backupDevice_1 = require("./backupDevice");
|
|
15
|
+
Object.defineProperty(exports, "backupDevice", { enumerable: true, get: function () { return __importDefault(backupDevice_1).default; } });
|
|
16
|
+
var binanceGetAddress_1 = require("./binanceGetAddress");
|
|
17
|
+
Object.defineProperty(exports, "binanceGetAddress", { enumerable: true, get: function () { return __importDefault(binanceGetAddress_1).default; } });
|
|
18
|
+
var binanceGetPublicKey_1 = require("./binanceGetPublicKey");
|
|
19
|
+
Object.defineProperty(exports, "binanceGetPublicKey", { enumerable: true, get: function () { return __importDefault(binanceGetPublicKey_1).default; } });
|
|
20
|
+
var binanceSignTransaction_1 = require("./binanceSignTransaction");
|
|
21
|
+
Object.defineProperty(exports, "binanceSignTransaction", { enumerable: true, get: function () { return __importDefault(binanceSignTransaction_1).default; } });
|
|
22
|
+
var blockchainDisconnect_1 = require("./blockchainDisconnect");
|
|
23
|
+
Object.defineProperty(exports, "blockchainDisconnect", { enumerable: true, get: function () { return __importDefault(blockchainDisconnect_1).default; } });
|
|
24
|
+
var blockchainEstimateFee_1 = require("./blockchainEstimateFee");
|
|
25
|
+
Object.defineProperty(exports, "blockchainEstimateFee", { enumerable: true, get: function () { return __importDefault(blockchainEstimateFee_1).default; } });
|
|
26
|
+
var blockchainGetAccountBalanceHistory_1 = require("./blockchainGetAccountBalanceHistory");
|
|
27
|
+
Object.defineProperty(exports, "blockchainGetAccountBalanceHistory", { enumerable: true, get: function () { return __importDefault(blockchainGetAccountBalanceHistory_1).default; } });
|
|
28
|
+
var blockchainGetCurrentFiatRates_1 = require("./blockchainGetCurrentFiatRates");
|
|
29
|
+
Object.defineProperty(exports, "blockchainGetCurrentFiatRates", { enumerable: true, get: function () { return __importDefault(blockchainGetCurrentFiatRates_1).default; } });
|
|
30
|
+
var blockchainGetFiatRatesForTimestamps_1 = require("./blockchainGetFiatRatesForTimestamps");
|
|
31
|
+
Object.defineProperty(exports, "blockchainGetFiatRatesForTimestamps", { enumerable: true, get: function () { return __importDefault(blockchainGetFiatRatesForTimestamps_1).default; } });
|
|
32
|
+
var blockchainGetTransactions_1 = require("./blockchainGetTransactions");
|
|
33
|
+
Object.defineProperty(exports, "blockchainGetTransactions", { enumerable: true, get: function () { return __importDefault(blockchainGetTransactions_1).default; } });
|
|
34
|
+
var blockchainSetCustomBackend_1 = require("./blockchainSetCustomBackend");
|
|
35
|
+
Object.defineProperty(exports, "blockchainSetCustomBackend", { enumerable: true, get: function () { return __importDefault(blockchainSetCustomBackend_1).default; } });
|
|
36
|
+
var blockchainSubscribe_1 = require("./blockchainSubscribe");
|
|
37
|
+
Object.defineProperty(exports, "blockchainSubscribe", { enumerable: true, get: function () { return __importDefault(blockchainSubscribe_1).default; } });
|
|
38
|
+
var blockchainSubscribeFiatRates_1 = require("./blockchainSubscribeFiatRates");
|
|
39
|
+
Object.defineProperty(exports, "blockchainSubscribeFiatRates", { enumerable: true, get: function () { return __importDefault(blockchainSubscribeFiatRates_1).default; } });
|
|
40
|
+
var blockchainUnsubscribe_1 = require("./blockchainUnsubscribe");
|
|
41
|
+
Object.defineProperty(exports, "blockchainUnsubscribe", { enumerable: true, get: function () { return __importDefault(blockchainUnsubscribe_1).default; } });
|
|
42
|
+
var blockchainUnsubscribeFiatRates_1 = require("./blockchainUnsubscribeFiatRates");
|
|
43
|
+
Object.defineProperty(exports, "blockchainUnsubscribeFiatRates", { enumerable: true, get: function () { return __importDefault(blockchainUnsubscribeFiatRates_1).default; } });
|
|
44
|
+
var cardanoGetAddress_1 = require("./cardanoGetAddress");
|
|
45
|
+
Object.defineProperty(exports, "cardanoGetAddress", { enumerable: true, get: function () { return __importDefault(cardanoGetAddress_1).default; } });
|
|
46
|
+
var cardanoGetNativeScriptHash_1 = require("./cardanoGetNativeScriptHash");
|
|
47
|
+
Object.defineProperty(exports, "cardanoGetNativeScriptHash", { enumerable: true, get: function () { return __importDefault(cardanoGetNativeScriptHash_1).default; } });
|
|
48
|
+
var cardanoGetPublicKey_1 = require("./cardanoGetPublicKey");
|
|
49
|
+
Object.defineProperty(exports, "cardanoGetPublicKey", { enumerable: true, get: function () { return __importDefault(cardanoGetPublicKey_1).default; } });
|
|
50
|
+
var cardanoSignTransaction_1 = require("./cardanoSignTransaction");
|
|
51
|
+
Object.defineProperty(exports, "cardanoSignTransaction", { enumerable: true, get: function () { return __importDefault(cardanoSignTransaction_1).default; } });
|
|
52
|
+
var changePin_1 = require("./changePin");
|
|
53
|
+
Object.defineProperty(exports, "changePin", { enumerable: true, get: function () { return __importDefault(changePin_1).default; } });
|
|
54
|
+
var cipherKeyValue_1 = require("./cipherKeyValue");
|
|
55
|
+
Object.defineProperty(exports, "cipherKeyValue", { enumerable: true, get: function () { return __importDefault(cipherKeyValue_1).default; } });
|
|
56
|
+
var composeTransaction_1 = require("./composeTransaction");
|
|
57
|
+
Object.defineProperty(exports, "composeTransaction", { enumerable: true, get: function () { return __importDefault(composeTransaction_1).default; } });
|
|
58
|
+
var customMessage_1 = require("./customMessage");
|
|
59
|
+
Object.defineProperty(exports, "customMessage", { enumerable: true, get: function () { return __importDefault(customMessage_1).default; } });
|
|
60
|
+
var eosGetPublicKey_1 = require("./eosGetPublicKey");
|
|
61
|
+
Object.defineProperty(exports, "eosGetPublicKey", { enumerable: true, get: function () { return __importDefault(eosGetPublicKey_1).default; } });
|
|
62
|
+
var eosSignTransaction_1 = require("./eosSignTransaction");
|
|
63
|
+
Object.defineProperty(exports, "eosSignTransaction", { enumerable: true, get: function () { return __importDefault(eosSignTransaction_1).default; } });
|
|
64
|
+
var ethereumGetAddress_1 = require("./ethereumGetAddress");
|
|
65
|
+
Object.defineProperty(exports, "ethereumGetAddress", { enumerable: true, get: function () { return __importDefault(ethereumGetAddress_1).default; } });
|
|
66
|
+
var ethereumGetPublicKey_1 = require("./ethereumGetPublicKey");
|
|
67
|
+
Object.defineProperty(exports, "ethereumGetPublicKey", { enumerable: true, get: function () { return __importDefault(ethereumGetPublicKey_1).default; } });
|
|
68
|
+
var ethereumSignMessage_1 = require("./ethereumSignMessage");
|
|
69
|
+
Object.defineProperty(exports, "ethereumSignMessage", { enumerable: true, get: function () { return __importDefault(ethereumSignMessage_1).default; } });
|
|
70
|
+
var ethereumSignTransaction_1 = require("./ethereumSignTransaction");
|
|
71
|
+
Object.defineProperty(exports, "ethereumSignTransaction", { enumerable: true, get: function () { return __importDefault(ethereumSignTransaction_1).default; } });
|
|
72
|
+
var ethereumSignTypedData_1 = require("./ethereumSignTypedData");
|
|
73
|
+
Object.defineProperty(exports, "ethereumSignTypedData", { enumerable: true, get: function () { return __importDefault(ethereumSignTypedData_1).default; } });
|
|
74
|
+
var ethereumVerifyMessage_1 = require("./ethereumVerifyMessage");
|
|
75
|
+
Object.defineProperty(exports, "ethereumVerifyMessage", { enumerable: true, get: function () { return __importDefault(ethereumVerifyMessage_1).default; } });
|
|
76
|
+
var firmwareUpdate_1 = require("./firmwareUpdate");
|
|
77
|
+
Object.defineProperty(exports, "firmwareUpdate", { enumerable: true, get: function () { return __importDefault(firmwareUpdate_1).default; } });
|
|
78
|
+
var getAccountInfo_1 = require("./getAccountInfo");
|
|
79
|
+
Object.defineProperty(exports, "getAccountInfo", { enumerable: true, get: function () { return __importDefault(getAccountInfo_1).default; } });
|
|
80
|
+
var getAddress_1 = require("./getAddress");
|
|
81
|
+
Object.defineProperty(exports, "getAddress", { enumerable: true, get: function () { return __importDefault(getAddress_1).default; } });
|
|
82
|
+
var getCoinInfo_1 = require("./getCoinInfo");
|
|
83
|
+
Object.defineProperty(exports, "getCoinInfo", { enumerable: true, get: function () { return __importDefault(getCoinInfo_1).default; } });
|
|
84
|
+
var getDeviceState_1 = require("./getDeviceState");
|
|
85
|
+
Object.defineProperty(exports, "getDeviceState", { enumerable: true, get: function () { return __importDefault(getDeviceState_1).default; } });
|
|
86
|
+
var getFeatures_1 = require("./getFeatures");
|
|
87
|
+
Object.defineProperty(exports, "getFeatures", { enumerable: true, get: function () { return __importDefault(getFeatures_1).default; } });
|
|
88
|
+
var getOwnershipId_1 = require("./getOwnershipId");
|
|
89
|
+
Object.defineProperty(exports, "getOwnershipId", { enumerable: true, get: function () { return __importDefault(getOwnershipId_1).default; } });
|
|
90
|
+
var getOwnershipProof_1 = require("./getOwnershipProof");
|
|
91
|
+
Object.defineProperty(exports, "getOwnershipProof", { enumerable: true, get: function () { return __importDefault(getOwnershipProof_1).default; } });
|
|
92
|
+
var getPublicKey_1 = require("./getPublicKey");
|
|
93
|
+
Object.defineProperty(exports, "getPublicKey", { enumerable: true, get: function () { return __importDefault(getPublicKey_1).default; } });
|
|
94
|
+
var getSettings_1 = require("./getSettings");
|
|
95
|
+
Object.defineProperty(exports, "getSettings", { enumerable: true, get: function () { return __importDefault(getSettings_1).default; } });
|
|
96
|
+
var nemGetAddress_1 = require("./nemGetAddress");
|
|
97
|
+
Object.defineProperty(exports, "nemGetAddress", { enumerable: true, get: function () { return __importDefault(nemGetAddress_1).default; } });
|
|
98
|
+
var nemSignTransaction_1 = require("./nemSignTransaction");
|
|
99
|
+
Object.defineProperty(exports, "nemSignTransaction", { enumerable: true, get: function () { return __importDefault(nemSignTransaction_1).default; } });
|
|
100
|
+
var pushTransaction_1 = require("./pushTransaction");
|
|
101
|
+
Object.defineProperty(exports, "pushTransaction", { enumerable: true, get: function () { return __importDefault(pushTransaction_1).default; } });
|
|
102
|
+
var rebootToBootloader_1 = require("./rebootToBootloader");
|
|
103
|
+
Object.defineProperty(exports, "rebootToBootloader", { enumerable: true, get: function () { return __importDefault(rebootToBootloader_1).default; } });
|
|
104
|
+
var recoveryDevice_1 = require("./recoveryDevice");
|
|
105
|
+
Object.defineProperty(exports, "recoveryDevice", { enumerable: true, get: function () { return __importDefault(recoveryDevice_1).default; } });
|
|
106
|
+
var requestLogin_1 = require("./requestLogin");
|
|
107
|
+
Object.defineProperty(exports, "requestLogin", { enumerable: true, get: function () { return __importDefault(requestLogin_1).default; } });
|
|
108
|
+
var resetDevice_1 = require("./resetDevice");
|
|
109
|
+
Object.defineProperty(exports, "resetDevice", { enumerable: true, get: function () { return __importDefault(resetDevice_1).default; } });
|
|
110
|
+
var rippleGetAddress_1 = require("./rippleGetAddress");
|
|
111
|
+
Object.defineProperty(exports, "rippleGetAddress", { enumerable: true, get: function () { return __importDefault(rippleGetAddress_1).default; } });
|
|
112
|
+
var rippleSignTransaction_1 = require("./rippleSignTransaction");
|
|
113
|
+
Object.defineProperty(exports, "rippleSignTransaction", { enumerable: true, get: function () { return __importDefault(rippleSignTransaction_1).default; } });
|
|
114
|
+
var setProxy_1 = require("./setProxy");
|
|
115
|
+
Object.defineProperty(exports, "setProxy", { enumerable: true, get: function () { return __importDefault(setProxy_1).default; } });
|
|
116
|
+
var signMessage_1 = require("./signMessage");
|
|
117
|
+
Object.defineProperty(exports, "signMessage", { enumerable: true, get: function () { return __importDefault(signMessage_1).default; } });
|
|
118
|
+
var signTransaction_1 = require("./signTransaction");
|
|
119
|
+
Object.defineProperty(exports, "signTransaction", { enumerable: true, get: function () { return __importDefault(signTransaction_1).default; } });
|
|
120
|
+
var stellarGetAddress_1 = require("./stellarGetAddress");
|
|
121
|
+
Object.defineProperty(exports, "stellarGetAddress", { enumerable: true, get: function () { return __importDefault(stellarGetAddress_1).default; } });
|
|
122
|
+
var stellarSignTransaction_1 = require("./stellarSignTransaction");
|
|
123
|
+
Object.defineProperty(exports, "stellarSignTransaction", { enumerable: true, get: function () { return __importDefault(stellarSignTransaction_1).default; } });
|
|
124
|
+
var tezosGetAddress_1 = require("./tezosGetAddress");
|
|
125
|
+
Object.defineProperty(exports, "tezosGetAddress", { enumerable: true, get: function () { return __importDefault(tezosGetAddress_1).default; } });
|
|
126
|
+
var tezosGetPublicKey_1 = require("./tezosGetPublicKey");
|
|
127
|
+
Object.defineProperty(exports, "tezosGetPublicKey", { enumerable: true, get: function () { return __importDefault(tezosGetPublicKey_1).default; } });
|
|
128
|
+
var tezosSignTransaction_1 = require("./tezosSignTransaction");
|
|
129
|
+
Object.defineProperty(exports, "tezosSignTransaction", { enumerable: true, get: function () { return __importDefault(tezosSignTransaction_1).default; } });
|
|
130
|
+
var verifyMessage_1 = require("./verifyMessage");
|
|
131
|
+
Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return __importDefault(verifyMessage_1).default; } });
|
|
132
|
+
var wipeDevice_1 = require("./wipeDevice");
|
|
133
|
+
Object.defineProperty(exports, "wipeDevice", { enumerable: true, get: function () { return __importDefault(wipeDevice_1).default; } });
|
|
134
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CoreMessage } from '../../events';
|
|
2
|
+
import { PROTO } from '../../constants';
|
|
3
|
+
import type { Device } from '../../device/Device';
|
|
4
|
+
import type { TypedCall } from '../../device/DeviceCommands';
|
|
5
|
+
export declare const uploadFirmware: (typedCall: TypedCall, postMessage: (message: CoreMessage) => void, device: Device, { payload }: PROTO.FirmwareUpload) => Promise<PROTO.Success>;
|
|
6
|
+
//# sourceMappingURL=uploadFirmware.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadFirmware = void 0;
|
|
4
|
+
const events_1 = require("../../events");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const postConfirmationMessage = (device) => {
|
|
7
|
+
if (device.features.firmware_present) {
|
|
8
|
+
device.emit(events_1.DEVICE.BUTTON, device, { code: 'ButtonRequest_FirmwareUpdate' });
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const postProgressMessage = (device, progress, postMessage) => {
|
|
12
|
+
postMessage((0, events_1.createUiMessage)(events_1.UI.FIRMWARE_PROGRESS, {
|
|
13
|
+
device: device.toMessageObject(),
|
|
14
|
+
progress,
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
const uploadFirmware = async (typedCall, postMessage, device, { payload }) => {
|
|
18
|
+
if (device.features.major_version === 1) {
|
|
19
|
+
postConfirmationMessage(device);
|
|
20
|
+
await typedCall('FirmwareErase', 'Success', {});
|
|
21
|
+
postProgressMessage(device, 0, postMessage);
|
|
22
|
+
const { message } = await typedCall('FirmwareUpload', 'Success', {
|
|
23
|
+
payload,
|
|
24
|
+
});
|
|
25
|
+
postProgressMessage(device, 100, postMessage);
|
|
26
|
+
return message;
|
|
27
|
+
}
|
|
28
|
+
if (device.features.major_version === 2) {
|
|
29
|
+
postConfirmationMessage(device);
|
|
30
|
+
const length = payload.byteLength;
|
|
31
|
+
let response = await typedCall('FirmwareErase', ['FirmwareRequest', 'Success'], { length });
|
|
32
|
+
while (response.type !== 'Success') {
|
|
33
|
+
const start = response.message.offset;
|
|
34
|
+
const end = response.message.offset + response.message.length;
|
|
35
|
+
const chunk = payload.slice(start, end);
|
|
36
|
+
if (start > 0) {
|
|
37
|
+
postProgressMessage(device, Math.round((start / length) * 100), postMessage);
|
|
38
|
+
}
|
|
39
|
+
response = await typedCall('FirmwareUpload', ['FirmwareRequest', 'Success'], {
|
|
40
|
+
payload: chunk,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
postProgressMessage(device, 100, postMessage);
|
|
44
|
+
return response.message;
|
|
45
|
+
}
|
|
46
|
+
throw constants_1.ERRORS.TypedError('Runtime', 'uploadFirmware: unknown major_version');
|
|
47
|
+
};
|
|
48
|
+
exports.uploadFirmware = uploadFirmware;
|
|
49
|
+
//# sourceMappingURL=uploadFirmware.js.map
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTx = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
const getCommon = (tx, address_n) => ({
|
|
6
|
+
address_n,
|
|
7
|
+
network: (tx.version >> 24) & 0xff,
|
|
8
|
+
timestamp: tx.timeStamp,
|
|
9
|
+
fee: tx.fee,
|
|
10
|
+
deadline: tx.deadline,
|
|
11
|
+
signer: address_n ? undefined : tx.signer,
|
|
12
|
+
});
|
|
13
|
+
const transferMessage = (tx) => {
|
|
14
|
+
const mosaics = tx.mosaics
|
|
15
|
+
? tx.mosaics.map(mosaic => ({
|
|
16
|
+
namespace: mosaic.mosaicId.namespaceId,
|
|
17
|
+
mosaic: mosaic.mosaicId.name,
|
|
18
|
+
quantity: mosaic.quantity,
|
|
19
|
+
}))
|
|
20
|
+
: undefined;
|
|
21
|
+
return {
|
|
22
|
+
recipient: tx.recipient,
|
|
23
|
+
amount: tx.amount,
|
|
24
|
+
payload: tx.message ? tx.message.payload : undefined,
|
|
25
|
+
public_key: tx.message && tx.message.type === 0x02 ? tx.message.publicKey : undefined,
|
|
26
|
+
mosaics,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const importanceTransferMessage = (tx) => ({
|
|
30
|
+
mode: tx.importanceTransfer.mode,
|
|
31
|
+
public_key: tx.importanceTransfer.publicKey,
|
|
32
|
+
});
|
|
33
|
+
const aggregateModificationMessage = (tx) => {
|
|
34
|
+
const modifications = tx.modifications
|
|
35
|
+
? tx.modifications.map(modification => ({
|
|
36
|
+
type: modification.modificationType,
|
|
37
|
+
public_key: modification.cosignatoryAccount,
|
|
38
|
+
}))
|
|
39
|
+
: undefined;
|
|
40
|
+
return {
|
|
41
|
+
modifications,
|
|
42
|
+
relative_change: tx.minCosignatories.relativeChange,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const provisionNamespaceMessage = (tx) => ({
|
|
46
|
+
namespace: tx.newPart,
|
|
47
|
+
parent: tx.parent,
|
|
48
|
+
sink: tx.rentalFeeSink,
|
|
49
|
+
fee: tx.rentalFee,
|
|
50
|
+
});
|
|
51
|
+
const mosaicCreationMessage = (tx) => {
|
|
52
|
+
const { levy } = tx.mosaicDefinition;
|
|
53
|
+
const definition = {
|
|
54
|
+
namespace: tx.mosaicDefinition.id.namespaceId,
|
|
55
|
+
mosaic: tx.mosaicDefinition.id.name,
|
|
56
|
+
levy: levy && levy.type,
|
|
57
|
+
fee: levy && levy.fee,
|
|
58
|
+
levy_address: levy && levy.recipient,
|
|
59
|
+
levy_namespace: levy && levy.mosaicId && levy.mosaicId.namespaceId,
|
|
60
|
+
levy_mosaic: levy && levy.mosaicId && levy.mosaicId.name,
|
|
61
|
+
description: tx.mosaicDefinition.description,
|
|
62
|
+
};
|
|
63
|
+
const { properties } = tx.mosaicDefinition;
|
|
64
|
+
if (Array.isArray(properties)) {
|
|
65
|
+
properties.forEach(property => {
|
|
66
|
+
const { name, value } = property;
|
|
67
|
+
switch (name) {
|
|
68
|
+
case 'divisibility':
|
|
69
|
+
definition.divisibility = parseInt(value, 10);
|
|
70
|
+
break;
|
|
71
|
+
case 'initialSupply':
|
|
72
|
+
definition.supply = parseInt(value, 10);
|
|
73
|
+
break;
|
|
74
|
+
case 'supplyMutable':
|
|
75
|
+
definition.mutable_supply = value === 'true';
|
|
76
|
+
break;
|
|
77
|
+
case 'transferable':
|
|
78
|
+
definition.transferable = value === 'true';
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
definition,
|
|
85
|
+
sink: tx.creationFeeSink,
|
|
86
|
+
fee: tx.creationFee,
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const supplyChangeMessage = (tx) => ({
|
|
90
|
+
namespace: tx.mosaicId.namespaceId,
|
|
91
|
+
mosaic: tx.mosaicId.name,
|
|
92
|
+
type: tx.supplyType,
|
|
93
|
+
delta: tx.delta,
|
|
94
|
+
});
|
|
95
|
+
const createTx = (tx, address_n) => {
|
|
96
|
+
let transaction = tx;
|
|
97
|
+
const message = {
|
|
98
|
+
transaction: getCommon(tx, address_n),
|
|
99
|
+
transfer: undefined,
|
|
100
|
+
importance_transfer: undefined,
|
|
101
|
+
aggregate_modification: undefined,
|
|
102
|
+
provision_namespace: undefined,
|
|
103
|
+
mosaic_creation: undefined,
|
|
104
|
+
supply_change: undefined,
|
|
105
|
+
};
|
|
106
|
+
if (tx.type === constants_1.NEM.TxType.COSIGNING ||
|
|
107
|
+
tx.type === constants_1.NEM.TxType.MULTISIG ||
|
|
108
|
+
tx.type === constants_1.NEM.TxType.MULTISIG_SIGNATURE) {
|
|
109
|
+
message.cosigning =
|
|
110
|
+
tx.type === constants_1.NEM.TxType.COSIGNING || tx.type === constants_1.NEM.TxType.MULTISIG_SIGNATURE;
|
|
111
|
+
transaction = tx.otherTrans;
|
|
112
|
+
message.multisig = getCommon(transaction);
|
|
113
|
+
}
|
|
114
|
+
switch (transaction.type) {
|
|
115
|
+
case constants_1.NEM.TxType.TRANSFER:
|
|
116
|
+
message.transfer = transferMessage(transaction);
|
|
117
|
+
break;
|
|
118
|
+
case constants_1.NEM.TxType.IMPORTANCE_TRANSFER:
|
|
119
|
+
message.importance_transfer = importanceTransferMessage(transaction);
|
|
120
|
+
break;
|
|
121
|
+
case constants_1.NEM.TxType.AGGREGATE_MODIFICATION:
|
|
122
|
+
message.aggregate_modification = aggregateModificationMessage(transaction);
|
|
123
|
+
break;
|
|
124
|
+
case constants_1.NEM.TxType.PROVISION_NAMESPACE:
|
|
125
|
+
message.provision_namespace = provisionNamespaceMessage(transaction);
|
|
126
|
+
break;
|
|
127
|
+
case constants_1.NEM.TxType.MOSAIC_CREATION:
|
|
128
|
+
message.mosaic_creation = mosaicCreationMessage(transaction);
|
|
129
|
+
break;
|
|
130
|
+
case constants_1.NEM.TxType.SUPPLY_CHANGE:
|
|
131
|
+
message.supply_change = supplyChangeMessage(transaction);
|
|
132
|
+
break;
|
|
133
|
+
default:
|
|
134
|
+
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'Unknown transaction type');
|
|
135
|
+
}
|
|
136
|
+
return message;
|
|
137
|
+
};
|
|
138
|
+
exports.createTx = createTx;
|
|
139
|
+
//# sourceMappingURL=nemSignTx.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import { PROTO } from '../constants';
|
|
3
|
+
declare type Params = PROTO.NEMGetAddress & {
|
|
4
|
+
address?: string;
|
|
5
|
+
};
|
|
6
|
+
export default class NEMGetAddress extends AbstractMethod<'nemGetAddress', Params[]> {
|
|
7
|
+
hasBundle?: boolean;
|
|
8
|
+
progress: number;
|
|
9
|
+
confirmed?: boolean;
|
|
10
|
+
init(): void;
|
|
11
|
+
getButtonRequestData(code: string): {
|
|
12
|
+
type: "address";
|
|
13
|
+
serializedPath: string;
|
|
14
|
+
address: string;
|
|
15
|
+
} | undefined;
|
|
16
|
+
confirmation(): Promise<boolean>;
|
|
17
|
+
noBackupConfirmation(): Promise<boolean>;
|
|
18
|
+
_call({ address_n, network, show_display }: Params): Promise<PROTO.NEMAddress>;
|
|
19
|
+
run(): Promise<import("..").Address | import("..").Address[]>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=nemGetAddress.d.ts.map
|
|
@@ -0,0 +1,144 @@
|
|
|
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 coinInfo_1 = require("../data/coinInfo");
|
|
6
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
7
|
+
const constants_1 = require("../constants");
|
|
8
|
+
const events_1 = require("../events");
|
|
9
|
+
const MAINNET = 0x68;
|
|
10
|
+
const TESTNET = 0x98;
|
|
11
|
+
const MIJIN = 0x60;
|
|
12
|
+
class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.progress = 0;
|
|
16
|
+
}
|
|
17
|
+
init() {
|
|
18
|
+
this.requiredPermissions = ['read'];
|
|
19
|
+
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('NEM'), this.firmwareRange);
|
|
20
|
+
this.hasBundle = !!this.payload.bundle;
|
|
21
|
+
const payload = !this.payload.bundle
|
|
22
|
+
? { ...this.payload, bundle: [this.payload] }
|
|
23
|
+
: this.payload;
|
|
24
|
+
(0, paramsValidator_1.validateParams)(payload, [
|
|
25
|
+
{ name: 'bundle', type: 'array' },
|
|
26
|
+
{ name: 'useEventListener', type: 'boolean' },
|
|
27
|
+
]);
|
|
28
|
+
this.params = payload.bundle.map(batch => {
|
|
29
|
+
(0, paramsValidator_1.validateParams)(batch, [
|
|
30
|
+
{ name: 'path', required: true },
|
|
31
|
+
{ name: 'address', type: 'string' },
|
|
32
|
+
{ name: 'network', type: 'number' },
|
|
33
|
+
{ name: 'showOnTrezor', type: 'boolean' },
|
|
34
|
+
]);
|
|
35
|
+
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
36
|
+
return {
|
|
37
|
+
address_n: path,
|
|
38
|
+
network: batch.network || MAINNET,
|
|
39
|
+
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
40
|
+
address: batch.address,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
const useEventListener = payload.useEventListener &&
|
|
44
|
+
this.params.length === 1 &&
|
|
45
|
+
typeof this.params[0].address === 'string' &&
|
|
46
|
+
this.params[0].show_display;
|
|
47
|
+
this.confirmed = useEventListener;
|
|
48
|
+
this.useUi = !useEventListener;
|
|
49
|
+
if (this.params.length === 1) {
|
|
50
|
+
let network = 'Unknown';
|
|
51
|
+
switch (this.params[0].network) {
|
|
52
|
+
case MAINNET:
|
|
53
|
+
network = 'Mainnet';
|
|
54
|
+
break;
|
|
55
|
+
case TESTNET:
|
|
56
|
+
network = 'Testnet';
|
|
57
|
+
break;
|
|
58
|
+
case MIJIN:
|
|
59
|
+
network = 'Mijin';
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
this.info = `Export NEM address for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1} on ${network} network`;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.info = 'Export multiple NEM addresses';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
getButtonRequestData(code) {
|
|
69
|
+
if (code === 'ButtonRequest_Address') {
|
|
70
|
+
return {
|
|
71
|
+
type: 'address',
|
|
72
|
+
serializedPath: (0, pathUtils_1.getSerializedPath)(this.params[this.progress].address_n),
|
|
73
|
+
address: this.params[this.progress].address || 'not-set',
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async confirmation() {
|
|
78
|
+
if (this.confirmed)
|
|
79
|
+
return true;
|
|
80
|
+
await this.getPopupPromise().promise;
|
|
81
|
+
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
82
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
83
|
+
view: 'export-address',
|
|
84
|
+
label: this.info,
|
|
85
|
+
}));
|
|
86
|
+
const uiResp = await uiPromise.promise;
|
|
87
|
+
this.confirmed = uiResp.payload;
|
|
88
|
+
return this.confirmed;
|
|
89
|
+
}
|
|
90
|
+
async noBackupConfirmation() {
|
|
91
|
+
await this.getPopupPromise().promise;
|
|
92
|
+
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
93
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
94
|
+
view: 'no-backup',
|
|
95
|
+
}));
|
|
96
|
+
const uiResp = await uiPromise.promise;
|
|
97
|
+
return uiResp.payload;
|
|
98
|
+
}
|
|
99
|
+
async _call({ address_n, network, show_display }) {
|
|
100
|
+
const cmd = this.device.getCommands();
|
|
101
|
+
const response = await cmd.typedCall('NEMGetAddress', 'NEMAddress', {
|
|
102
|
+
address_n,
|
|
103
|
+
network,
|
|
104
|
+
show_display,
|
|
105
|
+
});
|
|
106
|
+
return response.message;
|
|
107
|
+
}
|
|
108
|
+
async run() {
|
|
109
|
+
const responses = [];
|
|
110
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
111
|
+
const batch = this.params[i];
|
|
112
|
+
if (batch.show_display) {
|
|
113
|
+
const silent = await this._call({
|
|
114
|
+
...batch,
|
|
115
|
+
show_display: false,
|
|
116
|
+
});
|
|
117
|
+
if (typeof batch.address === 'string') {
|
|
118
|
+
if (batch.address !== silent.address) {
|
|
119
|
+
throw constants_1.ERRORS.TypedError('Method_AddressNotMatch');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
batch.address = silent.address;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const response = await this._call(batch);
|
|
127
|
+
responses.push({
|
|
128
|
+
path: batch.address_n,
|
|
129
|
+
serializedPath: (0, pathUtils_1.getSerializedPath)(batch.address_n),
|
|
130
|
+
address: response.address,
|
|
131
|
+
});
|
|
132
|
+
if (this.hasBundle) {
|
|
133
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.BUNDLE_PROGRESS, {
|
|
134
|
+
progress: i,
|
|
135
|
+
response,
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
138
|
+
this.progress++;
|
|
139
|
+
}
|
|
140
|
+
return this.hasBundle ? responses : responses[0];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
exports.default = NEMGetAddress;
|
|
144
|
+
//# sourceMappingURL=nemGetAddress.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import type { PROTO } from '../constants';
|
|
3
|
+
export default class NEMSignTransaction extends AbstractMethod<'nemSignTransaction', PROTO.NEMSignTx> {
|
|
4
|
+
init(): void;
|
|
5
|
+
run(): Promise<PROTO.NEMSignedTx>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=nemSignTransaction.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
|
+
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
|
+
const coinInfo_1 = require("../data/coinInfo");
|
|
7
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
8
|
+
const helper = (0, tslib_1.__importStar)(require("./nem/nemSignTx"));
|
|
9
|
+
class NEMSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
10
|
+
init() {
|
|
11
|
+
this.requiredPermissions = ['read', 'write'];
|
|
12
|
+
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('NEM'), this.firmwareRange);
|
|
13
|
+
this.info = 'Sign NEM transaction';
|
|
14
|
+
const { payload } = this;
|
|
15
|
+
(0, paramsValidator_1.validateParams)(payload, [
|
|
16
|
+
{ name: 'path', required: true },
|
|
17
|
+
{ name: 'transaction', required: true },
|
|
18
|
+
]);
|
|
19
|
+
const path = (0, pathUtils_1.validatePath)(payload.path, 3);
|
|
20
|
+
this.params = helper.createTx(payload.transaction, path);
|
|
21
|
+
}
|
|
22
|
+
async run() {
|
|
23
|
+
const cmd = this.device.getCommands();
|
|
24
|
+
const response = await cmd.typedCall('NEMSignTx', 'NEMSignedTx', this.params);
|
|
25
|
+
return response.message;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = NEMSignTransaction;
|
|
29
|
+
//# sourceMappingURL=nemSignTransaction.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import type { CoinInfo } from '../types';
|
|
3
|
+
declare type Params = {
|
|
4
|
+
tx: string;
|
|
5
|
+
coinInfo: CoinInfo;
|
|
6
|
+
};
|
|
7
|
+
export default class PushTransaction extends AbstractMethod<'pushTransaction', Params> {
|
|
8
|
+
init(): void;
|
|
9
|
+
run(): Promise<{
|
|
10
|
+
txid: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=pushTransaction.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
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 coinInfo_1 = require("../data/coinInfo");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const BlockchainLink_1 = require("../backend/BlockchainLink");
|
|
8
|
+
class PushTransaction extends AbstractMethod_1.AbstractMethod {
|
|
9
|
+
init() {
|
|
10
|
+
this.requiredPermissions = [];
|
|
11
|
+
this.useUi = false;
|
|
12
|
+
this.useDevice = false;
|
|
13
|
+
const { payload } = this;
|
|
14
|
+
(0, paramsValidator_1.validateParams)(payload, [
|
|
15
|
+
{ name: 'tx', type: 'string', required: true },
|
|
16
|
+
{ name: 'coin', type: 'string', required: true },
|
|
17
|
+
]);
|
|
18
|
+
const coinInfo = (0, coinInfo_1.getCoinInfo)(payload.coin);
|
|
19
|
+
if (!coinInfo) {
|
|
20
|
+
throw constants_1.ERRORS.TypedError('Method_UnknownCoin');
|
|
21
|
+
}
|
|
22
|
+
(0, BlockchainLink_1.isBackendSupported)(coinInfo);
|
|
23
|
+
if (coinInfo.type === 'bitcoin' && !/^[0-9A-Fa-f]*$/.test(payload.tx)) {
|
|
24
|
+
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'Transaction must be hexadecimal');
|
|
25
|
+
}
|
|
26
|
+
this.params = {
|
|
27
|
+
tx: payload.tx,
|
|
28
|
+
coinInfo,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async run() {
|
|
32
|
+
const backend = await (0, BlockchainLink_1.initBlockchain)(this.params.coinInfo, this.postMessage);
|
|
33
|
+
const txid = await backend.pushTransaction(this.params.tx);
|
|
34
|
+
return {
|
|
35
|
+
txid,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = PushTransaction;
|
|
40
|
+
//# sourceMappingURL=pushTransaction.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
export default class RebootToBootloader extends AbstractMethod<'rebootToBootloader'> {
|
|
3
|
+
confirmed?: boolean;
|
|
4
|
+
init(): void;
|
|
5
|
+
confirmation(): Promise<boolean>;
|
|
6
|
+
run(): Promise<import("packages/transport/lib/types/messages").Success>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=rebootToBootloader.d.ts.map
|