@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,186 @@
|
|
|
1
|
+
import { networks } from '@trezor/utxo-lib';
|
|
2
|
+
export declare const convertXpub: ({
|
|
3
|
+
description: string;
|
|
4
|
+
network: networks.Network;
|
|
5
|
+
xpub: string;
|
|
6
|
+
result: string;
|
|
7
|
+
requestedNetwork?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
description: string;
|
|
10
|
+
network: networks.Network;
|
|
11
|
+
requestedNetwork: {
|
|
12
|
+
bip32: {
|
|
13
|
+
public: number;
|
|
14
|
+
private: number;
|
|
15
|
+
};
|
|
16
|
+
messagePrefix: string;
|
|
17
|
+
bech32: string;
|
|
18
|
+
pubKeyHash: number;
|
|
19
|
+
scriptHash: number;
|
|
20
|
+
wif: number;
|
|
21
|
+
forkId?: number | undefined;
|
|
22
|
+
};
|
|
23
|
+
xpub: string;
|
|
24
|
+
result: string;
|
|
25
|
+
})[];
|
|
26
|
+
export declare const convertBitcoinXpub: {
|
|
27
|
+
description: string;
|
|
28
|
+
network: networks.Network;
|
|
29
|
+
xpub: string;
|
|
30
|
+
result: string;
|
|
31
|
+
}[];
|
|
32
|
+
export declare const convertMultisigPubKey: ({
|
|
33
|
+
description: string;
|
|
34
|
+
utxo: {
|
|
35
|
+
multisig?: undefined;
|
|
36
|
+
};
|
|
37
|
+
result: {
|
|
38
|
+
multisig?: undefined;
|
|
39
|
+
};
|
|
40
|
+
network?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
description: string;
|
|
43
|
+
utxo: {
|
|
44
|
+
multisig: {
|
|
45
|
+
pubkeys?: undefined;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
result: {
|
|
49
|
+
multisig: {
|
|
50
|
+
pubkeys?: undefined;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
network?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
description: string;
|
|
56
|
+
utxo: {
|
|
57
|
+
multisig: {
|
|
58
|
+
pubkeys: {
|
|
59
|
+
node: {
|
|
60
|
+
depth: number;
|
|
61
|
+
};
|
|
62
|
+
}[];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
result: {
|
|
66
|
+
multisig: {
|
|
67
|
+
pubkeys: {
|
|
68
|
+
node: {
|
|
69
|
+
depth: number;
|
|
70
|
+
};
|
|
71
|
+
}[];
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
network?: undefined;
|
|
75
|
+
} | {
|
|
76
|
+
description: string;
|
|
77
|
+
network: networks.Network;
|
|
78
|
+
utxo: {
|
|
79
|
+
multisig: {
|
|
80
|
+
pubkeys: {
|
|
81
|
+
node: string;
|
|
82
|
+
}[];
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
result: {
|
|
86
|
+
multisig: {
|
|
87
|
+
pubkeys: {
|
|
88
|
+
node: {
|
|
89
|
+
chain_code: string;
|
|
90
|
+
child_num: number;
|
|
91
|
+
depth: number;
|
|
92
|
+
fingerprint: number;
|
|
93
|
+
public_key: string;
|
|
94
|
+
};
|
|
95
|
+
}[];
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
})[];
|
|
99
|
+
export declare const xpubDerive: ({
|
|
100
|
+
description: string;
|
|
101
|
+
suffix: number;
|
|
102
|
+
xpub: {
|
|
103
|
+
xpub: string;
|
|
104
|
+
node: {
|
|
105
|
+
child_num: number;
|
|
106
|
+
chain_code: string;
|
|
107
|
+
public_key: string;
|
|
108
|
+
fingerprint: number;
|
|
109
|
+
depth: number;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
childXPub: {
|
|
113
|
+
xpub: string;
|
|
114
|
+
node: {
|
|
115
|
+
child_num: number;
|
|
116
|
+
chain_code: string;
|
|
117
|
+
public_key: string;
|
|
118
|
+
fingerprint: number;
|
|
119
|
+
depth: number;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
network?: undefined;
|
|
123
|
+
error?: undefined;
|
|
124
|
+
} | {
|
|
125
|
+
description: string;
|
|
126
|
+
suffix: number;
|
|
127
|
+
xpub: {
|
|
128
|
+
xpub: string;
|
|
129
|
+
node: {
|
|
130
|
+
child_num: number;
|
|
131
|
+
chain_code: string;
|
|
132
|
+
public_key: string;
|
|
133
|
+
fingerprint: number;
|
|
134
|
+
depth: number;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
childXPub: {
|
|
138
|
+
xpub: string;
|
|
139
|
+
node: {
|
|
140
|
+
child_num: number;
|
|
141
|
+
chain_code: string;
|
|
142
|
+
public_key: string;
|
|
143
|
+
fingerprint: number;
|
|
144
|
+
depth: number;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
network: {
|
|
148
|
+
bip32: {
|
|
149
|
+
public: number;
|
|
150
|
+
private: number;
|
|
151
|
+
};
|
|
152
|
+
messagePrefix: string;
|
|
153
|
+
bech32: string;
|
|
154
|
+
pubKeyHash: number;
|
|
155
|
+
scriptHash: number;
|
|
156
|
+
wif: number;
|
|
157
|
+
forkId?: number | undefined;
|
|
158
|
+
};
|
|
159
|
+
error?: undefined;
|
|
160
|
+
} | {
|
|
161
|
+
description: string;
|
|
162
|
+
suffix: number;
|
|
163
|
+
xpub: {
|
|
164
|
+
xpub: string;
|
|
165
|
+
node: {
|
|
166
|
+
child_num: number;
|
|
167
|
+
chain_code: string;
|
|
168
|
+
public_key: string;
|
|
169
|
+
fingerprint: number;
|
|
170
|
+
depth: number;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
childXPub: {
|
|
174
|
+
xpub: string;
|
|
175
|
+
node: {
|
|
176
|
+
child_num: number;
|
|
177
|
+
chain_code: string;
|
|
178
|
+
public_key: string;
|
|
179
|
+
fingerprint: number;
|
|
180
|
+
depth: number;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
error: string;
|
|
184
|
+
network?: undefined;
|
|
185
|
+
})[];
|
|
186
|
+
//# sourceMappingURL=hdnodeUtils.d.ts.map
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.xpubDerive = exports.convertMultisigPubKey = exports.convertBitcoinXpub = exports.convertXpub = void 0;
|
|
4
|
+
const utxo_lib_1 = require("@trezor/utxo-lib");
|
|
5
|
+
const NETWORK_P2SH = {
|
|
6
|
+
...utxo_lib_1.networks.bitcoin,
|
|
7
|
+
bip32: {
|
|
8
|
+
...utxo_lib_1.networks.bitcoin.bip32,
|
|
9
|
+
public: 77429938,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
const NETWORK_P2WPKH = {
|
|
13
|
+
...utxo_lib_1.networks.bitcoin,
|
|
14
|
+
bip32: {
|
|
15
|
+
...utxo_lib_1.networks.bitcoin.bip32,
|
|
16
|
+
public: 78792518,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
exports.convertXpub = [
|
|
20
|
+
{
|
|
21
|
+
description: 'No requested network == no change',
|
|
22
|
+
network: utxo_lib_1.networks.bitcoin,
|
|
23
|
+
xpub: 'xpub6CVKsQYXc9awxgV1tWbG4foDvdcnieK2JkbpPEBKB5WwAPKBZ1mstLbKVB4ov7QzxzjaxNK6EfmNY5Jsk2cG26EVcEkycGW4tchT2dyUhrx',
|
|
24
|
+
result: 'xpub6CVKsQYXc9awxgV1tWbG4foDvdcnieK2JkbpPEBKB5WwAPKBZ1mstLbKVB4ov7QzxzjaxNK6EfmNY5Jsk2cG26EVcEkycGW4tchT2dyUhrx',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
description: 'P2PKH > P2SH',
|
|
28
|
+
network: utxo_lib_1.networks.bitcoin,
|
|
29
|
+
requestedNetwork: NETWORK_P2SH,
|
|
30
|
+
xpub: 'xpub6CVKsQYXc9awxgV1tWbG4foDvdcnieK2JkbpPEBKB5WwAPKBZ1mstLbKVB4ov7QzxzjaxNK6EfmNY5Jsk2cG26EVcEkycGW4tchT2dyUhrx',
|
|
31
|
+
result: 'ypub6XKbB5DSkq8Royg8isNtGktj6bmEfGJXDs83Ad5CZ5tpDV8QofwSWQFTWP2Pv24vNdrPhquehL7vRMvSTj2GpKv6UaTQCBKZALm6RJAmxG6',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
description: 'P2SH > P2PKH',
|
|
35
|
+
network: NETWORK_P2SH,
|
|
36
|
+
requestedNetwork: utxo_lib_1.networks.bitcoin,
|
|
37
|
+
xpub: 'ypub6XKbB5DSkq8Royg8isNtGktj6bmEfGJXDs83Ad5CZ5tpDV8QofwSWQFTWP2Pv24vNdrPhquehL7vRMvSTj2GpKv6UaTQCBKZALm6RJAmxG6',
|
|
38
|
+
result: 'xpub6CVKsQYXc9awxgV1tWbG4foDvdcnieK2JkbpPEBKB5WwAPKBZ1mstLbKVB4ov7QzxzjaxNK6EfmNY5Jsk2cG26EVcEkycGW4tchT2dyUhrx',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
description: 'P2PKH > Bech32/P2WPKH',
|
|
42
|
+
network: utxo_lib_1.networks.bitcoin,
|
|
43
|
+
requestedNetwork: NETWORK_P2WPKH,
|
|
44
|
+
xpub: 'xpub6DDUPHpUo4pcy43iJeZjbSVWGav1SMMmuWdMHiGtkK8rhKmfbomtkwW6GKs1GGAKehT6QRocrmda3WWxXawpjmwaUHfFRXuKrXSapdckEYF',
|
|
45
|
+
result: 'zpub6rszzdAK6RuafeRwyN8z1cgWcXCuKbLmjjfnrW4fWKtcoXQ8787214pNJjnBG5UATyghuNzjn6Lfp5k5xymrLFJnCy46bMYJPyZsbpFGagT',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
description: 'Bech32/P2WPKH > P2PKH',
|
|
49
|
+
network: NETWORK_P2WPKH,
|
|
50
|
+
requestedNetwork: utxo_lib_1.networks.bitcoin,
|
|
51
|
+
xpub: 'zpub6rszzdAK6RuafeRwyN8z1cgWcXCuKbLmjjfnrW4fWKtcoXQ8787214pNJjnBG5UATyghuNzjn6Lfp5k5xymrLFJnCy46bMYJPyZsbpFGagT',
|
|
52
|
+
result: 'xpub6DDUPHpUo4pcy43iJeZjbSVWGav1SMMmuWdMHiGtkK8rhKmfbomtkwW6GKs1GGAKehT6QRocrmda3WWxXawpjmwaUHfFRXuKrXSapdckEYF',
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
exports.convertBitcoinXpub = [
|
|
56
|
+
{
|
|
57
|
+
description: 'No requested network == no change',
|
|
58
|
+
network: utxo_lib_1.networks.bitcoin,
|
|
59
|
+
xpub: 'xpub6CVKsQYXc9awxgV1tWbG4foDvdcnieK2JkbpPEBKB5WwAPKBZ1mstLbKVB4ov7QzxzjaxNK6EfmNY5Jsk2cG26EVcEkycGW4tchT2dyUhrx',
|
|
60
|
+
result: 'xpub6CVKsQYXc9awxgV1tWbG4foDvdcnieK2JkbpPEBKB5WwAPKBZ1mstLbKVB4ov7QzxzjaxNK6EfmNY5Jsk2cG26EVcEkycGW4tchT2dyUhrx',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
description: 'Requested network P2SH',
|
|
64
|
+
network: NETWORK_P2SH,
|
|
65
|
+
xpub: 'xpub6CVKsQYXc9awxgV1tWbG4foDvdcnieK2JkbpPEBKB5WwAPKBZ1mstLbKVB4ov7QzxzjaxNK6EfmNY5Jsk2cG26EVcEkycGW4tchT2dyUhrx',
|
|
66
|
+
result: 'ypub6XKbB5DSkq8Royg8isNtGktj6bmEfGJXDs83Ad5CZ5tpDV8QofwSWQFTWP2Pv24vNdrPhquehL7vRMvSTj2GpKv6UaTQCBKZALm6RJAmxG6',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
description: 'Requested network Bech32/P2WPKH',
|
|
70
|
+
network: NETWORK_P2WPKH,
|
|
71
|
+
xpub: 'xpub6DDUPHpUo4pcy43iJeZjbSVWGav1SMMmuWdMHiGtkK8rhKmfbomtkwW6GKs1GGAKehT6QRocrmda3WWxXawpjmwaUHfFRXuKrXSapdckEYF',
|
|
72
|
+
result: 'zpub6rszzdAK6RuafeRwyN8z1cgWcXCuKbLmjjfnrW4fWKtcoXQ8787214pNJjnBG5UATyghuNzjn6Lfp5k5xymrLFJnCy46bMYJPyZsbpFGagT',
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
exports.convertMultisigPubKey = [
|
|
76
|
+
{
|
|
77
|
+
description: 'no multisig = no conversion',
|
|
78
|
+
utxo: {},
|
|
79
|
+
result: {},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
description: 'no pubkeys = no conversion',
|
|
83
|
+
utxo: {
|
|
84
|
+
multisig: {},
|
|
85
|
+
},
|
|
86
|
+
result: {
|
|
87
|
+
multisig: {},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
description: 'node is not a string = no conversion',
|
|
92
|
+
utxo: {
|
|
93
|
+
multisig: {
|
|
94
|
+
pubkeys: [{ node: { depth: 4 } }],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
result: {
|
|
98
|
+
multisig: {
|
|
99
|
+
pubkeys: [{ node: { depth: 4 } }],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
description: 'convert multisig input',
|
|
105
|
+
network: utxo_lib_1.networks.bitcoin,
|
|
106
|
+
utxo: {
|
|
107
|
+
multisig: {
|
|
108
|
+
pubkeys: [
|
|
109
|
+
{
|
|
110
|
+
node: 'xpub6EexEtC6c2rN5QCpzrL2nUNGDfxizCi3kM1C2Mk5a6PfQs4H3F72C642M3XbnzycvvtD4U6vzn1nYPpH8VUmiREc2YuXP3EFgN1uLTrVEj4',
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
result: {
|
|
116
|
+
multisig: {
|
|
117
|
+
pubkeys: [
|
|
118
|
+
{
|
|
119
|
+
node: {
|
|
120
|
+
chain_code: 'fd5fd24c06088bce57f3d817df206d0891adf5a77f5391bdc12793ef1917460e',
|
|
121
|
+
child_num: 2147483648,
|
|
122
|
+
depth: 4,
|
|
123
|
+
fingerprint: 2559962404,
|
|
124
|
+
public_key: '02d598ec0f8f418c80859b690e8ee731e2bf7c8e2233d7fa722249bc3f27a65151',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
const DEFAULT_NODE = {
|
|
133
|
+
xpub: 'xpub6CVKsQYXc9awxgV1tWbG4foDvdcnieK2JkbpPEBKB5WwAPKBZ1mstLbKVB4ov7QzxzjaxNK6EfmNY5Jsk2cG26EVcEkycGW4tchT2dyUhrx',
|
|
134
|
+
node: {
|
|
135
|
+
child_num: 2147483648,
|
|
136
|
+
chain_code: '072d8252ea73b130c7f6139daf220842bf0d42ffe43fd274c9c158504f4c50bf',
|
|
137
|
+
public_key: '0215a09870bbb713f1ba94d364e1e5bfcf9cdb5178d22efbca6ec17dc2c4f706cd',
|
|
138
|
+
fingerprint: 1910945124,
|
|
139
|
+
depth: 3,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
const DEFAULT_NODE_CHILD = {
|
|
143
|
+
xpub: 'xpub6EnV9K1LzPtRDXqqcDkBk99uCFneHiHR3DBQxXcbuWzQoUGLfJiHeF3uDW1JZH3ZG7mr4TuNtPbgLYwEibEkcDcnQkQksZi7jm3eY8PqKFv',
|
|
144
|
+
node: {
|
|
145
|
+
child_num: 0,
|
|
146
|
+
chain_code: '2589d77d82c575ed697ef8122f8c44c235377d2969c7a674fe73a7347066c4b6',
|
|
147
|
+
public_key: '020ddd7e4206daf889a2c11920fcccbb60df383d4c5fcd982cd5c7d400fdd46c8e',
|
|
148
|
+
fingerprint: 2856412653,
|
|
149
|
+
depth: 4,
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
exports.xpubDerive = [
|
|
153
|
+
{
|
|
154
|
+
description: 'success P2PKH format',
|
|
155
|
+
suffix: 0,
|
|
156
|
+
xpub: DEFAULT_NODE,
|
|
157
|
+
childXPub: DEFAULT_NODE_CHILD,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
description: 'success P2SH format',
|
|
161
|
+
suffix: 0,
|
|
162
|
+
xpub: {
|
|
163
|
+
...DEFAULT_NODE,
|
|
164
|
+
xpub: 'ypub6XKbB5DSkq8Royg8isNtGktj6bmEfGJXDs83Ad5CZ5tpDV8QofwSWQFTWP2Pv24vNdrPhquehL7vRMvSTj2GpKv6UaTQCBKZALm6RJAmxG6',
|
|
165
|
+
},
|
|
166
|
+
childXPub: {
|
|
167
|
+
...DEFAULT_NODE_CHILD,
|
|
168
|
+
xpub: 'ypub6ZckSygG95Ru4q2xSaXoxEFQNDw6ELGuxKhdjvWVHXNHra5ZuxsrGJi3EhxtZBhUfkteowVwM3xEDqYoSHemQTJPH67BTUXc1V7Hvneqgzd',
|
|
169
|
+
},
|
|
170
|
+
network: NETWORK_P2SH,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
description: 'Invalid network version. (P2SH xpub is used, but network is set to P2PKH)',
|
|
174
|
+
suffix: 0,
|
|
175
|
+
xpub: {
|
|
176
|
+
...DEFAULT_NODE,
|
|
177
|
+
xpub: 'ypub6XKbB5DSkq8Royg8isNtGktj6bmEfGJXDs83Ad5CZ5tpDV8QofwSWQFTWP2Pv24vNdrPhquehL7vRMvSTj2GpKv6UaTQCBKZALm6RJAmxG6',
|
|
178
|
+
},
|
|
179
|
+
childXPub: {
|
|
180
|
+
...DEFAULT_NODE_CHILD,
|
|
181
|
+
xpub: 'ypub6ZckSygG95Ru4q2xSaXoxEFQNDw6ELGuxKhdjvWVHXNHra5ZuxsrGJi3EhxtZBhUfkteowVwM3xEDqYoSHemQTJPH67BTUXc1V7Hvneqgzd',
|
|
182
|
+
},
|
|
183
|
+
error: 'Invalid network version',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
description: 'Invalid public key transmission. (depths are the same)',
|
|
187
|
+
suffix: 0,
|
|
188
|
+
xpub: DEFAULT_NODE,
|
|
189
|
+
childXPub: {
|
|
190
|
+
...DEFAULT_NODE_CHILD,
|
|
191
|
+
node: {
|
|
192
|
+
...DEFAULT_NODE_CHILD.node,
|
|
193
|
+
depth: 3,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
error: 'Invalid public key transmission detected',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
description: 'Invalid child cross-check. (suffix is set to 1 but 0 was used to derive child)',
|
|
200
|
+
suffix: 1,
|
|
201
|
+
xpub: DEFAULT_NODE,
|
|
202
|
+
childXPub: DEFAULT_NODE_CHILD,
|
|
203
|
+
error: 'Invalid child cross-check public key',
|
|
204
|
+
},
|
|
205
|
+
];
|
|
206
|
+
//# sourceMappingURL=hdnodeUtils.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CoinInfo, BitcoinNetworkInfo } from '../types';
|
|
2
|
+
declare type Bip44Options = {
|
|
3
|
+
purpose?: number;
|
|
4
|
+
coinType?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const getAccountAddressN: (coinInfo: CoinInfo, accountIndex: number, bip44?: Bip44Options | undefined) => number[];
|
|
7
|
+
export declare const getAccountLabel: (path: number[], coinInfo: CoinInfo) => string;
|
|
8
|
+
export declare const getPublicKeyLabel: (path: number[], coinInfo?: BitcoinNetworkInfo | undefined) => string;
|
|
9
|
+
export declare const isUtxoBased: (coinInfo: CoinInfo) => boolean;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=accountUtils.d.ts.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isUtxoBased = exports.getPublicKeyLabel = exports.getAccountLabel = exports.getAccountAddressN = void 0;
|
|
4
|
+
const pathUtils_1 = require("./pathUtils");
|
|
5
|
+
const coinInfo_1 = require("../data/coinInfo");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const getAccountAddressN = (coinInfo, accountIndex, bip44) => {
|
|
8
|
+
if (!coinInfo) {
|
|
9
|
+
throw constants_1.ERRORS.TypedError('Method_UnknownCoin');
|
|
10
|
+
}
|
|
11
|
+
const index = typeof accountIndex === 'number' ? accountIndex : 0;
|
|
12
|
+
const options = {
|
|
13
|
+
purpose: 44,
|
|
14
|
+
coinType: coinInfo.slip44,
|
|
15
|
+
...bip44,
|
|
16
|
+
};
|
|
17
|
+
if (coinInfo.type === 'bitcoin') {
|
|
18
|
+
return [(0, pathUtils_1.toHardened)(options.purpose), (0, pathUtils_1.toHardened)(options.coinType), (0, pathUtils_1.toHardened)(index)];
|
|
19
|
+
}
|
|
20
|
+
if (coinInfo.shortcut === 'ADA' || coinInfo.shortcut === 'tADA') {
|
|
21
|
+
return [(0, pathUtils_1.toHardened)(1852), (0, pathUtils_1.toHardened)(options.coinType), (0, pathUtils_1.toHardened)(index)];
|
|
22
|
+
}
|
|
23
|
+
if (coinInfo.type === 'ethereum') {
|
|
24
|
+
return [(0, pathUtils_1.toHardened)(options.purpose), (0, pathUtils_1.toHardened)(options.coinType), (0, pathUtils_1.toHardened)(0), 0, index];
|
|
25
|
+
}
|
|
26
|
+
if (coinInfo.shortcut === 'tXRP') {
|
|
27
|
+
return [(0, pathUtils_1.toHardened)(options.purpose), (0, pathUtils_1.toHardened)(144), (0, pathUtils_1.toHardened)(index), 0, 0];
|
|
28
|
+
}
|
|
29
|
+
return [(0, pathUtils_1.toHardened)(options.purpose), (0, pathUtils_1.toHardened)(options.coinType), (0, pathUtils_1.toHardened)(index), 0, 0];
|
|
30
|
+
};
|
|
31
|
+
exports.getAccountAddressN = getAccountAddressN;
|
|
32
|
+
const getAccountLabel = (path, coinInfo) => {
|
|
33
|
+
if (coinInfo.type === 'bitcoin') {
|
|
34
|
+
const accountType = (0, pathUtils_1.fromHardened)(path[0]);
|
|
35
|
+
const account = (0, pathUtils_1.fromHardened)(path[2]);
|
|
36
|
+
let prefix = '';
|
|
37
|
+
if (accountType === 48) {
|
|
38
|
+
prefix = 'multisig';
|
|
39
|
+
}
|
|
40
|
+
else if (accountType === 49 && coinInfo.segwit) {
|
|
41
|
+
prefix = 'segwit';
|
|
42
|
+
}
|
|
43
|
+
else if (accountType === 44 && coinInfo.segwit) {
|
|
44
|
+
prefix = 'legacy';
|
|
45
|
+
}
|
|
46
|
+
return `${prefix} <span>account #${account + 1}</span>`;
|
|
47
|
+
}
|
|
48
|
+
const account = (0, pathUtils_1.fromHardened)(path[4]);
|
|
49
|
+
return `account #${account + 1}`;
|
|
50
|
+
};
|
|
51
|
+
exports.getAccountLabel = getAccountLabel;
|
|
52
|
+
const getPublicKeyLabel = (path, coinInfo) => {
|
|
53
|
+
let hasSegwit = false;
|
|
54
|
+
let coinLabel = 'Unknown coin';
|
|
55
|
+
if (coinInfo) {
|
|
56
|
+
coinLabel = coinInfo.label;
|
|
57
|
+
hasSegwit = coinInfo.segwit;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
coinLabel = (0, coinInfo_1.getCoinName)(path);
|
|
61
|
+
}
|
|
62
|
+
const p1 = (0, pathUtils_1.fromHardened)(path[0]);
|
|
63
|
+
let account = path.length >= 3 ? (0, pathUtils_1.fromHardened)(path[2]) : -1;
|
|
64
|
+
let realAccountId = account + 1;
|
|
65
|
+
let prefix = 'Export public key';
|
|
66
|
+
let accountType = '';
|
|
67
|
+
if (p1 === 45342) {
|
|
68
|
+
const p2 = (0, pathUtils_1.fromHardened)(path[1]);
|
|
69
|
+
account = (0, pathUtils_1.fromHardened)(path[3]);
|
|
70
|
+
realAccountId = account + 1;
|
|
71
|
+
prefix = 'Export Copay ID of';
|
|
72
|
+
if (p2 === 48) {
|
|
73
|
+
accountType = 'multisig';
|
|
74
|
+
}
|
|
75
|
+
else if (p2 === 44) {
|
|
76
|
+
accountType = 'legacy';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else if (p1 === 48) {
|
|
80
|
+
accountType = `${coinLabel} multisig`;
|
|
81
|
+
}
|
|
82
|
+
else if (p1 === 44 && hasSegwit) {
|
|
83
|
+
accountType = `${coinLabel} legacy`;
|
|
84
|
+
}
|
|
85
|
+
else if (p1 === 84 && hasSegwit) {
|
|
86
|
+
accountType = `${coinLabel} native segwit`;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
accountType = coinLabel;
|
|
90
|
+
}
|
|
91
|
+
if (realAccountId > 0) {
|
|
92
|
+
return `${prefix} of ${accountType} <span>account #${realAccountId}</span>`;
|
|
93
|
+
}
|
|
94
|
+
return prefix;
|
|
95
|
+
};
|
|
96
|
+
exports.getPublicKeyLabel = getPublicKeyLabel;
|
|
97
|
+
const isUtxoBased = (coinInfo) => coinInfo.type === 'bitcoin' || coinInfo.shortcut === 'ADA' || coinInfo.shortcut === 'tADA';
|
|
98
|
+
exports.isUtxoBased = isUtxoBased;
|
|
99
|
+
//# sourceMappingURL=accountUtils.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isValidAddress = void 0;
|
|
4
|
+
const utxo_lib_1 = require("@trezor/utxo-lib");
|
|
5
|
+
const isValidBase58Address = (address, network) => {
|
|
6
|
+
try {
|
|
7
|
+
const decoded = utxo_lib_1.address.fromBase58Check(address, network);
|
|
8
|
+
if (decoded.version !== network.pubKeyHash && decoded.version !== network.scriptHash) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
catch (e) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
};
|
|
17
|
+
const isValidBech32Address = (address, network) => {
|
|
18
|
+
try {
|
|
19
|
+
const decoded = utxo_lib_1.address.fromBech32(address);
|
|
20
|
+
if (decoded.prefix !== network.bech32) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
};
|
|
29
|
+
const isValidAddress = (address, coinInfo) => isValidBase58Address(address, coinInfo.network) ||
|
|
30
|
+
isValidBech32Address(address, coinInfo.network);
|
|
31
|
+
exports.isValidAddress = isValidAddress;
|
|
32
|
+
//# sourceMappingURL=addressUtils.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.httpRequest = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const cross_fetch_1 = (0, tslib_1.__importDefault)(require("cross-fetch"));
|
|
6
|
+
const httpRequest = async (url, type = 'text') => {
|
|
7
|
+
const response = await (0, cross_fetch_1.default)(url, { credentials: 'same-origin' });
|
|
8
|
+
if (response.ok) {
|
|
9
|
+
if (type === 'json') {
|
|
10
|
+
const txt = await response.text();
|
|
11
|
+
return JSON.parse(txt);
|
|
12
|
+
}
|
|
13
|
+
if (type === 'binary') {
|
|
14
|
+
return response.arrayBuffer();
|
|
15
|
+
}
|
|
16
|
+
return response.text();
|
|
17
|
+
}
|
|
18
|
+
throw new Error(`httpRequest error: ${url} ${response.statusText}`);
|
|
19
|
+
};
|
|
20
|
+
exports.httpRequest = httpRequest;
|
|
21
|
+
//# sourceMappingURL=assets-browser.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.httpRequest = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const cross_fetch_1 = (0, tslib_1.__importDefault)(require("cross-fetch"));
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const assets_browser_1 = require("./assets-browser");
|
|
8
|
+
if (global && typeof global.fetch !== 'function') {
|
|
9
|
+
global.fetch = cross_fetch_1.default;
|
|
10
|
+
}
|
|
11
|
+
const httpRequest = (url, _type) => {
|
|
12
|
+
const fileUrl = url.split('?')[0];
|
|
13
|
+
switch (fileUrl) {
|
|
14
|
+
case './data/coins.json':
|
|
15
|
+
return require('@trezor/connect-common/files/coins.json');
|
|
16
|
+
case './data/bridge/releases.json':
|
|
17
|
+
return require('@trezor/connect-common/files/bridge/releases.json');
|
|
18
|
+
case './data/firmware/1/releases.json':
|
|
19
|
+
return require('@trezor/connect-common/files/firmware/1/releases.json');
|
|
20
|
+
case './data/firmware/2/releases.json':
|
|
21
|
+
return require('@trezor/connect-common/files/firmware/2/releases.json');
|
|
22
|
+
case './data/messages/messages.json':
|
|
23
|
+
return require('@trezor/transport/messages.json');
|
|
24
|
+
}
|
|
25
|
+
return /^https?/.test(url) ? (0, assets_browser_1.httpRequest)(url) : fs_1.promises.readFile(url);
|
|
26
|
+
};
|
|
27
|
+
exports.httpRequest = httpRequest;
|
|
28
|
+
//# sourceMappingURL=assets.js.map
|