@trezor/connect 9.2.1 → 9.2.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 +90 -0
- package/README.md +1 -1
- package/lib/api/binance/api/binanceSignTransaction.d.ts +1 -1
- package/lib/api/binance/binanceSignTx.d.ts +1 -1
- package/lib/api/bitcoin/Fees.d.ts +2 -2
- package/lib/api/bitcoin/TransactionComposer.d.ts +2 -2
- package/lib/api/blockchainDisconnect.d.ts +1 -0
- package/lib/api/blockchainDisconnect.js +3 -4
- package/lib/api/blockchainEstimateFee.d.ts +1 -0
- package/lib/api/blockchainEstimateFee.js +7 -4
- package/lib/api/blockchainGetAccountBalanceHistory.d.ts +1 -0
- package/lib/api/blockchainGetAccountBalanceHistory.js +3 -1
- package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -0
- package/lib/api/blockchainGetCurrentFiatRates.js +3 -1
- package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -0
- package/lib/api/blockchainGetFiatRatesForTimestamps.js +3 -1
- package/lib/api/blockchainGetTransactions.d.ts +1 -0
- package/lib/api/blockchainGetTransactions.js +3 -1
- package/lib/api/blockchainSetCustomBackend.js +1 -5
- package/lib/api/blockchainSubscribe.d.ts +2 -0
- package/lib/api/blockchainSubscribe.js +13 -2
- package/lib/api/blockchainSubscribeFiatRates.d.ts +1 -0
- package/lib/api/blockchainSubscribeFiatRates.js +3 -1
- package/lib/api/blockchainUnsubscribe.d.ts +1 -0
- package/lib/api/blockchainUnsubscribe.js +5 -2
- package/lib/api/blockchainUnsubscribeFiatRates.d.ts +1 -0
- package/lib/api/blockchainUnsubscribeFiatRates.js +6 -2
- package/lib/api/changeLanguage.d.ts +0 -1
- package/lib/api/changeLanguage.js +8 -39
- package/lib/api/composeTransaction.d.ts +2 -0
- package/lib/api/composeTransaction.js +10 -5
- package/lib/api/eos/eosSignTx.d.ts +58 -58
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +6 -6
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +2 -1
- package/lib/api/ethereum/ethereumDefinitions.js +1 -0
- package/lib/api/getAccountInfo.js +4 -3
- package/lib/api/getCoinInfo.d.ts +25 -22
- package/lib/api/getFeatures.d.ts +10 -10
- package/lib/api/getPublicKey.d.ts +6 -6
- package/lib/api/nem/nemSignTx.d.ts +13 -13
- package/lib/api/pushTransaction.d.ts +1 -0
- package/lib/api/pushTransaction.js +2 -1
- package/lib/api/resetDevice.d.ts +1 -1
- package/lib/api/resetDevice.js +2 -2
- package/lib/api/signTransaction.d.ts +1 -0
- package/lib/api/signTransaction.js +5 -3
- package/lib/api/stellar/stellarSignTx.d.ts +1 -1
- package/lib/api/tezos/tezosSignTx.d.ts +18 -18
- package/lib/backend/BackendManager.d.ts +6 -4
- package/lib/backend/BackendManager.js +36 -28
- package/lib/backend/Blockchain.d.ts +15 -4
- package/lib/backend/Blockchain.js +27 -17
- package/lib/backend/BlockchainLink.d.ts +3 -3
- package/lib/backend/BlockchainLink.js +3 -3
- package/lib/core/AbstractMethod.js +1 -0
- package/lib/core/index.js +34 -5
- package/lib/data/DataManager.d.ts +22 -0
- package/lib/data/DataManager.js +7 -3
- package/lib/data/coinInfo.d.ts +131 -117
- package/lib/data/config.d.ts +22 -0
- package/lib/data/config.js +19 -1
- package/lib/data/connectSettings.js +3 -0
- package/lib/data/defaultFeeLevels.js +9 -1
- package/lib/data/deviceAuthenticityConfig.d.ts +9 -0
- package/lib/data/deviceAuthenticityConfig.js +26 -3
- package/lib/data/firmwareInfo.d.ts +1 -1
- package/lib/data/firmwareInfo.js +1 -5
- package/lib/data/getLanguage.d.ts +6 -0
- package/lib/data/getLanguage.js +10 -0
- 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 +15 -3
- package/lib/device/Device.js +55 -6
- package/lib/device/DeviceCommands.d.ts +8 -8
- package/lib/device/DeviceList.js +4 -6
- package/lib/device/resolveDescriptorForTaproot.js +21 -16
- package/lib/events/blockchain.d.ts +3 -0
- package/lib/events/device.d.ts +1 -0
- package/lib/events/device.js +1 -0
- package/lib/types/api/applySettings.d.ts +6 -6
- package/lib/types/api/authenticateDevice.d.ts +9 -0
- package/lib/types/api/bitcoin/index.d.ts +1 -0
- package/lib/types/api/blockchainSetCustomBackend.d.ts +3 -2
- package/lib/types/api/blockchainSubscribe.d.ts +1 -0
- package/lib/types/api/composeTransaction.d.ts +2 -0
- package/lib/types/api/getAccountInfo.d.ts +1 -0
- package/lib/types/api/getAddress.d.ts +5 -5
- package/lib/types/api/getCoinInfo.d.ts +4 -2
- package/lib/types/api/getPublicKey.js +4 -1
- package/lib/types/api/nemGetAddress.d.ts +11 -4
- package/lib/types/api/nemGetAddress.js +9 -0
- package/lib/types/api/pushTransaction.d.ts +1 -0
- package/lib/types/api/pushTransaction.js +1 -0
- package/lib/types/api/recoveryDevice.d.ts +1 -1
- package/lib/types/api/resetDevice.d.ts +1 -15
- package/lib/types/api/resetDevice.js +0 -9
- package/lib/types/api/setBusy.d.ts +2 -2
- package/lib/types/coinInfo.d.ts +15 -7
- package/lib/types/coinInfo.js +8 -6
- package/lib/types/firmware.d.ts +5 -15
- package/lib/types/params.d.ts +1 -0
- package/lib/types/params.js +5 -2
- package/lib/types/settings.d.ts +1 -0
- package/lib/utils/assetUtils.js +18 -8
- package/lib/utils/{assets-native.d.ts → assets.native.d.ts} +1 -1
- package/lib/utils/{assets-native.js → assets.native.js} +1 -1
- package/lib/utils/debug.d.ts +5 -31
- package/lib/utils/debug.js +8 -110
- package/lib/utils/hdnodeUtils.d.ts +3 -3
- package/lib/utils/pathUtils.d.ts +3 -3
- package/lib/workers/{workers-react-native.d.ts → workers.native.d.ts} +1 -1
- package/lib/workers/{workers-react-native.js → workers.native.js} +1 -1
- package/package.json +40 -20
|
@@ -20,6 +20,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
20
20
|
(0, paramsValidator_1.validateParams)(payload, [
|
|
21
21
|
{ name: 'outputs', type: 'array', required: true },
|
|
22
22
|
{ name: 'coin', type: 'string', required: true },
|
|
23
|
+
{ name: 'identity', type: 'string' },
|
|
23
24
|
{ name: 'push', type: 'boolean' },
|
|
24
25
|
{ name: 'account', type: 'object' },
|
|
25
26
|
{ name: 'feeLevels', type: 'array' },
|
|
@@ -48,6 +49,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
48
49
|
this.params = {
|
|
49
50
|
outputs,
|
|
50
51
|
coinInfo,
|
|
52
|
+
identity: payload.identity,
|
|
51
53
|
account: payload.account,
|
|
52
54
|
feeLevels: payload.feeLevels,
|
|
53
55
|
baseFee: payload.baseFee,
|
|
@@ -66,6 +68,9 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
66
68
|
}
|
|
67
69
|
return `Send ${(0, formatUtils_1.formatAmount)(this.params.total.toString(), this.params.coinInfo)}`;
|
|
68
70
|
}
|
|
71
|
+
getBlockchain() {
|
|
72
|
+
return (0, BlockchainLink_1.initBlockchain)(this.params.coinInfo, this.postMessage, this.params.identity);
|
|
73
|
+
}
|
|
69
74
|
async precompose(account, feeLevels) {
|
|
70
75
|
const { coinInfo, outputs, baseFee, skipPermutation } = this.params;
|
|
71
76
|
const address_n = pathUtils.validatePath(account.path);
|
|
@@ -83,7 +88,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
83
88
|
baseFee,
|
|
84
89
|
skipPermutation,
|
|
85
90
|
});
|
|
86
|
-
const blockchain = await
|
|
91
|
+
const blockchain = await this.getBlockchain();
|
|
87
92
|
await composer.init(blockchain);
|
|
88
93
|
return feeLevels.map(level => {
|
|
89
94
|
composer.composeCustomFee(level.feePerUnit);
|
|
@@ -120,7 +125,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
120
125
|
}
|
|
121
126
|
async selectAccount() {
|
|
122
127
|
const { coinInfo } = this.params;
|
|
123
|
-
const blockchain = await
|
|
128
|
+
const blockchain = await this.getBlockchain();
|
|
124
129
|
const dfd = this.createUiPromise(events_1.UI.RECEIVE_ACCOUNT);
|
|
125
130
|
if (this.discovery && this.discovery.completed) {
|
|
126
131
|
const { discovery } = this;
|
|
@@ -181,7 +186,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
181
186
|
}
|
|
182
187
|
async selectFee(account, utxos) {
|
|
183
188
|
const { coinInfo, outputs } = this.params;
|
|
184
|
-
const blockchain = await
|
|
189
|
+
const blockchain = await this.getBlockchain();
|
|
185
190
|
const composer = new bitcoin_1.TransactionComposer({
|
|
186
191
|
account,
|
|
187
192
|
utxos,
|
|
@@ -228,7 +233,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
228
233
|
const requiredRefTxs = (0, bitcoin_1.requireReferencedTransactions)(inputs, options, coinInfo);
|
|
229
234
|
const refTxsIds = (0, bitcoin_1.getReferencedTransactions)(inputs);
|
|
230
235
|
if (requiredRefTxs && refTxsIds.length > 0) {
|
|
231
|
-
refTxs = await
|
|
236
|
+
refTxs = await this.getBlockchain()
|
|
232
237
|
.then(blockchain => blockchain.getTransactionHexes(refTxsIds))
|
|
233
238
|
.then((0, bitcoin_1.parseTransactionHexes)(coinInfo.network))
|
|
234
239
|
.then(bitcoin_1.transformReferencedTransactions);
|
|
@@ -246,7 +251,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
246
251
|
});
|
|
247
252
|
await (0, bitcoin_1.verifyTx)(this.device.getCommands().getHDNode.bind(this.device.getCommands()), inputs, outputs, response.serializedTx, coinInfo);
|
|
248
253
|
if (this.params.push) {
|
|
249
|
-
const blockchain = await
|
|
254
|
+
const blockchain = await this.getBlockchain();
|
|
250
255
|
const txid = await blockchain.pushTransaction(response.serializedTx);
|
|
251
256
|
return {
|
|
252
257
|
...response,
|
|
@@ -21,7 +21,59 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
21
21
|
sender: string;
|
|
22
22
|
receiver: string;
|
|
23
23
|
} | undefined;
|
|
24
|
+
unknown?: {
|
|
25
|
+
data_size: number;
|
|
26
|
+
data_chunk: string;
|
|
27
|
+
} | undefined;
|
|
28
|
+
refund?: {
|
|
29
|
+
owner: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
new_account?: {
|
|
32
|
+
name: string;
|
|
33
|
+
owner: {
|
|
34
|
+
keys: {
|
|
35
|
+
address_n?: number[] | undefined;
|
|
36
|
+
type?: number | undefined;
|
|
37
|
+
weight: number;
|
|
38
|
+
key: string;
|
|
39
|
+
}[];
|
|
40
|
+
threshold: number;
|
|
41
|
+
accounts: {
|
|
42
|
+
weight: number;
|
|
43
|
+
account: {
|
|
44
|
+
permission: string;
|
|
45
|
+
actor: string;
|
|
46
|
+
};
|
|
47
|
+
}[];
|
|
48
|
+
waits: {
|
|
49
|
+
weight: number;
|
|
50
|
+
wait_sec: number;
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
53
|
+
creator: string;
|
|
54
|
+
active: {
|
|
55
|
+
keys: {
|
|
56
|
+
address_n?: number[] | undefined;
|
|
57
|
+
type?: number | undefined;
|
|
58
|
+
weight: number;
|
|
59
|
+
key: string;
|
|
60
|
+
}[];
|
|
61
|
+
threshold: number;
|
|
62
|
+
accounts: {
|
|
63
|
+
weight: number;
|
|
64
|
+
account: {
|
|
65
|
+
permission: string;
|
|
66
|
+
actor: string;
|
|
67
|
+
};
|
|
68
|
+
}[];
|
|
69
|
+
waits: {
|
|
70
|
+
weight: number;
|
|
71
|
+
wait_sec: number;
|
|
72
|
+
}[];
|
|
73
|
+
};
|
|
74
|
+
} | undefined;
|
|
24
75
|
delegate?: {
|
|
76
|
+
transfer: boolean;
|
|
25
77
|
sender: string;
|
|
26
78
|
receiver: string;
|
|
27
79
|
net_quantity: {
|
|
@@ -32,7 +84,6 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
32
84
|
symbol: string;
|
|
33
85
|
amount: string | number;
|
|
34
86
|
};
|
|
35
|
-
transfer: boolean;
|
|
36
87
|
} | undefined;
|
|
37
88
|
undelegate?: {
|
|
38
89
|
sender: string;
|
|
@@ -46,9 +97,6 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
46
97
|
amount: string | number;
|
|
47
98
|
};
|
|
48
99
|
} | undefined;
|
|
49
|
-
refund?: {
|
|
50
|
-
owner: string;
|
|
51
|
-
} | undefined;
|
|
52
100
|
buy_ram?: {
|
|
53
101
|
quantity: {
|
|
54
102
|
symbol: string;
|
|
@@ -77,8 +125,8 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
77
125
|
parent: string;
|
|
78
126
|
auth: {
|
|
79
127
|
keys: {
|
|
80
|
-
type?: number | undefined;
|
|
81
128
|
address_n?: number[] | undefined;
|
|
129
|
+
type?: number | undefined;
|
|
82
130
|
weight: number;
|
|
83
131
|
key: string;
|
|
84
132
|
}[];
|
|
@@ -86,8 +134,8 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
86
134
|
accounts: {
|
|
87
135
|
weight: number;
|
|
88
136
|
account: {
|
|
89
|
-
actor: string;
|
|
90
137
|
permission: string;
|
|
138
|
+
actor: string;
|
|
91
139
|
};
|
|
92
140
|
}[];
|
|
93
141
|
waits: {
|
|
@@ -102,69 +150,21 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
102
150
|
} | undefined;
|
|
103
151
|
link_auth?: {
|
|
104
152
|
type: string;
|
|
105
|
-
code: string;
|
|
106
153
|
account: string;
|
|
154
|
+
code: string;
|
|
107
155
|
requirement: string;
|
|
108
156
|
} | undefined;
|
|
109
157
|
unlink_auth?: {
|
|
110
158
|
type: string;
|
|
111
|
-
code: string;
|
|
112
159
|
account: string;
|
|
113
|
-
|
|
114
|
-
new_account?: {
|
|
115
|
-
name: string;
|
|
116
|
-
owner: {
|
|
117
|
-
keys: {
|
|
118
|
-
type?: number | undefined;
|
|
119
|
-
address_n?: number[] | undefined;
|
|
120
|
-
weight: number;
|
|
121
|
-
key: string;
|
|
122
|
-
}[];
|
|
123
|
-
threshold: number;
|
|
124
|
-
accounts: {
|
|
125
|
-
weight: number;
|
|
126
|
-
account: {
|
|
127
|
-
actor: string;
|
|
128
|
-
permission: string;
|
|
129
|
-
};
|
|
130
|
-
}[];
|
|
131
|
-
waits: {
|
|
132
|
-
weight: number;
|
|
133
|
-
wait_sec: number;
|
|
134
|
-
}[];
|
|
135
|
-
};
|
|
136
|
-
creator: string;
|
|
137
|
-
active: {
|
|
138
|
-
keys: {
|
|
139
|
-
type?: number | undefined;
|
|
140
|
-
address_n?: number[] | undefined;
|
|
141
|
-
weight: number;
|
|
142
|
-
key: string;
|
|
143
|
-
}[];
|
|
144
|
-
threshold: number;
|
|
145
|
-
accounts: {
|
|
146
|
-
weight: number;
|
|
147
|
-
account: {
|
|
148
|
-
actor: string;
|
|
149
|
-
permission: string;
|
|
150
|
-
};
|
|
151
|
-
}[];
|
|
152
|
-
waits: {
|
|
153
|
-
weight: number;
|
|
154
|
-
wait_sec: number;
|
|
155
|
-
}[];
|
|
156
|
-
};
|
|
157
|
-
} | undefined;
|
|
158
|
-
unknown?: {
|
|
159
|
-
data_size: number;
|
|
160
|
-
data_chunk: string;
|
|
160
|
+
code: string;
|
|
161
161
|
} | undefined;
|
|
162
162
|
common: {
|
|
163
|
-
account: string;
|
|
164
163
|
name: string;
|
|
164
|
+
account: string;
|
|
165
165
|
authorization: {
|
|
166
|
-
actor: string;
|
|
167
166
|
permission: string;
|
|
167
|
+
actor: string;
|
|
168
168
|
}[];
|
|
169
169
|
};
|
|
170
170
|
}[];
|
|
@@ -14,24 +14,24 @@ export default class EthereumGetPublicKey extends AbstractMethod<'ethereumGetPub
|
|
|
14
14
|
xpubSegwit?: string | undefined;
|
|
15
15
|
descriptorChecksum?: string | undefined;
|
|
16
16
|
path: number[];
|
|
17
|
-
depth: number;
|
|
18
|
-
fingerprint: number;
|
|
19
|
-
xpub: string;
|
|
20
17
|
publicKey: string;
|
|
21
18
|
serializedPath: string;
|
|
19
|
+
depth: number;
|
|
20
|
+
fingerprint: number;
|
|
22
21
|
chainCode: string;
|
|
23
22
|
childNum: number;
|
|
23
|
+
xpub: string;
|
|
24
24
|
} | {
|
|
25
25
|
xpubSegwit?: string | undefined;
|
|
26
26
|
descriptorChecksum?: string | undefined;
|
|
27
27
|
path: number[];
|
|
28
|
-
depth: number;
|
|
29
|
-
fingerprint: number;
|
|
30
|
-
xpub: string;
|
|
31
28
|
publicKey: string;
|
|
32
29
|
serializedPath: string;
|
|
30
|
+
depth: number;
|
|
31
|
+
fingerprint: number;
|
|
33
32
|
chainCode: string;
|
|
34
33
|
childNum: number;
|
|
34
|
+
xpub: string;
|
|
35
35
|
}[]>;
|
|
36
36
|
}
|
|
37
37
|
export {};
|
|
@@ -57,10 +57,11 @@ declare const Params: import("@sinclair/typebox").TIntersect<[import("@sinclair/
|
|
|
57
57
|
shortcut: import("@sinclair/typebox").TString;
|
|
58
58
|
slip44: import("@sinclair/typebox").TNumber;
|
|
59
59
|
support: import("@sinclair/typebox").TObject<{
|
|
60
|
-
connect: import("@sinclair/typebox").TBoolean;
|
|
61
60
|
T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
62
61
|
T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
63
62
|
T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
63
|
+
T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
64
|
+
connect: import("@sinclair/typebox").TBoolean;
|
|
64
65
|
}>;
|
|
65
66
|
decimals: import("@sinclair/typebox").TNumber;
|
|
66
67
|
blockchainLink: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
@@ -28,6 +28,7 @@ class GetAccountInfo extends AbstractMethod_1.AbstractMethod {
|
|
|
28
28
|
this.params = payload.bundle.map(batch => {
|
|
29
29
|
(0, paramsValidator_1.validateParams)(batch, [
|
|
30
30
|
{ name: 'coin', type: 'string', required: true },
|
|
31
|
+
{ name: 'identity', type: 'string' },
|
|
31
32
|
{ name: 'descriptor', type: 'string' },
|
|
32
33
|
{ name: 'path', type: 'string' },
|
|
33
34
|
{ name: 'details', type: 'string' },
|
|
@@ -204,7 +205,7 @@ class GetAccountInfo extends AbstractMethod_1.AbstractMethod {
|
|
|
204
205
|
if (typeof descriptor !== 'string') {
|
|
205
206
|
throw constants_1.ERRORS.TypedError('Runtime', 'GetAccountInfo: descriptor not found');
|
|
206
207
|
}
|
|
207
|
-
const blockchain = await (0, BlockchainLink_1.initBlockchain)(request.coinInfo, this.postMessage);
|
|
208
|
+
const blockchain = await (0, BlockchainLink_1.initBlockchain)(request.coinInfo, this.postMessage, request.identity);
|
|
208
209
|
if (this.disposed)
|
|
209
210
|
break;
|
|
210
211
|
const info = await blockchain.getAccountInfo({
|
|
@@ -256,8 +257,8 @@ class GetAccountInfo extends AbstractMethod_1.AbstractMethod {
|
|
|
256
257
|
return this.hasBundle ? responses : responses[0];
|
|
257
258
|
}
|
|
258
259
|
async discover(request) {
|
|
259
|
-
const { coinInfo, defaultAccountType } = request;
|
|
260
|
-
const blockchain = await (0, BlockchainLink_1.initBlockchain)(coinInfo, this.postMessage);
|
|
260
|
+
const { coinInfo, identity, defaultAccountType } = request;
|
|
261
|
+
const blockchain = await (0, BlockchainLink_1.initBlockchain)(coinInfo, this.postMessage, identity);
|
|
261
262
|
const dfd = this.createUiPromise(events_1.UI.RECEIVE_ACCOUNT);
|
|
262
263
|
const discovery = new Discovery_1.Discovery({
|
|
263
264
|
blockchain,
|
package/lib/api/getCoinInfo.d.ts
CHANGED
|
@@ -10,24 +10,25 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
|
|
|
10
10
|
type: string;
|
|
11
11
|
url: string[];
|
|
12
12
|
} | undefined;
|
|
13
|
-
name: string;
|
|
14
|
-
slip44: number;
|
|
15
|
-
decimals: number;
|
|
16
13
|
label: string;
|
|
17
14
|
blockTime: number;
|
|
18
15
|
minFee: number;
|
|
19
16
|
maxFee: number;
|
|
17
|
+
name: string;
|
|
20
18
|
shortcut: string;
|
|
19
|
+
slip44: number;
|
|
21
20
|
support: {
|
|
22
21
|
T1B1: string | false;
|
|
23
22
|
T2T1: string | false;
|
|
24
23
|
T2B1: string | false;
|
|
24
|
+
T3T1: string | false;
|
|
25
25
|
connect: boolean;
|
|
26
26
|
};
|
|
27
|
+
decimals: number;
|
|
27
28
|
defaultFees: {
|
|
28
29
|
feeLimit?: string | undefined;
|
|
29
30
|
feePerTx?: string | undefined;
|
|
30
|
-
label: "
|
|
31
|
+
label: "high" | "normal" | "economy" | "low" | "custom";
|
|
31
32
|
feePerUnit: string;
|
|
32
33
|
blocks: number;
|
|
33
34
|
}[];
|
|
@@ -37,6 +38,16 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
|
|
|
37
38
|
xPubMagicSegwit?: number | undefined;
|
|
38
39
|
taproot?: boolean | undefined;
|
|
39
40
|
type: "bitcoin";
|
|
41
|
+
dustLimit: number;
|
|
42
|
+
curveName: string;
|
|
43
|
+
forceBip143: boolean;
|
|
44
|
+
hashGenesisBlock: string;
|
|
45
|
+
maxAddressLength: number;
|
|
46
|
+
maxFeeSatoshiKb: number;
|
|
47
|
+
minAddressLength: number;
|
|
48
|
+
minFeeSatoshiKb: number;
|
|
49
|
+
segwit: boolean;
|
|
50
|
+
xPubMagic: number;
|
|
40
51
|
network: {
|
|
41
52
|
forkId?: number | undefined;
|
|
42
53
|
messagePrefix: string;
|
|
@@ -49,40 +60,31 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
|
|
|
49
60
|
scriptHash: number;
|
|
50
61
|
wif: number;
|
|
51
62
|
};
|
|
52
|
-
dustLimit: number;
|
|
53
|
-
curveName: string;
|
|
54
|
-
forceBip143: boolean;
|
|
55
|
-
hashGenesisBlock: string;
|
|
56
|
-
maxAddressLength: number;
|
|
57
|
-
maxFeeSatoshiKb: number;
|
|
58
|
-
minAddressLength: number;
|
|
59
|
-
minFeeSatoshiKb: number;
|
|
60
|
-
segwit: boolean;
|
|
61
|
-
xPubMagic: number;
|
|
62
63
|
isBitcoin: boolean;
|
|
63
64
|
}) | ({
|
|
64
65
|
blockchainLink?: {
|
|
65
66
|
type: string;
|
|
66
67
|
url: string[];
|
|
67
68
|
} | undefined;
|
|
68
|
-
name: string;
|
|
69
|
-
slip44: number;
|
|
70
|
-
decimals: number;
|
|
71
69
|
label: string;
|
|
72
70
|
blockTime: number;
|
|
73
71
|
minFee: number;
|
|
74
72
|
maxFee: number;
|
|
73
|
+
name: string;
|
|
75
74
|
shortcut: string;
|
|
75
|
+
slip44: number;
|
|
76
76
|
support: {
|
|
77
77
|
T1B1: string | false;
|
|
78
78
|
T2T1: string | false;
|
|
79
79
|
T2B1: string | false;
|
|
80
|
+
T3T1: string | false;
|
|
80
81
|
connect: boolean;
|
|
81
82
|
};
|
|
83
|
+
decimals: number;
|
|
82
84
|
defaultFees: {
|
|
83
85
|
feeLimit?: string | undefined;
|
|
84
86
|
feePerTx?: string | undefined;
|
|
85
|
-
label: "
|
|
87
|
+
label: "high" | "normal" | "economy" | "low" | "custom";
|
|
86
88
|
feePerUnit: string;
|
|
87
89
|
blocks: number;
|
|
88
90
|
}[];
|
|
@@ -95,24 +97,25 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
|
|
|
95
97
|
type: string;
|
|
96
98
|
url: string[];
|
|
97
99
|
} | undefined;
|
|
98
|
-
name: string;
|
|
99
|
-
slip44: number;
|
|
100
|
-
decimals: number;
|
|
101
100
|
label: string;
|
|
102
101
|
blockTime: number;
|
|
103
102
|
minFee: number;
|
|
104
103
|
maxFee: number;
|
|
104
|
+
name: string;
|
|
105
105
|
shortcut: string;
|
|
106
|
+
slip44: number;
|
|
106
107
|
support: {
|
|
107
108
|
T1B1: string | false;
|
|
108
109
|
T2T1: string | false;
|
|
109
110
|
T2B1: string | false;
|
|
111
|
+
T3T1: string | false;
|
|
110
112
|
connect: boolean;
|
|
111
113
|
};
|
|
114
|
+
decimals: number;
|
|
112
115
|
defaultFees: {
|
|
113
116
|
feeLimit?: string | undefined;
|
|
114
117
|
feePerTx?: string | undefined;
|
|
115
|
-
label: "
|
|
118
|
+
label: "high" | "normal" | "economy" | "low" | "custom";
|
|
116
119
|
feePerUnit: string;
|
|
117
120
|
blocks: number;
|
|
118
121
|
}[];
|
package/lib/api/getFeatures.d.ts
CHANGED
|
@@ -2,17 +2,24 @@ import { AbstractMethod } from '../core/AbstractMethod';
|
|
|
2
2
|
export default class GetFeatures extends AbstractMethod<'getFeatures'> {
|
|
3
3
|
init(): void;
|
|
4
4
|
run(): Promise<{
|
|
5
|
+
hide_passphrase_from_host?: boolean | undefined;
|
|
5
6
|
_passphrase_cached?: boolean | undefined;
|
|
6
7
|
busy?: boolean | undefined;
|
|
7
8
|
homescreen_format?: "Toif" | "Jpeg" | "ToiG" | undefined;
|
|
8
|
-
hide_passphrase_from_host?: boolean | undefined;
|
|
9
9
|
unit_color?: number | undefined;
|
|
10
10
|
unit_btconly?: boolean | undefined;
|
|
11
11
|
homescreen_width?: number | undefined;
|
|
12
12
|
homescreen_height?: number | undefined;
|
|
13
13
|
bootloader_locked?: boolean | undefined;
|
|
14
14
|
language_version_matches?: boolean | undefined;
|
|
15
|
-
|
|
15
|
+
flags: number | null;
|
|
16
|
+
language: string | null;
|
|
17
|
+
label: string | null;
|
|
18
|
+
auto_lock_delay_ms: number | null;
|
|
19
|
+
display_rotation: number | null;
|
|
20
|
+
passphrase_always_on_device: boolean | null;
|
|
21
|
+
safety_checks: "Strict" | "PromptAlways" | "PromptTemporarily" | null;
|
|
22
|
+
experimental_features: boolean | null;
|
|
16
23
|
vendor: string;
|
|
17
24
|
major_version: number;
|
|
18
25
|
minor_version: number;
|
|
@@ -21,8 +28,6 @@ export default class GetFeatures extends AbstractMethod<'getFeatures'> {
|
|
|
21
28
|
device_id: string | null;
|
|
22
29
|
pin_protection: boolean | null;
|
|
23
30
|
passphrase_protection: boolean | null;
|
|
24
|
-
language: string | null;
|
|
25
|
-
label: string | null;
|
|
26
31
|
initialized: boolean | null;
|
|
27
32
|
revision: string | null;
|
|
28
33
|
bootloader_hash: string | null;
|
|
@@ -30,7 +35,6 @@ export default class GetFeatures extends AbstractMethod<'getFeatures'> {
|
|
|
30
35
|
unlocked: boolean | null;
|
|
31
36
|
firmware_present: boolean | null;
|
|
32
37
|
needs_backup: boolean | null;
|
|
33
|
-
flags: number | null;
|
|
34
38
|
model: string;
|
|
35
39
|
fw_major: number | null;
|
|
36
40
|
fw_minor: number | null;
|
|
@@ -44,11 +48,7 @@ export default class GetFeatures extends AbstractMethod<'getFeatures'> {
|
|
|
44
48
|
sd_card_present: boolean | null;
|
|
45
49
|
sd_protection: boolean | null;
|
|
46
50
|
wipe_code_protection: boolean | null;
|
|
47
|
-
|
|
48
|
-
safety_checks: "Strict" | "PromptAlways" | "PromptTemporarily" | null;
|
|
49
|
-
auto_lock_delay_ms: number | null;
|
|
50
|
-
display_rotation: number | null;
|
|
51
|
-
experimental_features: boolean | null;
|
|
51
|
+
session_id: string | null;
|
|
52
52
|
internal_model: import("@trezor/protobuf").DeviceModelInternal;
|
|
53
53
|
}>;
|
|
54
54
|
}
|
|
@@ -17,24 +17,24 @@ export default class GetPublicKey extends AbstractMethod<'getPublicKey', Params[
|
|
|
17
17
|
xpubSegwit?: string | undefined;
|
|
18
18
|
descriptorChecksum?: string | undefined;
|
|
19
19
|
path: number[];
|
|
20
|
-
depth: number;
|
|
21
|
-
fingerprint: number;
|
|
22
|
-
xpub: string;
|
|
23
20
|
publicKey: string;
|
|
24
21
|
serializedPath: string;
|
|
22
|
+
depth: number;
|
|
23
|
+
fingerprint: number;
|
|
25
24
|
chainCode: string;
|
|
26
25
|
childNum: number;
|
|
26
|
+
xpub: string;
|
|
27
27
|
} | {
|
|
28
28
|
xpubSegwit?: string | undefined;
|
|
29
29
|
descriptorChecksum?: string | undefined;
|
|
30
30
|
path: number[];
|
|
31
|
-
depth: number;
|
|
32
|
-
fingerprint: number;
|
|
33
|
-
xpub: string;
|
|
34
31
|
publicKey: string;
|
|
35
32
|
serializedPath: string;
|
|
33
|
+
depth: number;
|
|
34
|
+
fingerprint: number;
|
|
36
35
|
chainCode: string;
|
|
37
36
|
childNum: number;
|
|
37
|
+
xpub: string;
|
|
38
38
|
}[]>;
|
|
39
39
|
}
|
|
40
40
|
export {};
|
|
@@ -2,14 +2,6 @@ import { PROTO } from '../../constants';
|
|
|
2
2
|
import * as $T from '../../types/api/nem';
|
|
3
3
|
export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chunkify?: boolean) => {
|
|
4
4
|
chunkify?: boolean | undefined;
|
|
5
|
-
multisig?: {
|
|
6
|
-
address_n?: number[] | undefined;
|
|
7
|
-
network?: number | undefined;
|
|
8
|
-
signer?: string | undefined;
|
|
9
|
-
timestamp: number;
|
|
10
|
-
fee: string | number;
|
|
11
|
-
deadline: number;
|
|
12
|
-
} | undefined;
|
|
13
5
|
transfer?: {
|
|
14
6
|
public_key?: string | undefined;
|
|
15
7
|
payload?: string | undefined;
|
|
@@ -21,6 +13,14 @@ export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chun
|
|
|
21
13
|
amount: string | number;
|
|
22
14
|
recipient: string;
|
|
23
15
|
} | undefined;
|
|
16
|
+
multisig?: {
|
|
17
|
+
address_n?: number[] | undefined;
|
|
18
|
+
network?: number | undefined;
|
|
19
|
+
signer?: string | undefined;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
fee: string | number;
|
|
22
|
+
deadline: number;
|
|
23
|
+
} | undefined;
|
|
24
24
|
cosigning?: boolean | undefined;
|
|
25
25
|
provision_namespace?: {
|
|
26
26
|
parent?: string | undefined;
|
|
@@ -32,17 +32,17 @@ export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chun
|
|
|
32
32
|
fee: string | number;
|
|
33
33
|
sink: string;
|
|
34
34
|
definition: {
|
|
35
|
-
fee?: string | number | undefined;
|
|
36
35
|
name?: string | undefined;
|
|
37
|
-
|
|
38
|
-
divisibility?: number | undefined;
|
|
36
|
+
fee?: string | number | undefined;
|
|
39
37
|
levy?: PROTO.NEMMosaicLevy | undefined;
|
|
38
|
+
divisibility?: number | undefined;
|
|
39
|
+
transferable?: boolean | undefined;
|
|
40
|
+
ticker?: string | undefined;
|
|
40
41
|
levy_address?: string | undefined;
|
|
41
42
|
levy_namespace?: string | undefined;
|
|
42
43
|
levy_mosaic?: string | undefined;
|
|
43
44
|
supply?: number | undefined;
|
|
44
45
|
mutable_supply?: boolean | undefined;
|
|
45
|
-
transferable?: boolean | undefined;
|
|
46
46
|
networks?: number[] | undefined;
|
|
47
47
|
description: string;
|
|
48
48
|
namespace: string;
|
|
@@ -51,9 +51,9 @@ export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chun
|
|
|
51
51
|
} | undefined;
|
|
52
52
|
supply_change?: {
|
|
53
53
|
type: PROTO.NEMSupplyChangeType;
|
|
54
|
+
delta: number;
|
|
54
55
|
namespace: string;
|
|
55
56
|
mosaic: string;
|
|
56
|
-
delta: number;
|
|
57
57
|
} | undefined;
|
|
58
58
|
aggregate_modification?: {
|
|
59
59
|
modifications?: {
|
|
@@ -24,10 +24,11 @@ class PushTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
24
24
|
this.params = {
|
|
25
25
|
tx: payload.tx,
|
|
26
26
|
coinInfo,
|
|
27
|
+
identity: payload.identity,
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
30
|
async run() {
|
|
30
|
-
const backend = await (0, BlockchainLink_1.initBlockchain)(this.params.coinInfo, this.postMessage);
|
|
31
|
+
const backend = await (0, BlockchainLink_1.initBlockchain)(this.params.coinInfo, this.postMessage, this.params.identity);
|
|
31
32
|
const txid = await backend.pushTransaction(this.params.tx);
|
|
32
33
|
return {
|
|
33
34
|
txid,
|
package/lib/api/resetDevice.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
-
import
|
|
2
|
+
import { PROTO } from '../constants';
|
|
3
3
|
export default class ResetDevice extends AbstractMethod<'resetDevice', PROTO.ResetDevice> {
|
|
4
4
|
confirmed?: boolean;
|
|
5
5
|
init(): void;
|
package/lib/api/resetDevice.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
4
|
const events_1 = require("../events");
|
|
5
5
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
6
7
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
7
|
-
const resetDevice_1 = require("../types/api/resetDevice");
|
|
8
8
|
class ResetDevice extends AbstractMethod_1.AbstractMethod {
|
|
9
9
|
init() {
|
|
10
10
|
this.allowDeviceMode = [events_1.UI.INITIALIZE, events_1.UI.SEEDLESS];
|
|
@@ -12,7 +12,7 @@ class ResetDevice extends AbstractMethod_1.AbstractMethod {
|
|
|
12
12
|
this.requiredPermissions = ['management'];
|
|
13
13
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, null, this.firmwareRange);
|
|
14
14
|
const { payload } = this;
|
|
15
|
-
(0, schema_utils_1.Assert)(
|
|
15
|
+
(0, schema_utils_1.Assert)(constants_1.PROTO.ResetDevice, payload);
|
|
16
16
|
this.params = {
|
|
17
17
|
display_random: payload.display_random,
|
|
18
18
|
strength: payload.strength || 256,
|