@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,671 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initTransport = exports.init = exports.initCore = exports.Core = exports.onCall = exports.handleMessage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const events_1 = (0, tslib_1.__importDefault)(require("events"));
|
|
6
|
+
const DataManager_1 = require("../data/DataManager");
|
|
7
|
+
const DeviceList_1 = require("../device/DeviceList");
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
const events_2 = require("../events");
|
|
10
|
+
const method_1 = require("./method");
|
|
11
|
+
const deferred_1 = require("../utils/deferred");
|
|
12
|
+
const promiseUtils_1 = require("../utils/promiseUtils");
|
|
13
|
+
const debug_1 = require("../utils/debug");
|
|
14
|
+
const BlockchainLink_1 = require("../backend/BlockchainLink");
|
|
15
|
+
const interactionTimeout_1 = require("../utils/interactionTimeout");
|
|
16
|
+
let _core;
|
|
17
|
+
let _deviceList;
|
|
18
|
+
let _popupPromise;
|
|
19
|
+
let _uiPromises = [];
|
|
20
|
+
const _callMethods = [];
|
|
21
|
+
let _preferredDevice;
|
|
22
|
+
let _interactionTimeout;
|
|
23
|
+
const _log = (0, debug_1.initLog)('Core');
|
|
24
|
+
const postMessage = (message) => {
|
|
25
|
+
if (message.event === events_2.RESPONSE_EVENT) {
|
|
26
|
+
const index = _callMethods.findIndex(call => call && call.responseID === message.id);
|
|
27
|
+
if (index >= 0) {
|
|
28
|
+
_callMethods.splice(index, 1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
_core.emit(events_2.CORE_EVENT, message);
|
|
32
|
+
};
|
|
33
|
+
const getPopupPromise = (requestWindow = true) => {
|
|
34
|
+
if (requestWindow) {
|
|
35
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.REQUEST_UI_WINDOW));
|
|
36
|
+
}
|
|
37
|
+
if (!_popupPromise) {
|
|
38
|
+
_popupPromise = (0, deferred_1.create)();
|
|
39
|
+
}
|
|
40
|
+
return _popupPromise;
|
|
41
|
+
};
|
|
42
|
+
const interactionTimeout = () => _interactionTimeout.start(() => {
|
|
43
|
+
onPopupClosed('Interaction timeout');
|
|
44
|
+
});
|
|
45
|
+
const createUiPromise = (promiseEvent, device) => {
|
|
46
|
+
const uiPromise = (0, deferred_1.create)(promiseEvent, device);
|
|
47
|
+
_uiPromises.push(uiPromise);
|
|
48
|
+
interactionTimeout();
|
|
49
|
+
return uiPromise;
|
|
50
|
+
};
|
|
51
|
+
const findUiPromise = (promiseEvent) => _uiPromises.find(p => p.id === promiseEvent);
|
|
52
|
+
const removeUiPromise = (promise) => {
|
|
53
|
+
_uiPromises = _uiPromises.filter(p => p !== promise);
|
|
54
|
+
};
|
|
55
|
+
const handleMessage = (message, isTrustedOrigin = false) => {
|
|
56
|
+
_log.debug('handleMessage', isTrustedOrigin, message);
|
|
57
|
+
const safeMessages = [
|
|
58
|
+
events_2.IFRAME.CALL,
|
|
59
|
+
events_2.POPUP.CLOSED,
|
|
60
|
+
events_2.UI.CUSTOM_MESSAGE_RESPONSE,
|
|
61
|
+
events_2.UI.LOGIN_CHALLENGE_RESPONSE,
|
|
62
|
+
events_2.TRANSPORT.DISABLE_WEBUSB,
|
|
63
|
+
];
|
|
64
|
+
if (!isTrustedOrigin && safeMessages.indexOf(message.type) === -1) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
switch (message.type) {
|
|
68
|
+
case events_2.POPUP.HANDSHAKE:
|
|
69
|
+
getPopupPromise(false).resolve();
|
|
70
|
+
break;
|
|
71
|
+
case events_2.POPUP.CLOSED:
|
|
72
|
+
onPopupClosed(message.payload ? message.payload.error : null);
|
|
73
|
+
break;
|
|
74
|
+
case events_2.TRANSPORT.DISABLE_WEBUSB:
|
|
75
|
+
disableWebUSBTransport();
|
|
76
|
+
break;
|
|
77
|
+
case events_2.UI.RECEIVE_DEVICE:
|
|
78
|
+
case events_2.UI.RECEIVE_CONFIRMATION:
|
|
79
|
+
case events_2.UI.RECEIVE_PERMISSION:
|
|
80
|
+
case events_2.UI.RECEIVE_PIN:
|
|
81
|
+
case events_2.UI.RECEIVE_PASSPHRASE:
|
|
82
|
+
case events_2.UI.INVALID_PASSPHRASE_ACTION:
|
|
83
|
+
case events_2.UI.RECEIVE_ACCOUNT:
|
|
84
|
+
case events_2.UI.RECEIVE_FEE:
|
|
85
|
+
case events_2.UI.CUSTOM_MESSAGE_RESPONSE:
|
|
86
|
+
case events_2.UI.RECEIVE_WORD:
|
|
87
|
+
case events_2.UI.LOGIN_CHALLENGE_RESPONSE: {
|
|
88
|
+
const uiPromise = findUiPromise(message.type);
|
|
89
|
+
if (uiPromise) {
|
|
90
|
+
uiPromise.resolve(message);
|
|
91
|
+
removeUiPromise(uiPromise);
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case events_2.IFRAME.CALL:
|
|
96
|
+
(0, exports.onCall)(message).catch(error => {
|
|
97
|
+
_log.error('onCall', error);
|
|
98
|
+
});
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
exports.handleMessage = handleMessage;
|
|
103
|
+
const initDevice = async (method) => {
|
|
104
|
+
if (!_deviceList) {
|
|
105
|
+
throw constants_1.ERRORS.TypedError('Transport_Missing');
|
|
106
|
+
}
|
|
107
|
+
const isWebUsb = _deviceList.transportType() === 'WebUsbPlugin';
|
|
108
|
+
let device;
|
|
109
|
+
let showDeviceSelection = isWebUsb;
|
|
110
|
+
if (method.devicePath) {
|
|
111
|
+
device = _deviceList.getDevice(method.devicePath);
|
|
112
|
+
showDeviceSelection = !!(device === null || device === void 0 ? void 0 : device.unreadableError);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
const devices = _deviceList.asArray();
|
|
116
|
+
if (devices.length === 1 && !isWebUsb) {
|
|
117
|
+
device = _deviceList.getDevice(devices[0].path);
|
|
118
|
+
showDeviceSelection = !!(device === null || device === void 0 ? void 0 : device.unreadableError);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
showDeviceSelection = true;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (showDeviceSelection) {
|
|
125
|
+
createUiPromise(events_2.UI.RECEIVE_DEVICE);
|
|
126
|
+
await getPopupPromise().promise;
|
|
127
|
+
const devices = _deviceList.asArray();
|
|
128
|
+
if (devices.length === 1 && devices[0].type !== 'unreadable' && !isWebUsb) {
|
|
129
|
+
device = _deviceList.getDevice(devices[0].path);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.SELECT_DEVICE, {
|
|
133
|
+
webusb: isWebUsb,
|
|
134
|
+
devices: _deviceList.asArray(),
|
|
135
|
+
}));
|
|
136
|
+
const uiPromise = findUiPromise(events_2.UI.RECEIVE_DEVICE);
|
|
137
|
+
if (uiPromise) {
|
|
138
|
+
const { payload } = await uiPromise.promise;
|
|
139
|
+
if (payload.remember) {
|
|
140
|
+
_preferredDevice = payload.device;
|
|
141
|
+
}
|
|
142
|
+
device = _deviceList.getDevice(payload.device.path);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (!device) {
|
|
147
|
+
throw constants_1.ERRORS.TypedError('Device_NotFound');
|
|
148
|
+
}
|
|
149
|
+
return device;
|
|
150
|
+
};
|
|
151
|
+
const onCall = async (message) => {
|
|
152
|
+
var _a;
|
|
153
|
+
if (!message.id || !message.payload || message.type !== events_2.IFRAME.CALL) {
|
|
154
|
+
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'onCall: message.id or message.payload is missing');
|
|
155
|
+
}
|
|
156
|
+
const responseID = message.id;
|
|
157
|
+
const trustedHost = DataManager_1.DataManager.getSettings('trustedHost');
|
|
158
|
+
const isUsingPopup = DataManager_1.DataManager.getSettings('popup');
|
|
159
|
+
if (_preferredDevice && !message.payload.device) {
|
|
160
|
+
message.payload.device = _preferredDevice;
|
|
161
|
+
}
|
|
162
|
+
let method;
|
|
163
|
+
let messageResponse;
|
|
164
|
+
try {
|
|
165
|
+
method = (0, method_1.getMethod)(message);
|
|
166
|
+
method.postMessage = postMessage;
|
|
167
|
+
method.getPopupPromise = getPopupPromise;
|
|
168
|
+
method.createUiPromise = createUiPromise;
|
|
169
|
+
method.init();
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
postMessage((0, events_2.createPopupMessage)(events_2.POPUP.CANCEL_POPUP_REQUEST));
|
|
173
|
+
postMessage((0, events_2.createResponseMessage)(responseID, false, { error }));
|
|
174
|
+
return Promise.resolve();
|
|
175
|
+
}
|
|
176
|
+
_callMethods.push(method);
|
|
177
|
+
if (!method.useDevice) {
|
|
178
|
+
try {
|
|
179
|
+
if (method.useUi) {
|
|
180
|
+
await getPopupPromise().promise;
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
postMessage((0, events_2.createPopupMessage)(events_2.POPUP.CANCEL_POPUP_REQUEST));
|
|
184
|
+
}
|
|
185
|
+
const response = await method.run();
|
|
186
|
+
messageResponse = (0, events_2.createResponseMessage)(method.responseID, true, response);
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
messageResponse = (0, events_2.createResponseMessage)(method.responseID, false, { error });
|
|
190
|
+
}
|
|
191
|
+
postMessage(messageResponse);
|
|
192
|
+
return Promise.resolve();
|
|
193
|
+
}
|
|
194
|
+
if (!_deviceList && !DataManager_1.DataManager.getSettings('transportReconnect')) {
|
|
195
|
+
await (0, exports.initTransport)(DataManager_1.DataManager.getSettings());
|
|
196
|
+
}
|
|
197
|
+
if (isUsingPopup &&
|
|
198
|
+
method.requiredPermissions.includes('management') &&
|
|
199
|
+
!DataManager_1.DataManager.isManagementAllowed()) {
|
|
200
|
+
postMessage((0, events_2.createPopupMessage)(events_2.POPUP.CANCEL_POPUP_REQUEST));
|
|
201
|
+
postMessage((0, events_2.createResponseMessage)(responseID, false, {
|
|
202
|
+
error: constants_1.ERRORS.TypedError('Method_NotAllowed'),
|
|
203
|
+
}));
|
|
204
|
+
return Promise.resolve();
|
|
205
|
+
}
|
|
206
|
+
let device;
|
|
207
|
+
try {
|
|
208
|
+
device = await initDevice(method);
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
if (error.code === 'Transport_Missing') {
|
|
212
|
+
await getPopupPromise().promise;
|
|
213
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.TRANSPORT));
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
postMessage((0, events_2.createPopupMessage)(events_2.POPUP.CANCEL_POPUP_REQUEST));
|
|
217
|
+
}
|
|
218
|
+
postMessage((0, events_2.createResponseMessage)(responseID, false, { error }));
|
|
219
|
+
throw error;
|
|
220
|
+
}
|
|
221
|
+
method.setDevice(device);
|
|
222
|
+
const previousCall = _callMethods.filter(call => call && call !== method && call.devicePath === method.devicePath);
|
|
223
|
+
if (previousCall.length > 0 && method.overridePreviousCall) {
|
|
224
|
+
previousCall.forEach(call => {
|
|
225
|
+
call.overridden = true;
|
|
226
|
+
});
|
|
227
|
+
const overrideError = constants_1.ERRORS.TypedError('Method_Override');
|
|
228
|
+
await device.override(overrideError);
|
|
229
|
+
if (method.overridden) {
|
|
230
|
+
postMessage((0, events_2.createResponseMessage)(method.responseID, false, { error: overrideError }));
|
|
231
|
+
throw overrideError;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
else if (device.isRunning()) {
|
|
235
|
+
if (!device.isLoaded()) {
|
|
236
|
+
await device.waitForFirstRun();
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
postMessage((0, events_2.createResponseMessage)(responseID, false, {
|
|
240
|
+
error: constants_1.ERRORS.TypedError('Device_CallInProgress'),
|
|
241
|
+
}));
|
|
242
|
+
throw constants_1.ERRORS.TypedError('Device_CallInProgress');
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
device.setInstance((_a = message.payload.device) === null || _a === void 0 ? void 0 : _a.instance);
|
|
246
|
+
if (method.hasExpectedDeviceState) {
|
|
247
|
+
device.setExternalState(method.deviceState);
|
|
248
|
+
}
|
|
249
|
+
device.on(events_2.DEVICE.BUTTON, (d, code) => {
|
|
250
|
+
onDeviceButtonHandler(d, code, method);
|
|
251
|
+
});
|
|
252
|
+
device.on(events_2.DEVICE.PIN, onDevicePinHandler);
|
|
253
|
+
device.on(events_2.DEVICE.WORD, onDeviceWordHandler);
|
|
254
|
+
device.on(events_2.DEVICE.PASSPHRASE, method.useEmptyPassphrase ? onEmptyPassphraseHandler : onDevicePassphraseHandler);
|
|
255
|
+
device.on(events_2.DEVICE.PASSPHRASE_ON_DEVICE, () => {
|
|
256
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.REQUEST_PASSPHRASE_ON_DEVICE, { device: device.toMessageObject() }));
|
|
257
|
+
});
|
|
258
|
+
if (_deviceList) {
|
|
259
|
+
await _deviceList.reconfigure(device.getVersion());
|
|
260
|
+
}
|
|
261
|
+
try {
|
|
262
|
+
let PIN_TRIES = 1;
|
|
263
|
+
const MAX_PIN_TRIES = 3;
|
|
264
|
+
const inner = async () => {
|
|
265
|
+
const firmwareException = await method.checkFirmwareRange(isUsingPopup);
|
|
266
|
+
if (firmwareException) {
|
|
267
|
+
if (isUsingPopup) {
|
|
268
|
+
await getPopupPromise().promise;
|
|
269
|
+
postMessage((0, events_2.createUiMessage)(firmwareException, device.toMessageObject()));
|
|
270
|
+
await createUiPromise(events_2.DEVICE.DISCONNECT, device).promise;
|
|
271
|
+
return Promise.reject(constants_1.ERRORS.TypedError('Method_Cancel'));
|
|
272
|
+
}
|
|
273
|
+
return Promise.reject(constants_1.ERRORS.TypedError('Device_FwException', firmwareException));
|
|
274
|
+
}
|
|
275
|
+
const unexpectedMode = device.hasUnexpectedMode(method.allowDeviceMode, method.requireDeviceMode);
|
|
276
|
+
if (unexpectedMode) {
|
|
277
|
+
device.keepSession = false;
|
|
278
|
+
if (isUsingPopup) {
|
|
279
|
+
await getPopupPromise().promise;
|
|
280
|
+
postMessage((0, events_2.createUiMessage)(unexpectedMode, device.toMessageObject()));
|
|
281
|
+
await createUiPromise(events_2.DEVICE.DISCONNECT, device).promise;
|
|
282
|
+
return Promise.reject(constants_1.ERRORS.TypedError('Device_ModeException', unexpectedMode));
|
|
283
|
+
}
|
|
284
|
+
return Promise.reject(constants_1.ERRORS.TypedError('Device_ModeException', unexpectedMode));
|
|
285
|
+
}
|
|
286
|
+
method.checkPermissions();
|
|
287
|
+
if (!trustedHost && method.requiredPermissions.length > 0) {
|
|
288
|
+
const permitted = await method.requestPermissions();
|
|
289
|
+
if (!permitted) {
|
|
290
|
+
return Promise.reject(constants_1.ERRORS.TypedError('Method_PermissionsNotGranted'));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
const deviceNeedsBackup = device.features.needs_backup;
|
|
294
|
+
if (deviceNeedsBackup && typeof method.noBackupConfirmation === 'function') {
|
|
295
|
+
const permitted = await method.noBackupConfirmation();
|
|
296
|
+
if (!permitted) {
|
|
297
|
+
return Promise.reject(constants_1.ERRORS.TypedError('Method_PermissionsNotGranted'));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (deviceNeedsBackup) {
|
|
301
|
+
await getPopupPromise().promise;
|
|
302
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.DEVICE_NEEDS_BACKUP, device.toMessageObject()));
|
|
303
|
+
}
|
|
304
|
+
if (device.firmwareStatus === 'outdated') {
|
|
305
|
+
await getPopupPromise().promise;
|
|
306
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.FIRMWARE_OUTDATED, device.toMessageObject()));
|
|
307
|
+
}
|
|
308
|
+
if (!trustedHost && typeof method.confirmation === 'function') {
|
|
309
|
+
const confirmed = await method.confirmation();
|
|
310
|
+
if (!confirmed) {
|
|
311
|
+
return Promise.reject(constants_1.ERRORS.TypedError('Method_Cancel'));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (_deviceList) {
|
|
315
|
+
await _deviceList.reconfigure(device.getVersion());
|
|
316
|
+
}
|
|
317
|
+
try {
|
|
318
|
+
const invalidDeviceState = method.useDeviceState
|
|
319
|
+
? await device.validateState(method.network)
|
|
320
|
+
: undefined;
|
|
321
|
+
if (invalidDeviceState) {
|
|
322
|
+
if (isUsingPopup) {
|
|
323
|
+
const uiPromise = createUiPromise(events_2.UI.INVALID_PASSPHRASE_ACTION, device);
|
|
324
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.INVALID_PASSPHRASE, {
|
|
325
|
+
device: device.toMessageObject(),
|
|
326
|
+
}));
|
|
327
|
+
const uiResp = await uiPromise.promise;
|
|
328
|
+
if (uiResp.payload) {
|
|
329
|
+
device.setInternalState(undefined);
|
|
330
|
+
await device.initialize(method.useEmptyPassphrase, method.useCardanoDerivation);
|
|
331
|
+
return inner();
|
|
332
|
+
}
|
|
333
|
+
device.setExternalState(invalidDeviceState);
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
throw constants_1.ERRORS.TypedError('Device_InvalidState');
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
catch (error) {
|
|
341
|
+
if (error.message === constants_1.ERRORS.INVALID_PIN_ERROR_MESSAGE &&
|
|
342
|
+
PIN_TRIES < MAX_PIN_TRIES) {
|
|
343
|
+
PIN_TRIES++;
|
|
344
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.INVALID_PIN, { device: device.toMessageObject() }));
|
|
345
|
+
return inner();
|
|
346
|
+
}
|
|
347
|
+
device.setInternalState(undefined);
|
|
348
|
+
return Promise.reject(error);
|
|
349
|
+
}
|
|
350
|
+
if (method.useUi) {
|
|
351
|
+
await getPopupPromise().promise;
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
postMessage((0, events_2.createPopupMessage)(events_2.POPUP.CANCEL_POPUP_REQUEST));
|
|
355
|
+
}
|
|
356
|
+
try {
|
|
357
|
+
const customMessages = method.getCustomMessages();
|
|
358
|
+
if (_deviceList && customMessages) {
|
|
359
|
+
await _deviceList.reconfigure(customMessages, true);
|
|
360
|
+
}
|
|
361
|
+
const response = await method.run();
|
|
362
|
+
messageResponse = (0, events_2.createResponseMessage)(method.responseID, true, response);
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
return Promise.reject(error);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
await device.run(inner, {
|
|
369
|
+
keepSession: method.keepSession,
|
|
370
|
+
useEmptyPassphrase: method.useEmptyPassphrase,
|
|
371
|
+
skipFinalReload: method.skipFinalReload,
|
|
372
|
+
useCardanoDerivation: method.useCardanoDerivation,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
catch (error) {
|
|
376
|
+
if (_deviceList && error.code === 'Device_Disconnected') {
|
|
377
|
+
_deviceList.addAuthPenalty(device);
|
|
378
|
+
}
|
|
379
|
+
if (method) {
|
|
380
|
+
if (_deviceList && error.message === constants_1.ERRORS.WRONG_PREVIOUS_SESSION_ERROR_MESSAGE) {
|
|
381
|
+
_deviceList.enumerate();
|
|
382
|
+
}
|
|
383
|
+
messageResponse = (0, events_2.createResponseMessage)(method.responseID, false, { error });
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
finally {
|
|
387
|
+
const response = messageResponse;
|
|
388
|
+
if (response) {
|
|
389
|
+
if (method.name === 'rebootToBootloader' && response.success) {
|
|
390
|
+
await (0, promiseUtils_1.resolveAfter)(1000);
|
|
391
|
+
await device.run(() => Promise.resolve(), { skipFinalReload: true });
|
|
392
|
+
}
|
|
393
|
+
await device.cleanup();
|
|
394
|
+
closePopup();
|
|
395
|
+
cleanup();
|
|
396
|
+
if (method) {
|
|
397
|
+
method.dispose();
|
|
398
|
+
}
|
|
399
|
+
if (_deviceList) {
|
|
400
|
+
if (response.success) {
|
|
401
|
+
_deviceList.removeAuthPenalty(device);
|
|
402
|
+
}
|
|
403
|
+
await _deviceList.restoreMessages();
|
|
404
|
+
}
|
|
405
|
+
postMessage(response);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
exports.onCall = onCall;
|
|
410
|
+
const cleanup = () => {
|
|
411
|
+
_popupPromise = undefined;
|
|
412
|
+
_uiPromises = [];
|
|
413
|
+
_interactionTimeout.stop();
|
|
414
|
+
_log.debug('Cleanup...');
|
|
415
|
+
};
|
|
416
|
+
const closePopup = () => {
|
|
417
|
+
if (_popupPromise) {
|
|
418
|
+
postMessage((0, events_2.createPopupMessage)(events_2.POPUP.CANCEL_POPUP_REQUEST));
|
|
419
|
+
}
|
|
420
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.CLOSE_UI_WINDOW));
|
|
421
|
+
};
|
|
422
|
+
const onDeviceButtonHandler = async (...[device, request, method]) => {
|
|
423
|
+
const addressRequest = request.code === 'ButtonRequest_Address';
|
|
424
|
+
if (!addressRequest || (addressRequest && method.useUi)) {
|
|
425
|
+
await getPopupPromise().promise;
|
|
426
|
+
}
|
|
427
|
+
const data = typeof method.getButtonRequestData === 'function' && request.code
|
|
428
|
+
? method.getButtonRequestData(request.code)
|
|
429
|
+
: undefined;
|
|
430
|
+
interactionTimeout();
|
|
431
|
+
postMessage((0, events_2.createDeviceMessage)(events_2.DEVICE.BUTTON, { ...request, device: device.toMessageObject() }));
|
|
432
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.REQUEST_BUTTON, {
|
|
433
|
+
...request,
|
|
434
|
+
device: device.toMessageObject(),
|
|
435
|
+
data,
|
|
436
|
+
}));
|
|
437
|
+
if (addressRequest && !method.useUi) {
|
|
438
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.ADDRESS_VALIDATION, data));
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
const onDevicePinHandler = async (...[device, type, callback]) => {
|
|
442
|
+
await getPopupPromise().promise;
|
|
443
|
+
const uiPromise = createUiPromise(events_2.UI.RECEIVE_PIN, device);
|
|
444
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.REQUEST_PIN, { device: device.toMessageObject(), type }));
|
|
445
|
+
const uiResp = await uiPromise.promise;
|
|
446
|
+
callback(null, uiResp.payload);
|
|
447
|
+
};
|
|
448
|
+
const onDeviceWordHandler = async (...[device, type, callback]) => {
|
|
449
|
+
await getPopupPromise().promise;
|
|
450
|
+
const uiPromise = createUiPromise(events_2.UI.RECEIVE_WORD, device);
|
|
451
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.REQUEST_WORD, { device: device.toMessageObject(), type }));
|
|
452
|
+
const uiResp = await uiPromise.promise;
|
|
453
|
+
callback(null, uiResp.payload);
|
|
454
|
+
};
|
|
455
|
+
const onDevicePassphraseHandler = async (...[device, callback]) => {
|
|
456
|
+
await getPopupPromise().promise;
|
|
457
|
+
const uiPromise = createUiPromise(events_2.UI.RECEIVE_PASSPHRASE, device);
|
|
458
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.REQUEST_PASSPHRASE, { device: device.toMessageObject() }));
|
|
459
|
+
const uiResp = await uiPromise.promise;
|
|
460
|
+
const { value, passphraseOnDevice, save } = uiResp.payload;
|
|
461
|
+
callback({
|
|
462
|
+
passphrase: value.normalize('NFKD'),
|
|
463
|
+
passphraseOnDevice,
|
|
464
|
+
cache: save,
|
|
465
|
+
});
|
|
466
|
+
};
|
|
467
|
+
const onEmptyPassphraseHandler = (...[_, callback]) => {
|
|
468
|
+
callback({ passphrase: '' });
|
|
469
|
+
};
|
|
470
|
+
const onPopupClosed = (customErrorMessage) => {
|
|
471
|
+
const error = customErrorMessage
|
|
472
|
+
? constants_1.ERRORS.TypedError('Method_Cancel', customErrorMessage)
|
|
473
|
+
: constants_1.ERRORS.TypedError('Method_Interrupted');
|
|
474
|
+
if (_deviceList && _deviceList.asArray().length > 0) {
|
|
475
|
+
_deviceList.allDevices().forEach(d => {
|
|
476
|
+
d.keepSession = false;
|
|
477
|
+
if (d.isUsedHere()) {
|
|
478
|
+
d.interruptionFromUser(error);
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
const uiPromise = findUiPromise(events_2.DEVICE.DISCONNECT);
|
|
482
|
+
if (uiPromise) {
|
|
483
|
+
uiPromise.resolve({ type: events_2.DEVICE.DISCONNECT, payload: undefined });
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
_callMethods.forEach(m => {
|
|
487
|
+
postMessage((0, events_2.createResponseMessage)(m.responseID, false, { error }));
|
|
488
|
+
});
|
|
489
|
+
_callMethods.splice(0, _callMethods.length);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
cleanup();
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
if (_uiPromises.length > 0) {
|
|
497
|
+
_uiPromises.forEach(p => {
|
|
498
|
+
p.reject(error);
|
|
499
|
+
});
|
|
500
|
+
_uiPromises = [];
|
|
501
|
+
}
|
|
502
|
+
if (_popupPromise) {
|
|
503
|
+
_popupPromise.reject(error);
|
|
504
|
+
_popupPromise = undefined;
|
|
505
|
+
}
|
|
506
|
+
cleanup();
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
const handleDeviceSelectionChanges = (interruptDevice) => {
|
|
510
|
+
const uiPromise = findUiPromise(events_2.UI.RECEIVE_DEVICE);
|
|
511
|
+
if (uiPromise && _deviceList) {
|
|
512
|
+
const list = _deviceList.asArray();
|
|
513
|
+
const isWebUsb = _deviceList.transportType().indexOf('webusb') >= 0;
|
|
514
|
+
if (list.length === 1 && !isWebUsb) {
|
|
515
|
+
uiPromise.resolve({
|
|
516
|
+
type: events_2.UI.RECEIVE_DEVICE,
|
|
517
|
+
payload: { device: list[0] },
|
|
518
|
+
});
|
|
519
|
+
removeUiPromise(uiPromise);
|
|
520
|
+
}
|
|
521
|
+
else {
|
|
522
|
+
postMessage((0, events_2.createUiMessage)(events_2.UI.SELECT_DEVICE, {
|
|
523
|
+
webusb: isWebUsb,
|
|
524
|
+
devices: list,
|
|
525
|
+
}));
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
if (interruptDevice) {
|
|
529
|
+
const { path } = interruptDevice;
|
|
530
|
+
let shouldClosePopup = false;
|
|
531
|
+
_uiPromises.forEach(p => {
|
|
532
|
+
if (p.data && p.data.getDevicePath() === path) {
|
|
533
|
+
if (p.id === events_2.DEVICE.DISCONNECT) {
|
|
534
|
+
p.resolve({ type: events_2.DEVICE.DISCONNECT });
|
|
535
|
+
}
|
|
536
|
+
shouldClosePopup = true;
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
if (_preferredDevice && _preferredDevice.path === path) {
|
|
540
|
+
_preferredDevice = undefined;
|
|
541
|
+
}
|
|
542
|
+
if (shouldClosePopup) {
|
|
543
|
+
closePopup();
|
|
544
|
+
cleanup();
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
const initDeviceList = async (settings) => {
|
|
549
|
+
try {
|
|
550
|
+
_deviceList = new DeviceList_1.DeviceList();
|
|
551
|
+
_deviceList.on(events_2.DEVICE.CONNECT, device => {
|
|
552
|
+
handleDeviceSelectionChanges();
|
|
553
|
+
postMessage((0, events_2.createDeviceMessage)(events_2.DEVICE.CONNECT, device));
|
|
554
|
+
});
|
|
555
|
+
_deviceList.on(events_2.DEVICE.CONNECT_UNACQUIRED, device => {
|
|
556
|
+
handleDeviceSelectionChanges();
|
|
557
|
+
postMessage((0, events_2.createDeviceMessage)(events_2.DEVICE.CONNECT_UNACQUIRED, device));
|
|
558
|
+
});
|
|
559
|
+
_deviceList.on(events_2.DEVICE.DISCONNECT, device => {
|
|
560
|
+
handleDeviceSelectionChanges(device);
|
|
561
|
+
postMessage((0, events_2.createDeviceMessage)(events_2.DEVICE.DISCONNECT, device));
|
|
562
|
+
});
|
|
563
|
+
_deviceList.on(events_2.DEVICE.CHANGED, device => {
|
|
564
|
+
postMessage((0, events_2.createDeviceMessage)(events_2.DEVICE.CHANGED, device));
|
|
565
|
+
});
|
|
566
|
+
_deviceList.on(events_2.TRANSPORT.ERROR, async (error) => {
|
|
567
|
+
_log.warn('TRANSPORT.ERROR', error);
|
|
568
|
+
if (_deviceList) {
|
|
569
|
+
_deviceList.disconnectDevices();
|
|
570
|
+
_deviceList.dispose();
|
|
571
|
+
}
|
|
572
|
+
_deviceList = undefined;
|
|
573
|
+
postMessage((0, events_2.createTransportMessage)(events_2.TRANSPORT.ERROR, { error }));
|
|
574
|
+
if (settings.transportReconnect) {
|
|
575
|
+
await (0, promiseUtils_1.resolveAfter)(1000, null);
|
|
576
|
+
await initDeviceList(settings);
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
_deviceList.on(events_2.TRANSPORT.START, transportType => postMessage((0, events_2.createTransportMessage)(events_2.TRANSPORT.START, transportType)));
|
|
580
|
+
await _deviceList.init();
|
|
581
|
+
if (_deviceList) {
|
|
582
|
+
await _deviceList.waitForTransportFirstEvent();
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
catch (error) {
|
|
586
|
+
_deviceList = undefined;
|
|
587
|
+
postMessage((0, events_2.createTransportMessage)(events_2.TRANSPORT.ERROR, { error }));
|
|
588
|
+
if (!settings.transportReconnect) {
|
|
589
|
+
throw error;
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
await (0, promiseUtils_1.resolveAfter)(3000, null);
|
|
593
|
+
await initDeviceList(settings);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
class Core extends events_1.default {
|
|
598
|
+
handleMessage(message, isTrustedOrigin) {
|
|
599
|
+
(0, exports.handleMessage)(message, isTrustedOrigin);
|
|
600
|
+
}
|
|
601
|
+
dispose() {
|
|
602
|
+
if (_deviceList) {
|
|
603
|
+
_deviceList.dispose();
|
|
604
|
+
}
|
|
605
|
+
(0, BlockchainLink_1.dispose)();
|
|
606
|
+
this.removeAllListeners();
|
|
607
|
+
}
|
|
608
|
+
getCurrentMethod() {
|
|
609
|
+
return _callMethods;
|
|
610
|
+
}
|
|
611
|
+
getTransportInfo() {
|
|
612
|
+
if (_deviceList) {
|
|
613
|
+
return _deviceList.getTransportInfo();
|
|
614
|
+
}
|
|
615
|
+
return {
|
|
616
|
+
type: '',
|
|
617
|
+
version: '',
|
|
618
|
+
outdated: true,
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
exports.Core = Core;
|
|
623
|
+
const initCore = () => {
|
|
624
|
+
_core = new Core();
|
|
625
|
+
return _core;
|
|
626
|
+
};
|
|
627
|
+
exports.initCore = initCore;
|
|
628
|
+
const init = async (settings) => {
|
|
629
|
+
try {
|
|
630
|
+
await DataManager_1.DataManager.load(settings);
|
|
631
|
+
(0, debug_1.enableLog)(DataManager_1.DataManager.getSettings('debug'));
|
|
632
|
+
(0, exports.initCore)();
|
|
633
|
+
_interactionTimeout = new interactionTimeout_1.InteractionTimeout(settings.popup ? settings.interactionTimeout : 0);
|
|
634
|
+
return _core;
|
|
635
|
+
}
|
|
636
|
+
catch (error) {
|
|
637
|
+
_log.error('init', error);
|
|
638
|
+
throw error;
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
exports.init = init;
|
|
642
|
+
const initTransport = async (settings) => {
|
|
643
|
+
try {
|
|
644
|
+
if (!settings.transportReconnect) {
|
|
645
|
+
await initDeviceList(settings);
|
|
646
|
+
}
|
|
647
|
+
else {
|
|
648
|
+
initDeviceList(settings);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
catch (error) {
|
|
652
|
+
_log.error('initTransport', error);
|
|
653
|
+
throw error;
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
exports.initTransport = initTransport;
|
|
657
|
+
const disableWebUSBTransport = async () => {
|
|
658
|
+
if (!_deviceList)
|
|
659
|
+
return;
|
|
660
|
+
if (_deviceList.transportType() !== 'WebUsbPlugin')
|
|
661
|
+
return;
|
|
662
|
+
const settings = DataManager_1.DataManager.getSettings();
|
|
663
|
+
settings.webusb = false;
|
|
664
|
+
try {
|
|
665
|
+
_deviceList.dispose();
|
|
666
|
+
await initDeviceList(settings);
|
|
667
|
+
}
|
|
668
|
+
catch (error) {
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as Methods from '../api';
|
|
2
|
+
import type { IFrameCallMessage } from '../events';
|
|
3
|
+
export declare const getMethod: (message: IFrameCallMessage & {
|
|
4
|
+
id?: number;
|
|
5
|
+
}) => Methods.applyFlags | Methods.applySettings | Methods.authorizeCoinJoin | Methods.backupDevice | Methods.binanceGetAddress | Methods.binanceGetPublicKey | Methods.binanceSignTransaction | Methods.blockchainDisconnect | Methods.blockchainEstimateFee | Methods.blockchainGetAccountBalanceHistory | Methods.blockchainGetCurrentFiatRates | Methods.blockchainGetFiatRatesForTimestamps | Methods.blockchainGetTransactions | Methods.blockchainSetCustomBackend | Methods.blockchainSubscribe | Methods.blockchainSubscribeFiatRates | Methods.blockchainUnsubscribe | Methods.blockchainUnsubscribeFiatRates | Methods.cardanoGetAddress | Methods.cardanoGetNativeScriptHash | Methods.cardanoGetPublicKey | Methods.cardanoSignTransaction | Methods.changePin | Methods.cipherKeyValue | Methods.composeTransaction | Methods.customMessage | Methods.eosGetPublicKey | Methods.eosSignTransaction | Methods.ethereumGetAddress | Methods.ethereumGetPublicKey | Methods.ethereumSignMessage | Methods.ethereumSignTransaction | Methods.ethereumSignTypedData | Methods.ethereumVerifyMessage | Methods.firmwareUpdate | Methods.getAccountInfo | Methods.getAddress | Methods.getCoinInfo | Methods.getDeviceState | Methods.getFeatures | Methods.getOwnershipId | Methods.getOwnershipProof | Methods.getPublicKey | Methods.getSettings | Methods.nemGetAddress | Methods.nemSignTransaction | Methods.pushTransaction | Methods.rebootToBootloader | Methods.recoveryDevice | Methods.requestLogin | Methods.resetDevice | Methods.rippleGetAddress | Methods.rippleSignTransaction | Methods.setProxy | Methods.signMessage | Methods.signTransaction | Methods.stellarGetAddress | Methods.stellarSignTransaction | Methods.tezosGetAddress | Methods.tezosGetPublicKey | Methods.tezosSignTransaction | Methods.verifyMessage | Methods.wipeDevice;
|
|
6
|
+
//# sourceMappingURL=method.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMethod = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Methods = (0, tslib_1.__importStar)(require("../api"));
|
|
6
|
+
const errors_1 = require("../constants/errors");
|
|
7
|
+
const getMethod = (message) => {
|
|
8
|
+
const { method } = message.payload;
|
|
9
|
+
if (typeof method !== 'string') {
|
|
10
|
+
throw (0, errors_1.TypedError)('Method_InvalidParameter', 'Message method is not set');
|
|
11
|
+
}
|
|
12
|
+
const MethodConstructor = Methods[method];
|
|
13
|
+
if (MethodConstructor) {
|
|
14
|
+
return new MethodConstructor(message);
|
|
15
|
+
}
|
|
16
|
+
throw (0, errors_1.TypedError)('Method_InvalidParameter', `Method ${method} not found`);
|
|
17
|
+
};
|
|
18
|
+
exports.getMethod = getMethod;
|
|
19
|
+
//# sourceMappingURL=method.js.map
|