@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,147 @@
|
|
|
1
|
+
declare const _default: ({
|
|
2
|
+
description: string;
|
|
3
|
+
inputs: {
|
|
4
|
+
address_n: number[];
|
|
5
|
+
prev_hash: string;
|
|
6
|
+
prev_index: number;
|
|
7
|
+
amount: string;
|
|
8
|
+
}[];
|
|
9
|
+
outputs: {
|
|
10
|
+
address: string;
|
|
11
|
+
amount: string;
|
|
12
|
+
script_type: string;
|
|
13
|
+
}[];
|
|
14
|
+
tx: string;
|
|
15
|
+
getHDNode?: undefined;
|
|
16
|
+
network?: undefined;
|
|
17
|
+
error?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
description: string;
|
|
20
|
+
inputs: {
|
|
21
|
+
address_n: number[];
|
|
22
|
+
prev_hash: string;
|
|
23
|
+
prev_index: number;
|
|
24
|
+
amount: string;
|
|
25
|
+
}[];
|
|
26
|
+
outputs: {
|
|
27
|
+
address_n: number[];
|
|
28
|
+
amount: string;
|
|
29
|
+
script_type: string;
|
|
30
|
+
}[];
|
|
31
|
+
tx: string;
|
|
32
|
+
getHDNode: () => {
|
|
33
|
+
xpub: string;
|
|
34
|
+
};
|
|
35
|
+
network?: undefined;
|
|
36
|
+
error?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
description: string;
|
|
39
|
+
network: string;
|
|
40
|
+
inputs: {
|
|
41
|
+
address_n: number[];
|
|
42
|
+
prev_hash: string;
|
|
43
|
+
prev_index: number;
|
|
44
|
+
amount: string;
|
|
45
|
+
}[];
|
|
46
|
+
outputs: {
|
|
47
|
+
address: string;
|
|
48
|
+
amount: string;
|
|
49
|
+
script_type: string;
|
|
50
|
+
}[];
|
|
51
|
+
tx: string;
|
|
52
|
+
getHDNode?: undefined;
|
|
53
|
+
error?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
description: string;
|
|
56
|
+
network: string;
|
|
57
|
+
inputs: {
|
|
58
|
+
address_n: number[];
|
|
59
|
+
prev_hash: string;
|
|
60
|
+
prev_index: number;
|
|
61
|
+
amount: string;
|
|
62
|
+
}[];
|
|
63
|
+
outputs: ({
|
|
64
|
+
address: string;
|
|
65
|
+
amount: string;
|
|
66
|
+
script_type: string;
|
|
67
|
+
address_n?: undefined;
|
|
68
|
+
} | {
|
|
69
|
+
address_n: number[];
|
|
70
|
+
amount: string;
|
|
71
|
+
script_type: string;
|
|
72
|
+
address?: undefined;
|
|
73
|
+
})[];
|
|
74
|
+
tx: string;
|
|
75
|
+
getHDNode: () => {
|
|
76
|
+
xpub: string;
|
|
77
|
+
};
|
|
78
|
+
error?: undefined;
|
|
79
|
+
} | {
|
|
80
|
+
description: string;
|
|
81
|
+
inputs: {
|
|
82
|
+
address_n: number[];
|
|
83
|
+
prev_hash: string;
|
|
84
|
+
prev_index: number;
|
|
85
|
+
amount: string;
|
|
86
|
+
}[];
|
|
87
|
+
outputs: {
|
|
88
|
+
op_return_data: string;
|
|
89
|
+
amount: string;
|
|
90
|
+
script_type: string;
|
|
91
|
+
}[];
|
|
92
|
+
tx: string;
|
|
93
|
+
getHDNode?: undefined;
|
|
94
|
+
network?: undefined;
|
|
95
|
+
error?: undefined;
|
|
96
|
+
} | {
|
|
97
|
+
description: string;
|
|
98
|
+
inputs: {
|
|
99
|
+
address_n: number[];
|
|
100
|
+
prev_hash: string;
|
|
101
|
+
prev_index: number;
|
|
102
|
+
amount: string;
|
|
103
|
+
}[];
|
|
104
|
+
outputs: {
|
|
105
|
+
op_return_data: string;
|
|
106
|
+
script_type: string;
|
|
107
|
+
}[];
|
|
108
|
+
tx: string;
|
|
109
|
+
getHDNode?: undefined;
|
|
110
|
+
network?: undefined;
|
|
111
|
+
error?: undefined;
|
|
112
|
+
} | {
|
|
113
|
+
description: string;
|
|
114
|
+
inputs: {
|
|
115
|
+
address_n: number[];
|
|
116
|
+
prev_hash: string;
|
|
117
|
+
prev_index: number;
|
|
118
|
+
amount: string;
|
|
119
|
+
}[];
|
|
120
|
+
outputs: {
|
|
121
|
+
address: string;
|
|
122
|
+
amount: string;
|
|
123
|
+
script_type: string;
|
|
124
|
+
}[];
|
|
125
|
+
tx: string;
|
|
126
|
+
error: string;
|
|
127
|
+
getHDNode?: undefined;
|
|
128
|
+
network?: undefined;
|
|
129
|
+
} | {
|
|
130
|
+
description: string;
|
|
131
|
+
inputs: {
|
|
132
|
+
address_n: number[];
|
|
133
|
+
prev_hash: string;
|
|
134
|
+
prev_index: number;
|
|
135
|
+
amount: string;
|
|
136
|
+
}[];
|
|
137
|
+
outputs: {
|
|
138
|
+
amount: string;
|
|
139
|
+
script_type: string;
|
|
140
|
+
}[];
|
|
141
|
+
tx: string;
|
|
142
|
+
error: string;
|
|
143
|
+
getHDNode?: undefined;
|
|
144
|
+
network?: undefined;
|
|
145
|
+
})[];
|
|
146
|
+
export default _default;
|
|
147
|
+
//# sourceMappingURL=signtxVerify.d.ts.map
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const PATH = [2147483692, 2147483648, 2147483648, 0, 5];
|
|
4
|
+
const inputs = [
|
|
5
|
+
{
|
|
6
|
+
address_n: PATH,
|
|
7
|
+
prev_hash: '50f6f1209ca92d7359564be803cb2c932cde7d370f7cee50fd1fad6790f6206d',
|
|
8
|
+
prev_index: 1,
|
|
9
|
+
amount: '1',
|
|
10
|
+
},
|
|
11
|
+
];
|
|
12
|
+
exports.default = [
|
|
13
|
+
{
|
|
14
|
+
description: 'external P2PKH output',
|
|
15
|
+
inputs,
|
|
16
|
+
outputs: [
|
|
17
|
+
{
|
|
18
|
+
address: '1MJ2tj2ThBE62zXbBYA5ZaN3fdve5CPAz1',
|
|
19
|
+
amount: '10000',
|
|
20
|
+
script_type: 'PAYTOADDRESS',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100a200ea1278c3d32251a63c56f5f0861f48167c61d84de8d951eac1204856ccd402201fc03f446557bcbcef1e473616bb7bddc96561b656b7ddd6b419501543ed5044012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff0110270000000000001976a914de9b2a8da088824e8fe51debea566617d851537888ac00000000',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
description: 'internal P2PKH output',
|
|
27
|
+
inputs,
|
|
28
|
+
outputs: [
|
|
29
|
+
{
|
|
30
|
+
address_n: PATH,
|
|
31
|
+
amount: '10000',
|
|
32
|
+
script_type: 'PAYTOADDRESS',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a47304402203d784f8134a0afe40dfc5ff479a99352110855b845fb4a7524915272cd249f47022079f90d8713035c99a46975d3bca9a8bc2464b02437f09b2cf3d34df91bb53ad2012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff0110270000000000001976a914a6450f1945831a81912616691e721b787383f4ed88ac00000000',
|
|
36
|
+
getHDNode: () => ({
|
|
37
|
+
xpub: 'xpub6Ex8WCdj1KH5mK9r99QKENUmhpjEPgYm1dJmKY2nxx16tSAiQCVYjHfymFdzfpYDAHGtWYTif7WkUKLMULRJFPeV1hvEbeXqrM11K85yPjp',
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
description: 'internal P2PKH output (custom path)',
|
|
42
|
+
inputs,
|
|
43
|
+
outputs: [
|
|
44
|
+
{
|
|
45
|
+
address_n: [0],
|
|
46
|
+
amount: '10000',
|
|
47
|
+
script_type: 'PAYTOADDRESS',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a473044022046c0e8694878140567d55665f85fb09c28e07605873c4ebd6b1ed46aac67f0e7022032405c728d8d2726d9b297804882e684c0d5f9ca5df291c4ebca6857056a0eaa012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff0110270000000000001976a9144e145e3b27f90d854fba11106654c11451eb960088ac00000000',
|
|
51
|
+
getHDNode: () => ({
|
|
52
|
+
xpub: 'xpub68Zyu13hPwsx8egknnRtfGmk6n9f6S5zbousZUJmQDZsB3GCppTz73oD2WS8DcCa4hqvNePCt8dFt5TKSSBgvCdgg48iWZQ7qgKnFaQnj21',
|
|
53
|
+
}),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
description: 'external P2SH output',
|
|
57
|
+
inputs,
|
|
58
|
+
outputs: [
|
|
59
|
+
{
|
|
60
|
+
address: '3L6TyTisPBmrDAj6RoKmDzNnj4eQi54gD2',
|
|
61
|
+
amount: '10000',
|
|
62
|
+
script_type: 'PAYTOADDRESS',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a47304402203239b33a93c205e1a463304c10383fcfea109012aa7c8b71238c22d2f02dfb98022074f687be14198ca844ab35823dfb70cabbb208338ea7154516a1c657e8b5a3de012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff01102700000000000017a914c9e193b1af9e4349d2ee53b4190e2bd36e59719e8700000000',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
description: 'internal P2SH output',
|
|
69
|
+
inputs,
|
|
70
|
+
outputs: [
|
|
71
|
+
{
|
|
72
|
+
address_n: [2147483697, 2147483648, 2147483648, 0, 5],
|
|
73
|
+
amount: '10000',
|
|
74
|
+
script_type: 'PAYTOP2SHWITNESS',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a4730440220240b8780aa29f5afa7d9d040ef8c406a9f44f981bf819b01d9e6d68e5a02c59b022020f40e21ef9c3cf6e5f7d4a776593e8bf3971166e1a0324dfdcfcec8c3bce8c0012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff01102700000000000017a9140c598ef0edacdc76bd460441b41d069c62eead278700000000',
|
|
78
|
+
getHDNode: () => ({
|
|
79
|
+
xpub: 'xpub6EnV9K1LzPtRDXqqcDkBk99uCFneHiHR3DBQxXcbuWzQoUGLfJiHeF3uDW1JZH3ZG7mr4TuNtPbgLYwEibEkcDcnQkQksZi7jm3eY8PqKFv',
|
|
80
|
+
}),
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
description: 'external P2WPKH output',
|
|
84
|
+
inputs,
|
|
85
|
+
outputs: [
|
|
86
|
+
{
|
|
87
|
+
address: 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4',
|
|
88
|
+
amount: '10000',
|
|
89
|
+
script_type: 'PAYTOADDRESS',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100cdf268cb89433f2cdc990ca3f45bf356befe51bbbbd6b57f1ca08ac69298acad022032beef4e1380bd3819c0cbf1b1a70b434a115199d1cbe5c59de8d94f98086452012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff011027000000000000160014751e76e8199196d454941c45d1b3a323f1433bd600000000',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
description: 'external P2WSH output',
|
|
96
|
+
inputs,
|
|
97
|
+
outputs: [
|
|
98
|
+
{
|
|
99
|
+
address: 'bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3',
|
|
100
|
+
amount: '10000',
|
|
101
|
+
script_type: 'PAYTOADDRESS',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a4730440220714c3704cb9aee785a5e03eb77eacf5bd95d29a4fe9cf33e4a868aa4100d2b6902207c5bdef296404d3fedeaaa71579140768b72c0bea882c7a2f16c029963d7c622012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff0110270000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c632960490326200000000',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
description: 'external P2TR output',
|
|
108
|
+
network: 'testnet',
|
|
109
|
+
inputs: [...inputs, ...inputs, ...inputs],
|
|
110
|
+
outputs: [
|
|
111
|
+
{
|
|
112
|
+
address: 'tb1p5cxhpna6xuthmq3e6qvpshvxfv4a6r90tct4l4z9fnqqdlfdwkkq5cyr45',
|
|
113
|
+
amount: '34009772',
|
|
114
|
+
script_type: 'PAYTOADDRESS',
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
tx: '010000000001036681d03f108f557f55dc885cfcf9e5ac8f2bc564d5ff4fbd55627bb06ffa6e87000000000000000000f33120595c2b58a67121393289b4017ff6c627e5f929b602d00a17c819104ecd000000000000000000f7b890100da516c5fe7bb3627da6b166d5bf4a8feaec3e98544e36d0338c8f9800000000000000000001acf2060200000000225120a60d70cfba37177d8239d018185d864b2bdd0caf5e175fd4454cc006fd2d75ac01402124dd40569c8518e42eb23e3e75d6446c816b099f89dd485171ae4ae6dbacff54847e4aed4f7265128d107ac73422f7d3fef65ee8ef7d57d907183fac2ce9fe01405d837bb4c7933f70915dc9c8e1f8b3843bf018292a8febd9a1801a2c5b137da407e463b7c091e6cc05ea5f3b6377d7c3c17c42d9f1db37654defeae22cfcd5690140c49a7fc0a2be865f4c1d8be8b56af8eecd3b8af55c823159c417b2ef390a1dab1f8ccba681a3cf3fd0dd072261ca4f5263196e69bbcccbb889d1c189f20ee61500000000',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
description: 'internal P2TR output',
|
|
121
|
+
network: 'testnet',
|
|
122
|
+
inputs,
|
|
123
|
+
outputs: [
|
|
124
|
+
{
|
|
125
|
+
address: 'tb1pdsepw2hky9etm9d3yfumyq9g25xwys6d0jysstaaymgc6nheggasgamqts',
|
|
126
|
+
amount: '2000',
|
|
127
|
+
script_type: 'PAYTOADDRESS',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
address_n: [2147483734, 2147483649, 2147483648, 1, 1],
|
|
131
|
+
amount: '8580',
|
|
132
|
+
script_type: 'PAYTOTAPROOT',
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
tx: '0100000000010137c69a1d916c702a237ae1af6362d3d0ad63a078488c860d3fe0c276aa37d83d0000000000fdffffff02d0070000000000002251206c32172af62172bd95b12279b200a8550ce2434d7c89082fbd26d18d4ef9423b84210000000000002251207866dd733460c84db1aa3f7208d9a2d0f706c80306b398050b41dcd44cd214ad014081ed20fcb7fa953e0cdda874383af18d6127102e03c8386ac13a41a4e4da6e3eb2f52ffe85cf482b35f93523fa226e6b6e382cb71ee2bebac6551c29d16a94f900000000',
|
|
136
|
+
getHDNode: () => ({
|
|
137
|
+
xpub: 'tpubDECt75TERm1JRzmVvnEta9ywSwgfTJ1WQQnAoEG9EAY75gWwJU5e2GqEdDaYSTi3ogdPeqC25T4to7Lzp9uui7HfKqhPX1PtRW7ZGz6PBw3',
|
|
138
|
+
}),
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
description: 'opreturn output',
|
|
142
|
+
inputs,
|
|
143
|
+
outputs: [
|
|
144
|
+
{
|
|
145
|
+
op_return_data: 'deadbeef',
|
|
146
|
+
amount: '0',
|
|
147
|
+
script_type: 'PAYTOOPRETURN',
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100ab05878122fa124067dafccd47b6c55567ed7564ae50676dff89dd9fd920a544022025cdf05643234329fec08fc81abec07e2b9f4e14adfa2e2e507e4debc5d36073012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff010000000000000000066a04deadbeef00000000',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
description: 'opreturn output without amount',
|
|
154
|
+
inputs,
|
|
155
|
+
outputs: [
|
|
156
|
+
{
|
|
157
|
+
op_return_data: 'deadbeef',
|
|
158
|
+
script_type: 'PAYTOOPRETURN',
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100ab05878122fa124067dafccd47b6c55567ed7564ae50676dff89dd9fd920a544022025cdf05643234329fec08fc81abec07e2b9f4e14adfa2e2e507e4debc5d36073012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff010000000000000000066a04deadbeef00000000',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
description: 'Error, output scripts differ',
|
|
165
|
+
inputs,
|
|
166
|
+
outputs: [
|
|
167
|
+
{
|
|
168
|
+
address: 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4',
|
|
169
|
+
amount: '10000',
|
|
170
|
+
script_type: 'PAYTOADDRESS',
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a4730440220714c3704cb9aee785a5e03eb77eacf5bd95d29a4fe9cf33e4a868aa4100d2b6902207c5bdef296404d3fedeaaa71579140768b72c0bea882c7a2f16c029963d7c622012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff0110270000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c632960490326200000000',
|
|
174
|
+
error: 'verifyTx: Output 0 scripts differ',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
description: 'Error, amount differ',
|
|
178
|
+
inputs,
|
|
179
|
+
outputs: [
|
|
180
|
+
{
|
|
181
|
+
address: 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4',
|
|
182
|
+
amount: '20000',
|
|
183
|
+
script_type: 'PAYTOADDRESS',
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100cdf268cb89433f2cdc990ca3f45bf356befe51bbbbd6b57f1ca08ac69298acad022032beef4e1380bd3819c0cbf1b1a70b434a115199d1cbe5c59de8d94f98086452012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff011027000000000000160014751e76e8199196d454941c45d1b3a323f1433bd600000000',
|
|
187
|
+
error: 'verifyTx: Wrong output amount at output 0. Requested: 20000, signed: 10000',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
description: 'Error, wrong length (inputs)',
|
|
191
|
+
inputs: [],
|
|
192
|
+
outputs: [],
|
|
193
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100cdf268cb89433f2cdc990ca3f45bf356befe51bbbbd6b57f1ca08ac69298acad022032beef4e1380bd3819c0cbf1b1a70b434a115199d1cbe5c59de8d94f98086452012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff011027000000000000160014751e76e8199196d454941c45d1b3a323f1433bd600000000',
|
|
194
|
+
error: 'verifyTx: Signed transaction inputs invalid length',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
description: 'Error, wrong length (outputs)',
|
|
198
|
+
inputs,
|
|
199
|
+
outputs: [],
|
|
200
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100cdf268cb89433f2cdc990ca3f45bf356befe51bbbbd6b57f1ca08ac69298acad022032beef4e1380bd3819c0cbf1b1a70b434a115199d1cbe5c59de8d94f98086452012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff011027000000000000160014751e76e8199196d454941c45d1b3a323f1433bd600000000',
|
|
201
|
+
error: 'verifyTx: Signed transaction outputs invalid length',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
description: 'Error, output without address',
|
|
205
|
+
inputs,
|
|
206
|
+
outputs: [
|
|
207
|
+
{
|
|
208
|
+
amount: '10000',
|
|
209
|
+
script_type: 'PAYTOADDRESS',
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100cdf268cb89433f2cdc990ca3f45bf356befe51bbbbd6b57f1ca08ac69298acad022032beef4e1380bd3819c0cbf1b1a70b434a115199d1cbe5c59de8d94f98086452012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff011027000000000000160014751e76e8199196d454941c45d1b3a323f1433bd600000000',
|
|
213
|
+
error: 'deriveOutputScript: Neither address or address_n is set',
|
|
214
|
+
},
|
|
215
|
+
];
|
|
216
|
+
//# sourceMappingURL=signtxVerify.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BitcoinNetworkInfo } from '../../types';
|
|
2
|
+
import type { TransactionOptions } from '../../types/api/signTransaction';
|
|
3
|
+
export declare const enhanceSignTx: (options: TransactionOptions, coinInfo: BitcoinNetworkInfo) => TransactionOptions;
|
|
4
|
+
//# sourceMappingURL=enhanceSignTx.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enhanceSignTx = void 0;
|
|
4
|
+
const BlockchainLink_1 = require("../../backend/BlockchainLink");
|
|
5
|
+
const enhanceSignTx = (options, coinInfo) => {
|
|
6
|
+
var _a;
|
|
7
|
+
if (coinInfo.shortcut === 'ZEC' || coinInfo.shortcut === 'TAZ') {
|
|
8
|
+
if (typeof options.overwintered !== 'boolean') {
|
|
9
|
+
options.overwintered = true;
|
|
10
|
+
}
|
|
11
|
+
if (typeof options.version !== 'number') {
|
|
12
|
+
options.version = 5;
|
|
13
|
+
}
|
|
14
|
+
if (typeof options.version_group_id !== 'number') {
|
|
15
|
+
options.version_group_id = 0x26a7270a;
|
|
16
|
+
}
|
|
17
|
+
if (typeof options.branch_id !== 'number') {
|
|
18
|
+
const backend = (0, BlockchainLink_1.findBackend)(coinInfo.name);
|
|
19
|
+
if (backend && ((_a = backend.serverInfo) === null || _a === void 0 ? void 0 : _a.consensusBranchId)) {
|
|
20
|
+
options.branch_id = backend.serverInfo.consensusBranchId;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
options.branch_id = 0xc2d6d0b4;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (coinInfo.shortcut === 'KMD') {
|
|
28
|
+
if (typeof options.overwintered !== 'boolean') {
|
|
29
|
+
options.overwintered = true;
|
|
30
|
+
}
|
|
31
|
+
if (typeof options.version !== 'number') {
|
|
32
|
+
options.version = 4;
|
|
33
|
+
}
|
|
34
|
+
if (typeof options.version_group_id !== 'number') {
|
|
35
|
+
options.version_group_id = 0x892f2085;
|
|
36
|
+
}
|
|
37
|
+
if (typeof options.branch_id !== 'number') {
|
|
38
|
+
options.branch_id = 0x76b809bb;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (coinInfo.shortcut === 'KOTO') {
|
|
42
|
+
if (typeof options.overwintered !== 'boolean') {
|
|
43
|
+
options.overwintered = true;
|
|
44
|
+
}
|
|
45
|
+
if (typeof options.version !== 'number') {
|
|
46
|
+
options.version = 4;
|
|
47
|
+
}
|
|
48
|
+
if (typeof options.version_group_id !== 'number') {
|
|
49
|
+
options.version_group_id = 0x892f2085;
|
|
50
|
+
}
|
|
51
|
+
if (typeof options.branch_id !== 'number') {
|
|
52
|
+
options.branch_id = 0x2bb40e60;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (coinInfo.shortcut === 'PPC' || coinInfo.shortcut === 'tPPC') {
|
|
56
|
+
if (typeof options.timestamp !== 'number') {
|
|
57
|
+
options.timestamp = Math.round(new Date().getTime() / 1000);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return options;
|
|
61
|
+
};
|
|
62
|
+
exports.enhanceSignTx = enhanceSignTx;
|
|
63
|
+
//# sourceMappingURL=enhanceSignTx.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './enhanceSignTx';
|
|
2
|
+
export * from './Fees';
|
|
3
|
+
export * from './inputs';
|
|
4
|
+
export * from './outputs';
|
|
5
|
+
export * from './refTx';
|
|
6
|
+
export * from './signtx';
|
|
7
|
+
export * from './signtxLegacy';
|
|
8
|
+
export * from './signtxVerify';
|
|
9
|
+
export * from './TransactionComposer';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./enhanceSignTx"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./Fees"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./inputs"), exports);
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./outputs"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./refTx"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./signtx"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./signtxLegacy"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./signtxVerify"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./TransactionComposer"), exports);
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComposedTxInput } from '@trezor/utxo-lib';
|
|
2
|
+
import type { TypedRawTransaction } from '@trezor/blockchain-link';
|
|
3
|
+
import type { BitcoinNetworkInfo } from '../../types';
|
|
4
|
+
import type { PROTO } from '../../constants';
|
|
5
|
+
export declare const validateTrezorInputs: (inputs: PROTO.TxInputType[], coinInfo: BitcoinNetworkInfo) => PROTO.TxInputType[];
|
|
6
|
+
export declare const enhanceTrezorInputs: (inputs: PROTO.TxInputType[], rawTxs: TypedRawTransaction[]) => void;
|
|
7
|
+
export declare const inputToTrezor: (input: ComposedTxInput, sequence: number) => PROTO.TxInputType;
|
|
8
|
+
//# sourceMappingURL=inputs.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inputToTrezor = exports.enhanceTrezorInputs = exports.validateTrezorInputs = void 0;
|
|
4
|
+
const bufferUtils_1 = require("../../utils/bufferUtils");
|
|
5
|
+
const pathUtils_1 = require("../../utils/pathUtils");
|
|
6
|
+
const hdnodeUtils_1 = require("../../utils/hdnodeUtils");
|
|
7
|
+
const paramsValidator_1 = require("../common/paramsValidator");
|
|
8
|
+
const validateTrezorInputs = (inputs, coinInfo) => inputs
|
|
9
|
+
.map(i => (0, pathUtils_1.fixPath)(i))
|
|
10
|
+
.map(i => (0, hdnodeUtils_1.convertMultisigPubKey)(coinInfo.network, i))
|
|
11
|
+
.map(input => {
|
|
12
|
+
const useAmount = input.script_type === 'EXTERNAL' || (0, pathUtils_1.isSegwitPath)(input.address_n);
|
|
13
|
+
(0, paramsValidator_1.validateParams)(input, [
|
|
14
|
+
{ name: 'prev_hash', type: 'string', required: true },
|
|
15
|
+
{ name: 'prev_index', type: 'number', required: true },
|
|
16
|
+
{ name: 'amount', type: 'uint', required: useAmount },
|
|
17
|
+
{ name: 'script_type', type: 'string' },
|
|
18
|
+
{ name: 'sequence', type: 'number' },
|
|
19
|
+
{ name: 'multisig', type: 'object' },
|
|
20
|
+
]);
|
|
21
|
+
if (input.script_type === 'EXTERNAL') {
|
|
22
|
+
(0, paramsValidator_1.validateParams)(input, [
|
|
23
|
+
{ name: 'script_pubkey', type: 'string', required: true },
|
|
24
|
+
{ name: 'commitment_data', type: 'string' },
|
|
25
|
+
{ name: 'ownership_proof', type: 'string' },
|
|
26
|
+
{ name: 'script_sig', type: 'string' },
|
|
27
|
+
{ name: 'witness', type: 'string' },
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
(0, pathUtils_1.validatePath)(input.address_n);
|
|
32
|
+
}
|
|
33
|
+
return input;
|
|
34
|
+
});
|
|
35
|
+
exports.validateTrezorInputs = validateTrezorInputs;
|
|
36
|
+
const enhanceTrezorInputs = (inputs, rawTxs) => {
|
|
37
|
+
inputs.forEach(input => {
|
|
38
|
+
if (!input.amount) {
|
|
39
|
+
console.warn('TrezorConnect.singTransaction deprecation: missing input amount.');
|
|
40
|
+
const refTx = rawTxs.find(t => 'txid' in t.tx && t.tx.txid === input.prev_hash);
|
|
41
|
+
if (refTx && refTx.type === 'blockbook' && refTx.tx.vout[input.prev_index]) {
|
|
42
|
+
input.amount = refTx.tx.vout[input.prev_index].value;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
exports.enhanceTrezorInputs = enhanceTrezorInputs;
|
|
48
|
+
const inputToTrezor = (input, sequence) => {
|
|
49
|
+
const address_n = input.path;
|
|
50
|
+
return {
|
|
51
|
+
address_n,
|
|
52
|
+
prev_index: input.index,
|
|
53
|
+
prev_hash: (0, bufferUtils_1.reverseBuffer)(input.hash).toString('hex'),
|
|
54
|
+
script_type: (0, pathUtils_1.getScriptType)(address_n),
|
|
55
|
+
amount: input.amount,
|
|
56
|
+
sequence,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
exports.inputToTrezor = inputToTrezor;
|
|
60
|
+
//# sourceMappingURL=inputs.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComposeOutput as UtxoLibOutput, ComposedTxOutput } from '@trezor/utxo-lib';
|
|
2
|
+
import { PROTO } from '../../constants';
|
|
3
|
+
import type { BitcoinNetworkInfo } from '../../types';
|
|
4
|
+
import type { ComposeOutput } from '../../types/api/composeTransaction';
|
|
5
|
+
export declare const validateTrezorOutputs: (outputs: PROTO.TxOutputType[], coinInfo: BitcoinNetworkInfo) => PROTO.TxOutputType[];
|
|
6
|
+
export declare const validateHDOutput: (output: ComposeOutput, coinInfo: BitcoinNetworkInfo) => UtxoLibOutput;
|
|
7
|
+
export declare const outputToTrezor: (output: ComposedTxOutput, _coinInfo: BitcoinNetworkInfo) => PROTO.TxOutputType;
|
|
8
|
+
//# sourceMappingURL=outputs.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.outputToTrezor = exports.validateHDOutput = exports.validateTrezorOutputs = void 0;
|
|
4
|
+
const pathUtils_1 = require("../../utils/pathUtils");
|
|
5
|
+
const addressUtils_1 = require("../../utils/addressUtils");
|
|
6
|
+
const hdnodeUtils_1 = require("../../utils/hdnodeUtils");
|
|
7
|
+
const paramsValidator_1 = require("../common/paramsValidator");
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const validateTrezorOutputs = (outputs, coinInfo) => {
|
|
10
|
+
const trezorOutputs = outputs
|
|
11
|
+
.map(o => (0, pathUtils_1.fixPath)(o))
|
|
12
|
+
.map(o => (0, hdnodeUtils_1.convertMultisigPubKey)(coinInfo.network, o));
|
|
13
|
+
trezorOutputs.forEach(output => {
|
|
14
|
+
(0, paramsValidator_1.validateParams)(output, [
|
|
15
|
+
{ name: 'address_n', type: 'array' },
|
|
16
|
+
{ name: 'address', type: 'string' },
|
|
17
|
+
{ name: 'amount', type: 'uint' },
|
|
18
|
+
{ name: 'op_return_data', type: 'string' },
|
|
19
|
+
{ name: 'multisig', type: 'object' },
|
|
20
|
+
]);
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(output, 'address_n') &&
|
|
22
|
+
Object.prototype.hasOwnProperty.call(output, 'address')) {
|
|
23
|
+
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'Cannot use address and address_n in one output');
|
|
24
|
+
}
|
|
25
|
+
if (output.address_n) {
|
|
26
|
+
const scriptType = (0, pathUtils_1.getOutputScriptType)(output.address_n);
|
|
27
|
+
if (output.script_type !== scriptType)
|
|
28
|
+
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', `Output change script_type should be set to ${scriptType}`);
|
|
29
|
+
}
|
|
30
|
+
if ('address' in output &&
|
|
31
|
+
typeof output.address === 'string' &&
|
|
32
|
+
!(0, addressUtils_1.isValidAddress)(output.address, coinInfo)) {
|
|
33
|
+
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', `Invalid ${coinInfo.label} output address ${output.address}`);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return trezorOutputs;
|
|
37
|
+
};
|
|
38
|
+
exports.validateTrezorOutputs = validateTrezorOutputs;
|
|
39
|
+
const validateHDOutput = (output, coinInfo) => {
|
|
40
|
+
const validateAddress = (address) => {
|
|
41
|
+
if (!address || !(0, addressUtils_1.isValidAddress)(address, coinInfo)) {
|
|
42
|
+
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', `Invalid ${coinInfo.label} output address format`);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
switch (output.type) {
|
|
46
|
+
case 'opreturn':
|
|
47
|
+
(0, paramsValidator_1.validateParams)(output, [{ name: 'dataHex', type: 'string' }]);
|
|
48
|
+
return {
|
|
49
|
+
type: 'opreturn',
|
|
50
|
+
dataHex: output.dataHex || '',
|
|
51
|
+
};
|
|
52
|
+
case 'send-max':
|
|
53
|
+
(0, paramsValidator_1.validateParams)(output, [{ name: 'address', type: 'string', required: true }]);
|
|
54
|
+
validateAddress(output.address);
|
|
55
|
+
return {
|
|
56
|
+
type: 'send-max',
|
|
57
|
+
address: output.address,
|
|
58
|
+
};
|
|
59
|
+
case 'noaddress':
|
|
60
|
+
(0, paramsValidator_1.validateParams)(output, [{ name: 'amount', type: 'uint', required: true }]);
|
|
61
|
+
return {
|
|
62
|
+
type: 'noaddress',
|
|
63
|
+
amount: output.amount,
|
|
64
|
+
};
|
|
65
|
+
case 'send-max-noaddress':
|
|
66
|
+
return {
|
|
67
|
+
type: 'send-max-noaddress',
|
|
68
|
+
};
|
|
69
|
+
default:
|
|
70
|
+
(0, paramsValidator_1.validateParams)(output, [
|
|
71
|
+
{ name: 'amount', type: 'uint', required: true },
|
|
72
|
+
{ name: 'address', type: 'string', required: true },
|
|
73
|
+
]);
|
|
74
|
+
validateAddress(output.address);
|
|
75
|
+
return {
|
|
76
|
+
type: 'complete',
|
|
77
|
+
address: output.address,
|
|
78
|
+
amount: output.amount,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
exports.validateHDOutput = validateHDOutput;
|
|
83
|
+
const outputToTrezor = (output, _coinInfo) => {
|
|
84
|
+
if (output.opReturnData) {
|
|
85
|
+
if (output.value) {
|
|
86
|
+
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'opReturn output should not contains value');
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
amount: '0',
|
|
90
|
+
op_return_data: output.opReturnData.toString('hex'),
|
|
91
|
+
script_type: 'PAYTOOPRETURN',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (!output.address && !output.path) {
|
|
95
|
+
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'Both address and path of an output cannot be null.');
|
|
96
|
+
}
|
|
97
|
+
if (output.path) {
|
|
98
|
+
return {
|
|
99
|
+
address_n: output.path,
|
|
100
|
+
amount: output.value,
|
|
101
|
+
script_type: (0, pathUtils_1.getOutputScriptType)(output.path),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const { address, value } = output;
|
|
105
|
+
if (typeof address !== 'string') {
|
|
106
|
+
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'Wrong output address type, should be string');
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
address,
|
|
110
|
+
amount: value,
|
|
111
|
+
script_type: 'PAYTOADDRESS',
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
exports.outputToTrezor = outputToTrezor;
|
|
115
|
+
//# sourceMappingURL=outputs.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TypedRawTransaction } from '@trezor/blockchain-link';
|
|
2
|
+
import type { CoinInfo, AccountAddresses } from '../../types';
|
|
3
|
+
import type { RefTransaction, TransactionOptions } from '../../types/api/signTransaction';
|
|
4
|
+
import type { PROTO } from '../../constants';
|
|
5
|
+
export declare const requireReferencedTransactions: (inputs: PROTO.TxInputType[], options?: TransactionOptions, coinInfo?: CoinInfo | undefined) => boolean;
|
|
6
|
+
export declare const getReferencedTransactions: (inputs: PROTO.TxInputType[]) => string[];
|
|
7
|
+
export declare const getOrigTransactions: (inputs: PROTO.TxInputType[], outputs: PROTO.TxOutputType[]) => string[];
|
|
8
|
+
export declare const transformOrigTransactions: (txs: TypedRawTransaction[], coinInfo: CoinInfo, addresses?: AccountAddresses | undefined) => RefTransaction[];
|
|
9
|
+
export declare const transformReferencedTransactions: (txs: TypedRawTransaction[], coinInfo: CoinInfo) => RefTransaction[];
|
|
10
|
+
export declare const validateReferencedTransactions: (txs: RefTransaction[] | typeof undefined, inputs: PROTO.TxInputType[], outputs: PROTO.TxOutputType[]) => RefTransaction[] | undefined;
|
|
11
|
+
//# sourceMappingURL=refTx.d.ts.map
|