@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,24 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import type { MessagesSchema as PROTO } from '@trezor/protobuf';
|
|
3
|
-
import type { MethodContext, MethodMessage } from '../../../core/AbstractMethod';
|
|
4
|
-
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
5
|
-
export default class TezosGetPublicKey extends AbstractMethod<'tezosGetPublicKey', PROTO.TezosGetPublicKey[]> {
|
|
6
|
-
hasBundle?: boolean;
|
|
7
|
-
constructor(message: MethodMessage<'tezosGetPublicKey'>);
|
|
8
|
-
get requiredPermissions(): MethodPermission[];
|
|
9
|
-
init(): void;
|
|
10
|
-
get info(): string;
|
|
11
|
-
get confirmation(): {
|
|
12
|
-
view: "export-address";
|
|
13
|
-
label: string;
|
|
14
|
-
};
|
|
15
|
-
run({ sendCoreMessage }: MethodContext): Promise<{
|
|
16
|
-
publicKey: string;
|
|
17
|
-
path: number[];
|
|
18
|
-
serializedPath: string;
|
|
19
|
-
} | {
|
|
20
|
-
publicKey: string;
|
|
21
|
-
path: number[];
|
|
22
|
-
serializedPath: string;
|
|
23
|
-
}[]>;
|
|
24
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Bundle, GetPublicKey as GetPublicKeySchema, UI_REQUEST, createUiMessage } from "@trezor/connect-common";
|
|
2
|
-
import { Assert } from "@trezor/schema-utils";
|
|
3
|
-
import { AbstractMethod } from "../../../core/AbstractMethod.mjs";
|
|
4
|
-
import { getMiscNetwork } from "../../../data/coinInfo.mjs";
|
|
5
|
-
import { fromHardened, getSerializedPath, validatePath } from "../../../utils/pathUtils.mjs";
|
|
6
|
-
import { bundlify } from "../../common/paramsValidator.mjs";
|
|
7
|
-
export default class TezosGetPublicKey extends AbstractMethod {
|
|
8
|
-
hasBundle;
|
|
9
|
-
constructor(message) {
|
|
10
|
-
const {
|
|
11
|
-
hasBundle,
|
|
12
|
-
payload
|
|
13
|
-
} = bundlify(message.payload);
|
|
14
|
-
Assert(Bundle(GetPublicKeySchema), payload);
|
|
15
|
-
const params = payload.bundle.map(batch => {
|
|
16
|
-
const path = validatePath(batch.path, 3);
|
|
17
|
-
return {
|
|
18
|
-
address_n: path,
|
|
19
|
-
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : false,
|
|
20
|
-
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
super(message, params);
|
|
24
|
-
this.hasBundle = hasBundle;
|
|
25
|
-
this.requiredDeviceCapabilities = ['Capability_Tezos'];
|
|
26
|
-
this.requiredFirmwareCoins = [getMiscNetwork('Tezos')];
|
|
27
|
-
}
|
|
28
|
-
get requiredPermissions() {
|
|
29
|
-
return ['read'];
|
|
30
|
-
}
|
|
31
|
-
init() {}
|
|
32
|
-
get info() {
|
|
33
|
-
return 'Export Tezos public key';
|
|
34
|
-
}
|
|
35
|
-
get confirmation() {
|
|
36
|
-
return {
|
|
37
|
-
view: 'export-address',
|
|
38
|
-
label: this.params.length > 1 ? 'Export multiple Tezos public keys' : `Export Tezos public key for account #${fromHardened(this.params[0].address_n[2]) + 1}`
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
async run({
|
|
42
|
-
sendCoreMessage
|
|
43
|
-
}) {
|
|
44
|
-
const responses = [];
|
|
45
|
-
const cmd = this.getDevice().getCommands();
|
|
46
|
-
for (let i = 0; i < this.params.length; i++) {
|
|
47
|
-
const batch = this.params[i];
|
|
48
|
-
const {
|
|
49
|
-
message
|
|
50
|
-
} = await cmd.typedCall('TezosGetPublicKey', 'TezosPublicKey', batch);
|
|
51
|
-
responses.push({
|
|
52
|
-
path: batch.address_n,
|
|
53
|
-
serializedPath: getSerializedPath(batch.address_n),
|
|
54
|
-
publicKey: message.public_key
|
|
55
|
-
});
|
|
56
|
-
if (this.hasBundle) {
|
|
57
|
-
sendCoreMessage(createUiMessage(UI_REQUEST.BUNDLE_PROGRESS, {
|
|
58
|
-
total: this.params.length,
|
|
59
|
-
progress: i,
|
|
60
|
-
response: message
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return this.hasBundle ? responses : responses[0];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,14 +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 TezosSignTransaction extends AbstractMethod<'tezosSignTransaction', PROTO.TezosSignTx> {
|
|
6
|
-
constructor(message: MethodMessage<'tezosSignTransaction'>);
|
|
7
|
-
get requiredPermissions(): MethodPermission[];
|
|
8
|
-
get info(): string;
|
|
9
|
-
run(): Promise<{
|
|
10
|
-
signature: string;
|
|
11
|
-
sig_op_contents: string;
|
|
12
|
-
operation_hash: string;
|
|
13
|
-
}>;
|
|
14
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { TezosSignTransaction as TezosSignTransactionSchema } from "@trezor/connect-common/libESM/types/api/tezos/index.mjs";
|
|
2
|
-
import { Assert } from "@trezor/schema-utils";
|
|
3
|
-
import { AbstractMethod } from "../../../core/AbstractMethod.mjs";
|
|
4
|
-
import { getMiscNetwork } from "../../../data/coinInfo.mjs";
|
|
5
|
-
import { validatePath } from "../../../utils/pathUtils.mjs";
|
|
6
|
-
import * as helper from "../tezosSignTx.mjs";
|
|
7
|
-
export default class TezosSignTransaction extends AbstractMethod {
|
|
8
|
-
constructor(message) {
|
|
9
|
-
const {
|
|
10
|
-
payload
|
|
11
|
-
} = message;
|
|
12
|
-
Assert(TezosSignTransactionSchema, payload);
|
|
13
|
-
const path = validatePath(payload.path, 3);
|
|
14
|
-
const params = helper.createTx(path, payload.branch, payload.operation);
|
|
15
|
-
super(message, params);
|
|
16
|
-
this.requiredDeviceCapabilities = ['Capability_Tezos'];
|
|
17
|
-
this.requiredFirmwareCoins = [getMiscNetwork('Tezos')];
|
|
18
|
-
}
|
|
19
|
-
get requiredPermissions() {
|
|
20
|
-
return ['read', 'write'];
|
|
21
|
-
}
|
|
22
|
-
get info() {
|
|
23
|
-
return 'Sign Tezos transaction';
|
|
24
|
-
}
|
|
25
|
-
async run() {
|
|
26
|
-
const cmd = this.getDevice().getCommands();
|
|
27
|
-
const response = await cmd.typedCall('TezosSignTx', 'TezosSignedTx', this.params);
|
|
28
|
-
return response.message;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { TezosOperation } from '@trezor/connect-common';
|
|
2
|
-
import type { PROTO } from '@trezor/connect-common';
|
|
3
|
-
export declare const createTx: (address_n: number[], branch: string, operation: TezosOperation, chunkify?: boolean) => {
|
|
4
|
-
chunkify?: boolean | undefined;
|
|
5
|
-
reveal?: {
|
|
6
|
-
public_key: Uint8Array<ArrayBufferLike>;
|
|
7
|
-
fee: string | number;
|
|
8
|
-
gas_limit: number;
|
|
9
|
-
source: Uint8Array<ArrayBufferLike>;
|
|
10
|
-
counter: number;
|
|
11
|
-
storage_limit: number;
|
|
12
|
-
} | undefined;
|
|
13
|
-
transaction?: {
|
|
14
|
-
parameters?: number[] | undefined;
|
|
15
|
-
parameters_manager?: {
|
|
16
|
-
transfer?: {
|
|
17
|
-
amount: string | number;
|
|
18
|
-
destination: {
|
|
19
|
-
hash: Uint8Array<ArrayBufferLike>;
|
|
20
|
-
tag: number;
|
|
21
|
-
};
|
|
22
|
-
} | undefined;
|
|
23
|
-
set_delegate?: Uint8Array<ArrayBufferLike> | undefined;
|
|
24
|
-
cancel_delegate?: boolean | undefined;
|
|
25
|
-
} | undefined;
|
|
26
|
-
amount: string | number;
|
|
27
|
-
fee: string | number;
|
|
28
|
-
gas_limit: number;
|
|
29
|
-
destination: {
|
|
30
|
-
hash: Uint8Array<ArrayBufferLike>;
|
|
31
|
-
tag: number;
|
|
32
|
-
};
|
|
33
|
-
source: Uint8Array<ArrayBufferLike>;
|
|
34
|
-
counter: number;
|
|
35
|
-
storage_limit: number;
|
|
36
|
-
} | undefined;
|
|
37
|
-
origination?: {
|
|
38
|
-
delegate?: Uint8Array<ArrayBufferLike> | undefined;
|
|
39
|
-
manager_pubkey?: string | undefined;
|
|
40
|
-
spendable?: boolean | undefined;
|
|
41
|
-
delegatable?: boolean | undefined;
|
|
42
|
-
script: string | number[];
|
|
43
|
-
fee: string | number;
|
|
44
|
-
gas_limit: number;
|
|
45
|
-
balance: number;
|
|
46
|
-
source: Uint8Array<ArrayBufferLike>;
|
|
47
|
-
counter: number;
|
|
48
|
-
storage_limit: number;
|
|
49
|
-
} | undefined;
|
|
50
|
-
delegation?: {
|
|
51
|
-
fee: string | number;
|
|
52
|
-
delegate: Uint8Array<ArrayBufferLike>;
|
|
53
|
-
gas_limit: number;
|
|
54
|
-
source: Uint8Array<ArrayBufferLike>;
|
|
55
|
-
counter: number;
|
|
56
|
-
storage_limit: number;
|
|
57
|
-
} | undefined;
|
|
58
|
-
proposal?: {
|
|
59
|
-
source: string;
|
|
60
|
-
period: number;
|
|
61
|
-
proposals: string[];
|
|
62
|
-
} | undefined;
|
|
63
|
-
ballot?: {
|
|
64
|
-
proposal: string;
|
|
65
|
-
ballot: PROTO.TezosBallotType;
|
|
66
|
-
source: string;
|
|
67
|
-
period: number;
|
|
68
|
-
} | undefined;
|
|
69
|
-
address_n: number[];
|
|
70
|
-
branch: Uint8Array<ArrayBufferLike>;
|
|
71
|
-
};
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { sha256 } from "@noble/hashes/sha2.js";
|
|
2
|
-
import { base58check as createBase58check } from "@scure/base";
|
|
3
|
-
import { TezosOperation } from "@trezor/connect-common";
|
|
4
|
-
import { ERRORS } from "@trezor/connect-common/libESM/constants/index.mjs";
|
|
5
|
-
import { Assert } from "@trezor/schema-utils";
|
|
6
|
-
const bs58check = createBase58check(sha256);
|
|
7
|
-
const PREFIX = {
|
|
8
|
-
B: new Uint8Array([1, 52]),
|
|
9
|
-
tz1: new Uint8Array([6, 161, 159]),
|
|
10
|
-
tz2: new Uint8Array([6, 161, 161]),
|
|
11
|
-
tz3: new Uint8Array([6, 161, 164]),
|
|
12
|
-
KT1: new Uint8Array([2, 90, 121]),
|
|
13
|
-
edpk: new Uint8Array([13, 15, 37, 217]),
|
|
14
|
-
sppk: new Uint8Array([3, 254, 226, 86]),
|
|
15
|
-
p2pk: new Uint8Array([3, 178, 139, 127])
|
|
16
|
-
};
|
|
17
|
-
const bs58checkDecode = (prefix, enc) => bs58check.decode(enc).slice(prefix.length);
|
|
18
|
-
const concatArray = (first, second) => {
|
|
19
|
-
const result = new Uint8Array(first.length + second.length);
|
|
20
|
-
result.set(first);
|
|
21
|
-
result.set(second, first.length);
|
|
22
|
-
return result;
|
|
23
|
-
};
|
|
24
|
-
const publicKeyHash2buffer = publicKeyHash => {
|
|
25
|
-
switch (publicKeyHash.substring(0, 3)) {
|
|
26
|
-
case 'tz1':
|
|
27
|
-
return {
|
|
28
|
-
originated: 0,
|
|
29
|
-
hash: concatArray(new Uint8Array([0]), bs58checkDecode(PREFIX.tz1, publicKeyHash))
|
|
30
|
-
};
|
|
31
|
-
case 'tz2':
|
|
32
|
-
return {
|
|
33
|
-
originated: 0,
|
|
34
|
-
hash: concatArray(new Uint8Array([1]), bs58checkDecode(PREFIX.tz2, publicKeyHash))
|
|
35
|
-
};
|
|
36
|
-
case 'tz3':
|
|
37
|
-
return {
|
|
38
|
-
originated: 0,
|
|
39
|
-
hash: concatArray(new Uint8Array([2]), bs58checkDecode(PREFIX.tz3, publicKeyHash))
|
|
40
|
-
};
|
|
41
|
-
case 'KT1':
|
|
42
|
-
return {
|
|
43
|
-
originated: 1,
|
|
44
|
-
hash: concatArray(bs58checkDecode(PREFIX.KT1, publicKeyHash), new Uint8Array([0]))
|
|
45
|
-
};
|
|
46
|
-
default:
|
|
47
|
-
throw ERRORS.TypedError('Method_InvalidParameter', 'Wrong Tezos publicKeyHash address');
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const publicKey2buffer = publicKey => {
|
|
51
|
-
switch (publicKey.substring(0, 4)) {
|
|
52
|
-
case 'edpk':
|
|
53
|
-
return concatArray(new Uint8Array([0]), bs58checkDecode(PREFIX.edpk, publicKey));
|
|
54
|
-
case 'sppk':
|
|
55
|
-
return concatArray(new Uint8Array([1]), bs58checkDecode(PREFIX.sppk, publicKey));
|
|
56
|
-
case 'p2pk':
|
|
57
|
-
return concatArray(new Uint8Array([2]), bs58checkDecode(PREFIX.p2pk, publicKey));
|
|
58
|
-
default:
|
|
59
|
-
throw ERRORS.TypedError('Method_InvalidParameter', 'Wrong Tezos publicKey');
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
export const createTx = (address_n, branch, operation, chunkify) => {
|
|
63
|
-
let message = {
|
|
64
|
-
address_n,
|
|
65
|
-
branch: bs58checkDecode(PREFIX.B, branch),
|
|
66
|
-
chunkify: typeof chunkify === 'boolean' ? chunkify : false
|
|
67
|
-
};
|
|
68
|
-
Assert(TezosOperation, operation);
|
|
69
|
-
if (operation.reveal) {
|
|
70
|
-
const {
|
|
71
|
-
reveal
|
|
72
|
-
} = operation;
|
|
73
|
-
message = {
|
|
74
|
-
...message,
|
|
75
|
-
reveal: {
|
|
76
|
-
source: publicKeyHash2buffer(reveal.source).hash,
|
|
77
|
-
public_key: publicKey2buffer(reveal.public_key),
|
|
78
|
-
fee: reveal.fee,
|
|
79
|
-
counter: reveal.counter,
|
|
80
|
-
gas_limit: reveal.gas_limit,
|
|
81
|
-
storage_limit: reveal.storage_limit
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
if (operation.transaction) {
|
|
86
|
-
const {
|
|
87
|
-
transaction
|
|
88
|
-
} = operation;
|
|
89
|
-
message = {
|
|
90
|
-
...message,
|
|
91
|
-
transaction: {
|
|
92
|
-
source: publicKeyHash2buffer(transaction.source).hash,
|
|
93
|
-
destination: {
|
|
94
|
-
tag: publicKeyHash2buffer(transaction.destination).originated,
|
|
95
|
-
hash: publicKeyHash2buffer(transaction.destination).hash
|
|
96
|
-
},
|
|
97
|
-
amount: transaction.amount,
|
|
98
|
-
counter: transaction.counter,
|
|
99
|
-
fee: transaction.fee,
|
|
100
|
-
gas_limit: transaction.gas_limit,
|
|
101
|
-
storage_limit: transaction.storage_limit
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
if (Object.prototype.hasOwnProperty.call(transaction, 'parameters')) {
|
|
105
|
-
message = {
|
|
106
|
-
...message,
|
|
107
|
-
transaction: {
|
|
108
|
-
...message.transaction,
|
|
109
|
-
parameters: transaction.parameters
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
if (transaction.parameters_manager) {
|
|
114
|
-
const {
|
|
115
|
-
parameters_manager
|
|
116
|
-
} = transaction;
|
|
117
|
-
if (parameters_manager.set_delegate) {
|
|
118
|
-
message = {
|
|
119
|
-
...message,
|
|
120
|
-
transaction: {
|
|
121
|
-
...message.transaction,
|
|
122
|
-
parameters_manager: {
|
|
123
|
-
set_delegate: publicKeyHash2buffer(parameters_manager.set_delegate).hash
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
if (Object.prototype.hasOwnProperty.call(parameters_manager, 'cancel_delegate')) {
|
|
129
|
-
message = {
|
|
130
|
-
...message,
|
|
131
|
-
transaction: {
|
|
132
|
-
...message.transaction,
|
|
133
|
-
parameters_manager: {
|
|
134
|
-
cancel_delegate: true
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
if (parameters_manager.transfer) {
|
|
140
|
-
const {
|
|
141
|
-
transfer
|
|
142
|
-
} = parameters_manager;
|
|
143
|
-
message = {
|
|
144
|
-
...message,
|
|
145
|
-
transaction: {
|
|
146
|
-
...message.transaction,
|
|
147
|
-
parameters_manager: {
|
|
148
|
-
transfer: {
|
|
149
|
-
destination: {
|
|
150
|
-
tag: publicKeyHash2buffer(transfer.destination).originated,
|
|
151
|
-
hash: publicKeyHash2buffer(transfer.destination).hash
|
|
152
|
-
},
|
|
153
|
-
amount: transfer.amount
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (operation.origination) {
|
|
162
|
-
const {
|
|
163
|
-
origination
|
|
164
|
-
} = operation;
|
|
165
|
-
message = {
|
|
166
|
-
...message,
|
|
167
|
-
origination: {
|
|
168
|
-
source: publicKeyHash2buffer(origination.source).hash,
|
|
169
|
-
balance: origination.balance,
|
|
170
|
-
fee: origination.fee,
|
|
171
|
-
counter: origination.counter,
|
|
172
|
-
gas_limit: origination.gas_limit,
|
|
173
|
-
storage_limit: origination.storage_limit,
|
|
174
|
-
script: origination.script
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
if (origination.delegate) {
|
|
178
|
-
message = {
|
|
179
|
-
...message,
|
|
180
|
-
origination: {
|
|
181
|
-
...message.origination,
|
|
182
|
-
delegate: publicKeyHash2buffer(origination.delegate).hash
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
if (operation.delegation) {
|
|
188
|
-
const {
|
|
189
|
-
delegation
|
|
190
|
-
} = operation;
|
|
191
|
-
message = {
|
|
192
|
-
...message,
|
|
193
|
-
delegation: {
|
|
194
|
-
source: publicKeyHash2buffer(delegation.source).hash,
|
|
195
|
-
delegate: publicKeyHash2buffer(delegation.delegate).hash,
|
|
196
|
-
fee: delegation.fee,
|
|
197
|
-
counter: delegation.counter,
|
|
198
|
-
gas_limit: delegation.gas_limit,
|
|
199
|
-
storage_limit: delegation.storage_limit
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
return message;
|
|
204
|
-
};
|
|
@@ -1,13 +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 ThpGetCredentials extends AbstractMethod<'thpGetCredentials'> {
|
|
5
|
-
constructor(message: MethodMessage<'thpGetCredentials'>);
|
|
6
|
-
get requiredPermissions(): MethodPermission[];
|
|
7
|
-
run(): Promise<{
|
|
8
|
-
autoconnect: boolean;
|
|
9
|
-
host_static_key: string;
|
|
10
|
-
trezor_static_public_key: string;
|
|
11
|
-
credential: string;
|
|
12
|
-
}>;
|
|
13
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { DEVICE, UI_REQUEST } from "@trezor/connect-common";
|
|
2
|
-
import { ERRORS } from "@trezor/connect-common/libESM/constants/index.mjs";
|
|
3
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
4
|
-
import * as settingsStore from "../data/settingsStore.mjs";
|
|
5
|
-
import { getThpCredentials } from "../device/thp/index.mjs";
|
|
6
|
-
export default class ThpGetCredentials extends AbstractMethod {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super(message, undefined);
|
|
9
|
-
this.allowDeviceMode = [UI_REQUEST.INITIALIZE, UI_REQUEST.SEEDLESS];
|
|
10
|
-
this.useDeviceState = false;
|
|
11
|
-
}
|
|
12
|
-
get requiredPermissions() {
|
|
13
|
-
return ['management'];
|
|
14
|
-
}
|
|
15
|
-
async run() {
|
|
16
|
-
const thpState = this.getDevice().getThpState();
|
|
17
|
-
if (!thpState?.handshakeCredentials) {
|
|
18
|
-
throw ERRORS.TypedError('Device_ThpStateMissing');
|
|
19
|
-
}
|
|
20
|
-
const credentials = await getThpCredentials(this.getDevice(), true);
|
|
21
|
-
thpState.setPairingCredentials([credentials]);
|
|
22
|
-
settingsStore.get('thp')?.knownCredentials?.push(credentials);
|
|
23
|
-
this.getDevice().emit(DEVICE.THP_CREDENTIALS_CHANGED, {
|
|
24
|
-
credentials
|
|
25
|
-
});
|
|
26
|
-
return credentials;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import type { ThpCredentials } from '@trezor/protocol';
|
|
3
|
-
import type { MethodMessage } from '../core/AbstractMethod';
|
|
4
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
5
|
-
type Params = {
|
|
6
|
-
credentials: ThpCredentials[];
|
|
7
|
-
};
|
|
8
|
-
export default class ThpRemoveCredentials extends AbstractMethod<'thpRemoveCredentials', Params> {
|
|
9
|
-
constructor(message: MethodMessage<'thpRemoveCredentials'>);
|
|
10
|
-
get requiredPermissions(): MethodPermission[];
|
|
11
|
-
run(): Promise<{
|
|
12
|
-
message: string;
|
|
13
|
-
}>;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { UI_REQUEST } from "@trezor/connect-common";
|
|
2
|
-
import { AbstractMethod } from "../core/AbstractMethod.mjs";
|
|
3
|
-
import * as settingsStore from "../data/settingsStore.mjs";
|
|
4
|
-
export default class ThpRemoveCredentials extends AbstractMethod {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
const params = {
|
|
7
|
-
credentials: message.payload.credentials || []
|
|
8
|
-
};
|
|
9
|
-
super(message, params);
|
|
10
|
-
this.useDevice = message.payload.device !== undefined;
|
|
11
|
-
this.allowDeviceMode = [UI_REQUEST.INITIALIZE, UI_REQUEST.SEEDLESS];
|
|
12
|
-
this.useDeviceState = false;
|
|
13
|
-
}
|
|
14
|
-
get requiredPermissions() {
|
|
15
|
-
return ['management'];
|
|
16
|
-
}
|
|
17
|
-
run() {
|
|
18
|
-
const requestedCredentials = this.params.credentials;
|
|
19
|
-
if (this.useDevice) {
|
|
20
|
-
const thpState = this.getDevice().getThpState();
|
|
21
|
-
if (thpState) {
|
|
22
|
-
requestedCredentials.push(...thpState.pairingCredentials);
|
|
23
|
-
thpState.resetState();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const credentialsMap = new Map(requestedCredentials.map(c => [c.credential, c]));
|
|
27
|
-
const knownCredentials = settingsStore.get('thp')?.knownCredentials;
|
|
28
|
-
if (knownCredentials && knownCredentials.length > 0) {
|
|
29
|
-
credentialsMap.forEach(c => {
|
|
30
|
-
let index;
|
|
31
|
-
while ((index = knownCredentials.findIndex(({
|
|
32
|
-
credential
|
|
33
|
-
}) => c.credential === credential)) >= 0) {
|
|
34
|
-
knownCredentials.splice(index, 1);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return Promise.resolve({
|
|
39
|
-
message: 'Success'
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type MethodPermission } from '@trezor/connect-common';
|
|
2
|
-
import { TronComposeTransaction as TronComposeTransactionSchema } from '@trezor/connect-common/libESM/types/api/tron';
|
|
3
|
-
import type { MethodMessage } from '../../../core/AbstractMethod';
|
|
4
|
-
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
5
|
-
export default class TronComposeTransaction extends AbstractMethod<'tronComposeTransaction', TronComposeTransactionSchema> {
|
|
6
|
-
constructor(message: MethodMessage<'tronComposeTransaction'>);
|
|
7
|
-
get requiredPermissions(): MethodPermission[];
|
|
8
|
-
get info(): string;
|
|
9
|
-
run(): Promise<{
|
|
10
|
-
rawDataHex: string;
|
|
11
|
-
ref_block_bytes: string;
|
|
12
|
-
ref_block_hash: string;
|
|
13
|
-
expiration: number;
|
|
14
|
-
timestamp: number;
|
|
15
|
-
bandwidth: number;
|
|
16
|
-
}>;
|
|
17
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { bytesToHex } from "@noble/hashes/utils.js";
|
|
2
|
-
import { TronComposeTransaction as TronComposeTransactionSchema } from "@trezor/connect-common/libESM/types/api/tron/index.mjs";
|
|
3
|
-
import { Assert } from "@trezor/schema-utils";
|
|
4
|
-
import { AbstractMethod } from "../../../core/AbstractMethod.mjs";
|
|
5
|
-
import { TRON_BANDWIDTH_FORMULA_OVERHEAD, encodeTronContractRawData } from "../tronEncode.mjs";
|
|
6
|
-
export default class TronComposeTransaction extends AbstractMethod {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
const {
|
|
9
|
-
payload
|
|
10
|
-
} = message;
|
|
11
|
-
Assert(TronComposeTransactionSchema, payload);
|
|
12
|
-
super(message, payload);
|
|
13
|
-
this.useDevice = false;
|
|
14
|
-
this.useUi = false;
|
|
15
|
-
}
|
|
16
|
-
get requiredPermissions() {
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
get info() {
|
|
20
|
-
return 'Compose Tron transaction';
|
|
21
|
-
}
|
|
22
|
-
async run() {
|
|
23
|
-
const {
|
|
24
|
-
contract,
|
|
25
|
-
blockHash,
|
|
26
|
-
blockHeight,
|
|
27
|
-
fee_limit,
|
|
28
|
-
data
|
|
29
|
-
} = this.params;
|
|
30
|
-
const ref_block_bytes = blockHeight.toString(16).padStart(16, '0').slice(12, 16);
|
|
31
|
-
const ref_block_hash = blockHash.replace(/^0x/, '').slice(16, 32);
|
|
32
|
-
const timestamp = Date.now();
|
|
33
|
-
const expiration = timestamp + 60 * 60 * 1000;
|
|
34
|
-
const rawData = encodeTronContractRawData(contract, {
|
|
35
|
-
ref_block_bytes,
|
|
36
|
-
ref_block_hash,
|
|
37
|
-
expiration,
|
|
38
|
-
timestamp,
|
|
39
|
-
fee_limit,
|
|
40
|
-
data
|
|
41
|
-
});
|
|
42
|
-
return {
|
|
43
|
-
rawDataHex: bytesToHex(rawData),
|
|
44
|
-
ref_block_bytes,
|
|
45
|
-
ref_block_hash,
|
|
46
|
-
expiration,
|
|
47
|
-
timestamp,
|
|
48
|
-
bandwidth: rawData.length + TRON_BANDWIDTH_FORMULA_OVERHEAD
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { MethodMessage } from '../../../core/AbstractMethod';
|
|
2
|
-
import { AbstractMiscGetAddress } from '../../common/AbstractMiscGetAddress';
|
|
3
|
-
import type { MiscGetAddressParams } from '../../common/AbstractMiscGetAddress';
|
|
4
|
-
export default class TronGetAddress extends AbstractMiscGetAddress<'tronGetAddress'> {
|
|
5
|
-
constructor(message: MethodMessage<'tronGetAddress'>);
|
|
6
|
-
get info(): string;
|
|
7
|
-
get confirmation(): {
|
|
8
|
-
view: "export-address";
|
|
9
|
-
label: string;
|
|
10
|
-
};
|
|
11
|
-
_call({ proto }: MiscGetAddressParams): Promise<{
|
|
12
|
-
mac?: string | undefined;
|
|
13
|
-
address: string;
|
|
14
|
-
}>;
|
|
15
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { AbstractMiscGetAddress } from "../../common/AbstractMiscGetAddress.mjs";
|
|
2
|
-
export default class TronGetAddress extends AbstractMiscGetAddress {
|
|
3
|
-
constructor(message) {
|
|
4
|
-
super(message, 2);
|
|
5
|
-
this.requiredDeviceCapabilities = ['Capability_Tron'];
|
|
6
|
-
}
|
|
7
|
-
get info() {
|
|
8
|
-
return this.getInfo('Tron', false);
|
|
9
|
-
}
|
|
10
|
-
get confirmation() {
|
|
11
|
-
return this.getConfirmation('Tron');
|
|
12
|
-
}
|
|
13
|
-
async _call({
|
|
14
|
-
proto
|
|
15
|
-
}) {
|
|
16
|
-
const cmd = this.getDevice().getCommands();
|
|
17
|
-
const response = await cmd.typedCall('TronGetAddress', 'TronAddress', proto);
|
|
18
|
-
return response.message;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { MethodPermission, PROTO, TronContracts } from '@trezor/connect-common';
|
|
2
|
-
import type { MethodMessage } from '../../../core/AbstractMethod';
|
|
3
|
-
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
4
|
-
type Params = {
|
|
5
|
-
tx: PROTO.TronSignTx;
|
|
6
|
-
contract: TronContracts;
|
|
7
|
-
};
|
|
8
|
-
export default class TronSignTransaction extends AbstractMethod<'tronSignTransaction', Params> {
|
|
9
|
-
hasBundle?: boolean;
|
|
10
|
-
progress: number;
|
|
11
|
-
constructor(message: MethodMessage<'tronSignTransaction'>);
|
|
12
|
-
get requiredPermissions(): MethodPermission[];
|
|
13
|
-
get info(): string;
|
|
14
|
-
run(): Promise<{
|
|
15
|
-
signature: string;
|
|
16
|
-
serializedTx: string | undefined;
|
|
17
|
-
}>;
|
|
18
|
-
}
|
|
19
|
-
export {};
|