@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,68 +0,0 @@
|
|
|
1
|
-
import { ERRORS } from "@trezor/connect-common/libESM/constants/index.mjs";
|
|
2
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
3
|
-
import { validateParams } from "./common/paramsValidator.mjs";
|
|
4
|
-
import { initBlockchain, isBackendSupported } from "../backend/BlockchainLink.mjs";
|
|
5
|
-
import { getCoinInfo } from "../data/coinInfo.mjs";
|
|
6
|
-
export default class BlockchainSubscribe extends AbstractMethod {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
const {
|
|
9
|
-
payload
|
|
10
|
-
} = message;
|
|
11
|
-
validateParams(payload, [{
|
|
12
|
-
name: 'accounts',
|
|
13
|
-
type: 'array',
|
|
14
|
-
allowEmpty: true
|
|
15
|
-
}, {
|
|
16
|
-
name: 'blocks',
|
|
17
|
-
type: 'boolean'
|
|
18
|
-
}, {
|
|
19
|
-
name: 'coin',
|
|
20
|
-
type: 'string',
|
|
21
|
-
required: true
|
|
22
|
-
}, {
|
|
23
|
-
name: 'identity',
|
|
24
|
-
type: 'string'
|
|
25
|
-
}]);
|
|
26
|
-
if (payload.accounts) {
|
|
27
|
-
payload.accounts.forEach(account => {
|
|
28
|
-
validateParams(account, [{
|
|
29
|
-
name: 'descriptor',
|
|
30
|
-
type: 'string',
|
|
31
|
-
required: true
|
|
32
|
-
}]);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
const coinInfo = getCoinInfo(payload.coin);
|
|
36
|
-
if (!coinInfo) {
|
|
37
|
-
throw ERRORS.TypedError('Method_UnknownCoin');
|
|
38
|
-
}
|
|
39
|
-
isBackendSupported(coinInfo);
|
|
40
|
-
const params = {
|
|
41
|
-
accounts: payload.accounts,
|
|
42
|
-
blocks: payload.blocks ?? true,
|
|
43
|
-
coinInfo,
|
|
44
|
-
identity: payload.identity
|
|
45
|
-
};
|
|
46
|
-
super(message, params);
|
|
47
|
-
this.useDevice = false;
|
|
48
|
-
this.useUi = false;
|
|
49
|
-
}
|
|
50
|
-
get requiredPermissions() {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
async run({
|
|
54
|
-
sendCoreMessage
|
|
55
|
-
}) {
|
|
56
|
-
const backend = await initBlockchain(this.params.coinInfo, sendCoreMessage, this.params.identity);
|
|
57
|
-
const {
|
|
58
|
-
blocks,
|
|
59
|
-
accounts
|
|
60
|
-
} = this.params;
|
|
61
|
-
let result = {
|
|
62
|
-
subscribed: false
|
|
63
|
-
};
|
|
64
|
-
if (blocks) result = await backend.subscribeBlocks();
|
|
65
|
-
if (accounts) result = await backend.subscribeAccounts(accounts);
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CoinInfo, MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import type { MethodContext, MethodMessage, Payload } from '../core/AbstractMethod';
|
|
3
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
4
|
-
type Params = {
|
|
5
|
-
currency: Payload<'blockchainSubscribeFiatRates'>['currency'];
|
|
6
|
-
coinInfo: CoinInfo;
|
|
7
|
-
identity?: string;
|
|
8
|
-
};
|
|
9
|
-
export default class BlockchainSubscribeFiatRates extends AbstractMethod<'blockchainSubscribeFiatRates', Params> {
|
|
10
|
-
constructor(message: MethodMessage<'blockchainSubscribeFiatRates'>);
|
|
11
|
-
get requiredPermissions(): MethodPermission[];
|
|
12
|
-
init(): void;
|
|
13
|
-
run({ sendCoreMessage }: MethodContext): Promise<{
|
|
14
|
-
subscribed: boolean;
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ERRORS } from "@trezor/connect-common/libESM/constants/index.mjs";
|
|
2
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
3
|
-
import { validateParams } from "./common/paramsValidator.mjs";
|
|
4
|
-
import { initBlockchain, isBackendSupported } from "../backend/BlockchainLink.mjs";
|
|
5
|
-
import { getCoinInfo } from "../data/coinInfo.mjs";
|
|
6
|
-
export default class BlockchainSubscribeFiatRates extends AbstractMethod {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
const {
|
|
9
|
-
payload
|
|
10
|
-
} = message;
|
|
11
|
-
validateParams(payload, [{
|
|
12
|
-
name: 'currency',
|
|
13
|
-
type: 'string',
|
|
14
|
-
required: false
|
|
15
|
-
}, {
|
|
16
|
-
name: 'coin',
|
|
17
|
-
type: 'string',
|
|
18
|
-
required: true
|
|
19
|
-
}, {
|
|
20
|
-
name: 'identity',
|
|
21
|
-
type: 'string'
|
|
22
|
-
}]);
|
|
23
|
-
const coinInfo = getCoinInfo(payload.coin);
|
|
24
|
-
if (!coinInfo) {
|
|
25
|
-
throw ERRORS.TypedError('Method_UnknownCoin');
|
|
26
|
-
}
|
|
27
|
-
isBackendSupported(coinInfo);
|
|
28
|
-
const params = {
|
|
29
|
-
currency: payload.currency,
|
|
30
|
-
coinInfo,
|
|
31
|
-
identity: payload.identity
|
|
32
|
-
};
|
|
33
|
-
super(message, params);
|
|
34
|
-
this.useDevice = false;
|
|
35
|
-
this.useUi = false;
|
|
36
|
-
}
|
|
37
|
-
get requiredPermissions() {
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
init() {}
|
|
41
|
-
async run({
|
|
42
|
-
sendCoreMessage
|
|
43
|
-
}) {
|
|
44
|
-
const backend = await initBlockchain(this.params.coinInfo, sendCoreMessage, this.params.identity);
|
|
45
|
-
return backend.subscribeFiatRates(this.params.currency);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CoinInfo, MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import type { MethodContext, MethodMessage, Payload } from '../core/AbstractMethod';
|
|
3
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
4
|
-
type Params = {
|
|
5
|
-
accounts: Payload<'blockchainUnsubscribe'>['accounts'];
|
|
6
|
-
coinInfo: CoinInfo;
|
|
7
|
-
identity?: string;
|
|
8
|
-
blocks: boolean;
|
|
9
|
-
};
|
|
10
|
-
export default class BlockchainUnsubscribe extends AbstractMethod<'blockchainUnsubscribe', Params> {
|
|
11
|
-
constructor(message: MethodMessage<'blockchainUnsubscribe'>);
|
|
12
|
-
get requiredPermissions(): MethodPermission[];
|
|
13
|
-
run({ sendCoreMessage }: MethodContext): Promise<{
|
|
14
|
-
subscribed: boolean;
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { ERRORS } from "@trezor/connect-common/libESM/constants/index.mjs";
|
|
2
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
3
|
-
import { validateParams } from "./common/paramsValidator.mjs";
|
|
4
|
-
import { initBlockchain, isBackendSupported } from "../backend/BlockchainLink.mjs";
|
|
5
|
-
import { getCoinInfo } from "../data/coinInfo.mjs";
|
|
6
|
-
export default class BlockchainUnsubscribe extends AbstractMethod {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
const {
|
|
9
|
-
payload
|
|
10
|
-
} = message;
|
|
11
|
-
validateParams(payload, [{
|
|
12
|
-
name: 'accounts',
|
|
13
|
-
type: 'array',
|
|
14
|
-
allowEmpty: true
|
|
15
|
-
}, {
|
|
16
|
-
name: 'blocks',
|
|
17
|
-
type: 'boolean'
|
|
18
|
-
}, {
|
|
19
|
-
name: 'coin',
|
|
20
|
-
type: 'string',
|
|
21
|
-
required: true
|
|
22
|
-
}, {
|
|
23
|
-
name: 'identity',
|
|
24
|
-
type: 'string'
|
|
25
|
-
}]);
|
|
26
|
-
if (payload.accounts) {
|
|
27
|
-
payload.accounts.forEach(account => {
|
|
28
|
-
validateParams(account, [{
|
|
29
|
-
name: 'descriptor',
|
|
30
|
-
type: 'string',
|
|
31
|
-
required: true
|
|
32
|
-
}]);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
const coinInfo = getCoinInfo(payload.coin);
|
|
36
|
-
if (!coinInfo) {
|
|
37
|
-
throw ERRORS.TypedError('Method_UnknownCoin');
|
|
38
|
-
}
|
|
39
|
-
isBackendSupported(coinInfo);
|
|
40
|
-
const params = {
|
|
41
|
-
accounts: payload.accounts,
|
|
42
|
-
coinInfo,
|
|
43
|
-
identity: payload.identity,
|
|
44
|
-
blocks: payload.blocks ?? false
|
|
45
|
-
};
|
|
46
|
-
super(message, params);
|
|
47
|
-
this.useDevice = false;
|
|
48
|
-
this.useUi = false;
|
|
49
|
-
}
|
|
50
|
-
get requiredPermissions() {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
async run({
|
|
54
|
-
sendCoreMessage
|
|
55
|
-
}) {
|
|
56
|
-
const backend = await initBlockchain(this.params.coinInfo, sendCoreMessage, this.params.identity);
|
|
57
|
-
const {
|
|
58
|
-
accounts
|
|
59
|
-
} = this.params;
|
|
60
|
-
if (this.params.blocks) {
|
|
61
|
-
return backend.unsubscribeBlocks();
|
|
62
|
-
}
|
|
63
|
-
if (accounts) {
|
|
64
|
-
return backend.unsubscribeAccounts(accounts);
|
|
65
|
-
}
|
|
66
|
-
return backend.unsubscribeAll();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { CoinInfo, MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import type { MethodContext, MethodMessage } from '../core/AbstractMethod';
|
|
3
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
4
|
-
type Params = {
|
|
5
|
-
coinInfo: CoinInfo;
|
|
6
|
-
identity?: string;
|
|
7
|
-
};
|
|
8
|
-
export default class BlockchainUnsubscribeFiatRates extends AbstractMethod<'blockchainUnsubscribeFiatRates', Params> {
|
|
9
|
-
constructor(message: MethodMessage<'blockchainUnsubscribeFiatRates'>);
|
|
10
|
-
get requiredPermissions(): MethodPermission[];
|
|
11
|
-
run({ sendCoreMessage }: MethodContext): Promise<{
|
|
12
|
-
subscribed: boolean;
|
|
13
|
-
}>;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ERRORS } from "@trezor/connect-common/libESM/constants/index.mjs";
|
|
2
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
3
|
-
import { validateParams } from "./common/paramsValidator.mjs";
|
|
4
|
-
import { initBlockchain, isBackendSupported } from "../backend/BlockchainLink.mjs";
|
|
5
|
-
import { getCoinInfo } from "../data/coinInfo.mjs";
|
|
6
|
-
export default class BlockchainUnsubscribeFiatRates extends AbstractMethod {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
const {
|
|
9
|
-
payload
|
|
10
|
-
} = message;
|
|
11
|
-
validateParams(payload, [{
|
|
12
|
-
name: 'coin',
|
|
13
|
-
type: 'string',
|
|
14
|
-
required: true
|
|
15
|
-
}, {
|
|
16
|
-
name: 'identity',
|
|
17
|
-
type: 'string'
|
|
18
|
-
}]);
|
|
19
|
-
const coinInfo = getCoinInfo(payload.coin);
|
|
20
|
-
if (!coinInfo) {
|
|
21
|
-
throw ERRORS.TypedError('Method_UnknownCoin');
|
|
22
|
-
}
|
|
23
|
-
isBackendSupported(coinInfo);
|
|
24
|
-
const params = {
|
|
25
|
-
coinInfo,
|
|
26
|
-
identity: payload.identity
|
|
27
|
-
};
|
|
28
|
-
super(message, params);
|
|
29
|
-
this.useDevice = false;
|
|
30
|
-
this.useUi = false;
|
|
31
|
-
}
|
|
32
|
-
get requiredPermissions() {
|
|
33
|
-
return [];
|
|
34
|
-
}
|
|
35
|
-
async run({
|
|
36
|
-
sendCoreMessage
|
|
37
|
-
}) {
|
|
38
|
-
const backend = await initBlockchain(this.params.coinInfo, sendCoreMessage, this.params.identity);
|
|
39
|
-
return backend.unsubscribeFiatRates();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import type { MethodMessage } from '../core/AbstractMethod';
|
|
3
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
4
|
-
type Params = {
|
|
5
|
-
url: string;
|
|
6
|
-
chainId: number;
|
|
7
|
-
};
|
|
8
|
-
export default class BlockchainValidateEvmRpcUrl extends AbstractMethod<'blockchainValidateEvmRpcUrl', Params> {
|
|
9
|
-
constructor(message: MethodMessage<'blockchainValidateEvmRpcUrl'>);
|
|
10
|
-
get requiredPermissions(): MethodPermission[];
|
|
11
|
-
get info(): string;
|
|
12
|
-
run(): Promise<{
|
|
13
|
-
valid: boolean;
|
|
14
|
-
actualChainId?: number;
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { BlockchainLink } from "@trezor/blockchain-link";
|
|
2
|
-
import { MESSAGES } from "@trezor/blockchain-link-types";
|
|
3
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
4
|
-
import { EvmRpcWorker } from "../workers/workers.mjs";
|
|
5
|
-
import { validateParams } from "./common/paramsValidator.mjs";
|
|
6
|
-
export default class BlockchainValidateEvmRpcUrl extends AbstractMethod {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
const {
|
|
9
|
-
payload
|
|
10
|
-
} = message;
|
|
11
|
-
validateParams(payload, [{
|
|
12
|
-
name: 'url',
|
|
13
|
-
type: 'string',
|
|
14
|
-
required: true
|
|
15
|
-
}, {
|
|
16
|
-
name: 'chainId',
|
|
17
|
-
type: 'number',
|
|
18
|
-
required: true
|
|
19
|
-
}]);
|
|
20
|
-
const params = {
|
|
21
|
-
url: payload.url,
|
|
22
|
-
chainId: payload.chainId
|
|
23
|
-
};
|
|
24
|
-
super(message, params);
|
|
25
|
-
this.useDevice = false;
|
|
26
|
-
this.useUi = false;
|
|
27
|
-
}
|
|
28
|
-
get requiredPermissions() {
|
|
29
|
-
return [];
|
|
30
|
-
}
|
|
31
|
-
get info() {
|
|
32
|
-
return 'Validate EVM RPC URL';
|
|
33
|
-
}
|
|
34
|
-
async run() {
|
|
35
|
-
const link = new BlockchainLink({
|
|
36
|
-
name: 'evm-rpc-validator',
|
|
37
|
-
worker: EvmRpcWorker,
|
|
38
|
-
server: [],
|
|
39
|
-
debug: false
|
|
40
|
-
});
|
|
41
|
-
try {
|
|
42
|
-
const response = await link.sendMessage({
|
|
43
|
-
type: MESSAGES.VALIDATE_EVM_RPC,
|
|
44
|
-
payload: {
|
|
45
|
-
url: this.params.url,
|
|
46
|
-
chainId: this.params.chainId
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
return response;
|
|
50
|
-
} finally {
|
|
51
|
-
link.dispose();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import type { MethodMessage } from '../core/AbstractMethod';
|
|
3
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
4
|
-
export default class CancelCoinjoinAuthorization extends AbstractMethod<'cancelCoinjoinAuthorization'> {
|
|
5
|
-
constructor(message: MethodMessage<'cancelCoinjoinAuthorization'>);
|
|
6
|
-
get requiredPermissions(): MethodPermission[];
|
|
7
|
-
get info(): string;
|
|
8
|
-
run(): Promise<{
|
|
9
|
-
message: string;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { CancelCoinjoinAuthorization as CancelCoinjoinAuthorizationSchema } from "@trezor/connect-common";
|
|
2
|
-
import { Assert } from "@trezor/schema-utils";
|
|
3
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
4
|
-
export default class CancelCoinjoinAuthorization extends AbstractMethod {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
const {
|
|
7
|
-
payload
|
|
8
|
-
} = message;
|
|
9
|
-
Assert(CancelCoinjoinAuthorizationSchema, payload);
|
|
10
|
-
super(message, undefined);
|
|
11
|
-
this.preauthorized = typeof payload.preauthorized === 'boolean' ? payload.preauthorized : true;
|
|
12
|
-
}
|
|
13
|
-
get requiredPermissions() {
|
|
14
|
-
return ['management'];
|
|
15
|
-
}
|
|
16
|
-
get info() {
|
|
17
|
-
return 'Cancel Coinjoin Authorization';
|
|
18
|
-
}
|
|
19
|
-
async run() {
|
|
20
|
-
const cmd = this.getDevice().getCommands();
|
|
21
|
-
if (!this.preauthorized) {
|
|
22
|
-
if (!(await cmd.preauthorize(false))) {
|
|
23
|
-
return {
|
|
24
|
-
message: 'Not authorized'
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const response = await cmd.typedCall('CancelAuthorization', 'Success');
|
|
29
|
-
return response.message;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import { type CardanoComposeTransactionParams, type PrecomposedTransactionCardano } from '@trezor/connect-common/libESM/types/api/cardanoComposeTransaction';
|
|
3
|
-
import type { MethodMessage } from '../../../core/AbstractMethod';
|
|
4
|
-
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
5
|
-
export default class CardanoComposeTransaction extends AbstractMethod<'cardanoComposeTransaction', CardanoComposeTransactionParams> {
|
|
6
|
-
constructor(message: MethodMessage<'cardanoComposeTransaction'>);
|
|
7
|
-
get requiredPermissions(): MethodPermission[];
|
|
8
|
-
get info(): string;
|
|
9
|
-
run(): Promise<PrecomposedTransactionCardano[]>;
|
|
10
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { CoinSelectionError, trezorUtils } from "@fivebinaries/coin-selection";
|
|
2
|
-
import { CardanoComposeTransactionParamsSchema } from "@trezor/connect-common/libESM/types/api/cardanoComposeTransaction.mjs";
|
|
3
|
-
import { Assert } from "@trezor/schema-utils";
|
|
4
|
-
import { AbstractMethod } from "../../../core/AbstractMethod.mjs";
|
|
5
|
-
import { composeTxPlan } from "../cardanoUtils.mjs";
|
|
6
|
-
export default class CardanoComposeTransaction extends AbstractMethod {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
Assert(CardanoComposeTransactionParamsSchema, message.payload);
|
|
9
|
-
super(message, message.payload);
|
|
10
|
-
this.useDevice = false;
|
|
11
|
-
this.useDeviceState = false;
|
|
12
|
-
this.useUi = false;
|
|
13
|
-
}
|
|
14
|
-
get requiredPermissions() {
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
|
-
get info() {
|
|
18
|
-
return 'Compose Cardano transaction';
|
|
19
|
-
}
|
|
20
|
-
run() {
|
|
21
|
-
const {
|
|
22
|
-
feeLevels = [{}],
|
|
23
|
-
account,
|
|
24
|
-
outputs = [],
|
|
25
|
-
certificates = [],
|
|
26
|
-
withdrawals = [],
|
|
27
|
-
changeAddress,
|
|
28
|
-
addressParameters,
|
|
29
|
-
testnet
|
|
30
|
-
} = this.params;
|
|
31
|
-
const result = feeLevels.map(({
|
|
32
|
-
feePerUnit
|
|
33
|
-
}) => {
|
|
34
|
-
try {
|
|
35
|
-
const txPlan = composeTxPlan(account.descriptor, account.utxo, outputs, certificates, withdrawals, changeAddress.address, !!testnet, {
|
|
36
|
-
feeParams: feePerUnit ? {
|
|
37
|
-
a: feePerUnit
|
|
38
|
-
} : undefined
|
|
39
|
-
});
|
|
40
|
-
return {
|
|
41
|
-
fee: txPlan.fee,
|
|
42
|
-
feePerByte: feePerUnit ?? '0',
|
|
43
|
-
deposit: txPlan.deposit,
|
|
44
|
-
totalSpent: txPlan.totalSpent,
|
|
45
|
-
max: txPlan.max,
|
|
46
|
-
...(txPlan.type === 'nonfinal' ? {
|
|
47
|
-
type: txPlan.type,
|
|
48
|
-
bytes: 0
|
|
49
|
-
} : {
|
|
50
|
-
type: txPlan.type,
|
|
51
|
-
bytes: txPlan.tx.size,
|
|
52
|
-
ttl: txPlan.ttl,
|
|
53
|
-
inputs: trezorUtils.transformToTrezorInputs(txPlan.inputs, account.utxo),
|
|
54
|
-
outputs: trezorUtils.transformToTrezorOutputs(txPlan.outputs, addressParameters),
|
|
55
|
-
unsignedTx: txPlan.tx
|
|
56
|
-
})
|
|
57
|
-
};
|
|
58
|
-
} catch (error) {
|
|
59
|
-
if (error instanceof CoinSelectionError && error.code === 'UTXO_BALANCE_INSUFFICIENT') {
|
|
60
|
-
return {
|
|
61
|
-
type: 'error',
|
|
62
|
-
error: 'UTXO_BALANCE_INSUFFICIENT'
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
if (error instanceof CoinSelectionError && error.code === 'UTXO_VALUE_TOO_SMALL') {
|
|
66
|
-
return {
|
|
67
|
-
type: 'error',
|
|
68
|
-
error: 'UTXO_VALUE_TOO_SMALL'
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
type: 'error',
|
|
73
|
-
error: error.message
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
return Promise.resolve(result);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import { MessagesSchema as PROTO } from '@trezor/protobuf';
|
|
3
|
-
import type { MethodContext, MethodMessage } from '../../../core/AbstractMethod';
|
|
4
|
-
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
5
|
-
type Params = {
|
|
6
|
-
proto: PROTO.CardanoGetAddress;
|
|
7
|
-
address?: string;
|
|
8
|
-
};
|
|
9
|
-
export default class CardanoGetAddress extends AbstractMethod<'cardanoGetAddress', Params[]> {
|
|
10
|
-
hasBundle?: boolean;
|
|
11
|
-
progress: number;
|
|
12
|
-
constructor(message: MethodMessage<'cardanoGetAddress'>);
|
|
13
|
-
get requiredPermissions(): MethodPermission[];
|
|
14
|
-
get info(): string;
|
|
15
|
-
getButtonRequestData(code: string): {
|
|
16
|
-
type: "address";
|
|
17
|
-
serializedPath: string;
|
|
18
|
-
address: string;
|
|
19
|
-
} | undefined;
|
|
20
|
-
get confirmation(): {
|
|
21
|
-
view: "export-address";
|
|
22
|
-
label: string;
|
|
23
|
-
} | undefined;
|
|
24
|
-
_call({ proto }: Params): Promise<{
|
|
25
|
-
mac?: string | undefined;
|
|
26
|
-
address: string;
|
|
27
|
-
}>;
|
|
28
|
-
run({ sendCoreMessage }: MethodContext): Promise<import("@trezor/connect-common").CardanoAddress | import("@trezor/connect-common").CardanoAddress[]>;
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { Bundle, CardanoGetAddress as CardanoGetAddressSchema, UI_REQUEST, createUiMessage } from "@trezor/connect-common";
|
|
2
|
-
import { ERRORS } from "@trezor/connect-common/libESM/constants/index.mjs";
|
|
3
|
-
import { MessagesSchema as PROTO } from "@trezor/protobuf";
|
|
4
|
-
import { Assert } from "@trezor/schema-utils";
|
|
5
|
-
import { AbstractMethod } from "../../../core/AbstractMethod.mjs";
|
|
6
|
-
import { getMiscNetwork } from "../../../data/coinInfo.mjs";
|
|
7
|
-
import { fromHardened, getSerializedPath } from "../../../utils/pathUtils.mjs";
|
|
8
|
-
import { bundlify } from "../../common/paramsValidator.mjs";
|
|
9
|
-
import { addressParametersFromProto, addressParametersToProto, modifyAddressParametersForBackwardsCompatibility, validateAddressParameters } from "../cardanoAddressParameters.mjs";
|
|
10
|
-
export default class CardanoGetAddress extends AbstractMethod {
|
|
11
|
-
hasBundle;
|
|
12
|
-
progress = 0;
|
|
13
|
-
constructor(message) {
|
|
14
|
-
const {
|
|
15
|
-
hasBundle,
|
|
16
|
-
payload
|
|
17
|
-
} = bundlify(message.payload);
|
|
18
|
-
Assert(Bundle(CardanoGetAddressSchema), payload);
|
|
19
|
-
const params = payload.bundle.map(batch => {
|
|
20
|
-
validateAddressParameters(batch.addressParameters);
|
|
21
|
-
const proto = {
|
|
22
|
-
address_parameters: addressParametersToProto(batch.addressParameters),
|
|
23
|
-
protocol_magic: batch.protocolMagic,
|
|
24
|
-
network_id: batch.networkId,
|
|
25
|
-
derivation_type: typeof batch.derivationType !== 'undefined' ? batch.derivationType : PROTO.CardanoDerivationType.ICARUS_TREZOR,
|
|
26
|
-
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
27
|
-
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false
|
|
28
|
-
};
|
|
29
|
-
return {
|
|
30
|
-
proto,
|
|
31
|
-
address: batch.address
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
super(message, params);
|
|
35
|
-
this.hasBundle = hasBundle;
|
|
36
|
-
this.useUi = this.getUseUi(this.params, payload.useEventListener);
|
|
37
|
-
this.confirmMissingBackup = true;
|
|
38
|
-
this.requiredDeviceCapabilities = ['Capability_Cardano'];
|
|
39
|
-
this.requiredFirmwareCoins = [getMiscNetwork('Cardano')];
|
|
40
|
-
}
|
|
41
|
-
get requiredPermissions() {
|
|
42
|
-
return ['read'];
|
|
43
|
-
}
|
|
44
|
-
get info() {
|
|
45
|
-
if (this.params.length === 1) {
|
|
46
|
-
return `Export Cardano address for account #${fromHardened(this.params[0].proto.address_parameters.address_n[2]) + 1}`;
|
|
47
|
-
}
|
|
48
|
-
return 'Export multiple Cardano addresses';
|
|
49
|
-
}
|
|
50
|
-
getButtonRequestData(code) {
|
|
51
|
-
if (code === 'ButtonRequest_Address') {
|
|
52
|
-
return {
|
|
53
|
-
type: 'address',
|
|
54
|
-
serializedPath: getSerializedPath(this.params[this.progress].proto.address_parameters.address_n),
|
|
55
|
-
address: this.params[this.progress].address || 'not-set'
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
get confirmation() {
|
|
60
|
-
return !this.useUi ? undefined : {
|
|
61
|
-
view: 'export-address',
|
|
62
|
-
label: this.info
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
async _call({
|
|
66
|
-
proto
|
|
67
|
-
}) {
|
|
68
|
-
const cmd = this.getDevice().getCommands();
|
|
69
|
-
const response = await cmd.typedCall('CardanoGetAddress', 'CardanoAddress', proto);
|
|
70
|
-
return response.message;
|
|
71
|
-
}
|
|
72
|
-
async run({
|
|
73
|
-
sendCoreMessage
|
|
74
|
-
}) {
|
|
75
|
-
const responses = [];
|
|
76
|
-
for (let i = 0; i < this.params.length; i++) {
|
|
77
|
-
const batch = this.params[i];
|
|
78
|
-
batch.proto.address_parameters = modifyAddressParametersForBackwardsCompatibility(batch.proto.address_parameters);
|
|
79
|
-
if (batch.proto.show_display) {
|
|
80
|
-
const silent = await this._call({
|
|
81
|
-
...batch,
|
|
82
|
-
proto: {
|
|
83
|
-
...batch.proto,
|
|
84
|
-
show_display: false
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
if (typeof batch.address === 'string') {
|
|
88
|
-
if (batch.address !== silent.address) {
|
|
89
|
-
throw ERRORS.TypedError('Method_AddressNotMatch');
|
|
90
|
-
}
|
|
91
|
-
} else {
|
|
92
|
-
batch.address = silent.address;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
const response = await this._call(batch);
|
|
96
|
-
responses.push({
|
|
97
|
-
addressParameters: addressParametersFromProto(batch.proto.address_parameters),
|
|
98
|
-
protocolMagic: batch.proto.protocol_magic,
|
|
99
|
-
networkId: batch.proto.network_id,
|
|
100
|
-
serializedPath: getSerializedPath(batch.proto.address_parameters.address_n),
|
|
101
|
-
serializedStakingPath: getSerializedPath(batch.proto.address_parameters.address_n_staking),
|
|
102
|
-
address: response.address,
|
|
103
|
-
mac: response.mac
|
|
104
|
-
});
|
|
105
|
-
if (this.hasBundle) {
|
|
106
|
-
sendCoreMessage(createUiMessage(UI_REQUEST.BUNDLE_PROGRESS, {
|
|
107
|
-
total: this.params.length,
|
|
108
|
-
progress: i,
|
|
109
|
-
response
|
|
110
|
-
}));
|
|
111
|
-
}
|
|
112
|
-
this.progress++;
|
|
113
|
-
}
|
|
114
|
-
return this.hasBundle ? responses : responses[0];
|
|
115
|
-
}
|
|
116
|
-
}
|
|
@@ -1,12 +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 CardanoGetNativeScriptHash extends AbstractMethod<'cardanoGetNativeScriptHash', PROTO.CardanoGetNativeScriptHash> {
|
|
6
|
-
constructor(message: MethodMessage<'cardanoGetNativeScriptHash'>);
|
|
7
|
-
get requiredPermissions(): MethodPermission[];
|
|
8
|
-
get info(): string;
|
|
9
|
-
run(): Promise<{
|
|
10
|
-
scriptHash: string;
|
|
11
|
-
}>;
|
|
12
|
-
}
|