@trezor/connect 9.4.3-beta.1 → 9.4.3
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 +80 -49
- package/README.md +1 -1
- package/lib/api/applyFlags.js +1 -1
- package/lib/api/applySettings.js +1 -1
- package/lib/api/authenticateDevice.js +1 -1
- package/lib/api/authorizeCoinjoin.js +1 -1
- package/lib/api/backupDevice.js +1 -1
- package/lib/api/binance/api/binanceGetAddress.js +2 -1
- package/lib/api/binance/api/binanceGetPublicKey.js +2 -1
- package/lib/api/binance/api/binanceSignTransaction.js +2 -1
- package/lib/api/binance/binanceSignTx.js +1 -1
- package/lib/api/bitcoin/Fees.js +2 -2
- package/lib/api/bitcoin/TransactionComposer.d.ts +3 -3
- package/lib/api/bitcoin/TransactionComposer.js +2 -2
- package/lib/api/bitcoin/refTx.js +1 -1
- package/lib/api/blockchainDisconnect.js +1 -1
- package/lib/api/blockchainEvmRpcCall.d.ts +16 -0
- package/lib/api/blockchainEvmRpcCall.js +45 -0
- package/lib/api/cancelCoinjoinAuthorization.js +1 -1
- package/lib/api/cardano/api/cardanoGetAddress.js +2 -1
- package/lib/api/cardano/api/cardanoGetNativeScriptHash.js +2 -1
- package/lib/api/cardano/api/cardanoGetPublicKey.js +2 -1
- package/lib/api/cardano/api/cardanoSignTransaction.js +2 -1
- package/lib/api/cardano/cardanoAddressParameters.js +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.js +1 -1
- package/lib/api/cardano/cardanoCertificate.js +1 -1
- package/lib/api/cardano/cardanoInputs.d.ts +8 -8
- package/lib/api/cardano/cardanoInputs.js +1 -1
- package/lib/api/cardano/cardanoOutputs.d.ts +22 -22
- package/lib/api/cardano/cardanoOutputs.js +1 -1
- package/lib/api/cardano/cardanoTokenBundle.d.ts +6 -6
- package/lib/api/cardano/cardanoTokenBundle.js +1 -1
- package/lib/api/changeLanguage.js +1 -1
- package/lib/api/changePin.js +1 -1
- package/lib/api/cipherKeyValue.js +1 -1
- package/lib/api/common/paramsValidator.js +1 -1
- package/lib/api/composeTransaction.d.ts +9 -3
- package/lib/api/composeTransaction.js +7 -4
- package/lib/api/eos/api/eosGetPublicKey.js +2 -1
- package/lib/api/eos/api/eosSignTransaction.js +2 -1
- package/lib/api/eos/eosSignTx.d.ts +3 -3
- package/lib/api/ethereum/api/ethereumGetAddress.js +2 -1
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +2 -1
- package/lib/api/ethereum/api/ethereumSignMessage.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumSignMessage.js +2 -1
- package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumSignTransaction.js +13 -7
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +58 -57
- package/lib/api/ethereum/api/ethereumSignTypedData.js +3 -2
- package/lib/api/ethereum/api/ethereumVerifyMessage.js +2 -1
- package/lib/api/ethereum/ethereumDefinitions.d.ts +21 -21
- package/lib/api/ethereum/ethereumDefinitions.js +6 -5
- package/lib/api/firmware/getBinary.js +1 -1
- package/lib/api/firmware/x509certificate.js +3 -5
- package/lib/api/getAccountDescriptor.js +1 -1
- package/lib/api/getAddress.js +1 -1
- package/lib/api/getCoinInfo.d.ts +3 -0
- package/lib/api/getCoinInfo.js +1 -1
- package/lib/api/getFirmwareHash.js +1 -1
- package/lib/api/getOwnershipId.js +1 -1
- package/lib/api/getOwnershipProof.js +1 -1
- package/lib/api/getPublicKey.js +1 -1
- package/lib/api/index.d.ts +2 -1
- package/lib/api/index.js +5 -3
- package/lib/api/loadDevice.d.ts +14 -0
- package/lib/api/loadDevice.js +44 -0
- package/lib/api/nem/api/nemGetAddress.js +2 -1
- package/lib/api/nem/api/nemSignTransaction.js +2 -1
- package/lib/api/pushTransaction.js +1 -1
- package/lib/api/rebootToBootloader.js +1 -1
- package/lib/api/recoveryDevice.js +1 -1
- package/lib/api/requestLogin.js +1 -1
- package/lib/api/resetDevice.js +1 -1
- package/lib/api/ripple/api/rippleGetAddress.js +2 -1
- package/lib/api/ripple/api/rippleSignTransaction.js +2 -1
- package/lib/api/setBrightness.js +1 -1
- package/lib/api/setBusy.js +1 -1
- package/lib/api/signMessage.js +1 -1
- package/lib/api/solana/api/solanaGetAddress.js +2 -1
- package/lib/api/solana/api/solanaGetPublicKey.js +2 -1
- package/lib/api/solana/api/solanaSignTransaction.js +2 -1
- package/lib/api/stellar/api/stellarGetAddress.js +2 -1
- package/lib/api/stellar/api/stellarSignTransaction.js +2 -1
- package/lib/api/stellar/stellarSignTx.js +1 -1
- package/lib/api/tezos/api/tezosGetAddress.js +2 -1
- package/lib/api/tezos/api/tezosGetPublicKey.js +2 -1
- package/lib/api/tezos/api/tezosSignTransaction.js +2 -1
- package/lib/api/tezos/tezosSignTx.js +1 -1
- package/lib/api/unlockPath.js +1 -1
- package/lib/api/verifyMessage.js +1 -1
- package/lib/backend/Blockchain.d.ts +3 -0
- package/lib/backend/Blockchain.js +3 -0
- package/lib/constants/errors.d.ts +3 -0
- package/lib/constants/errors.js +3 -0
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/index.js +3 -1
- package/lib/constants/nem.d.ts +3 -3
- package/lib/constants/utxo.d.ts +3 -0
- package/lib/constants/utxo.js +5 -0
- package/lib/core/AbstractMethod.d.ts +13 -5
- package/lib/core/AbstractMethod.js +50 -24
- package/lib/core/index.js +41 -30
- package/lib/core/onCallFirmwareUpdate.d.ts +2 -2
- package/lib/core/onCallFirmwareUpdate.js +5 -5
- package/lib/data/DataManager.d.ts +0 -181
- package/lib/data/DataManager.js +40 -6
- package/lib/data/analyticsInfo.js +2 -1
- package/lib/data/coinInfo.d.ts +14 -0
- package/lib/data/config.d.ts +20 -22
- package/lib/data/config.js +15 -40
- package/lib/data/connectSettings.js +5 -4
- package/lib/data/deviceAuthenticityConfig.js +17 -0
- package/lib/data/deviceAuthenticityConfigTypes.d.ts +32 -23
- package/lib/data/firmwareInfo.d.ts +1 -1
- package/lib/data/models.d.ts +9 -0
- package/lib/data/models.js +9 -0
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +143 -36
- package/lib/device/Device.js +226 -119
- package/lib/device/DeviceCommands.js +4 -4
- package/lib/device/DeviceList.d.ts +13 -21
- package/lib/device/DeviceList.js +54 -168
- package/lib/device/prompts.js +3 -2
- package/lib/device/resolveDescriptorForTaproot.d.ts +1 -1
- package/lib/events/call.d.ts +5 -5
- package/lib/events/call.js +2 -2
- package/lib/events/device.d.ts +0 -6
- package/lib/events/device.js +0 -6
- package/lib/events/transport.d.ts +1 -1
- package/lib/factory.d.ts +6 -6
- package/lib/factory.js +132 -136
- package/lib/impl/dynamic.d.ts +13 -19
- package/lib/impl/dynamic.js +0 -9
- package/lib/index-browser.d.ts +3 -1
- package/lib/index-browser.js +0 -3
- package/lib/index.d.ts +3 -1
- package/lib/index.js +1 -13
- package/lib/types/api/applySettings.d.ts +13 -13
- package/lib/types/api/authenticateDevice.d.ts +33 -24
- package/lib/types/api/authorizeCoinjoin.d.ts +10 -10
- package/lib/types/api/binance/index.d.ts +143 -143
- package/lib/types/api/binance/index.js +1 -1
- package/lib/types/api/bitcoin/index.d.ts +11 -11
- package/lib/types/api/bitcoin/index.js +1 -1
- package/lib/types/api/blockchainEvmRpcCall.d.ts +4 -0
- package/lib/types/api/{checkFirmwareAuthenticity.js → blockchainEvmRpcCall.js} +1 -1
- package/lib/types/api/cancelCoinjoinAuthorization.d.ts +1 -1
- package/lib/types/api/cardano/index.d.ts +507 -507
- package/lib/types/api/changeLanguage.d.ts +6 -6
- package/lib/types/api/cipherKeyValue.d.ts +8 -8
- package/lib/types/api/cipherKeyValue.js +1 -1
- package/lib/types/api/composeTransaction.d.ts +13 -7
- package/lib/types/api/eos/index.d.ts +525 -525
- package/lib/types/api/eos/index.js +1 -1
- package/lib/types/api/ethereum/index.d.ts +100 -100
- package/lib/types/api/firmwareUpdate.d.ts +5 -5
- package/lib/types/api/getAccountDescriptor.d.ts +4 -4
- package/lib/types/api/getAddress.d.ts +32 -32
- package/lib/types/api/getOwnershipId.d.ts +24 -24
- package/lib/types/api/getOwnershipProof.d.ts +28 -28
- package/lib/types/api/getPublicKey.d.ts +24 -24
- package/lib/types/api/getPublicKey.js +1 -1
- package/lib/types/api/index.d.ts +4 -8
- package/lib/types/api/init.d.ts +4 -2
- package/lib/types/api/loadDevice.d.ts +4 -0
- package/lib/types/api/loadDevice.js +3 -0
- package/lib/types/api/nem/index.d.ts +612 -612
- package/lib/types/api/nem/index.js +1 -1
- package/lib/types/api/nemGetAddress.d.ts +6 -6
- package/lib/types/api/pushTransaction.d.ts +3 -3
- package/lib/types/api/recoveryDevice.d.ts +9 -9
- package/lib/types/api/requestLogin.d.ts +25 -25
- package/lib/types/api/ripple/index.d.ts +21 -21
- package/lib/types/api/ripple/index.js +1 -1
- package/lib/types/api/solana/index.d.ts +23 -23
- package/lib/types/api/solana/index.js +1 -1
- package/lib/types/api/stellar/index.d.ts +582 -582
- package/lib/types/api/stellar/index.js +1 -1
- package/lib/types/api/tezos/index.d.ts +120 -120
- package/lib/types/api/tezos/index.js +1 -1
- package/lib/types/api/unlockPath.d.ts +2 -2
- package/lib/types/coinInfo.d.ts +231 -224
- package/lib/types/device.d.ts +13 -1
- package/lib/types/device.js +3 -1
- package/lib/types/fees.d.ts +19 -19
- package/lib/types/firmware.d.ts +1 -1
- package/lib/types/params.d.ts +21 -18
- package/lib/types/settings.d.ts +15 -9
- package/lib/types/utils.d.ts +1 -0
- package/lib/types/utils.js +3 -0
- package/lib/utils/addressUtils.js +2 -2
- package/lib/utils/assetUtils.js +3 -3
- package/lib/utils/deviceFeaturesUtils.js +1 -1
- package/lib/utils/uiPromiseManager.d.ts +2 -1
- package/lib/utils/uiPromiseManager.js +3 -3
- package/package.json +13 -13
- package/lib/api/checkFirmwareAuthenticity.d.ts +0 -11
- package/lib/api/checkFirmwareAuthenticity.js +0 -63
- package/lib/types/api/checkFirmwareAuthenticity.d.ts +0 -11
package/lib/factory.js
CHANGED
|
@@ -2,141 +2,137 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.factory = void 0;
|
|
4
4
|
const events_1 = require("./events");
|
|
5
|
-
const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
requestWebUSBDevice,
|
|
138
|
-
};
|
|
139
|
-
return api;
|
|
140
|
-
};
|
|
5
|
+
const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse, cancel, dispose, }, extraMethods = {}) => ({
|
|
6
|
+
manifest,
|
|
7
|
+
init,
|
|
8
|
+
on: (type, fn) => {
|
|
9
|
+
eventEmitter.on(type, fn);
|
|
10
|
+
},
|
|
11
|
+
off: (type, fn) => {
|
|
12
|
+
eventEmitter.removeListener(type, fn);
|
|
13
|
+
},
|
|
14
|
+
removeAllListeners: type => {
|
|
15
|
+
if (typeof type === 'string') {
|
|
16
|
+
eventEmitter.removeAllListeners(type);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
eventEmitter.removeAllListeners();
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
uiResponse,
|
|
23
|
+
blockchainGetAccountBalanceHistory: params => call({ ...params, method: 'blockchainGetAccountBalanceHistory' }),
|
|
24
|
+
blockchainGetCurrentFiatRates: params => call({ ...params, method: 'blockchainGetCurrentFiatRates' }),
|
|
25
|
+
blockchainGetFiatRatesForTimestamps: params => call({ ...params, method: 'blockchainGetFiatRatesForTimestamps' }),
|
|
26
|
+
blockchainEvmRpcCall: params => call({ ...params, method: 'blockchainEvmRpcCall' }),
|
|
27
|
+
blockchainDisconnect: params => call({ ...params, method: 'blockchainDisconnect' }),
|
|
28
|
+
blockchainEstimateFee: params => call({ ...params, method: 'blockchainEstimateFee' }),
|
|
29
|
+
blockchainGetTransactions: params => call({ ...params, method: 'blockchainGetTransactions' }),
|
|
30
|
+
blockchainSetCustomBackend: params => call({ ...params, method: 'blockchainSetCustomBackend' }),
|
|
31
|
+
blockchainSubscribe: params => call({ ...params, method: 'blockchainSubscribe' }),
|
|
32
|
+
blockchainSubscribeFiatRates: params => call({ ...params, method: 'blockchainSubscribeFiatRates' }),
|
|
33
|
+
blockchainUnsubscribe: params => call({ ...params, method: 'blockchainUnsubscribe' }),
|
|
34
|
+
blockchainUnsubscribeFiatRates: params => call({ ...params, method: 'blockchainUnsubscribeFiatRates' }),
|
|
35
|
+
requestLogin: params => requestLogin(params),
|
|
36
|
+
cardanoGetAddress: params => call({
|
|
37
|
+
...params,
|
|
38
|
+
method: 'cardanoGetAddress',
|
|
39
|
+
useEventListener: eventEmitter.listenerCount(events_1.UI.ADDRESS_VALIDATION) > 0,
|
|
40
|
+
}),
|
|
41
|
+
cardanoGetNativeScriptHash: params => call({ ...params, method: 'cardanoGetNativeScriptHash' }),
|
|
42
|
+
cardanoGetPublicKey: params => call({ ...params, method: 'cardanoGetPublicKey' }),
|
|
43
|
+
cardanoSignTransaction: params => call({ ...params, method: 'cardanoSignTransaction' }),
|
|
44
|
+
cardanoComposeTransaction: params => call({ ...params, method: 'cardanoComposeTransaction' }),
|
|
45
|
+
cipherKeyValue: params => call({ ...params, method: 'cipherKeyValue' }),
|
|
46
|
+
composeTransaction: params => call({ ...params, method: 'composeTransaction' }),
|
|
47
|
+
ethereumGetAddress: params => call({
|
|
48
|
+
...params,
|
|
49
|
+
method: 'ethereumGetAddress',
|
|
50
|
+
useEventListener: eventEmitter.listenerCount(events_1.UI.ADDRESS_VALIDATION) > 0,
|
|
51
|
+
}),
|
|
52
|
+
ethereumGetPublicKey: params => call({ ...params, method: 'ethereumGetPublicKey' }),
|
|
53
|
+
ethereumSignMessage: params => call({ ...params, method: 'ethereumSignMessage' }),
|
|
54
|
+
ethereumSignTransaction: params => call({ ...params, method: 'ethereumSignTransaction' }),
|
|
55
|
+
ethereumSignTypedData: params => call({ ...params, method: 'ethereumSignTypedData' }),
|
|
56
|
+
ethereumVerifyMessage: params => call({ ...params, method: 'ethereumVerifyMessage' }),
|
|
57
|
+
getAccountDescriptor: params => call({ ...params, method: 'getAccountDescriptor' }),
|
|
58
|
+
getAccountInfo: params => call({ ...params, method: 'getAccountInfo' }),
|
|
59
|
+
getAddress: params => call({
|
|
60
|
+
...params,
|
|
61
|
+
method: 'getAddress',
|
|
62
|
+
useEventListener: eventEmitter.listenerCount(events_1.UI.ADDRESS_VALIDATION) > 0,
|
|
63
|
+
}),
|
|
64
|
+
getDeviceState: params => call({ ...params, method: 'getDeviceState' }),
|
|
65
|
+
getFeatures: params => call({ ...params, method: 'getFeatures' }),
|
|
66
|
+
getFirmwareHash: params => call({ ...params, method: 'getFirmwareHash' }),
|
|
67
|
+
getOwnershipId: params => call({ ...params, method: 'getOwnershipId' }),
|
|
68
|
+
getOwnershipProof: params => call({ ...params, method: 'getOwnershipProof' }),
|
|
69
|
+
getPublicKey: params => call({ ...params, method: 'getPublicKey' }),
|
|
70
|
+
nemGetAddress: params => call({
|
|
71
|
+
...params,
|
|
72
|
+
method: 'nemGetAddress',
|
|
73
|
+
useEventListener: eventEmitter.listenerCount(events_1.UI.ADDRESS_VALIDATION) > 0,
|
|
74
|
+
}),
|
|
75
|
+
nemSignTransaction: params => call({ ...params, method: 'nemSignTransaction' }),
|
|
76
|
+
pushTransaction: params => call({ ...params, method: 'pushTransaction' }),
|
|
77
|
+
rippleGetAddress: params => call({
|
|
78
|
+
...params,
|
|
79
|
+
method: 'rippleGetAddress',
|
|
80
|
+
useEventListener: eventEmitter.listenerCount(events_1.UI.ADDRESS_VALIDATION) > 0,
|
|
81
|
+
}),
|
|
82
|
+
rippleSignTransaction: params => call({ ...params, method: 'rippleSignTransaction' }),
|
|
83
|
+
signMessage: params => call({ ...params, method: 'signMessage' }),
|
|
84
|
+
signTransaction: params => call({ ...params, method: 'signTransaction' }),
|
|
85
|
+
solanaGetPublicKey: params => call({ ...params, method: 'solanaGetPublicKey' }),
|
|
86
|
+
solanaGetAddress: params => call({ ...params, method: 'solanaGetAddress' }),
|
|
87
|
+
solanaSignTransaction: params => call({ ...params, method: 'solanaSignTransaction' }),
|
|
88
|
+
stellarGetAddress: params => call({
|
|
89
|
+
...params,
|
|
90
|
+
method: 'stellarGetAddress',
|
|
91
|
+
useEventListener: eventEmitter.listenerCount(events_1.UI.ADDRESS_VALIDATION) > 0,
|
|
92
|
+
}),
|
|
93
|
+
stellarSignTransaction: params => call({ ...params, method: 'stellarSignTransaction' }),
|
|
94
|
+
tezosGetAddress: params => call({
|
|
95
|
+
...params,
|
|
96
|
+
method: 'tezosGetAddress',
|
|
97
|
+
useEventListener: eventEmitter.listenerCount(events_1.UI.ADDRESS_VALIDATION) > 0,
|
|
98
|
+
}),
|
|
99
|
+
tezosGetPublicKey: params => call({ ...params, method: 'tezosGetPublicKey' }),
|
|
100
|
+
tezosSignTransaction: params => call({ ...params, method: 'tezosSignTransaction' }),
|
|
101
|
+
unlockPath: params => call({ ...params, method: 'unlockPath' }),
|
|
102
|
+
eosGetPublicKey: params => call({ ...params, method: 'eosGetPublicKey' }),
|
|
103
|
+
eosSignTransaction: params => call({ ...params, method: 'eosSignTransaction' }),
|
|
104
|
+
binanceGetAddress: params => call({
|
|
105
|
+
...params,
|
|
106
|
+
method: 'binanceGetAddress',
|
|
107
|
+
useEventListener: eventEmitter.listenerCount(events_1.UI.ADDRESS_VALIDATION) > 0,
|
|
108
|
+
}),
|
|
109
|
+
binanceGetPublicKey: params => call({ ...params, method: 'binanceGetPublicKey' }),
|
|
110
|
+
binanceSignTransaction: params => call({ ...params, method: 'binanceSignTransaction' }),
|
|
111
|
+
verifyMessage: params => call({ ...params, method: 'verifyMessage' }),
|
|
112
|
+
resetDevice: params => call({ ...params, method: 'resetDevice' }),
|
|
113
|
+
loadDevice: params => call({ ...params, method: 'loadDevice' }),
|
|
114
|
+
wipeDevice: params => call({ ...params, method: 'wipeDevice' }),
|
|
115
|
+
applyFlags: params => call({ ...params, method: 'applyFlags' }),
|
|
116
|
+
applySettings: params => call({ ...params, method: 'applySettings' }),
|
|
117
|
+
getSettings: () => call({ method: 'getSettings' }),
|
|
118
|
+
authenticateDevice: params => call({ ...params, method: 'authenticateDevice' }),
|
|
119
|
+
authorizeCoinjoin: params => call({ ...params, method: 'authorizeCoinjoin' }),
|
|
120
|
+
cancelCoinjoinAuthorization: params => call({ ...params, method: 'cancelCoinjoinAuthorization' }),
|
|
121
|
+
showDeviceTutorial: params => call({ ...params, method: 'showDeviceTutorial' }),
|
|
122
|
+
backupDevice: params => call({ ...params, method: 'backupDevice' }),
|
|
123
|
+
changeLanguage: params => call({ ...params, method: 'changeLanguage' }),
|
|
124
|
+
changePin: params => call({ ...params, method: 'changePin' }),
|
|
125
|
+
changeWipeCode: params => call({ ...params, method: 'changeWipeCode' }),
|
|
126
|
+
firmwareUpdate: params => call({ ...params, method: 'firmwareUpdate' }),
|
|
127
|
+
recoveryDevice: params => call({ ...params, method: 'recoveryDevice' }),
|
|
128
|
+
getCoinInfo: params => call({ ...params, method: 'getCoinInfo' }),
|
|
129
|
+
rebootToBootloader: params => call({ ...params, method: 'rebootToBootloader' }),
|
|
130
|
+
setBrightness: params => call({ ...params, method: 'setBrightness' }),
|
|
131
|
+
setBusy: params => call({ ...params, method: 'setBusy' }),
|
|
132
|
+
setProxy: params => call({ ...params, method: 'setProxy' }),
|
|
133
|
+
dispose,
|
|
134
|
+
cancel,
|
|
135
|
+
...extraMethods,
|
|
136
|
+
});
|
|
141
137
|
exports.factory = factory;
|
|
142
138
|
//# sourceMappingURL=factory.js.map
|
package/lib/impl/dynamic.d.ts
CHANGED
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
import EventEmitter from 'events';
|
|
2
2
|
import { ConnectFactoryDependencies } from '../factory';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Manifest } from '../types/settings';
|
|
4
4
|
import { CallMethodPayload } from '../events';
|
|
5
|
-
|
|
5
|
+
import { InitFullSettings } from '../types/api/init';
|
|
6
|
+
type TrezorConnectDynamicParams<ImplType, SettingsType extends Record<string, any>, ImplInterface extends ConnectFactoryDependencies<SettingsType>> = {
|
|
6
7
|
implementations: {
|
|
7
|
-
type:
|
|
8
|
-
impl:
|
|
8
|
+
type: ImplType;
|
|
9
|
+
impl: ImplInterface;
|
|
9
10
|
}[];
|
|
10
|
-
getInitTarget: (settings:
|
|
11
|
+
getInitTarget: (settings: InitFullSettings<SettingsType>) => ImplType;
|
|
11
12
|
handleErrorFallback: (errorCode: string) => Promise<boolean>;
|
|
12
13
|
};
|
|
13
|
-
export declare class TrezorConnectDynamic<
|
|
14
|
+
export declare class TrezorConnectDynamic<ImplType, SettingsType extends Record<string, any>, ImplInterface extends ConnectFactoryDependencies<SettingsType>> implements ConnectFactoryDependencies<SettingsType> {
|
|
14
15
|
eventEmitter: EventEmitter;
|
|
15
16
|
private currentTarget;
|
|
16
17
|
private implementations;
|
|
17
18
|
private getInitTarget;
|
|
18
19
|
private handleErrorFallback;
|
|
19
|
-
lastSettings?:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
private getTarget;
|
|
24
|
-
switchTarget(target: TrezorConnectImplType): Promise<void>;
|
|
20
|
+
lastSettings?: InitFullSettings<SettingsType>;
|
|
21
|
+
constructor({ implementations, getInitTarget, handleErrorFallback, }: TrezorConnectDynamicParams<ImplType, SettingsType, ImplInterface>);
|
|
22
|
+
getTarget(): ImplInterface;
|
|
23
|
+
switchTarget(target: ImplType): Promise<void>;
|
|
25
24
|
manifest(manifest: Manifest): void;
|
|
26
|
-
init(settings:
|
|
27
|
-
manifest: Manifest;
|
|
28
|
-
} & Partial<ConnectSettingsPublic>): Promise<void>;
|
|
25
|
+
init(settings: InitFullSettings<SettingsType>): Promise<void>;
|
|
29
26
|
call(params: CallMethodPayload): Promise<any>;
|
|
30
|
-
requestLogin(params: any): import("
|
|
27
|
+
requestLogin(params: any): import("..").Response<import("../types/api/requestLogin").Login>;
|
|
31
28
|
uiResponse(params: any): void;
|
|
32
|
-
renderWebUSBButton(): void;
|
|
33
|
-
disableWebUSB(): void;
|
|
34
|
-
requestWebUSBDevice(): void;
|
|
35
29
|
cancel(error?: string): void;
|
|
36
30
|
dispose(): void;
|
|
37
31
|
}
|
package/lib/impl/dynamic.js
CHANGED
|
@@ -63,15 +63,6 @@ class TrezorConnectDynamic {
|
|
|
63
63
|
uiResponse(params) {
|
|
64
64
|
return this.getTarget().uiResponse(params);
|
|
65
65
|
}
|
|
66
|
-
renderWebUSBButton() {
|
|
67
|
-
return this.getTarget().renderWebUSBButton();
|
|
68
|
-
}
|
|
69
|
-
disableWebUSB() {
|
|
70
|
-
return this.getTarget().disableWebUSB();
|
|
71
|
-
}
|
|
72
|
-
requestWebUSBDevice() {
|
|
73
|
-
return this.getTarget().requestWebUSBDevice();
|
|
74
|
-
}
|
|
75
66
|
cancel(error) {
|
|
76
67
|
return this.getTarget().cancel(error);
|
|
77
68
|
}
|
package/lib/index-browser.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
declare const TrezorConnect: import("./exports").TrezorConnect
|
|
1
|
+
declare const TrezorConnect: Omit<import("./exports").TrezorConnect, "init"> & {
|
|
2
|
+
init: import("./types/api/init").InitType<Record<string, any>>;
|
|
3
|
+
} & Record<string, any>;
|
|
2
4
|
export default TrezorConnect;
|
|
3
5
|
export * from './exports';
|
|
4
6
|
//# sourceMappingURL=index-browser.d.ts.map
|
package/lib/index-browser.js
CHANGED
|
@@ -17,10 +17,7 @@ const TrezorConnect = (0, factory_1.factory)({
|
|
|
17
17
|
init: fallback,
|
|
18
18
|
call: fallback,
|
|
19
19
|
requestLogin: fallback,
|
|
20
|
-
requestWebUSBDevice: fallback,
|
|
21
20
|
uiResponse: fallback,
|
|
22
|
-
renderWebUSBButton: fallback,
|
|
23
|
-
disableWebUSB: fallback,
|
|
24
21
|
cancel: fallback,
|
|
25
22
|
dispose: fallback,
|
|
26
23
|
});
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import EventEmitter from 'events';
|
|
2
2
|
export declare const eventEmitter: EventEmitter<[never]>;
|
|
3
|
-
declare const TrezorConnect: import("./types").TrezorConnect
|
|
3
|
+
declare const TrezorConnect: Omit<import("./types").TrezorConnect, "init"> & {
|
|
4
|
+
init: import("./types/api/init").InitType<Record<string, any>>;
|
|
5
|
+
};
|
|
4
6
|
export default TrezorConnect;
|
|
5
7
|
export * from './exports';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -162,15 +162,6 @@ const cancel = (error) => {
|
|
|
162
162
|
payload: error ? { error } : null,
|
|
163
163
|
});
|
|
164
164
|
};
|
|
165
|
-
const renderWebUSBButton = (_className) => {
|
|
166
|
-
throw constants_1.ERRORS.TypedError('Method_InvalidPackage');
|
|
167
|
-
};
|
|
168
|
-
const disableWebUSB = () => {
|
|
169
|
-
throw constants_1.ERRORS.TypedError('Method_InvalidPackage');
|
|
170
|
-
};
|
|
171
|
-
const requestWebUSBDevice = () => {
|
|
172
|
-
throw constants_1.ERRORS.TypedError('Method_InvalidPackage');
|
|
173
|
-
};
|
|
174
165
|
const TrezorConnect = (0, factory_1.factory)({
|
|
175
166
|
eventEmitter: exports.eventEmitter,
|
|
176
167
|
manifest,
|
|
@@ -178,12 +169,9 @@ const TrezorConnect = (0, factory_1.factory)({
|
|
|
178
169
|
call,
|
|
179
170
|
requestLogin,
|
|
180
171
|
uiResponse,
|
|
181
|
-
renderWebUSBButton,
|
|
182
|
-
disableWebUSB,
|
|
183
|
-
requestWebUSBDevice,
|
|
184
172
|
cancel,
|
|
185
173
|
dispose,
|
|
186
|
-
});
|
|
174
|
+
}, {});
|
|
187
175
|
exports.default = TrezorConnect;
|
|
188
176
|
tslib_1.__exportStar(require("./exports"), exports);
|
|
189
177
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,19 +3,19 @@ import { PROTO } from '../../constants';
|
|
|
3
3
|
import type { Params, Response } from '../params';
|
|
4
4
|
export type ApplySettings = Static<typeof ApplySettings>;
|
|
5
5
|
export declare const ApplySettings: import("@trezor/schema-utils").TObject<{
|
|
6
|
-
language: import("@
|
|
7
|
-
label: import("@
|
|
8
|
-
passphrase_always_on_device: import("@
|
|
9
|
-
safety_checks: import("@
|
|
10
|
-
auto_lock_delay_ms: import("@
|
|
11
|
-
display_rotation: import("@
|
|
12
|
-
experimental_features: import("@
|
|
13
|
-
hide_passphrase_from_host: import("@
|
|
14
|
-
haptic_feedback: import("@
|
|
15
|
-
use_passphrase: import("@
|
|
16
|
-
homescreen: import("@
|
|
17
|
-
_passphrase_source: import("@
|
|
18
|
-
passphrase_source: import("@
|
|
6
|
+
language: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
7
|
+
label: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
8
|
+
passphrase_always_on_device: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
|
|
9
|
+
safety_checks: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils/lib/custom-types/keyof-enum").TKeyOfEnum<typeof PROTO.Enum_SafetyCheckLevel>>;
|
|
10
|
+
auto_lock_delay_ms: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TNumber>;
|
|
11
|
+
display_rotation: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TNumber>;
|
|
12
|
+
experimental_features: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
|
|
13
|
+
hide_passphrase_from_host: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
|
|
14
|
+
haptic_feedback: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
|
|
15
|
+
use_passphrase: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
|
|
16
|
+
homescreen: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
17
|
+
_passphrase_source: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TNumber>;
|
|
18
|
+
passphrase_source: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TNumber>;
|
|
19
19
|
}>;
|
|
20
20
|
export declare function applySettings(params: Params<ApplySettings>): Response<PROTO.Success>;
|
|
21
21
|
//# sourceMappingURL=applySettings.d.ts.map
|
|
@@ -2,42 +2,51 @@ import { Static } from '@trezor/schema-utils';
|
|
|
2
2
|
import type { Params, Response } from '../params';
|
|
3
3
|
export type AuthenticateDeviceParams = Static<typeof AuthenticateDeviceParams>;
|
|
4
4
|
export declare const AuthenticateDeviceParams: import("@trezor/schema-utils").TObject<{
|
|
5
|
-
config: import("@
|
|
6
|
-
T2B1: import("@
|
|
7
|
-
rootPubKeys: import("@
|
|
8
|
-
caPubKeys: import("@
|
|
5
|
+
config: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
6
|
+
T2B1: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
7
|
+
rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
8
|
+
caPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
9
9
|
}>, import("@trezor/schema-utils").TObject<{
|
|
10
|
-
debug: import("@
|
|
11
|
-
rootPubKeys: import("@
|
|
12
|
-
caPubKeys: import("@
|
|
10
|
+
debug: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
11
|
+
rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
12
|
+
caPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
13
13
|
}>>;
|
|
14
14
|
}>]>;
|
|
15
|
-
T3B1: import("@
|
|
16
|
-
rootPubKeys: import("@
|
|
17
|
-
caPubKeys: import("@
|
|
15
|
+
T3B1: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
16
|
+
rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
17
|
+
caPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
18
18
|
}>, import("@trezor/schema-utils").TObject<{
|
|
19
|
-
debug: import("@
|
|
20
|
-
rootPubKeys: import("@
|
|
21
|
-
caPubKeys: import("@
|
|
19
|
+
debug: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
20
|
+
rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
21
|
+
caPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
22
22
|
}>>;
|
|
23
23
|
}>]>;
|
|
24
|
-
T3T1: import("@
|
|
25
|
-
rootPubKeys: import("@
|
|
26
|
-
caPubKeys: import("@
|
|
24
|
+
T3T1: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
25
|
+
rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
26
|
+
caPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
27
27
|
}>, import("@trezor/schema-utils").TObject<{
|
|
28
|
-
debug: import("@
|
|
29
|
-
rootPubKeys: import("@
|
|
30
|
-
caPubKeys: import("@
|
|
28
|
+
debug: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
29
|
+
rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
30
|
+
caPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
31
|
+
}>>;
|
|
32
|
+
}>]>;
|
|
33
|
+
T3W1: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
34
|
+
rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
35
|
+
caPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
36
|
+
}>, import("@trezor/schema-utils").TObject<{
|
|
37
|
+
debug: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
38
|
+
rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
39
|
+
caPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
31
40
|
}>>;
|
|
32
41
|
}>]>;
|
|
33
42
|
}>, import("@trezor/schema-utils").TObject<{
|
|
34
|
-
T1B1: import("@
|
|
35
|
-
T2T1: import("@
|
|
43
|
+
T1B1: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
|
|
44
|
+
T2T1: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
|
|
36
45
|
}>]>, import("@trezor/schema-utils").TObject<{
|
|
37
|
-
version: import("@
|
|
38
|
-
timestamp: import("@
|
|
46
|
+
version: import("@trezor/schema-utils").TNumber;
|
|
47
|
+
timestamp: import("@trezor/schema-utils").TString;
|
|
39
48
|
}>]>>;
|
|
40
|
-
allowDebugKeys: import("@
|
|
49
|
+
allowDebugKeys: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
|
|
41
50
|
}>;
|
|
42
51
|
export type AuthenticateDeviceResult = {
|
|
43
52
|
valid: true;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { Params, Response } from '../params';
|
|
2
1
|
import { Static } from '@trezor/schema-utils';
|
|
2
|
+
import type { Params, Response } from '../params';
|
|
3
3
|
import { PROTO } from '../../constants';
|
|
4
4
|
export type AuthorizeCoinjoin = Static<typeof AuthorizeCoinjoin>;
|
|
5
5
|
export declare const AuthorizeCoinjoin: import("@trezor/schema-utils").TObject<{
|
|
6
|
-
path: import("@
|
|
7
|
-
coordinator: import("@
|
|
8
|
-
maxRounds: import("@
|
|
9
|
-
maxCoordinatorFeeRate: import("@
|
|
10
|
-
maxFeePerKvbyte: import("@
|
|
11
|
-
coin: import("@
|
|
12
|
-
scriptType: import("@
|
|
13
|
-
amountUnit: import("@
|
|
14
|
-
preauthorized: import("@
|
|
6
|
+
path: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TNumber>]>;
|
|
7
|
+
coordinator: import("@trezor/schema-utils").TString;
|
|
8
|
+
maxRounds: import("@trezor/schema-utils").TNumber;
|
|
9
|
+
maxCoordinatorFeeRate: import("@trezor/schema-utils").TNumber;
|
|
10
|
+
maxFeePerKvbyte: import("@trezor/schema-utils").TNumber;
|
|
11
|
+
coin: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
12
|
+
scriptType: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TLiteral<"SPENDADDRESS">, import("@trezor/schema-utils").TLiteral<"SPENDMULTISIG">, import("@trezor/schema-utils").TLiteral<"SPENDWITNESS">, import("@trezor/schema-utils").TLiteral<"SPENDP2SHWITNESS">, import("@trezor/schema-utils").TLiteral<"SPENDTAPROOT">]>>;
|
|
13
|
+
amountUnit: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TEnum<typeof PROTO.AmountUnit>>;
|
|
14
|
+
preauthorized: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
|
|
15
15
|
}>;
|
|
16
16
|
export declare function authorizeCoinjoin(params: Params<AuthorizeCoinjoin>): Response<PROTO.Success>;
|
|
17
17
|
//# sourceMappingURL=authorizeCoinjoin.d.ts.map
|