@trezor/connect 9.0.2 → 9.0.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/README.md +5 -5
- package/lib/api/bitcoin/TransactionComposer.js +2 -1
- package/lib/api/bitcoin/outputs.js +2 -4
- package/lib/api/bitcoin/signtxVerify.d.ts +3 -3
- package/lib/api/bitcoin/signtxVerify.js +16 -15
- package/lib/api/getAddress.d.ts +2 -1
- package/lib/api/getAddress.js +12 -1
- package/lib/api/getPublicKey.d.ts +1 -0
- package/lib/api/getPublicKey.js +22 -7
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +3 -1
- package/lib/api/signTransaction.d.ts +1 -0
- package/lib/api/signTransaction.js +14 -2
- package/lib/api/unlockPath.d.ts +10 -0
- package/lib/api/unlockPath.js +35 -0
- package/lib/core/index.d.ts +1 -1
- package/lib/core/method.d.ts +1 -1
- package/lib/data/config.js +1 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/DeviceCommands.d.ts +7 -2
- package/lib/device/DeviceCommands.js +37 -25
- package/lib/factory.js +1 -0
- package/lib/types/api/bitcoin/index.d.ts +1 -0
- package/lib/types/api/cardano/index.d.ts +3 -7
- package/lib/types/api/eos/index.d.ts +0 -4
- package/lib/types/api/eosGetPublicKey.d.ts +4 -4
- package/lib/types/api/getAddress.d.ts +1 -0
- package/lib/types/api/getPublicKey.d.ts +5 -0
- package/lib/types/api/index.d.ts +2 -0
- package/lib/types/api/unlockPath.d.ts +8 -0
- package/lib/types/api/unlockPath.js +3 -0
- package/lib/utils/pathUtils.d.ts +2 -3
- package/lib/utils/pathUtils.js +42 -15
- package/package.json +12 -2
- package/lib/api/bitcoin/__fixtures__/inputs.d.ts +0 -112
- package/lib/api/bitcoin/__fixtures__/inputs.js +0 -102
- package/lib/api/bitcoin/__fixtures__/signtxVerify.d.ts +0 -147
- package/lib/api/bitcoin/__fixtures__/signtxVerify.js +0 -216
- package/lib/api/common/__fixtures__/paramsValidator.d.ts +0 -596
- package/lib/api/common/__fixtures__/paramsValidator.js +0 -355
- package/lib/api/ethereum/__fixtures__/ethereumSignTypedData.d.ts +0 -225
- package/lib/api/ethereum/__fixtures__/ethereumSignTypedData.js +0 -341
- package/lib/utils/__fixtures__/accountUtils.d.ts +0 -4
- package/lib/utils/__fixtures__/accountUtils.js +0 -32
- package/lib/utils/__fixtures__/addressUtils.d.ts +0 -10
- package/lib/utils/__fixtures__/addressUtils.js +0 -214
- package/lib/utils/__fixtures__/ethereumUtils.d.ts +0 -3
- package/lib/utils/__fixtures__/ethereumUtils.js +0 -20
- package/lib/utils/__fixtures__/formatUtils.d.ts +0 -3
- package/lib/utils/__fixtures__/formatUtils.js +0 -15
- package/lib/utils/__fixtures__/hdnodeUtils.d.ts +0 -186
- package/lib/utils/__fixtures__/hdnodeUtils.js +0 -206
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const PATH = [2147483692, 2147483648, 2147483648, 0, 5];
|
|
4
|
-
const inputs = [
|
|
5
|
-
{
|
|
6
|
-
address_n: PATH,
|
|
7
|
-
prev_hash: '50f6f1209ca92d7359564be803cb2c932cde7d370f7cee50fd1fad6790f6206d',
|
|
8
|
-
prev_index: 1,
|
|
9
|
-
amount: '1',
|
|
10
|
-
},
|
|
11
|
-
];
|
|
12
|
-
exports.default = [
|
|
13
|
-
{
|
|
14
|
-
description: 'external P2PKH output',
|
|
15
|
-
inputs,
|
|
16
|
-
outputs: [
|
|
17
|
-
{
|
|
18
|
-
address: '1MJ2tj2ThBE62zXbBYA5ZaN3fdve5CPAz1',
|
|
19
|
-
amount: '10000',
|
|
20
|
-
script_type: 'PAYTOADDRESS',
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100a200ea1278c3d32251a63c56f5f0861f48167c61d84de8d951eac1204856ccd402201fc03f446557bcbcef1e473616bb7bddc96561b656b7ddd6b419501543ed5044012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff0110270000000000001976a914de9b2a8da088824e8fe51debea566617d851537888ac00000000',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
description: 'internal P2PKH output',
|
|
27
|
-
inputs,
|
|
28
|
-
outputs: [
|
|
29
|
-
{
|
|
30
|
-
address_n: PATH,
|
|
31
|
-
amount: '10000',
|
|
32
|
-
script_type: 'PAYTOADDRESS',
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a47304402203d784f8134a0afe40dfc5ff479a99352110855b845fb4a7524915272cd249f47022079f90d8713035c99a46975d3bca9a8bc2464b02437f09b2cf3d34df91bb53ad2012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff0110270000000000001976a914a6450f1945831a81912616691e721b787383f4ed88ac00000000',
|
|
36
|
-
getHDNode: () => ({
|
|
37
|
-
xpub: 'xpub6Ex8WCdj1KH5mK9r99QKENUmhpjEPgYm1dJmKY2nxx16tSAiQCVYjHfymFdzfpYDAHGtWYTif7WkUKLMULRJFPeV1hvEbeXqrM11K85yPjp',
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
description: 'internal P2PKH output (custom path)',
|
|
42
|
-
inputs,
|
|
43
|
-
outputs: [
|
|
44
|
-
{
|
|
45
|
-
address_n: [0],
|
|
46
|
-
amount: '10000',
|
|
47
|
-
script_type: 'PAYTOADDRESS',
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a473044022046c0e8694878140567d55665f85fb09c28e07605873c4ebd6b1ed46aac67f0e7022032405c728d8d2726d9b297804882e684c0d5f9ca5df291c4ebca6857056a0eaa012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff0110270000000000001976a9144e145e3b27f90d854fba11106654c11451eb960088ac00000000',
|
|
51
|
-
getHDNode: () => ({
|
|
52
|
-
xpub: 'xpub68Zyu13hPwsx8egknnRtfGmk6n9f6S5zbousZUJmQDZsB3GCppTz73oD2WS8DcCa4hqvNePCt8dFt5TKSSBgvCdgg48iWZQ7qgKnFaQnj21',
|
|
53
|
-
}),
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
description: 'external P2SH output',
|
|
57
|
-
inputs,
|
|
58
|
-
outputs: [
|
|
59
|
-
{
|
|
60
|
-
address: '3L6TyTisPBmrDAj6RoKmDzNnj4eQi54gD2',
|
|
61
|
-
amount: '10000',
|
|
62
|
-
script_type: 'PAYTOADDRESS',
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a47304402203239b33a93c205e1a463304c10383fcfea109012aa7c8b71238c22d2f02dfb98022074f687be14198ca844ab35823dfb70cabbb208338ea7154516a1c657e8b5a3de012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff01102700000000000017a914c9e193b1af9e4349d2ee53b4190e2bd36e59719e8700000000',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
description: 'internal P2SH output',
|
|
69
|
-
inputs,
|
|
70
|
-
outputs: [
|
|
71
|
-
{
|
|
72
|
-
address_n: [2147483697, 2147483648, 2147483648, 0, 5],
|
|
73
|
-
amount: '10000',
|
|
74
|
-
script_type: 'PAYTOP2SHWITNESS',
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a4730440220240b8780aa29f5afa7d9d040ef8c406a9f44f981bf819b01d9e6d68e5a02c59b022020f40e21ef9c3cf6e5f7d4a776593e8bf3971166e1a0324dfdcfcec8c3bce8c0012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff01102700000000000017a9140c598ef0edacdc76bd460441b41d069c62eead278700000000',
|
|
78
|
-
getHDNode: () => ({
|
|
79
|
-
xpub: 'xpub6EnV9K1LzPtRDXqqcDkBk99uCFneHiHR3DBQxXcbuWzQoUGLfJiHeF3uDW1JZH3ZG7mr4TuNtPbgLYwEibEkcDcnQkQksZi7jm3eY8PqKFv',
|
|
80
|
-
}),
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
description: 'external P2WPKH output',
|
|
84
|
-
inputs,
|
|
85
|
-
outputs: [
|
|
86
|
-
{
|
|
87
|
-
address: 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4',
|
|
88
|
-
amount: '10000',
|
|
89
|
-
script_type: 'PAYTOADDRESS',
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100cdf268cb89433f2cdc990ca3f45bf356befe51bbbbd6b57f1ca08ac69298acad022032beef4e1380bd3819c0cbf1b1a70b434a115199d1cbe5c59de8d94f98086452012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff011027000000000000160014751e76e8199196d454941c45d1b3a323f1433bd600000000',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
description: 'external P2WSH output',
|
|
96
|
-
inputs,
|
|
97
|
-
outputs: [
|
|
98
|
-
{
|
|
99
|
-
address: 'bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3',
|
|
100
|
-
amount: '10000',
|
|
101
|
-
script_type: 'PAYTOADDRESS',
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a4730440220714c3704cb9aee785a5e03eb77eacf5bd95d29a4fe9cf33e4a868aa4100d2b6902207c5bdef296404d3fedeaaa71579140768b72c0bea882c7a2f16c029963d7c622012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff0110270000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c632960490326200000000',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
description: 'external P2TR output',
|
|
108
|
-
network: 'testnet',
|
|
109
|
-
inputs: [...inputs, ...inputs, ...inputs],
|
|
110
|
-
outputs: [
|
|
111
|
-
{
|
|
112
|
-
address: 'tb1p5cxhpna6xuthmq3e6qvpshvxfv4a6r90tct4l4z9fnqqdlfdwkkq5cyr45',
|
|
113
|
-
amount: '34009772',
|
|
114
|
-
script_type: 'PAYTOADDRESS',
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
tx: '010000000001036681d03f108f557f55dc885cfcf9e5ac8f2bc564d5ff4fbd55627bb06ffa6e87000000000000000000f33120595c2b58a67121393289b4017ff6c627e5f929b602d00a17c819104ecd000000000000000000f7b890100da516c5fe7bb3627da6b166d5bf4a8feaec3e98544e36d0338c8f9800000000000000000001acf2060200000000225120a60d70cfba37177d8239d018185d864b2bdd0caf5e175fd4454cc006fd2d75ac01402124dd40569c8518e42eb23e3e75d6446c816b099f89dd485171ae4ae6dbacff54847e4aed4f7265128d107ac73422f7d3fef65ee8ef7d57d907183fac2ce9fe01405d837bb4c7933f70915dc9c8e1f8b3843bf018292a8febd9a1801a2c5b137da407e463b7c091e6cc05ea5f3b6377d7c3c17c42d9f1db37654defeae22cfcd5690140c49a7fc0a2be865f4c1d8be8b56af8eecd3b8af55c823159c417b2ef390a1dab1f8ccba681a3cf3fd0dd072261ca4f5263196e69bbcccbb889d1c189f20ee61500000000',
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
description: 'internal P2TR output',
|
|
121
|
-
network: 'testnet',
|
|
122
|
-
inputs,
|
|
123
|
-
outputs: [
|
|
124
|
-
{
|
|
125
|
-
address: 'tb1pdsepw2hky9etm9d3yfumyq9g25xwys6d0jysstaaymgc6nheggasgamqts',
|
|
126
|
-
amount: '2000',
|
|
127
|
-
script_type: 'PAYTOADDRESS',
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
address_n: [2147483734, 2147483649, 2147483648, 1, 1],
|
|
131
|
-
amount: '8580',
|
|
132
|
-
script_type: 'PAYTOTAPROOT',
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
tx: '0100000000010137c69a1d916c702a237ae1af6362d3d0ad63a078488c860d3fe0c276aa37d83d0000000000fdffffff02d0070000000000002251206c32172af62172bd95b12279b200a8550ce2434d7c89082fbd26d18d4ef9423b84210000000000002251207866dd733460c84db1aa3f7208d9a2d0f706c80306b398050b41dcd44cd214ad014081ed20fcb7fa953e0cdda874383af18d6127102e03c8386ac13a41a4e4da6e3eb2f52ffe85cf482b35f93523fa226e6b6e382cb71ee2bebac6551c29d16a94f900000000',
|
|
136
|
-
getHDNode: () => ({
|
|
137
|
-
xpub: 'tpubDECt75TERm1JRzmVvnEta9ywSwgfTJ1WQQnAoEG9EAY75gWwJU5e2GqEdDaYSTi3ogdPeqC25T4to7Lzp9uui7HfKqhPX1PtRW7ZGz6PBw3',
|
|
138
|
-
}),
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
description: 'opreturn output',
|
|
142
|
-
inputs,
|
|
143
|
-
outputs: [
|
|
144
|
-
{
|
|
145
|
-
op_return_data: 'deadbeef',
|
|
146
|
-
amount: '0',
|
|
147
|
-
script_type: 'PAYTOOPRETURN',
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100ab05878122fa124067dafccd47b6c55567ed7564ae50676dff89dd9fd920a544022025cdf05643234329fec08fc81abec07e2b9f4e14adfa2e2e507e4debc5d36073012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff010000000000000000066a04deadbeef00000000',
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
description: 'opreturn output without amount',
|
|
154
|
-
inputs,
|
|
155
|
-
outputs: [
|
|
156
|
-
{
|
|
157
|
-
op_return_data: 'deadbeef',
|
|
158
|
-
script_type: 'PAYTOOPRETURN',
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100ab05878122fa124067dafccd47b6c55567ed7564ae50676dff89dd9fd920a544022025cdf05643234329fec08fc81abec07e2b9f4e14adfa2e2e507e4debc5d36073012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff010000000000000000066a04deadbeef00000000',
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
description: 'Error, output scripts differ',
|
|
165
|
-
inputs,
|
|
166
|
-
outputs: [
|
|
167
|
-
{
|
|
168
|
-
address: 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4',
|
|
169
|
-
amount: '10000',
|
|
170
|
-
script_type: 'PAYTOADDRESS',
|
|
171
|
-
},
|
|
172
|
-
],
|
|
173
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006a4730440220714c3704cb9aee785a5e03eb77eacf5bd95d29a4fe9cf33e4a868aa4100d2b6902207c5bdef296404d3fedeaaa71579140768b72c0bea882c7a2f16c029963d7c622012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff0110270000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c632960490326200000000',
|
|
174
|
-
error: 'verifyTx: Output 0 scripts differ',
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
description: 'Error, amount differ',
|
|
178
|
-
inputs,
|
|
179
|
-
outputs: [
|
|
180
|
-
{
|
|
181
|
-
address: 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4',
|
|
182
|
-
amount: '20000',
|
|
183
|
-
script_type: 'PAYTOADDRESS',
|
|
184
|
-
},
|
|
185
|
-
],
|
|
186
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100cdf268cb89433f2cdc990ca3f45bf356befe51bbbbd6b57f1ca08ac69298acad022032beef4e1380bd3819c0cbf1b1a70b434a115199d1cbe5c59de8d94f98086452012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff011027000000000000160014751e76e8199196d454941c45d1b3a323f1433bd600000000',
|
|
187
|
-
error: 'verifyTx: Wrong output amount at output 0. Requested: 20000, signed: 10000',
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
description: 'Error, wrong length (inputs)',
|
|
191
|
-
inputs: [],
|
|
192
|
-
outputs: [],
|
|
193
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100cdf268cb89433f2cdc990ca3f45bf356befe51bbbbd6b57f1ca08ac69298acad022032beef4e1380bd3819c0cbf1b1a70b434a115199d1cbe5c59de8d94f98086452012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff011027000000000000160014751e76e8199196d454941c45d1b3a323f1433bd600000000',
|
|
194
|
-
error: 'verifyTx: Signed transaction inputs invalid length',
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
description: 'Error, wrong length (outputs)',
|
|
198
|
-
inputs,
|
|
199
|
-
outputs: [],
|
|
200
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100cdf268cb89433f2cdc990ca3f45bf356befe51bbbbd6b57f1ca08ac69298acad022032beef4e1380bd3819c0cbf1b1a70b434a115199d1cbe5c59de8d94f98086452012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff011027000000000000160014751e76e8199196d454941c45d1b3a323f1433bd600000000',
|
|
201
|
-
error: 'verifyTx: Signed transaction outputs invalid length',
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
description: 'Error, output without address',
|
|
205
|
-
inputs,
|
|
206
|
-
outputs: [
|
|
207
|
-
{
|
|
208
|
-
amount: '10000',
|
|
209
|
-
script_type: 'PAYTOADDRESS',
|
|
210
|
-
},
|
|
211
|
-
],
|
|
212
|
-
tx: '01000000016d20f69067ad1ffd50ee7c0f377dde2c932ccb03e84b5659732da99c20f1f650010000006b483045022100cdf268cb89433f2cdc990ca3f45bf356befe51bbbbd6b57f1ca08ac69298acad022032beef4e1380bd3819c0cbf1b1a70b434a115199d1cbe5c59de8d94f98086452012102a7a079c1ef9916b289c2ff21a992c808d0de3dfcf8a9f163205c5c9e21f55d5cffffffff011027000000000000160014751e76e8199196d454941c45d1b3a323f1433bd600000000',
|
|
213
|
-
error: 'deriveOutputScript: Neither address or address_n is set',
|
|
214
|
-
},
|
|
215
|
-
];
|
|
216
|
-
//# sourceMappingURL=signtxVerify.js.map
|