@trezor/connect 10.0.0-alpha.1 → 10.0.0-beta.2
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/CHANGELOG.md +159 -63
- package/README.md +5 -3
- package/lib/exports.d.ts +1 -0
- package/lib/exports.js +1 -0
- package/lib/impl/core-in-module-native.d.ts +7 -0
- package/lib/impl/core-in-module-native.js +11 -0
- package/lib/impl/core-in-module-node.d.ts +8 -0
- package/lib/impl/core-in-module-node.js +12 -0
- package/lib/impl/core-in-module-web.d.ts +9 -0
- package/lib/impl/core-in-module-web.js +26 -0
- package/lib/index.browser.d.ts +7 -0
- package/lib/index.browser.js +10 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +5 -0
- package/lib/index.native.d.ts +4 -0
- package/lib/index.native.js +5 -0
- package/package.json +30 -83
- package/libESM/api/applyFlags.d.mts +0 -20
- package/libESM/api/applyFlags.mjs +0 -36
- package/libESM/api/applySettings.d.mts +0 -20
- package/libESM/api/applySettings.mjs +0 -55
- package/libESM/api/authenticateDevice.d.mts +0 -9
- package/libESM/api/authenticateDevice.mjs +0 -108
- package/libESM/api/authorizeCoinjoin.d.mts +0 -11
- package/libESM/api/authorizeCoinjoin.mjs +0 -44
- package/libESM/api/backupDevice.d.mts +0 -19
- package/libESM/api/backupDevice.mjs +0 -36
- package/libESM/api/bitcoin/TransactionComposer.d.mts +0 -46
- package/libESM/api/bitcoin/TransactionComposer.mjs +0 -139
- package/libESM/api/bitcoin/createPendingTx.d.mts +0 -33
- package/libESM/api/bitcoin/createPendingTx.mjs +0 -54
- package/libESM/api/bitcoin/enhanceSignTx.d.mts +0 -2
- package/libESM/api/bitcoin/enhanceSignTx.mjs +0 -23
- package/libESM/api/bitcoin/index.d.mts +0 -9
- package/libESM/api/bitcoin/index.mjs +0 -9
- package/libESM/api/bitcoin/inputs.d.mts +0 -6
- package/libESM/api/bitcoin/inputs.mjs +0 -75
- package/libESM/api/bitcoin/outputs.d.mts +0 -5
- package/libESM/api/bitcoin/outputs.mjs +0 -128
- package/libESM/api/bitcoin/refTx.d.mts +0 -17
- package/libESM/api/bitcoin/refTx.mjs +0 -252
- package/libESM/api/bitcoin/signtx.d.mts +0 -22
- package/libESM/api/bitcoin/signtx.mjs +0 -213
- package/libESM/api/bitcoin/signtxLegacy.d.mts +0 -3
- package/libESM/api/bitcoin/signtxLegacy.mjs +0 -179
- package/libESM/api/bitcoin/signtxVerify.d.mts +0 -12
- package/libESM/api/bitcoin/signtxVerify.mjs +0 -86
- package/libESM/api/bitcoin/transactionBytes.d.mts +0 -3
- package/libESM/api/bitcoin/transactionBytes.mjs +0 -65
- package/libESM/api/bleUnpair.d.mts +0 -11
- package/libESM/api/bleUnpair.mjs +0 -35
- package/libESM/api/blockchainDisconnect.d.mts +0 -16
- package/libESM/api/blockchainDisconnect.mjs +0 -39
- package/libESM/api/blockchainEstimateFee.d.mts +0 -14
- package/libESM/api/blockchainEstimateFee.mjs +0 -106
- package/libESM/api/blockchainEvmRpcCall.d.mts +0 -17
- package/libESM/api/blockchainEvmRpcCall.mjs +0 -61
- package/libESM/api/blockchainGetAccountBalanceHistory.d.mts +0 -14
- package/libESM/api/blockchainGetAccountBalanceHistory.mjs +0 -64
- package/libESM/api/blockchainGetContractInfo.d.mts +0 -14
- package/libESM/api/blockchainGetContractInfo.mjs +0 -50
- package/libESM/api/blockchainGetCurrentFiatRates.d.mts +0 -18
- package/libESM/api/blockchainGetCurrentFiatRates.mjs +0 -53
- package/libESM/api/blockchainGetFiatRatesForTimestamps.d.mts +0 -21
- package/libESM/api/blockchainGetFiatRatesForTimestamps.mjs +0 -59
- package/libESM/api/blockchainGetInfo.d.mts +0 -13
- package/libESM/api/blockchainGetInfo.mjs +0 -41
- package/libESM/api/blockchainGetTransactions.d.mts +0 -15
- package/libESM/api/blockchainGetTransactions.mjs +0 -47
- package/libESM/api/blockchainSetCustomBackend.d.mts +0 -13
- package/libESM/api/blockchainSetCustomBackend.mjs +0 -41
- package/libESM/api/blockchainSubscribe.d.mts +0 -17
- package/libESM/api/blockchainSubscribe.mjs +0 -68
- package/libESM/api/blockchainSubscribeFiatRates.d.mts +0 -17
- package/libESM/api/blockchainSubscribeFiatRates.mjs +0 -47
- package/libESM/api/blockchainUnsubscribe.d.mts +0 -17
- package/libESM/api/blockchainUnsubscribe.mjs +0 -68
- package/libESM/api/blockchainUnsubscribeFiatRates.d.mts +0 -15
- package/libESM/api/blockchainUnsubscribeFiatRates.mjs +0 -41
- package/libESM/api/blockchainValidateEvmRpcUrl.d.mts +0 -17
- package/libESM/api/blockchainValidateEvmRpcUrl.mjs +0 -54
- package/libESM/api/cancelCoinjoinAuthorization.d.mts +0 -11
- package/libESM/api/cancelCoinjoinAuthorization.mjs +0 -31
- package/libESM/api/cardano/api/cardanoComposeTransaction.d.mts +0 -10
- package/libESM/api/cardano/api/cardanoComposeTransaction.mjs +0 -79
- package/libESM/api/cardano/api/cardanoGetAddress.d.mts +0 -30
- package/libESM/api/cardano/api/cardanoGetAddress.mjs +0 -116
- package/libESM/api/cardano/api/cardanoGetNativeScriptHash.d.mts +0 -12
- package/libESM/api/cardano/api/cardanoGetNativeScriptHash.mjs +0 -66
- package/libESM/api/cardano/api/cardanoGetPublicKey.d.mts +0 -20
- package/libESM/api/cardano/api/cardanoGetPublicKey.mjs +0 -72
- package/libESM/api/cardano/api/cardanoSignMessage.d.mts +0 -27
- package/libESM/api/cardano/api/cardanoSignMessage.mjs +0 -96
- package/libESM/api/cardano/api/cardanoSignTransaction.d.mts +0 -81
- package/libESM/api/cardano/api/cardanoSignTransaction.mjs +0 -298
- package/libESM/api/cardano/api/index.d.mts +0 -6
- package/libESM/api/cardano/api/index.mjs +0 -6
- package/libESM/api/cardano/cardanoAddressParameters.d.mts +0 -6
- package/libESM/api/cardano/cardanoAddressParameters.mjs +0 -79
- package/libESM/api/cardano/cardanoAuxiliaryData.d.mts +0 -4
- package/libESM/api/cardano/cardanoAuxiliaryData.mjs +0 -74
- package/libESM/api/cardano/cardanoCertificate.d.mts +0 -13
- package/libESM/api/cardano/cardanoCertificate.mjs +0 -142
- package/libESM/api/cardano/cardanoInputs.d.mts +0 -25
- package/libESM/api/cardano/cardanoInputs.mjs +0 -39
- package/libESM/api/cardano/cardanoOutputs.d.mts +0 -40
- package/libESM/api/cardano/cardanoOutputs.mjs +0 -70
- package/libESM/api/cardano/cardanoTokenBundle.d.mts +0 -12
- package/libESM/api/cardano/cardanoTokenBundle.mjs +0 -21
- package/libESM/api/cardano/cardanoUtils.d.mts +0 -9
- package/libESM/api/cardano/cardanoUtils.mjs +0 -101
- package/libESM/api/cardano/cardanoWitnesses.d.mts +0 -4
- package/libESM/api/cardano/cardanoWitnesses.mjs +0 -47
- package/libESM/api/changeLanguage.d.mts +0 -18
- package/libESM/api/changeLanguage.mjs +0 -47
- package/libESM/api/changePin.d.mts +0 -11
- package/libESM/api/changePin.mjs +0 -25
- package/libESM/api/changeWipeCode.d.mts +0 -11
- package/libESM/api/changeWipeCode.mjs +0 -27
- package/libESM/api/cipherKeyValue.d.mts +0 -15
- package/libESM/api/cipherKeyValue.mjs +0 -51
- package/libESM/api/common/AbstractMiscGetAddress.d.mts +0 -35
- package/libESM/api/common/AbstractMiscGetAddress.mjs +0 -102
- package/libESM/api/common/Discovery.d.mts +0 -33
- package/libESM/api/common/Discovery.mjs +0 -116
- package/libESM/api/common/paramsValidator.d.mts +0 -23
- package/libESM/api/common/paramsValidator.mjs +0 -134
- package/libESM/api/common/requestExistingAccounts.d.mts +0 -9
- package/libESM/api/common/requestExistingAccounts.mjs +0 -20
- package/libESM/api/composeTransaction.d.mts +0 -36
- package/libESM/api/composeTransaction.mjs +0 -386
- package/libESM/api/discoverAccounts.d.mts +0 -38
- package/libESM/api/discoverAccounts.mjs +0 -363
- package/libESM/api/ethereum/api/ethereumGetAddress.d.mts +0 -28
- package/libESM/api/ethereum/api/ethereumGetAddress.mjs +0 -135
- package/libESM/api/ethereum/api/ethereumGetPublicKey.d.mts +0 -48
- package/libESM/api/ethereum/api/ethereumGetPublicKey.mjs +0 -90
- package/libESM/api/ethereum/api/ethereumSignMessage.d.mts +0 -27
- package/libESM/api/ethereum/api/ethereumSignMessage.mjs +0 -64
- package/libESM/api/ethereum/api/ethereumSignTransaction.d.mts +0 -83
- package/libESM/api/ethereum/api/ethereumSignTransaction.mjs +0 -148
- package/libESM/api/ethereum/api/ethereumSignTypedData.d.mts +0 -116
- package/libESM/api/ethereum/api/ethereumSignTypedData.mjs +0 -202
- package/libESM/api/ethereum/api/ethereumVerifyMessage.d.mts +0 -12
- package/libESM/api/ethereum/api/ethereumVerifyMessage.mjs +0 -33
- package/libESM/api/ethereum/api/index.d.mts +0 -6
- package/libESM/api/ethereum/api/index.mjs +0 -6
- package/libESM/api/ethereum/ethereumDefinitions.d.mts +0 -46
- package/libESM/api/ethereum/ethereumDefinitions.mjs +0 -103
- package/libESM/api/ethereum/ethereumSignTx.d.mts +0 -20
- package/libESM/api/ethereum/ethereumSignTx.mjs +0 -131
- package/libESM/api/ethereum/ethereumSignTypedData.d.mts +0 -32
- package/libESM/api/ethereum/ethereumSignTypedData.mjs +0 -169
- package/libESM/api/evoluGetDelegatedIdentityKey.d.mts +0 -14
- package/libESM/api/evoluGetDelegatedIdentityKey.mjs +0 -26
- package/libESM/api/evoluGetNode.d.mts +0 -13
- package/libESM/api/evoluGetNode.mjs +0 -27
- package/libESM/api/evoluSignRegistrationRequest.d.mts +0 -15
- package/libESM/api/evoluSignRegistrationRequest.mjs +0 -31
- package/libESM/api/firmware/calculateFirmwareHash.d.mts +0 -13
- package/libESM/api/firmware/calculateFirmwareHash.mjs +0 -56
- package/libESM/api/firmware/calculateXPubHash.d.mts +0 -10
- package/libESM/api/firmware/calculateXPubHash.mjs +0 -14
- package/libESM/api/firmware/getBinary.d.mts +0 -10
- package/libESM/api/firmware/getBinary.mjs +0 -33
- package/libESM/api/firmware/index.d.mts +0 -6
- package/libESM/api/firmware/index.mjs +0 -6
- package/libESM/api/firmware/modifyFirmware.d.mts +0 -3
- package/libESM/api/firmware/modifyFirmware.mjs +0 -13
- package/libESM/api/firmware/parseFirmwareHeaders.d.mts +0 -4
- package/libESM/api/firmware/parseFirmwareHeaders.mjs +0 -26
- package/libESM/api/firmware/uploadFirmware.d.mts +0 -19
- package/libESM/api/firmware/uploadFirmware.mjs +0 -99
- package/libESM/api/firmware/verifyEntropy.d.mts +0 -18
- package/libESM/api/firmware/verifyEntropy.mjs +0 -107
- package/libESM/api/getAccountInfo.d.mts +0 -94
- package/libESM/api/getAccountInfo.mjs +0 -385
- package/libESM/api/getAddress.d.mts +0 -39
- package/libESM/api/getAddress.mjs +0 -142
- package/libESM/api/getCoinInfo.d.mts +0 -148
- package/libESM/api/getCoinInfo.mjs +0 -29
- package/libESM/api/getDeviceState.d.mts +0 -8
- package/libESM/api/getDeviceState.mjs +0 -16
- package/libESM/api/getFeatures.d.mts +0 -70
- package/libESM/api/getFeatures.mjs +0 -20
- package/libESM/api/getFirmwareHash.d.mts +0 -11
- package/libESM/api/getFirmwareHash.mjs +0 -27
- package/libESM/api/getNonce.d.mts +0 -10
- package/libESM/api/getNonce.mjs +0 -16
- package/libESM/api/getOwnershipId.d.mts +0 -15
- package/libESM/api/getOwnershipId.mjs +0 -79
- package/libESM/api/getOwnershipProof.d.mts +0 -15
- package/libESM/api/getOwnershipProof.mjs +0 -86
- package/libESM/api/getPublicKey.d.mts +0 -50
- package/libESM/api/getPublicKey.mjs +0 -88
- package/libESM/api/getSettings.d.mts +0 -8
- package/libESM/api/getSettings.mjs +0 -15
- package/libESM/api/index.d.mts +0 -59
- package/libESM/api/index.mjs +0 -59
- package/libESM/api/loadDevice.d.mts +0 -16
- package/libESM/api/loadDevice.mjs +0 -44
- package/libESM/api/monero/api/index.d.mts +0 -4
- package/libESM/api/monero/api/index.mjs +0 -4
- package/libESM/api/monero/api/moneroGetAddress.d.mts +0 -30
- package/libESM/api/monero/api/moneroGetAddress.mjs +0 -109
- package/libESM/api/monero/api/moneroGetWatchKey.d.mts +0 -14
- package/libESM/api/monero/api/moneroGetWatchKey.mjs +0 -44
- package/libESM/api/monero/api/moneroKeyImageSync.d.mts +0 -17
- package/libESM/api/monero/api/moneroKeyImageSync.mjs +0 -127
- package/libESM/api/monero/api/moneroSignTransaction.d.mts +0 -17
- package/libESM/api/monero/api/moneroSignTransaction.mjs +0 -202
- package/libESM/api/pingDevice.d.mts +0 -11
- package/libESM/api/pingDevice.mjs +0 -27
- package/libESM/api/pushTransaction.d.mts +0 -17
- package/libESM/api/pushTransaction.mjs +0 -42
- package/libESM/api/recoveryDevice.d.mts +0 -20
- package/libESM/api/recoveryDevice.mjs +0 -50
- package/libESM/api/requestLogin.d.mts +0 -14
- package/libESM/api/requestLogin.mjs +0 -48
- package/libESM/api/resetDevice.d.mts +0 -22
- package/libESM/api/resetDevice.mjs +0 -131
- package/libESM/api/ripple/api/index.d.mts +0 -2
- package/libESM/api/ripple/api/index.mjs +0 -2
- package/libESM/api/ripple/api/rippleGetAddress.d.mts +0 -15
- package/libESM/api/ripple/api/rippleGetAddress.mjs +0 -22
- package/libESM/api/ripple/api/rippleSignTransaction.d.mts +0 -13
- package/libESM/api/ripple/api/rippleSignTransaction.mjs +0 -52
- package/libESM/api/setBrightness.d.mts +0 -12
- package/libESM/api/setBrightness.mjs +0 -26
- package/libESM/api/setBusy.d.mts +0 -11
- package/libESM/api/setBusy.mjs +0 -32
- package/libESM/api/showDeviceTutorial.d.mts +0 -11
- package/libESM/api/showDeviceTutorial.mjs +0 -21
- package/libESM/api/signMessage.d.mts +0 -25
- package/libESM/api/signMessage.mjs +0 -71
- package/libESM/api/signTransaction.d.mts +0 -197
- package/libESM/api/signTransaction.mjs +0 -334
- package/libESM/api/solana/api/index.d.mts +0 -4
- package/libESM/api/solana/api/index.mjs +0 -4
- package/libESM/api/solana/api/solanaComposeTransaction.d.mts +0 -31
- package/libESM/api/solana/api/solanaComposeTransaction.mjs +0 -76
- package/libESM/api/solana/api/solanaGetAddress.d.mts +0 -15
- package/libESM/api/solana/api/solanaGetAddress.mjs +0 -22
- package/libESM/api/solana/api/solanaGetPublicKey.d.mts +0 -28
- package/libESM/api/solana/api/solanaGetPublicKey.mjs +0 -67
- package/libESM/api/solana/api/solanaSignTransaction.d.mts +0 -41
- package/libESM/api/solana/api/solanaSignTransaction.mjs +0 -203
- package/libESM/api/solana/solanaDefinitions.d.mts +0 -7
- package/libESM/api/solana/solanaDefinitions.mjs +0 -33
- package/libESM/api/stellar/api/index.d.mts +0 -2
- package/libESM/api/stellar/api/index.mjs +0 -2
- package/libESM/api/stellar/api/stellarGetAddress.d.mts +0 -15
- package/libESM/api/stellar/api/stellarGetAddress.mjs +0 -22
- package/libESM/api/stellar/api/stellarSignTransaction.d.mts +0 -26
- package/libESM/api/stellar/api/stellarSignTransaction.mjs +0 -66
- package/libESM/api/stellar/stellarSignTx.d.mts +0 -7
- package/libESM/api/stellar/stellarSignTx.mjs +0 -191
- package/libESM/api/telemetryGet.d.mts +0 -14
- package/libESM/api/telemetryGet.mjs +0 -24
- package/libESM/api/tezos/api/index.d.mts +0 -3
- package/libESM/api/tezos/api/index.mjs +0 -3
- package/libESM/api/tezos/api/tezosGetAddress.d.mts +0 -15
- package/libESM/api/tezos/api/tezosGetAddress.mjs +0 -22
- package/libESM/api/tezos/api/tezosGetPublicKey.d.mts +0 -24
- package/libESM/api/tezos/api/tezosGetPublicKey.mjs +0 -66
- package/libESM/api/tezos/api/tezosSignTransaction.d.mts +0 -14
- package/libESM/api/tezos/api/tezosSignTransaction.mjs +0 -30
- package/libESM/api/tezos/tezosSignTx.d.mts +0 -71
- package/libESM/api/tezos/tezosSignTx.mjs +0 -204
- package/libESM/api/thpGetCredentials.d.mts +0 -13
- package/libESM/api/thpGetCredentials.mjs +0 -28
- package/libESM/api/thpRemoveCredentials.d.mts +0 -15
- package/libESM/api/thpRemoveCredentials.mjs +0 -42
- package/libESM/api/tron/api/index.d.mts +0 -3
- package/libESM/api/tron/api/index.mjs +0 -3
- package/libESM/api/tron/api/tronComposeTransaction.d.mts +0 -17
- package/libESM/api/tron/api/tronComposeTransaction.mjs +0 -51
- package/libESM/api/tron/api/tronGetAddress.d.mts +0 -15
- package/libESM/api/tron/api/tronGetAddress.mjs +0 -20
- package/libESM/api/tron/api/tronSignTransaction.d.mts +0 -19
- package/libESM/api/tron/api/tronSignTransaction.mjs +0 -129
- package/libESM/api/tron/tronEncode.d.mts +0 -12
- package/libESM/api/tron/tronEncode.mjs +0 -77
- package/libESM/api/tron/tronProtobuf.d.mts +0 -5
- package/libESM/api/tron/tronProtobuf.mjs +0 -28
- package/libESM/api/unlockPath.d.mts +0 -12
- package/libESM/api/unlockPath.mjs +0 -31
- package/libESM/api/verifyMessage.d.mts +0 -16
- package/libESM/api/verifyMessage.mjs +0 -46
- package/libESM/api/wipeDevice.d.mts +0 -21
- package/libESM/api/wipeDevice.mjs +0 -47
- package/libESM/backend/BackendManager.d.mts +0 -24
- package/libESM/backend/BackendManager.mjs +0 -137
- package/libESM/backend/Blockchain.d.mts +0 -81
- package/libESM/backend/Blockchain.mjs +0 -232
- package/libESM/backend/BlockchainLink.d.mts +0 -9
- package/libESM/backend/BlockchainLink.mjs +0 -13
- package/libESM/backend/fees/BitcoinFeeLevels.d.mts +0 -19
- package/libESM/backend/fees/BitcoinFeeLevels.mjs +0 -43
- package/libESM/backend/fees/EthereumFeeLevels.d.mts +0 -17
- package/libESM/backend/fees/EthereumFeeLevels.mjs +0 -52
- package/libESM/backend/fees/MiscFeeLevels.d.mts +0 -18
- package/libESM/backend/fees/MiscFeeLevels.mjs +0 -25
- package/libESM/backend/fees/index.d.mts +0 -5
- package/libESM/backend/fees/index.mjs +0 -30
- package/libESM/core/AbstractMethod.d.mts +0 -65
- package/libESM/core/AbstractMethod.mjs +0 -153
- package/libESM/core/index.d.mts +0 -27
- package/libESM/core/index.mjs +0 -795
- package/libESM/core/method.d.mts +0 -3
- package/libESM/core/method.mjs +0 -19
- package/libESM/core/method.native.d.mts +0 -2
- package/libESM/core/method.native.mjs +0 -29
- package/libESM/core/onCallFirmwareUpdate.d.mts +0 -39
- package/libESM/core/onCallFirmwareUpdate.mjs +0 -436
- package/libESM/data/coinInfo.d.mts +0 -374
- package/libESM/data/coinInfo.mjs +0 -183
- package/libESM/data/config.d.mts +0 -8
- package/libESM/data/config.mjs +0 -265
- package/libESM/data/defaultFeeLevels.d.mts +0 -18
- package/libESM/data/defaultFeeLevels.mjs +0 -174
- package/libESM/data/firmwareInfo.d.mts +0 -41
- package/libESM/data/firmwareInfo.mjs +0 -411
- package/libESM/data/firmwareReleaseStore.d.mts +0 -10
- package/libESM/data/firmwareReleaseStore.mjs +0 -16
- package/libESM/data/localFirmwareStore.d.mts +0 -3
- package/libESM/data/localFirmwareStore.mjs +0 -8
- package/libESM/data/protobufLoader.d.mts +0 -1
- package/libESM/data/protobufLoader.mjs +0 -29
- package/libESM/data/settingsStore.d.mts +0 -6
- package/libESM/data/settingsStore.mjs +0 -21
- package/libESM/device/Device.d.mts +0 -237
- package/libESM/device/Device.mjs +0 -729
- package/libESM/device/DeviceCommands.d.mts +0 -77
- package/libESM/device/DeviceCommands.mjs +0 -245
- package/libESM/device/DeviceCurrentSession.d.mts +0 -3208
- package/libESM/device/DeviceCurrentSession.mjs +0 -240
- package/libESM/device/DeviceList.d.mts +0 -68
- package/libESM/device/DeviceList.mjs +0 -246
- package/libESM/device/TransportList.d.mts +0 -9
- package/libESM/device/TransportList.mjs +0 -41
- package/libESM/device/TransportManager.d.mts +0 -30
- package/libESM/device/TransportManager.mjs +0 -142
- package/libESM/device/calculateRevisionForDevice.d.mts +0 -7
- package/libESM/device/calculateRevisionForDevice.mjs +0 -19
- package/libESM/device/checkFirmwareRevision.d.mts +0 -12
- package/libESM/device/checkFirmwareRevision.mjs +0 -75
- package/libESM/device/resolveDescriptorForTaproot.d.mts +0 -14
- package/libESM/device/resolveDescriptorForTaproot.mjs +0 -25
- package/libESM/device/thp/handshake.d.mts +0 -3
- package/libESM/device/thp/handshake.mjs +0 -100
- package/libESM/device/thp/index.d.mts +0 -5
- package/libESM/device/thp/index.mjs +0 -65
- package/libESM/device/thp/pairing.d.mts +0 -16
- package/libESM/device/thp/pairing.mjs +0 -237
- package/libESM/device/thp/session.d.mts +0 -2
- package/libESM/device/thp/session.mjs +0 -27
- package/libESM/device/thp/thpCall.d.mts +0 -40
- package/libESM/device/thp/thpCall.mjs +0 -58
- package/libESM/device/validateMessageSize.d.mts +0 -2
- package/libESM/device/validateMessageSize.mjs +0 -9
- package/libESM/device/workflow/changeLanguage.d.mts +0 -14
- package/libESM/device/workflow/changeLanguage.mjs +0 -59
- package/libESM/device/workflow/checkFirmwareHash.d.mts +0 -9
- package/libESM/device/workflow/checkFirmwareHash.mjs +0 -86
- package/libESM/device/workflow/checkFirmwareHashWithRetries.d.mts +0 -8
- package/libESM/device/workflow/checkFirmwareHashWithRetries.mjs +0 -36
- package/libESM/device/workflow/handshake.d.mts +0 -9
- package/libESM/device/workflow/handshake.mjs +0 -55
- package/libESM/device/workflow/trezorPushNotification.d.mts +0 -2
- package/libESM/device/workflow/trezorPushNotification.mjs +0 -73
- package/libESM/device/workflow/validateState.d.mts +0 -2
- package/libESM/device/workflow/validateState.mjs +0 -153
- package/libESM/events/ui-promise.d.mts +0 -22
- package/libESM/events/ui-promise.mjs +0 -1
- package/libESM/exports.d.mts +0 -3
- package/libESM/exports.mjs +0 -3
- package/libESM/impl/core-in-module.d.mts +0 -27
- package/libESM/impl/core-in-module.mjs +0 -173
- package/libESM/index.browser.d.mts +0 -9
- package/libESM/index.browser.mjs +0 -50
- package/libESM/index.d.mts +0 -6
- package/libESM/index.mjs +0 -32
- package/libESM/index.renderer.d.mts +0 -6
- package/libESM/index.renderer.mjs +0 -19
- package/libESM/tsconfig.libESM.tsbuildinfo +0 -1
- package/libESM/types/idevice.d.mts +0 -109
- package/libESM/types/idevice.mjs +0 -1
- package/libESM/types/typed-call-provider.d.mts +0 -29
- package/libESM/types/typed-call-provider.mjs +0 -1
- package/libESM/types/workflow.d.mts +0 -16
- package/libESM/types/workflow.mjs +0 -1
- package/libESM/utils/accountUtils.d.mts +0 -10
- package/libESM/utils/accountUtils.mjs +0 -83
- package/libESM/utils/addressUtils.d.mts +0 -2
- package/libESM/utils/addressUtils.mjs +0 -24
- package/libESM/utils/assetUtils.d.mts +0 -13
- package/libESM/utils/assetUtils.mjs +0 -56
- package/libESM/utils/assets.browser.d.mts +0 -1
- package/libESM/utils/assets.browser.mjs +0 -1
- package/libESM/utils/assets.d.mts +0 -2
- package/libESM/utils/assets.mjs +0 -13
- package/libESM/utils/assets.native.d.mts +0 -2
- package/libESM/utils/assets.native.mjs +0 -23
- package/libESM/utils/assetsTypes.d.mts +0 -5
- package/libESM/utils/assetsTypes.mjs +0 -1
- package/libESM/utils/buildOutputDescriptor.d.mts +0 -12
- package/libESM/utils/buildOutputDescriptor.mjs +0 -67
- package/libESM/utils/deviceFeaturesUtils.d.mts +0 -7
- package/libESM/utils/deviceFeaturesUtils.mjs +0 -109
- package/libESM/utils/ethereumUtils.d.mts +0 -3
- package/libESM/utils/ethereumUtils.mjs +0 -7
- package/libESM/utils/firmwareReleaseConfigUtils.d.mts +0 -19
- package/libESM/utils/firmwareReleaseConfigUtils.mjs +0 -131
- package/libESM/utils/firmwareUtils.d.mts +0 -13
- package/libESM/utils/firmwareUtils.mjs +0 -54
- package/libESM/utils/formatUtils.d.mts +0 -15
- package/libESM/utils/formatUtils.mjs +0 -45
- package/libESM/utils/hdnodeUtils.d.mts +0 -6
- package/libESM/utils/hdnodeUtils.mjs +0 -62
- package/libESM/utils/pathUtils.d.mts +0 -17
- package/libESM/utils/pathUtils.mjs +0 -141
- package/libESM/utils/paymentRequest.d.mts +0 -8
- package/libESM/utils/paymentRequest.mjs +0 -25
- package/libESM/utils/uiPromiseManager.d.mts +0 -8
- package/libESM/utils/uiPromiseManager.mjs +0 -51
- package/libESM/workers/workers.browser.d.mts +0 -10
- package/libESM/workers/workers.browser.mjs +0 -16
- package/libESM/workers/workers.d.mts +0 -10
- package/libESM/workers/workers.mjs +0 -8
- package/libESM/workers/workers.native.d.mts +0 -7
- package/libESM/workers/workers.native.mjs +0 -7
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import { MessagesSchema as PROTO } from '@trezor/protobuf';
|
|
3
|
-
import type { MethodMessage } from '../core/AbstractMethod';
|
|
4
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
5
|
-
export default class ApplyFlags extends AbstractMethod<'applyFlags', PROTO.ApplyFlags> {
|
|
6
|
-
constructor(message: MethodMessage<'applyFlags'>);
|
|
7
|
-
get requiredPermissions(): MethodPermission[];
|
|
8
|
-
init(): void;
|
|
9
|
-
get confirmation(): {
|
|
10
|
-
view: "device-management";
|
|
11
|
-
customConfirmButton: {
|
|
12
|
-
className: string;
|
|
13
|
-
label: string;
|
|
14
|
-
};
|
|
15
|
-
label: string;
|
|
16
|
-
};
|
|
17
|
-
run(): Promise<{
|
|
18
|
-
message: string;
|
|
19
|
-
}>;
|
|
20
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { MessagesSchema as PROTO } from "@trezor/protobuf";
|
|
2
|
-
import { Assert } from "@trezor/schema-utils";
|
|
3
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
4
|
-
export default class ApplyFlags extends AbstractMethod {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
const {
|
|
7
|
-
payload
|
|
8
|
-
} = message;
|
|
9
|
-
Assert(PROTO.ApplyFlags, payload);
|
|
10
|
-
const params = {
|
|
11
|
-
flags: payload.flags
|
|
12
|
-
};
|
|
13
|
-
super(message, params);
|
|
14
|
-
this.useDeviceState = false;
|
|
15
|
-
this.skipFinalReload = false;
|
|
16
|
-
}
|
|
17
|
-
get requiredPermissions() {
|
|
18
|
-
return ['management'];
|
|
19
|
-
}
|
|
20
|
-
init() {}
|
|
21
|
-
get confirmation() {
|
|
22
|
-
return {
|
|
23
|
-
view: 'device-management',
|
|
24
|
-
customConfirmButton: {
|
|
25
|
-
className: 'confirm',
|
|
26
|
-
label: 'Proceed'
|
|
27
|
-
},
|
|
28
|
-
label: 'Do you really want to apply flags?'
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
async run() {
|
|
32
|
-
const cmd = this.getDevice().getCommands();
|
|
33
|
-
const response = await cmd.typedCall('ApplyFlags', 'Success', this.params);
|
|
34
|
-
return response.message;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import type { MessagesSchema as PROTO } from '@trezor/protobuf';
|
|
3
|
-
import type { MethodMessage } from '../core/AbstractMethod';
|
|
4
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
5
|
-
export default class ApplySettings extends AbstractMethod<'applySettings', PROTO.ApplySettings> {
|
|
6
|
-
constructor(message: MethodMessage<'applySettings'>);
|
|
7
|
-
get requiredPermissions(): MethodPermission[];
|
|
8
|
-
init(): void;
|
|
9
|
-
get confirmation(): {
|
|
10
|
-
view: "device-management";
|
|
11
|
-
customConfirmButton: {
|
|
12
|
-
className: string;
|
|
13
|
-
label: string;
|
|
14
|
-
};
|
|
15
|
-
label: string;
|
|
16
|
-
};
|
|
17
|
-
run(): Promise<{
|
|
18
|
-
message: string;
|
|
19
|
-
}>;
|
|
20
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { ApplySettings as ApplySettingsSchema } from "@trezor/connect-common";
|
|
2
|
-
import { Assert } from "@trezor/schema-utils";
|
|
3
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
4
|
-
export default class ApplySettings extends AbstractMethod {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
const {
|
|
7
|
-
payload
|
|
8
|
-
} = message;
|
|
9
|
-
Assert(ApplySettingsSchema, payload);
|
|
10
|
-
const params = {
|
|
11
|
-
...payload,
|
|
12
|
-
_passphrase_source: payload.passphrase_source
|
|
13
|
-
};
|
|
14
|
-
super(message, params);
|
|
15
|
-
this.useDeviceState = false;
|
|
16
|
-
this.skipFinalReload = false;
|
|
17
|
-
}
|
|
18
|
-
get requiredPermissions() {
|
|
19
|
-
return ['management'];
|
|
20
|
-
}
|
|
21
|
-
init() {}
|
|
22
|
-
get confirmation() {
|
|
23
|
-
return {
|
|
24
|
-
view: 'device-management',
|
|
25
|
-
customConfirmButton: {
|
|
26
|
-
className: 'confirm',
|
|
27
|
-
label: 'Proceed'
|
|
28
|
-
},
|
|
29
|
-
label: 'Do you really want to change device settings?'
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
async run() {
|
|
33
|
-
const device = this.getDevice();
|
|
34
|
-
const cmd = device.getCommands();
|
|
35
|
-
const homescreenBytes = this.params.homescreen ? Buffer.from(this.params.homescreen, 'hex') : undefined;
|
|
36
|
-
if (device.atLeast('2.9.0') && homescreenBytes) {
|
|
37
|
-
this.params.homescreen = undefined;
|
|
38
|
-
this.params.homescreen_length = homescreenBytes.length;
|
|
39
|
-
}
|
|
40
|
-
if (homescreenBytes !== undefined) {
|
|
41
|
-
device.startPiggybackAck();
|
|
42
|
-
}
|
|
43
|
-
let response = await cmd.typedCall('ApplySettings', ['DataChunkRequest', 'Success'], this.params);
|
|
44
|
-
while (response.type !== 'Success') {
|
|
45
|
-
const start = response.message.data_offset;
|
|
46
|
-
const end = start + response.message.data_length;
|
|
47
|
-
const data_chunk = homescreenBytes?.subarray(start, end).toString('hex') || '';
|
|
48
|
-
response = await cmd.typedCall('DataChunkAck', ['DataChunkRequest', 'Success'], {
|
|
49
|
-
data_chunk
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
await device.stopPiggybackAck();
|
|
53
|
-
return response.message;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import { AuthenticateDeviceParams } from '@trezor/device-authenticity';
|
|
3
|
-
import type { MethodMessage } from '../core/AbstractMethod';
|
|
4
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
5
|
-
export default class AuthenticateDevice extends AbstractMethod<'authenticateDevice', AuthenticateDeviceParams> {
|
|
6
|
-
constructor(message: MethodMessage<'authenticateDevice'>);
|
|
7
|
-
get requiredPermissions(): MethodPermission[];
|
|
8
|
-
run(): Promise<import("@trezor/device-authenticity/libESM/types").ResultsToValidate>;
|
|
9
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { UI_REQUEST } from "@trezor/connect-common";
|
|
2
|
-
import { AuthenticateDeviceParams, deviceAuthenticityBlacklistConfig, deviceAuthenticityConfig, getRandomChallenge, prepareDeviceAuthenticityData, validateSerialNumbers, verifyAuthenticityProof } from "@trezor/device-authenticity";
|
|
3
|
-
import { Assert } from "@trezor/schema-utils";
|
|
4
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
5
|
-
export default class AuthenticateDevice extends AbstractMethod {
|
|
6
|
-
constructor(message) {
|
|
7
|
-
const {
|
|
8
|
-
payload
|
|
9
|
-
} = message;
|
|
10
|
-
Assert(AuthenticateDeviceParams, payload);
|
|
11
|
-
const params = {
|
|
12
|
-
config: payload.config,
|
|
13
|
-
blacklistConfig: payload.blacklistConfig,
|
|
14
|
-
allowDebugKeys: payload.allowDebugKeys
|
|
15
|
-
};
|
|
16
|
-
super(message, params);
|
|
17
|
-
this.useEmptyPassphrase = true;
|
|
18
|
-
this.allowDeviceMode = [UI_REQUEST.INITIALIZE, UI_REQUEST.SEEDLESS];
|
|
19
|
-
this.skipFinalReload = false;
|
|
20
|
-
this.useDeviceState = false;
|
|
21
|
-
}
|
|
22
|
-
get requiredPermissions() {
|
|
23
|
-
return ['management'];
|
|
24
|
-
}
|
|
25
|
-
async run() {
|
|
26
|
-
const challenge = getRandomChallenge();
|
|
27
|
-
const {
|
|
28
|
-
message
|
|
29
|
-
} = await this.getDevice().getCommands().typedCall('AuthenticateDevice', 'AuthenticityProof', {
|
|
30
|
-
challenge: challenge.toString('hex')
|
|
31
|
-
});
|
|
32
|
-
const config = this.params.config || deviceAuthenticityConfig;
|
|
33
|
-
const blacklistConfig = this.params.blacklistConfig || deviceAuthenticityBlacklistConfig;
|
|
34
|
-
const commonParams = {
|
|
35
|
-
signedData: prepareDeviceAuthenticityData({
|
|
36
|
-
payload: challenge
|
|
37
|
-
}),
|
|
38
|
-
deviceModel: this.getDevice().features.internal_model,
|
|
39
|
-
allowDebugKeys: this.params.allowDebugKeys,
|
|
40
|
-
config,
|
|
41
|
-
blacklistConfig
|
|
42
|
-
};
|
|
43
|
-
const getOptigaResult = async () => {
|
|
44
|
-
const {
|
|
45
|
-
optiga_signature: signature,
|
|
46
|
-
optiga_certificates: certificates
|
|
47
|
-
} = message;
|
|
48
|
-
const isAvailable = signature !== undefined && certificates.length > 0;
|
|
49
|
-
if (isAvailable) {
|
|
50
|
-
return await verifyAuthenticityProof({
|
|
51
|
-
...commonParams,
|
|
52
|
-
certificates,
|
|
53
|
-
signature
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
valid: false,
|
|
58
|
-
error: 'RESPONSE_PAYLOAD_MISSING'
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
const hasTropicAbility = !this.getDevice().unavailableCapabilities['tropicDeviceAuthentication'];
|
|
62
|
-
const getTropicResult = async () => {
|
|
63
|
-
const {
|
|
64
|
-
tropic_signature: signature,
|
|
65
|
-
tropic_certificates: certificates
|
|
66
|
-
} = message;
|
|
67
|
-
const isAvailable = signature !== undefined && certificates.length > 0;
|
|
68
|
-
const isRequired = hasTropicAbility;
|
|
69
|
-
if (isAvailable) {
|
|
70
|
-
return await verifyAuthenticityProof({
|
|
71
|
-
...commonParams,
|
|
72
|
-
certificates,
|
|
73
|
-
signature
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return isRequired ? {
|
|
77
|
-
valid: false,
|
|
78
|
-
error: 'RESPONSE_PAYLOAD_MISSING'
|
|
79
|
-
} : null;
|
|
80
|
-
};
|
|
81
|
-
const getMCUResult = async () => {
|
|
82
|
-
const {
|
|
83
|
-
mcu_signature: signature,
|
|
84
|
-
mcu_certificates: certificates
|
|
85
|
-
} = message;
|
|
86
|
-
const isAvailable = signature !== undefined && certificates.length > 0;
|
|
87
|
-
const isRequired = !this.getDevice().unavailableCapabilities['mcuDeviceAuthentication'];
|
|
88
|
-
if (isAvailable) {
|
|
89
|
-
return await verifyAuthenticityProof({
|
|
90
|
-
...commonParams,
|
|
91
|
-
certificates,
|
|
92
|
-
signature
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
return isRequired ? {
|
|
96
|
-
valid: false,
|
|
97
|
-
error: 'RESPONSE_PAYLOAD_MISSING'
|
|
98
|
-
} : null;
|
|
99
|
-
};
|
|
100
|
-
const [optigaResult, tropicResult, mcuResult] = await Promise.all([getOptigaResult(), getTropicResult(), getMCUResult()]);
|
|
101
|
-
const results = {
|
|
102
|
-
optigaResult,
|
|
103
|
-
tropicResult,
|
|
104
|
-
mcuResult
|
|
105
|
-
};
|
|
106
|
-
return hasTropicAbility ? validateSerialNumbers(results) : results;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import type { MessagesSchema as PROTO } from '@trezor/protobuf';
|
|
3
|
-
import type { MethodMessage } from '../core/AbstractMethod';
|
|
4
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
5
|
-
export default class AuthorizeCoinjoin extends AbstractMethod<'authorizeCoinjoin', PROTO.AuthorizeCoinJoin> {
|
|
6
|
-
constructor(message: MethodMessage<'authorizeCoinjoin'>);
|
|
7
|
-
get requiredPermissions(): MethodPermission[];
|
|
8
|
-
run(): Promise<{
|
|
9
|
-
message: string;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { AuthorizeCoinjoin as AuthorizeCoinjoinSchema } from "@trezor/connect-common";
|
|
2
|
-
import { Assert } from "@trezor/schema-utils";
|
|
3
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
4
|
-
import { getBitcoinNetwork } from "../data/coinInfo.mjs";
|
|
5
|
-
import { getScriptType, validatePath } from "../utils/pathUtils.mjs";
|
|
6
|
-
export default class AuthorizeCoinjoin extends AbstractMethod {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
const {
|
|
9
|
-
payload
|
|
10
|
-
} = message;
|
|
11
|
-
Assert(AuthorizeCoinjoinSchema, payload);
|
|
12
|
-
const address_n = validatePath(payload.path, 3);
|
|
13
|
-
const script_type = payload.scriptType || getScriptType(address_n);
|
|
14
|
-
const coinInfo = getBitcoinNetwork(payload.coin || address_n);
|
|
15
|
-
const params = {
|
|
16
|
-
coordinator: payload.coordinator,
|
|
17
|
-
max_rounds: payload.maxRounds,
|
|
18
|
-
max_coordinator_fee_rate: payload.maxCoordinatorFeeRate,
|
|
19
|
-
max_fee_per_kvbyte: payload.maxFeePerKvbyte,
|
|
20
|
-
address_n,
|
|
21
|
-
coin_name: coinInfo?.name,
|
|
22
|
-
script_type,
|
|
23
|
-
amount_unit: payload.amountUnit
|
|
24
|
-
};
|
|
25
|
-
super(message, params);
|
|
26
|
-
this.requiredFirmwareCoins = [coinInfo];
|
|
27
|
-
this.preauthorized = payload.preauthorized;
|
|
28
|
-
}
|
|
29
|
-
get requiredPermissions() {
|
|
30
|
-
return ['management'];
|
|
31
|
-
}
|
|
32
|
-
async run() {
|
|
33
|
-
const cmd = this.getDevice().getCommands();
|
|
34
|
-
if (this.preauthorized) {
|
|
35
|
-
if (await cmd.preauthorize(false)) {
|
|
36
|
-
return {
|
|
37
|
-
message: 'Success'
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const response = await cmd.typedCall('AuthorizeCoinJoin', 'Success', this.params);
|
|
42
|
-
return response.message;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import { MessagesSchema as PROTO } from '@trezor/protobuf';
|
|
3
|
-
import type { MethodMessage } from '../core/AbstractMethod';
|
|
4
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
5
|
-
export default class BackupDevice extends AbstractMethod<'backupDevice', PROTO.BackupDevice> {
|
|
6
|
-
constructor(message: MethodMessage<'backupDevice'>);
|
|
7
|
-
get requiredPermissions(): MethodPermission[];
|
|
8
|
-
get confirmation(): {
|
|
9
|
-
view: "device-management";
|
|
10
|
-
customConfirmButton: {
|
|
11
|
-
className: string;
|
|
12
|
-
label: string;
|
|
13
|
-
};
|
|
14
|
-
label: string;
|
|
15
|
-
};
|
|
16
|
-
run(): Promise<{
|
|
17
|
-
message: string;
|
|
18
|
-
}>;
|
|
19
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { MessagesSchema as PROTO } from "@trezor/protobuf";
|
|
2
|
-
import { Assert } from "@trezor/schema-utils";
|
|
3
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
4
|
-
export default class BackupDevice extends AbstractMethod {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
const {
|
|
7
|
-
payload
|
|
8
|
-
} = message;
|
|
9
|
-
Assert(PROTO.BackupDevice, payload);
|
|
10
|
-
const params = {
|
|
11
|
-
group_threshold: payload.group_threshold,
|
|
12
|
-
groups: payload.groups
|
|
13
|
-
};
|
|
14
|
-
super(message, params);
|
|
15
|
-
this.skipFinalReload = false;
|
|
16
|
-
this.useDeviceState = false;
|
|
17
|
-
}
|
|
18
|
-
get requiredPermissions() {
|
|
19
|
-
return ['management'];
|
|
20
|
-
}
|
|
21
|
-
get confirmation() {
|
|
22
|
-
return {
|
|
23
|
-
view: 'device-management',
|
|
24
|
-
customConfirmButton: {
|
|
25
|
-
className: 'confirm',
|
|
26
|
-
label: 'Proceed'
|
|
27
|
-
},
|
|
28
|
-
label: 'Do you want to initiate backup procedure?'
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
async run() {
|
|
32
|
-
const cmd = this.getDevice().getCommands();
|
|
33
|
-
const response = await cmd.typedCall('BackupDevice', 'Success', this.params);
|
|
34
|
-
return response.message;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { BitcoinNetworkInfo, ComposeResult, ComposeUtxo, ComposedInputs, DiscoveryAccount } from '@trezor/connect-common';
|
|
2
|
-
import type { ComposeOutput, TransactionInputOutputSortingStrategy } from '@trezor/utxo-lib';
|
|
3
|
-
import type { Blockchain } from '../../backend/BlockchainLink';
|
|
4
|
-
import type { BitcoinFeeLevels } from '../../backend/fees/BitcoinFeeLevels';
|
|
5
|
-
type Options = {
|
|
6
|
-
account: DiscoveryAccount;
|
|
7
|
-
utxos: ComposeUtxo[];
|
|
8
|
-
outputs: ComposeOutput[];
|
|
9
|
-
coinInfo: BitcoinNetworkInfo;
|
|
10
|
-
baseFee?: number;
|
|
11
|
-
sortingStrategy: TransactionInputOutputSortingStrategy;
|
|
12
|
-
};
|
|
13
|
-
export declare class TransactionComposer {
|
|
14
|
-
account: DiscoveryAccount;
|
|
15
|
-
utxos: ComposedInputs[];
|
|
16
|
-
outputs: ComposeOutput[];
|
|
17
|
-
coinInfo: BitcoinNetworkInfo;
|
|
18
|
-
blockHeight: number;
|
|
19
|
-
baseFee: number;
|
|
20
|
-
sortingStrategy: TransactionInputOutputSortingStrategy;
|
|
21
|
-
feeLevels: BitcoinFeeLevels;
|
|
22
|
-
composed: {
|
|
23
|
-
[key: string]: ComposeResult;
|
|
24
|
-
};
|
|
25
|
-
constructor(options: Options);
|
|
26
|
-
init(blockchain: Blockchain): Promise<void>;
|
|
27
|
-
composeAllFeeLevels(): boolean;
|
|
28
|
-
composeCustomFee(fee: string): void;
|
|
29
|
-
getFeeLevelList(): ({
|
|
30
|
-
blocks?: undefined;
|
|
31
|
-
feePerByte?: undefined;
|
|
32
|
-
name: string;
|
|
33
|
-
fee: "0";
|
|
34
|
-
disabled: true;
|
|
35
|
-
} | {
|
|
36
|
-
name: string;
|
|
37
|
-
blocks: number;
|
|
38
|
-
fee: string;
|
|
39
|
-
feePerByte: string;
|
|
40
|
-
minutes: number;
|
|
41
|
-
total: string;
|
|
42
|
-
})[];
|
|
43
|
-
compose(feeRate: string): ComposeResult;
|
|
44
|
-
dispose(): void;
|
|
45
|
-
}
|
|
46
|
-
export {};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { BigNumber } from "@trezor/utils/libESM/bigNumber.mjs";
|
|
2
|
-
import { composeTx } from "@trezor/utxo-lib";
|
|
3
|
-
import { getOrInitBitcoinFeeLevels } from "../../backend/fees/index.mjs";
|
|
4
|
-
export class TransactionComposer {
|
|
5
|
-
account;
|
|
6
|
-
utxos;
|
|
7
|
-
outputs;
|
|
8
|
-
coinInfo;
|
|
9
|
-
blockHeight = 0;
|
|
10
|
-
baseFee;
|
|
11
|
-
sortingStrategy;
|
|
12
|
-
feeLevels;
|
|
13
|
-
composed = {};
|
|
14
|
-
constructor(options) {
|
|
15
|
-
this.account = options.account;
|
|
16
|
-
this.outputs = options.outputs;
|
|
17
|
-
this.coinInfo = options.coinInfo;
|
|
18
|
-
this.blockHeight = 0;
|
|
19
|
-
this.baseFee = options.baseFee || 0;
|
|
20
|
-
this.sortingStrategy = options.sortingStrategy;
|
|
21
|
-
this.feeLevels = getOrInitBitcoinFeeLevels(options.coinInfo);
|
|
22
|
-
const {
|
|
23
|
-
addresses
|
|
24
|
-
} = options.account;
|
|
25
|
-
const allAddresses = !addresses ? [] : addresses.used.concat(addresses.unused).concat(addresses.change).map(a => a.address);
|
|
26
|
-
this.utxos = options.utxos.flatMap(u => {
|
|
27
|
-
if (!u.required && new BigNumber(u.amount).lte(this.coinInfo.dustLimit)) return [];
|
|
28
|
-
return {
|
|
29
|
-
...u,
|
|
30
|
-
coinbase: typeof u.coinbase === 'boolean' ? u.coinbase : false,
|
|
31
|
-
own: allAddresses.includes(u.address)
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
async init(blockchain) {
|
|
36
|
-
const {
|
|
37
|
-
blockHeight
|
|
38
|
-
} = await blockchain.getNetworkInfo();
|
|
39
|
-
this.blockHeight = blockHeight;
|
|
40
|
-
if (!this.feeLevels.wasFetchedSuccessfully) {
|
|
41
|
-
await this.feeLevels.load(blockchain);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
composeAllFeeLevels() {
|
|
45
|
-
const {
|
|
46
|
-
levels
|
|
47
|
-
} = this.feeLevels;
|
|
48
|
-
if (this.utxos.length < 1) return false;
|
|
49
|
-
this.composed = {};
|
|
50
|
-
let atLeastOneValid = false;
|
|
51
|
-
levels.forEach(level => {
|
|
52
|
-
if (level.feePerUnit !== '0') {
|
|
53
|
-
const tx = this.compose(level.feePerUnit);
|
|
54
|
-
if (tx.type === 'final') {
|
|
55
|
-
atLeastOneValid = true;
|
|
56
|
-
}
|
|
57
|
-
this.composed[level.label] = tx;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
if (!atLeastOneValid) {
|
|
61
|
-
const lastLevel = levels[levels.length - 1];
|
|
62
|
-
let lastFee = new BigNumber(lastLevel.feePerUnit);
|
|
63
|
-
while (lastFee.gt(this.coinInfo.minFee) && this.composed.custom === undefined) {
|
|
64
|
-
lastFee = lastFee.minus(1);
|
|
65
|
-
const tx = this.compose(lastFee.toString());
|
|
66
|
-
if (tx.type === 'final') {
|
|
67
|
-
this.feeLevels.updateBitcoinCustomFee(lastFee.toString());
|
|
68
|
-
this.composed.custom = tx;
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
composeCustomFee(fee) {
|
|
77
|
-
const tx = this.compose(fee);
|
|
78
|
-
this.composed.custom = tx;
|
|
79
|
-
if (tx.type === 'final') {
|
|
80
|
-
this.feeLevels.updateBitcoinCustomFee(tx.feePerByte);
|
|
81
|
-
} else {
|
|
82
|
-
this.feeLevels.updateBitcoinCustomFee(fee);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
getFeeLevelList() {
|
|
86
|
-
const list = [];
|
|
87
|
-
const {
|
|
88
|
-
levels
|
|
89
|
-
} = this.feeLevels;
|
|
90
|
-
levels.forEach(level => {
|
|
91
|
-
const tx = this.composed[level.label];
|
|
92
|
-
if (tx && tx.type === 'final') {
|
|
93
|
-
list.push({
|
|
94
|
-
name: level.label,
|
|
95
|
-
fee: tx.fee,
|
|
96
|
-
feePerByte: level.feePerUnit,
|
|
97
|
-
blocks: level.blocks,
|
|
98
|
-
minutes: level.blocks * this.coinInfo.blockTime,
|
|
99
|
-
total: tx.totalSpent
|
|
100
|
-
});
|
|
101
|
-
} else {
|
|
102
|
-
list.push({
|
|
103
|
-
name: level.label,
|
|
104
|
-
fee: '0',
|
|
105
|
-
disabled: true
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
return list;
|
|
110
|
-
}
|
|
111
|
-
compose(feeRate) {
|
|
112
|
-
const {
|
|
113
|
-
account,
|
|
114
|
-
coinInfo,
|
|
115
|
-
baseFee
|
|
116
|
-
} = this;
|
|
117
|
-
const {
|
|
118
|
-
addresses
|
|
119
|
-
} = account;
|
|
120
|
-
if (!addresses) return {
|
|
121
|
-
type: 'error',
|
|
122
|
-
error: 'ADDRESSES-NOT-SET'
|
|
123
|
-
};
|
|
124
|
-
const changeAddress = addresses.change.find(a => !a.transfers) || addresses.change[addresses.change.length - 1];
|
|
125
|
-
return composeTx({
|
|
126
|
-
txType: account.type,
|
|
127
|
-
utxos: this.utxos,
|
|
128
|
-
outputs: this.outputs,
|
|
129
|
-
feeRate,
|
|
130
|
-
longTermFeeRate: this.feeLevels.longTermFeeRate,
|
|
131
|
-
sortingStrategy: this.sortingStrategy,
|
|
132
|
-
network: coinInfo.network,
|
|
133
|
-
changeAddress,
|
|
134
|
-
dustThreshold: coinInfo.dustLimit,
|
|
135
|
-
baseFee
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
dispose() {}
|
|
139
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { AccountAddresses, PROTO } from '@trezor/connect-common';
|
|
2
|
-
import type { Transaction as BitcoinJsTransaction } from '@trezor/utxo-lib';
|
|
3
|
-
export declare const createPendingTransaction: (tx: BitcoinJsTransaction, { addresses, inputs, outputs, }: {
|
|
4
|
-
addresses: AccountAddresses;
|
|
5
|
-
inputs: PROTO.TxInputType[];
|
|
6
|
-
outputs: PROTO.TxOutputType[];
|
|
7
|
-
}) => {
|
|
8
|
-
txid: string;
|
|
9
|
-
hex: string;
|
|
10
|
-
blockHeight: number;
|
|
11
|
-
blockTime: number;
|
|
12
|
-
confirmations: number;
|
|
13
|
-
vsize: number;
|
|
14
|
-
size: number;
|
|
15
|
-
value: string;
|
|
16
|
-
valueIn: string;
|
|
17
|
-
fees: string;
|
|
18
|
-
vin: {
|
|
19
|
-
n: number;
|
|
20
|
-
txid: string;
|
|
21
|
-
vout: number;
|
|
22
|
-
isAddress: boolean;
|
|
23
|
-
addresses: string[];
|
|
24
|
-
value: string;
|
|
25
|
-
sequence: number | undefined;
|
|
26
|
-
}[];
|
|
27
|
-
vout: {
|
|
28
|
-
n: number;
|
|
29
|
-
isAddress: boolean;
|
|
30
|
-
addresses: string[];
|
|
31
|
-
value: string;
|
|
32
|
-
}[];
|
|
33
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { BigNumber } from "@trezor/utils/libESM/bigNumber.mjs";
|
|
2
|
-
import { getSerializedPath } from "../../utils/pathUtils.mjs";
|
|
3
|
-
export const createPendingTransaction = (tx, {
|
|
4
|
-
addresses,
|
|
5
|
-
inputs,
|
|
6
|
-
outputs
|
|
7
|
-
}) => {
|
|
8
|
-
const valueOut = outputs.reduce((sum, out) => BigNumber(sum).plus(out.amount), new BigNumber('0'));
|
|
9
|
-
const valueIn = inputs.reduce((sum, ins) => BigNumber(sum).plus(ins.amount), new BigNumber('0'));
|
|
10
|
-
const allAddresses = addresses.unused.concat(addresses.used, addresses.change);
|
|
11
|
-
const findAddress = ({
|
|
12
|
-
address_n
|
|
13
|
-
}) => {
|
|
14
|
-
const path = address_n ? getSerializedPath(address_n) : undefined;
|
|
15
|
-
return allAddresses.filter(address => address.path === path).map(address => address.address);
|
|
16
|
-
};
|
|
17
|
-
return {
|
|
18
|
-
txid: tx.getId(),
|
|
19
|
-
hex: tx.toHex(),
|
|
20
|
-
blockHeight: 0,
|
|
21
|
-
blockTime: Math.floor(Date.now() / 1000),
|
|
22
|
-
confirmations: 0,
|
|
23
|
-
vsize: tx.virtualSize(),
|
|
24
|
-
size: tx.weight(),
|
|
25
|
-
value: valueOut.toString(),
|
|
26
|
-
valueIn: valueIn.toString(),
|
|
27
|
-
fees: valueIn.minus(valueOut).toString(),
|
|
28
|
-
vin: inputs.map((ins, n) => ({
|
|
29
|
-
n,
|
|
30
|
-
txid: ins.prev_hash,
|
|
31
|
-
vout: ins.prev_index,
|
|
32
|
-
isAddress: true,
|
|
33
|
-
addresses: findAddress(ins),
|
|
34
|
-
value: ins.amount.toString(),
|
|
35
|
-
sequence: ins.sequence
|
|
36
|
-
})),
|
|
37
|
-
vout: outputs.map((out, n) => {
|
|
38
|
-
let transformedAddresses = [];
|
|
39
|
-
if (out.address) {
|
|
40
|
-
transformedAddresses = [out.address];
|
|
41
|
-
} else if ('op_return_data' in out) {
|
|
42
|
-
transformedAddresses = [`OP_RETURN (${Buffer.from(out.op_return_data, 'hex').toString('ascii')})`];
|
|
43
|
-
} else {
|
|
44
|
-
transformedAddresses = findAddress(out);
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
n,
|
|
48
|
-
isAddress: out.script_type !== 'PAYTOOPRETURN',
|
|
49
|
-
addresses: transformedAddresses,
|
|
50
|
-
value: out.amount.toString()
|
|
51
|
-
};
|
|
52
|
-
})
|
|
53
|
-
};
|
|
54
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { findBackend } from "../../backend/BlockchainLink.mjs";
|
|
2
|
-
export const enhanceSignTx = (options, coinInfo) => {
|
|
3
|
-
if (coinInfo.shortcut === 'ZEC' || coinInfo.shortcut === 'TAZ') {
|
|
4
|
-
if (typeof options.overwintered !== 'boolean') {
|
|
5
|
-
options.overwintered = true;
|
|
6
|
-
}
|
|
7
|
-
if (typeof options.version !== 'number') {
|
|
8
|
-
options.version = 5;
|
|
9
|
-
}
|
|
10
|
-
if (typeof options.version_group_id !== 'number') {
|
|
11
|
-
options.version_group_id = 0x26a7270a;
|
|
12
|
-
}
|
|
13
|
-
if (typeof options.branch_id !== 'number') {
|
|
14
|
-
const backend = findBackend(coinInfo.shortcut);
|
|
15
|
-
if (backend && backend.serverInfo?.consensusBranchId) {
|
|
16
|
-
options.branch_id = backend.serverInfo.consensusBranchId;
|
|
17
|
-
} else {
|
|
18
|
-
options.branch_id = 0xc2d6d0b4;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return options;
|
|
23
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './createPendingTx';
|
|
2
|
-
export * from './enhanceSignTx';
|
|
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';
|