@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,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.config = void 0;
|
|
4
|
+
exports.config = {
|
|
5
|
+
webusb: [
|
|
6
|
+
{ vendorId: 0x534c, productId: 0x0001 },
|
|
7
|
+
{ vendorId: 0x1209, productId: 0x53c0 },
|
|
8
|
+
{ vendorId: 0x1209, productId: 0x53c1 },
|
|
9
|
+
],
|
|
10
|
+
whitelist: [
|
|
11
|
+
{ origin: 'chrome-extension://imloifkgjagghnncjkhggdhalmcnfklk', priority: 1 },
|
|
12
|
+
{ origin: 'chrome-extension://niebkpllfhmpfbffbfifagfgoamhpflf', priority: 1 },
|
|
13
|
+
{ origin: 'file://', priority: 2 },
|
|
14
|
+
{ origin: 'trezor.io', priority: 0 },
|
|
15
|
+
{ origin: 'sldev.cz', priority: 0 },
|
|
16
|
+
{ origin: 'localhost', priority: 0 },
|
|
17
|
+
{ origin: 'trezoriovpjcahpzkrewelclulmszwbqpzmzgub37gbcjlvluxtruqad.onion', priority: 0 },
|
|
18
|
+
],
|
|
19
|
+
management: [{ origin: 'trezor.io' }, { origin: 'sldev.cz' }, { origin: 'localhost' }],
|
|
20
|
+
knownHosts: [
|
|
21
|
+
{
|
|
22
|
+
origin: 'imloifkgjagghnncjkhggdhalmcnfklk',
|
|
23
|
+
label: 'Trezor Password Manager (Develop)',
|
|
24
|
+
icon: '',
|
|
25
|
+
},
|
|
26
|
+
{ origin: 'niebkpllfhmpfbffbfifagfgoamhpflf', label: 'Trezor Password Manager', icon: '' },
|
|
27
|
+
{ origin: 'trezor-connect@trezor.io', label: 'Trezor Connect FF Extension', icon: '' },
|
|
28
|
+
{
|
|
29
|
+
origin: 'efbfhenfhihgdcmnfdkhaphjdnopihlf',
|
|
30
|
+
label: 'Trezor Connect Chrome Extension',
|
|
31
|
+
icon: '',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
origin: 'mnpfhpndmjholfdlhpkjfmjkgppmodaf',
|
|
35
|
+
label: 'MetaMask',
|
|
36
|
+
icon: '',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
origin: 'webextension@metamask.io',
|
|
40
|
+
label: 'MetaMask',
|
|
41
|
+
icon: '',
|
|
42
|
+
},
|
|
43
|
+
{ origin: 'file://', label: ' ', icon: '' },
|
|
44
|
+
],
|
|
45
|
+
onionDomains: {
|
|
46
|
+
'trezor.io': 'trezoriovpjcahpzkrewelclulmszwbqpzmzgub37gbcjlvluxtruqad.onion',
|
|
47
|
+
},
|
|
48
|
+
assets: [
|
|
49
|
+
{
|
|
50
|
+
name: 'coins',
|
|
51
|
+
url: './data/coins.json',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'bridge',
|
|
55
|
+
url: './data/bridge/releases.json',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'firmware-t1',
|
|
59
|
+
url: './data/firmware/1/releases.json',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'firmware-t2',
|
|
63
|
+
url: './data/firmware/2/releases.json',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
messages: [
|
|
67
|
+
{
|
|
68
|
+
name: 'default',
|
|
69
|
+
range: {
|
|
70
|
+
min: ['1.0.0', '2.0.0'],
|
|
71
|
+
},
|
|
72
|
+
json: './data/messages/messages.json',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
supportedBrowsers: {
|
|
76
|
+
chrome: {
|
|
77
|
+
version: 59,
|
|
78
|
+
download: 'https://www.google.com/chrome/',
|
|
79
|
+
update: 'https://support.google.com/chrome/answer/95414',
|
|
80
|
+
},
|
|
81
|
+
chromium: {
|
|
82
|
+
version: 59,
|
|
83
|
+
download: 'https://www.chromium.org/',
|
|
84
|
+
update: 'https://www.chromium.org/',
|
|
85
|
+
},
|
|
86
|
+
electron: {
|
|
87
|
+
version: 0,
|
|
88
|
+
download: 'https://www.electronjs.org/',
|
|
89
|
+
update: 'https://www.electronjs.org/',
|
|
90
|
+
},
|
|
91
|
+
firefox: {
|
|
92
|
+
version: 54,
|
|
93
|
+
download: 'https://www.mozilla.org/en-US/firefox/new/',
|
|
94
|
+
update: 'https://support.mozilla.org/en-US/kb/update-firefox-latest-version',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
supportedFirmware: [
|
|
98
|
+
{
|
|
99
|
+
coin: ['xrp', 'txrp'],
|
|
100
|
+
methods: ['getAccountInfo'],
|
|
101
|
+
min: ['0', '2.1.0'],
|
|
102
|
+
max: undefined,
|
|
103
|
+
comment: [
|
|
104
|
+
"Since firmware 2.1.0 there is a new protobuf field 'destination_tag' in RippleSignTx",
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
coin: ['bnb'],
|
|
109
|
+
min: ['1.9.0', '2.3.0'],
|
|
110
|
+
comment: [
|
|
111
|
+
'There were protobuf backwards incompatible changes with introduction of 1.9.0/2.3.0 firmwares',
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
coin: ['eth', 'trop'],
|
|
116
|
+
min: ['1.8.0', '2.1.0'],
|
|
117
|
+
comment: ['There were protobuf backwards incompatible changes.'],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
methods: ['rippleGetAddress', 'rippleSignTransaction'],
|
|
121
|
+
min: ['0', '2.1.0'],
|
|
122
|
+
comment: [
|
|
123
|
+
"Since firmware 2.1.0 there is a new protobuf field 'destination_tag' in RippleSignTx",
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
methods: ['cardanoGetAddress', 'cardanoGetPublicKey'],
|
|
128
|
+
min: ['0', '2.3.2'],
|
|
129
|
+
comment: ['Shelley fork support since firmware 2.3.2'],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
methods: ['cardanoSignTransaction'],
|
|
133
|
+
min: ['0', '2.4.2'],
|
|
134
|
+
comment: ['Non-streamed signing no longer supported'],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
methods: ['cardanoGetNativeScriptHash'],
|
|
138
|
+
min: ['0', '2.4.3'],
|
|
139
|
+
comment: ['Cardano GetNativeScriptHash call added in 2.4.3'],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
methods: ['tezosSignTransaction'],
|
|
143
|
+
min: ['0', '2.1.8'],
|
|
144
|
+
comment: [
|
|
145
|
+
'Since 2.1.8 there are new protobuf fields in tezos transaction (Babylon fork)',
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
methods: ['stellarSignTransaction'],
|
|
150
|
+
min: ['1.9.0', '2.3.0'],
|
|
151
|
+
comment: [
|
|
152
|
+
'There were protobuf backwards incompatible changes with introduction of 1.9.0/2.3.0 firmwares',
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
capabilities: ['replaceTransaction', 'amountUnit'],
|
|
157
|
+
min: ['1.9.4', '2.3.5'],
|
|
158
|
+
comment: ['new sign tx process since 1.9.4/2.3.5'],
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
capabilities: ['decreaseOutput'],
|
|
162
|
+
min: ['1.10.0', '2.4.0'],
|
|
163
|
+
comment: ['allow reduce output in RBF transaction since 1.10.0/2.4.0'],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
capabilities: ['eip1559'],
|
|
167
|
+
min: ['1.10.4', '2.4.2'],
|
|
168
|
+
comment: ['new eth transaction pricing mechanism (EIP1559) since 1.10.4/2.4.2'],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
capabilities: ['taproot', 'signMessageNoScriptType'],
|
|
172
|
+
min: ['1.10.4', '2.4.3'],
|
|
173
|
+
comment: [
|
|
174
|
+
'new btc accounts taproot since 1.10.4/2.4.3 (BTC + TEST only)',
|
|
175
|
+
'SignMessage with no_script_type support',
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
coin: ['dcr', 'tdcr'],
|
|
180
|
+
methods: ['signTransaction'],
|
|
181
|
+
min: ['1.10.1', '2.4.0'],
|
|
182
|
+
comment: [''],
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
methods: ['ethereumSignTypedData'],
|
|
186
|
+
min: ['1.10.5', '2.4.3'],
|
|
187
|
+
comment: ['EIP-712 typed signing support added in 1.10.5/2.4.3'],
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
capabilities: ['eip712-domain-only'],
|
|
191
|
+
min: ['1.10.6', '2.4.4'],
|
|
192
|
+
comment: ['EIP-712 domain-only signing, when primaryType=EIP712Domain'],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
capabilities: ['coinjoin'],
|
|
196
|
+
methods: ['authorizeCoinJoin', 'getOwnershipId', 'getOwnershipProof'],
|
|
197
|
+
min: ['0', '2.4.4'],
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
};
|
|
201
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ConnectSettings } from '../types';
|
|
2
|
+
export declare const DEFAULT_PRIORITY = 2;
|
|
3
|
+
export declare const getEnv: () => "web" | "webextension" | "electron" | "react-native";
|
|
4
|
+
export declare const corsValidator: (url?: string | undefined) => string | undefined;
|
|
5
|
+
export declare const parseConnectSettings: (input?: Partial<ConnectSettings>) => ConnectSettings;
|
|
6
|
+
//# sourceMappingURL=connectSettings.d.ts.map
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseConnectSettings = exports.corsValidator = exports.getEnv = exports.DEFAULT_PRIORITY = void 0;
|
|
4
|
+
const version_1 = require("./version");
|
|
5
|
+
exports.DEFAULT_PRIORITY = 2;
|
|
6
|
+
const initialSettings = {
|
|
7
|
+
configSrc: './data/config.json',
|
|
8
|
+
version: version_1.VERSION,
|
|
9
|
+
debug: false,
|
|
10
|
+
priority: exports.DEFAULT_PRIORITY,
|
|
11
|
+
trustedHost: false,
|
|
12
|
+
connectSrc: version_1.DEFAULT_DOMAIN,
|
|
13
|
+
iframeSrc: `${version_1.DEFAULT_DOMAIN}iframe.html`,
|
|
14
|
+
popup: true,
|
|
15
|
+
popupSrc: `${version_1.DEFAULT_DOMAIN}popup.html`,
|
|
16
|
+
webusbSrc: `${version_1.DEFAULT_DOMAIN}webusb.html`,
|
|
17
|
+
webusb: true,
|
|
18
|
+
pendingTransportEvent: true,
|
|
19
|
+
supportedBrowser: typeof navigator !== 'undefined' ? !/Trident|MSIE|Edge/.test(navigator.userAgent) : true,
|
|
20
|
+
env: 'web',
|
|
21
|
+
lazyLoad: false,
|
|
22
|
+
timestamp: new Date().getTime(),
|
|
23
|
+
interactionTimeout: 600,
|
|
24
|
+
};
|
|
25
|
+
const parseManifest = (manifest) => {
|
|
26
|
+
if (!manifest)
|
|
27
|
+
return;
|
|
28
|
+
if (typeof manifest.email !== 'string')
|
|
29
|
+
return;
|
|
30
|
+
if (typeof manifest.appUrl !== 'string')
|
|
31
|
+
return;
|
|
32
|
+
return {
|
|
33
|
+
email: manifest.email,
|
|
34
|
+
appUrl: manifest.appUrl,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const getEnv = () => {
|
|
38
|
+
if (typeof chrome !== 'undefined' &&
|
|
39
|
+
chrome.runtime &&
|
|
40
|
+
typeof chrome.runtime.onConnect !== 'undefined') {
|
|
41
|
+
return 'webextension';
|
|
42
|
+
}
|
|
43
|
+
if (typeof navigator !== 'undefined') {
|
|
44
|
+
if (typeof navigator.product === 'string' &&
|
|
45
|
+
navigator.product.toLowerCase() === 'reactnative') {
|
|
46
|
+
return 'react-native';
|
|
47
|
+
}
|
|
48
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
49
|
+
if (userAgent.indexOf(' electron/') > -1) {
|
|
50
|
+
return 'electron';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return 'web';
|
|
54
|
+
};
|
|
55
|
+
exports.getEnv = getEnv;
|
|
56
|
+
const corsValidator = (url) => {
|
|
57
|
+
if (typeof url !== 'string')
|
|
58
|
+
return;
|
|
59
|
+
if (url.match(/^https:\/\/([A-Za-z0-9\-_]+\.)*trezor\.io\//))
|
|
60
|
+
return url;
|
|
61
|
+
if (url.match(/^https?:\/\/localhost:[58][0-9]{3}\//))
|
|
62
|
+
return url;
|
|
63
|
+
if (url.match(/^https:\/\/([A-Za-z0-9\-_]+\.)*sldev\.cz\//))
|
|
64
|
+
return url;
|
|
65
|
+
if (url.match(/^https?:\/\/([A-Za-z0-9\-_]+\.)*trezoriovpjcahpzkrewelclulmszwbqpzmzgub37gbcjlvluxtruqad\.onion\//))
|
|
66
|
+
return url;
|
|
67
|
+
};
|
|
68
|
+
exports.corsValidator = corsValidator;
|
|
69
|
+
const parseConnectSettings = (input = {}) => {
|
|
70
|
+
const settings = { ...initialSettings };
|
|
71
|
+
if (Object.prototype.hasOwnProperty.call(input, 'debug')) {
|
|
72
|
+
if (Array.isArray(input)) {
|
|
73
|
+
}
|
|
74
|
+
if (typeof input.debug === 'boolean') {
|
|
75
|
+
settings.debug = input.debug;
|
|
76
|
+
}
|
|
77
|
+
else if (typeof input.debug === 'string') {
|
|
78
|
+
settings.debug = input.debug === 'true';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (typeof input.connectSrc === 'string') {
|
|
82
|
+
settings.connectSrc = input.connectSrc;
|
|
83
|
+
}
|
|
84
|
+
let globalSrc;
|
|
85
|
+
if (typeof window !== 'undefined') {
|
|
86
|
+
globalSrc = window.__TREZOR_CONNECT_SRC;
|
|
87
|
+
}
|
|
88
|
+
else if (typeof global !== 'undefined') {
|
|
89
|
+
globalSrc = global.__TREZOR_CONNECT_SRC;
|
|
90
|
+
}
|
|
91
|
+
if (typeof globalSrc === 'string') {
|
|
92
|
+
settings.connectSrc = (0, exports.corsValidator)(globalSrc);
|
|
93
|
+
settings.debug = true;
|
|
94
|
+
}
|
|
95
|
+
if (typeof window !== 'undefined' &&
|
|
96
|
+
window.location &&
|
|
97
|
+
typeof window.location.search === 'string') {
|
|
98
|
+
const vars = window.location.search.split('&');
|
|
99
|
+
const customUrl = vars.find(v => v.indexOf('trezor-connect-src') >= 0);
|
|
100
|
+
if (customUrl) {
|
|
101
|
+
const [, connectSrc] = customUrl.split('=');
|
|
102
|
+
settings.connectSrc = (0, exports.corsValidator)(decodeURIComponent(connectSrc));
|
|
103
|
+
settings.debug = true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const src = settings.connectSrc || version_1.DEFAULT_DOMAIN;
|
|
107
|
+
settings.iframeSrc = `${src}iframe.html`;
|
|
108
|
+
settings.popupSrc = `${src}popup.html`;
|
|
109
|
+
settings.webusbSrc = `${src}webusb.html`;
|
|
110
|
+
if (typeof input.transportReconnect === 'boolean') {
|
|
111
|
+
settings.transportReconnect = input.transportReconnect;
|
|
112
|
+
}
|
|
113
|
+
if (typeof input.webusb === 'boolean') {
|
|
114
|
+
settings.webusb = input.webusb;
|
|
115
|
+
}
|
|
116
|
+
if (typeof input.popup === 'boolean') {
|
|
117
|
+
settings.popup = input.popup;
|
|
118
|
+
}
|
|
119
|
+
if (typeof input.lazyLoad === 'boolean') {
|
|
120
|
+
settings.lazyLoad = input.lazyLoad;
|
|
121
|
+
}
|
|
122
|
+
if (typeof input.pendingTransportEvent === 'boolean') {
|
|
123
|
+
settings.pendingTransportEvent = input.pendingTransportEvent;
|
|
124
|
+
}
|
|
125
|
+
if (typeof window !== 'undefined' && window.location && window.location.protocol === 'file:') {
|
|
126
|
+
settings.origin = `file://${window.location.pathname}`;
|
|
127
|
+
settings.webusb = false;
|
|
128
|
+
}
|
|
129
|
+
if (typeof input.extension === 'string') {
|
|
130
|
+
settings.extension = input.extension;
|
|
131
|
+
}
|
|
132
|
+
if (typeof input.env === 'string') {
|
|
133
|
+
settings.env = input.env;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
settings.env = (0, exports.getEnv)();
|
|
137
|
+
}
|
|
138
|
+
if (typeof input.timestamp === 'number') {
|
|
139
|
+
settings.timestamp = input.timestamp;
|
|
140
|
+
}
|
|
141
|
+
if (typeof input.interactionTimeout === 'number') {
|
|
142
|
+
settings.interactionTimeout = input.interactionTimeout;
|
|
143
|
+
}
|
|
144
|
+
if (typeof input.manifest === 'object') {
|
|
145
|
+
settings.manifest = parseManifest(input.manifest);
|
|
146
|
+
}
|
|
147
|
+
return settings;
|
|
148
|
+
};
|
|
149
|
+
exports.parseConnectSettings = parseConnectSettings;
|
|
150
|
+
//# sourceMappingURL=connectSettings.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Features, FirmwareRelease, ReleaseInfo } from '../types';
|
|
2
|
+
export declare const parseFirmware: (json: any, model: number) => void;
|
|
3
|
+
export interface GetInfoProps {
|
|
4
|
+
features: Features;
|
|
5
|
+
releases: FirmwareRelease[];
|
|
6
|
+
}
|
|
7
|
+
export declare const getInfo: ({ features, releases }: GetInfoProps) => ReleaseInfo | null;
|
|
8
|
+
export declare const getFirmwareStatus: (features: Features) => "valid" | "outdated" | "required" | "unknown" | "none";
|
|
9
|
+
export declare const getRelease: (features: Features) => ReleaseInfo | null;
|
|
10
|
+
export declare const getReleases: (model: number) => FirmwareRelease[];
|
|
11
|
+
//# sourceMappingURL=firmwareInfo.d.ts.map
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReleases = exports.getRelease = exports.getFirmwareStatus = exports.getInfo = exports.parseFirmware = void 0;
|
|
4
|
+
const utils_1 = require("@trezor/utils");
|
|
5
|
+
const firmwareUtils_1 = require("../utils/firmwareUtils");
|
|
6
|
+
const releases = {};
|
|
7
|
+
releases[1] = [];
|
|
8
|
+
releases[2] = [];
|
|
9
|
+
const cleanUrl = (url) => {
|
|
10
|
+
if (typeof url !== 'string')
|
|
11
|
+
return;
|
|
12
|
+
if (url.indexOf('data/') === 0)
|
|
13
|
+
return url.substring(5);
|
|
14
|
+
return url;
|
|
15
|
+
};
|
|
16
|
+
const parseFirmware = (json, model) => {
|
|
17
|
+
Object.keys(json).forEach(key => {
|
|
18
|
+
const release = json[key];
|
|
19
|
+
releases[model].push({
|
|
20
|
+
...release,
|
|
21
|
+
url: cleanUrl(release.url),
|
|
22
|
+
url_bitcoinonly: cleanUrl(release.url_bitcoinonly),
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.parseFirmware = parseFirmware;
|
|
27
|
+
const getChangelog = (releases, features) => {
|
|
28
|
+
if (features.bootloader_mode) {
|
|
29
|
+
if (features.firmware_present && features.major_version === 1) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
if (features.firmware_present && features.major_version === 2) {
|
|
33
|
+
return releases.filter(r => utils_1.versionUtils.isNewer(r.version, [
|
|
34
|
+
features.fw_major,
|
|
35
|
+
features.fw_minor,
|
|
36
|
+
features.fw_patch,
|
|
37
|
+
]));
|
|
38
|
+
}
|
|
39
|
+
return releases;
|
|
40
|
+
}
|
|
41
|
+
return releases.filter(r => utils_1.versionUtils.isNewer(r.version, [
|
|
42
|
+
features.major_version,
|
|
43
|
+
features.minor_version,
|
|
44
|
+
features.patch_version,
|
|
45
|
+
]));
|
|
46
|
+
};
|
|
47
|
+
const isNewer = (release, features) => {
|
|
48
|
+
if (features.major_version === 1 && features.bootloader_mode) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return utils_1.versionUtils.isNewer(release.version, [
|
|
52
|
+
features.major_version,
|
|
53
|
+
features.minor_version,
|
|
54
|
+
features.patch_version,
|
|
55
|
+
]);
|
|
56
|
+
};
|
|
57
|
+
const isRequired = (changelog) => {
|
|
58
|
+
if (!changelog || !changelog.length)
|
|
59
|
+
return null;
|
|
60
|
+
return changelog.some(item => item.required);
|
|
61
|
+
};
|
|
62
|
+
const isEqual = (release, latest) => utils_1.versionUtils.isEqual(release.version, latest.version);
|
|
63
|
+
const getInfo = ({ features, releases }) => {
|
|
64
|
+
if (!(0, firmwareUtils_1.isStrictFeatures)(features)) {
|
|
65
|
+
throw new Error('Features of unexpected shape provided.');
|
|
66
|
+
}
|
|
67
|
+
if (!(0, firmwareUtils_1.isValidReleases)(releases)) {
|
|
68
|
+
throw new Error(`Release object in unexpected shape.`);
|
|
69
|
+
}
|
|
70
|
+
let parsedReleases = releases;
|
|
71
|
+
let score = 0;
|
|
72
|
+
if (features.device_id) {
|
|
73
|
+
score = (0, firmwareUtils_1.getScore)(features.device_id);
|
|
74
|
+
}
|
|
75
|
+
const { bootloader_mode, major_version, minor_version, patch_version, fw_major, fw_minor, fw_patch, } = features;
|
|
76
|
+
if (score) {
|
|
77
|
+
parsedReleases = parsedReleases.filter(item => {
|
|
78
|
+
if (!item.rollout)
|
|
79
|
+
return true;
|
|
80
|
+
return item.rollout >= score;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const latest = parsedReleases[0];
|
|
84
|
+
if (major_version === 2 && bootloader_mode) {
|
|
85
|
+
if (fw_major !== null && fw_minor !== null && fw_patch !== null) {
|
|
86
|
+
parsedReleases = (0, firmwareUtils_1.filterSafeListByFirmware)(parsedReleases, [
|
|
87
|
+
fw_major,
|
|
88
|
+
fw_minor,
|
|
89
|
+
fw_patch,
|
|
90
|
+
]);
|
|
91
|
+
}
|
|
92
|
+
parsedReleases = (0, firmwareUtils_1.filterSafeListByBootloader)(parsedReleases, [
|
|
93
|
+
major_version,
|
|
94
|
+
minor_version,
|
|
95
|
+
patch_version,
|
|
96
|
+
]);
|
|
97
|
+
}
|
|
98
|
+
else if (major_version === 1 && bootloader_mode) {
|
|
99
|
+
parsedReleases = (0, firmwareUtils_1.filterSafeListByBootloader)(parsedReleases, [
|
|
100
|
+
major_version,
|
|
101
|
+
minor_version,
|
|
102
|
+
patch_version,
|
|
103
|
+
]);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
parsedReleases = (0, firmwareUtils_1.filterSafeListByFirmware)(parsedReleases, [
|
|
107
|
+
major_version,
|
|
108
|
+
minor_version,
|
|
109
|
+
patch_version,
|
|
110
|
+
]);
|
|
111
|
+
}
|
|
112
|
+
if (!parsedReleases.length) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const isLatest = isEqual(parsedReleases[0], latest);
|
|
116
|
+
const changelog = getChangelog(parsedReleases, features);
|
|
117
|
+
return {
|
|
118
|
+
changelog,
|
|
119
|
+
release: parsedReleases[0],
|
|
120
|
+
isLatest,
|
|
121
|
+
latest,
|
|
122
|
+
isRequired: isRequired(changelog),
|
|
123
|
+
isNewer: isNewer(parsedReleases[0], features),
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
exports.getInfo = getInfo;
|
|
127
|
+
const getFirmwareStatus = (features) => {
|
|
128
|
+
if (features.firmware_present === false) {
|
|
129
|
+
return 'none';
|
|
130
|
+
}
|
|
131
|
+
if (features.major_version === 1 && features.bootloader_mode) {
|
|
132
|
+
return 'unknown';
|
|
133
|
+
}
|
|
134
|
+
const info = (0, exports.getInfo)({ features, releases: releases[features.major_version] });
|
|
135
|
+
if (!info)
|
|
136
|
+
return 'unknown';
|
|
137
|
+
if (info.isRequired)
|
|
138
|
+
return 'required';
|
|
139
|
+
if (info.isNewer)
|
|
140
|
+
return 'outdated';
|
|
141
|
+
return 'valid';
|
|
142
|
+
};
|
|
143
|
+
exports.getFirmwareStatus = getFirmwareStatus;
|
|
144
|
+
const getRelease = (features) => (0, exports.getInfo)({ features, releases: releases[features.major_version] });
|
|
145
|
+
exports.getRelease = getRelease;
|
|
146
|
+
const getReleases = (model) => releases[model];
|
|
147
|
+
exports.getReleases = getReleases;
|
|
148
|
+
//# sourceMappingURL=firmwareInfo.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBridgeInfo = exports.parseBridgeJSON = void 0;
|
|
4
|
+
const info = {
|
|
5
|
+
version: [],
|
|
6
|
+
directory: '',
|
|
7
|
+
packages: [],
|
|
8
|
+
changelog: '',
|
|
9
|
+
};
|
|
10
|
+
const parseBridgeJSON = (json) => {
|
|
11
|
+
const latest = json[0];
|
|
12
|
+
const version = latest.version.join('.');
|
|
13
|
+
const data = JSON.parse(JSON.stringify(latest).replace(/{version}/g, version));
|
|
14
|
+
const { directory } = data;
|
|
15
|
+
const packages = data.packages.map(p => ({
|
|
16
|
+
name: p.name,
|
|
17
|
+
platform: p.platform,
|
|
18
|
+
url: `${directory}${p.url}`,
|
|
19
|
+
signature: p.signature ? `${directory}${p.signature}` : undefined,
|
|
20
|
+
}));
|
|
21
|
+
info.version = data.version;
|
|
22
|
+
info.directory = directory;
|
|
23
|
+
info.packages = packages;
|
|
24
|
+
return info;
|
|
25
|
+
};
|
|
26
|
+
exports.parseBridgeJSON = parseBridgeJSON;
|
|
27
|
+
const getBridgeInfo = () => info;
|
|
28
|
+
exports.getBridgeInfo = getBridgeInfo;
|
|
29
|
+
//# sourceMappingURL=transportInfo.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUdevInfo = void 0;
|
|
4
|
+
const info = {
|
|
5
|
+
directory: '',
|
|
6
|
+
packages: [
|
|
7
|
+
{
|
|
8
|
+
name: 'RPM package',
|
|
9
|
+
platform: ['rpm32', 'rpm64'],
|
|
10
|
+
url: '/udev/trezor-udev-2-1.noarch.rpm',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'DEB package',
|
|
14
|
+
platform: ['deb32', 'deb64'],
|
|
15
|
+
url: '/udev/trezor-udev_2_all.deb',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
const getUdevInfo = () => info;
|
|
20
|
+
exports.getUdevInfo = getUdevInfo;
|
|
21
|
+
//# sourceMappingURL=udevInfo.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
|
|
4
|
+
exports.VERSION = '9.0.0-beta.1';
|
|
5
|
+
const versionN = exports.VERSION.split('.').map(s => parseInt(s, 10));
|
|
6
|
+
exports.DEFAULT_DOMAIN = `https://connect.trezor.io/${versionN[0]}/`;
|
|
7
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import EventEmitter from 'events';
|
|
3
|
+
declare class AbortSignal {
|
|
4
|
+
eventEmitter: EventEmitter;
|
|
5
|
+
aborted: boolean;
|
|
6
|
+
constructor();
|
|
7
|
+
toString(): string;
|
|
8
|
+
removeEventListener(name: string, handler: any): void;
|
|
9
|
+
addEventListener(name: string, handler: any): void;
|
|
10
|
+
dispatchEvent(type: string): void;
|
|
11
|
+
}
|
|
12
|
+
declare class AbortControllerFallback {
|
|
13
|
+
signal: AbortSignal;
|
|
14
|
+
constructor();
|
|
15
|
+
abort(): void;
|
|
16
|
+
toString(): string;
|
|
17
|
+
}
|
|
18
|
+
export declare type Controller = AbortController | AbortControllerFallback;
|
|
19
|
+
export declare const getAbortController: () => AbortControllerFallback | AbortController;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=AbortController.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAbortController = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const events_1 = (0, tslib_1.__importDefault)(require("events"));
|
|
6
|
+
class AbortSignal {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.aborted = false;
|
|
9
|
+
this.eventEmitter = new events_1.default();
|
|
10
|
+
}
|
|
11
|
+
toString() {
|
|
12
|
+
return '[object AbortSignal]';
|
|
13
|
+
}
|
|
14
|
+
removeEventListener(name, handler) {
|
|
15
|
+
this.eventEmitter.removeListener(name, handler);
|
|
16
|
+
}
|
|
17
|
+
addEventListener(name, handler) {
|
|
18
|
+
this.eventEmitter.on(name, handler);
|
|
19
|
+
}
|
|
20
|
+
dispatchEvent(type) {
|
|
21
|
+
this.eventEmitter.emit(type, { type, target: this });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
class AbortControllerFallback {
|
|
25
|
+
constructor() {
|
|
26
|
+
this.signal = new AbortSignal();
|
|
27
|
+
}
|
|
28
|
+
abort() {
|
|
29
|
+
if (this.signal.aborted)
|
|
30
|
+
return;
|
|
31
|
+
this.signal.dispatchEvent('abort');
|
|
32
|
+
this.signal.aborted = true;
|
|
33
|
+
}
|
|
34
|
+
toString() {
|
|
35
|
+
return '[object AbortController]';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const getAbortController = () => typeof AbortController !== 'undefined' ? new AbortController() : new AbortControllerFallback();
|
|
39
|
+
exports.getAbortController = getAbortController;
|
|
40
|
+
//# sourceMappingURL=AbortController.js.map
|