@exodus/web3-ethereum 1.4.3 → 1.4.5
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/lib/provider/storage.d.ts +1 -1
- package/lib/rpc-handlers/exposeHandlers.d.ts +1 -1
- package/lib/rpc-handlers/exposeHandlers.js +1 -1
- package/lib/rpc-handlers/index.d.ts +1 -1
- package/lib/rpc-handlers/index.js +1 -1
- package/lib/rpc-handlers/validator.js +288 -264
- package/lib/simulation/simulation.d.ts +1 -1
- package/lib/simulation/utils.js +2 -1
- package/lib/wallet-standard/wallet.d.ts +1 -1
- package/package.json +8 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import type { EVMDeps } from '../types.js';
|
|
1
2
|
import type RPC from '@exodus/json-rpc';
|
|
2
3
|
import type { AppDeps, WalletDeps } from '@exodus/web3-types';
|
|
3
|
-
import type { EVMDeps } from '../types.js';
|
|
4
4
|
export declare function exposeHandlers(rpc: typeof RPC, deps: AppDeps & EVMDeps & WalletDeps): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getTransactionId, signMessage, signTransaction, signTypedData, } from '@exodus/web3-ethereum-utils';
|
|
2
1
|
import { AssetNotSupportedError, InvalidInputError, UnauthorizedError, UserRejectedRequestError, } from '@exodus/web3-errors';
|
|
2
|
+
import { getTransactionId, signMessage, signTransaction, signTypedData, } from '@exodus/web3-ethereum-utils';
|
|
3
3
|
import { SignTypedDataVersion } from '@metamask/eth-sig-util';
|
|
4
4
|
import { parseAndValidateTypedData } from './parseAndValidateTypedData.js';
|
|
5
5
|
// See: https://eips.ethereum.org/EIPS/eip-2255.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { validate as validateDeps, validateCommonDeps, } from '@exodus/web3-rpc-handlers';
|
|
2
1
|
import { RPC_REQUEST_TIMEOUT } from '@exodus/web3-constants';
|
|
2
|
+
import { validate as validateDeps, validateCommonDeps, } from '@exodus/web3-rpc-handlers';
|
|
3
3
|
import { exposeHandlers } from './exposeHandlers.js';
|
|
4
4
|
import { validateRequest } from './validator.js';
|
|
5
5
|
const validateEVMDeps = (evm) => {
|
|
@@ -13,7 +13,9 @@ export function validateRequest(value) {
|
|
|
13
13
|
/~\//.test(s) ? `${s}`.replace(/~/g, '~0').replace(/\//g, '~1') : s
|
|
14
14
|
const pattern1 = new RegExp('^[a-z]+([A-Z][a-z]+)*[A-Z]?$', 'u')
|
|
15
15
|
const format1 = new RegExp('^0x[a-f0-9]*$', 'i')
|
|
16
|
+
const format2 = new RegExp('^0x[a-f0-9]{40}$', 'i')
|
|
16
17
|
const pattern2 = new RegExp('^[a-z]+$', 'u')
|
|
18
|
+
const format3 = new RegExp('^(?!_)(\\n|\\r|.)*$', '')
|
|
17
19
|
const unique = (array) => {
|
|
18
20
|
if (array.length < 2) return true
|
|
19
21
|
if (array.length === 2) return !deepEqual(array[0], array[1])
|
|
@@ -113,36 +115,60 @@ export function validateRequest(value) {
|
|
|
113
115
|
return false
|
|
114
116
|
return true
|
|
115
117
|
})()
|
|
116
|
-
|
|
118
|
+
const sub6 = (() => {
|
|
119
|
+
const err0 = validate.errors
|
|
120
|
+
const res0 = validate(data[i][key1])
|
|
121
|
+
const suberr0 = validate.errors
|
|
122
|
+
validate.errors = err0
|
|
123
|
+
if (!res0) return false
|
|
124
|
+
return true
|
|
125
|
+
})()
|
|
126
|
+
const sub7 = (() => {
|
|
127
|
+
if (!(typeof data[i][key1] === 'string')) return false
|
|
128
|
+
if (!format2.test(data[i][key1])) return false
|
|
129
|
+
return true
|
|
130
|
+
})()
|
|
131
|
+
if (!(sub4 || sub5 || sub6 || sub7)) return false
|
|
117
132
|
}
|
|
118
133
|
}
|
|
119
134
|
return true
|
|
120
135
|
})()
|
|
121
|
-
const
|
|
136
|
+
const sub8 = (() => {
|
|
122
137
|
if (!(typeof data[i] === 'string')) return false
|
|
123
138
|
if (!format1.test(data[i])) return false
|
|
124
139
|
return true
|
|
125
140
|
})()
|
|
126
|
-
const
|
|
141
|
+
const sub9 = (() => {
|
|
127
142
|
if (!(typeof data[i] === 'string')) return false
|
|
128
143
|
if (!pattern2.test(data[i])) return false
|
|
129
144
|
return true
|
|
130
145
|
})()
|
|
131
|
-
const
|
|
146
|
+
const sub10 = (() => {
|
|
132
147
|
if (!Array.isArray(data[i])) return false
|
|
133
148
|
if (data[i].length < 1) return false
|
|
134
149
|
for (let j = 0; j < data[i].length; j++) {
|
|
135
150
|
if (j in data[i] && hasOwn(data[i], j)) {
|
|
136
|
-
|
|
151
|
+
const sub11 = (() => {
|
|
152
|
+
if (!(typeof data[i][j] === 'number')) return false
|
|
153
|
+
return true
|
|
154
|
+
})()
|
|
155
|
+
const sub12 = (() => {
|
|
156
|
+
if (!(typeof data[i][j] === 'string')) return false
|
|
157
|
+
if (data[i][j].length > 100 && stringLength(data[i][j]) > 100)
|
|
158
|
+
return false
|
|
159
|
+
if (!format3.test(data[i][j])) return false
|
|
160
|
+
return true
|
|
161
|
+
})()
|
|
162
|
+
if (!(sub11 || sub12)) return false
|
|
137
163
|
}
|
|
138
164
|
}
|
|
139
165
|
return true
|
|
140
166
|
})()
|
|
141
|
-
const
|
|
167
|
+
const sub13 = (() => {
|
|
142
168
|
if (!(Array.isArray(data[i]) && data[i].length === 0)) return false
|
|
143
169
|
return true
|
|
144
170
|
})()
|
|
145
|
-
if (!(sub2 || sub3 ||
|
|
171
|
+
if (!(sub2 || sub3 || sub8 || sub9 || sub10 || sub13)) {
|
|
146
172
|
validate.errors = [
|
|
147
173
|
{ keywordLocation: '#/items/anyOf', instanceLocation: '#/' + i },
|
|
148
174
|
]
|
|
@@ -166,7 +192,7 @@ export function validateRequest(value) {
|
|
|
166
192
|
keywordLocation: `${schemaBase}${keywordLocation.slice(1)}`,
|
|
167
193
|
instanceLocation: `${dataBase}${instanceLocation.slice(1)}`,
|
|
168
194
|
})
|
|
169
|
-
const
|
|
195
|
+
const format4 = new RegExp('^0x[0-9a-f]+$', 'i')
|
|
170
196
|
const ref2 = function validate(data) {
|
|
171
197
|
validate.errors = null
|
|
172
198
|
if (!Array.isArray(data)) {
|
|
@@ -186,7 +212,7 @@ export function validateRequest(value) {
|
|
|
186
212
|
]
|
|
187
213
|
return false
|
|
188
214
|
}
|
|
189
|
-
if (!
|
|
215
|
+
if (!format4.test(data[0])) {
|
|
190
216
|
validate.errors = [
|
|
191
217
|
{ keywordLocation: '#/0/format', instanceLocation: '#/0' },
|
|
192
218
|
]
|
|
@@ -201,7 +227,6 @@ export function validateRequest(value) {
|
|
|
201
227
|
}
|
|
202
228
|
return true
|
|
203
229
|
}
|
|
204
|
-
const format3 = new RegExp('^0x[a-f0-9]{40}$', 'i')
|
|
205
230
|
const ref4 = function validate(data) {
|
|
206
231
|
validate.errors = null
|
|
207
232
|
if (!(typeof data === 'object' && data && !Array.isArray(data))) {
|
|
@@ -216,17 +241,17 @@ export function validateRequest(value) {
|
|
|
216
241
|
}
|
|
217
242
|
if ('chainId' in data && hasOwn(data, 'chainId')) {
|
|
218
243
|
let passes1 = 0
|
|
219
|
-
const
|
|
244
|
+
const sub14 = (() => {
|
|
220
245
|
if (!(typeof data.chainId === 'string')) return false
|
|
221
|
-
if (!
|
|
246
|
+
if (!format4.test(data.chainId)) return false
|
|
222
247
|
return true
|
|
223
248
|
})()
|
|
224
|
-
if (
|
|
225
|
-
const
|
|
249
|
+
if (sub14) passes1++
|
|
250
|
+
const sub15 = (() => {
|
|
226
251
|
if (!(typeof data.chainId === 'number')) return false
|
|
227
252
|
return true
|
|
228
253
|
})()
|
|
229
|
-
if (
|
|
254
|
+
if (sub15) passes1++
|
|
230
255
|
if (passes1 !== 1) {
|
|
231
256
|
validate.errors = [
|
|
232
257
|
{
|
|
@@ -246,7 +271,7 @@ export function validateRequest(value) {
|
|
|
246
271
|
]
|
|
247
272
|
return false
|
|
248
273
|
}
|
|
249
|
-
if (!
|
|
274
|
+
if (!format2.test(data.from)) {
|
|
250
275
|
validate.errors = [
|
|
251
276
|
{
|
|
252
277
|
keywordLocation: '#/properties/from/format',
|
|
@@ -265,7 +290,7 @@ export function validateRequest(value) {
|
|
|
265
290
|
]
|
|
266
291
|
return false
|
|
267
292
|
}
|
|
268
|
-
if (!
|
|
293
|
+
if (!format2.test(data.to)) {
|
|
269
294
|
validate.errors = [
|
|
270
295
|
{
|
|
271
296
|
keywordLocation: '#/properties/to/format',
|
|
@@ -285,7 +310,7 @@ export function validateRequest(value) {
|
|
|
285
310
|
]
|
|
286
311
|
return false
|
|
287
312
|
}
|
|
288
|
-
if (!
|
|
313
|
+
if (!format4.test(data.gas)) {
|
|
289
314
|
validate.errors = [
|
|
290
315
|
{
|
|
291
316
|
keywordLocation: '#/properties/gas/format',
|
|
@@ -305,7 +330,7 @@ export function validateRequest(value) {
|
|
|
305
330
|
]
|
|
306
331
|
return false
|
|
307
332
|
}
|
|
308
|
-
if (!
|
|
333
|
+
if (!format4.test(data.gasPrice)) {
|
|
309
334
|
validate.errors = [
|
|
310
335
|
{
|
|
311
336
|
keywordLocation: '#/properties/gasPrice/format',
|
|
@@ -360,17 +385,17 @@ export function validateRequest(value) {
|
|
|
360
385
|
hasOwn(data, 'maxPriorityFeePerGas')
|
|
361
386
|
) {
|
|
362
387
|
let passes2 = 0
|
|
363
|
-
const
|
|
388
|
+
const sub16 = (() => {
|
|
364
389
|
if (!(typeof data.maxPriorityFeePerGas === 'string')) return false
|
|
365
390
|
if (!format1.test(data.maxPriorityFeePerGas)) return false
|
|
366
391
|
return true
|
|
367
392
|
})()
|
|
368
|
-
if (
|
|
369
|
-
const
|
|
393
|
+
if (sub16) passes2++
|
|
394
|
+
const sub17 = (() => {
|
|
370
395
|
if (!(data.maxPriorityFeePerGas === null)) return false
|
|
371
396
|
return true
|
|
372
397
|
})()
|
|
373
|
-
if (
|
|
398
|
+
if (sub17) passes2++
|
|
374
399
|
if (passes2 !== 1) {
|
|
375
400
|
validate.errors = [
|
|
376
401
|
{
|
|
@@ -383,17 +408,17 @@ export function validateRequest(value) {
|
|
|
383
408
|
}
|
|
384
409
|
if ('maxFeePerGas' in data && hasOwn(data, 'maxFeePerGas')) {
|
|
385
410
|
let passes3 = 0
|
|
386
|
-
const
|
|
411
|
+
const sub18 = (() => {
|
|
387
412
|
if (!(typeof data.maxFeePerGas === 'string')) return false
|
|
388
413
|
if (!format1.test(data.maxFeePerGas)) return false
|
|
389
414
|
return true
|
|
390
415
|
})()
|
|
391
|
-
if (
|
|
392
|
-
const
|
|
416
|
+
if (sub18) passes3++
|
|
417
|
+
const sub19 = (() => {
|
|
393
418
|
if (!(data.maxFeePerGas === null)) return false
|
|
394
419
|
return true
|
|
395
420
|
})()
|
|
396
|
-
if (
|
|
421
|
+
if (sub19) passes3++
|
|
397
422
|
if (passes3 !== 1) {
|
|
398
423
|
validate.errors = [
|
|
399
424
|
{
|
|
@@ -433,12 +458,12 @@ export function validateRequest(value) {
|
|
|
433
458
|
return false
|
|
434
459
|
}
|
|
435
460
|
if (0 in data && hasOwn(data, 0)) {
|
|
436
|
-
const
|
|
437
|
-
const
|
|
438
|
-
const
|
|
439
|
-
validate.errors =
|
|
440
|
-
if (!
|
|
441
|
-
validate.errors = [errorMerge(
|
|
461
|
+
const err23 = validate.errors
|
|
462
|
+
const res23 = ref4(data[0])
|
|
463
|
+
const suberr23 = ref4.errors
|
|
464
|
+
validate.errors = err23
|
|
465
|
+
if (!res23) {
|
|
466
|
+
validate.errors = [errorMerge(suberr23[0], '#/0/$ref', '#/0')]
|
|
442
467
|
return false
|
|
443
468
|
}
|
|
444
469
|
}
|
|
@@ -469,7 +494,7 @@ export function validateRequest(value) {
|
|
|
469
494
|
]
|
|
470
495
|
return false
|
|
471
496
|
}
|
|
472
|
-
if (!
|
|
497
|
+
if (!format2.test(data[0])) {
|
|
473
498
|
validate.errors = [
|
|
474
499
|
{ keywordLocation: '#/0/format', instanceLocation: '#/0' },
|
|
475
500
|
]
|
|
@@ -483,7 +508,7 @@ export function validateRequest(value) {
|
|
|
483
508
|
]
|
|
484
509
|
return false
|
|
485
510
|
}
|
|
486
|
-
if (!
|
|
511
|
+
if (!format4.test(data[1])) {
|
|
487
512
|
validate.errors = [
|
|
488
513
|
{ keywordLocation: '#/1/format', instanceLocation: '#/1' },
|
|
489
514
|
]
|
|
@@ -511,12 +536,12 @@ export function validateRequest(value) {
|
|
|
511
536
|
return false
|
|
512
537
|
}
|
|
513
538
|
if (0 in data && hasOwn(data, 0)) {
|
|
514
|
-
const
|
|
515
|
-
const
|
|
516
|
-
const
|
|
517
|
-
validate.errors =
|
|
518
|
-
if (!
|
|
519
|
-
validate.errors = [errorMerge(
|
|
539
|
+
const err26 = validate.errors
|
|
540
|
+
const res26 = ref4(data[0])
|
|
541
|
+
const suberr26 = ref4.errors
|
|
542
|
+
validate.errors = err26
|
|
543
|
+
if (!res26) {
|
|
544
|
+
validate.errors = [errorMerge(suberr26[0], '#/0/$ref', '#/0')]
|
|
520
545
|
return false
|
|
521
546
|
}
|
|
522
547
|
}
|
|
@@ -528,7 +553,6 @@ export function validateRequest(value) {
|
|
|
528
553
|
}
|
|
529
554
|
return true
|
|
530
555
|
}
|
|
531
|
-
const format4 = new RegExp('^(?!_)(\\n|\\r|.)*$', '')
|
|
532
556
|
const ref7 = function validate(data) {
|
|
533
557
|
validate.errors = null
|
|
534
558
|
if (!Array.isArray(data)) {
|
|
@@ -548,7 +572,7 @@ export function validateRequest(value) {
|
|
|
548
572
|
]
|
|
549
573
|
return false
|
|
550
574
|
}
|
|
551
|
-
if (!
|
|
575
|
+
if (!format2.test(data[0])) {
|
|
552
576
|
validate.errors = [
|
|
553
577
|
{ keywordLocation: '#/0/format', instanceLocation: '#/0' },
|
|
554
578
|
]
|
|
@@ -568,7 +592,7 @@ export function validateRequest(value) {
|
|
|
568
592
|
]
|
|
569
593
|
return false
|
|
570
594
|
}
|
|
571
|
-
if (!
|
|
595
|
+
if (!format3.test(data[1])) {
|
|
572
596
|
validate.errors = [
|
|
573
597
|
{ keywordLocation: '#/1/format', instanceLocation: '#/1' },
|
|
574
598
|
]
|
|
@@ -702,7 +726,7 @@ export function validateRequest(value) {
|
|
|
702
726
|
]
|
|
703
727
|
return false
|
|
704
728
|
}
|
|
705
|
-
if (!
|
|
729
|
+
if (!format3.test(data[k].value)) {
|
|
706
730
|
validate.errors = [
|
|
707
731
|
{
|
|
708
732
|
keywordLocation: '#/items/properties/value/format',
|
|
@@ -739,12 +763,12 @@ export function validateRequest(value) {
|
|
|
739
763
|
return false
|
|
740
764
|
}
|
|
741
765
|
if (0 in data && hasOwn(data, 0)) {
|
|
742
|
-
const
|
|
743
|
-
const
|
|
744
|
-
const
|
|
745
|
-
validate.errors =
|
|
746
|
-
if (!
|
|
747
|
-
validate.errors = [errorMerge(
|
|
766
|
+
const err29 = validate.errors
|
|
767
|
+
const res29 = ref9(data[0])
|
|
768
|
+
const suberr29 = ref9.errors
|
|
769
|
+
validate.errors = err29
|
|
770
|
+
if (!res29) {
|
|
771
|
+
validate.errors = [errorMerge(suberr29[0], '#/0/$ref', '#/0')]
|
|
748
772
|
return false
|
|
749
773
|
}
|
|
750
774
|
}
|
|
@@ -755,7 +779,7 @@ export function validateRequest(value) {
|
|
|
755
779
|
]
|
|
756
780
|
return false
|
|
757
781
|
}
|
|
758
|
-
if (!
|
|
782
|
+
if (!format2.test(data[1])) {
|
|
759
783
|
validate.errors = [
|
|
760
784
|
{ keywordLocation: '#/1/format', instanceLocation: '#/1' },
|
|
761
785
|
]
|
|
@@ -795,7 +819,7 @@ export function validateRequest(value) {
|
|
|
795
819
|
]
|
|
796
820
|
return false
|
|
797
821
|
}
|
|
798
|
-
if (!
|
|
822
|
+
if (!format3.test(data[0])) {
|
|
799
823
|
validate.errors = [
|
|
800
824
|
{ keywordLocation: '#/0/format', instanceLocation: '#/0' },
|
|
801
825
|
]
|
|
@@ -809,7 +833,7 @@ export function validateRequest(value) {
|
|
|
809
833
|
]
|
|
810
834
|
return false
|
|
811
835
|
}
|
|
812
|
-
if (!
|
|
836
|
+
if (!format2.test(data[1])) {
|
|
813
837
|
validate.errors = [
|
|
814
838
|
{ keywordLocation: '#/1/format', instanceLocation: '#/1' },
|
|
815
839
|
]
|
|
@@ -848,14 +872,14 @@ export function validateRequest(value) {
|
|
|
848
872
|
return false
|
|
849
873
|
}
|
|
850
874
|
if ('eth_accounts' in data && hasOwn(data, 'eth_accounts')) {
|
|
851
|
-
const
|
|
852
|
-
const
|
|
853
|
-
const
|
|
854
|
-
validate.errors =
|
|
855
|
-
if (!
|
|
875
|
+
const err35 = validate.errors
|
|
876
|
+
const res35 = ref13(data.eth_accounts)
|
|
877
|
+
const suberr35 = ref13.errors
|
|
878
|
+
validate.errors = err35
|
|
879
|
+
if (!res35) {
|
|
856
880
|
validate.errors = [
|
|
857
881
|
errorMerge(
|
|
858
|
-
|
|
882
|
+
suberr35[0],
|
|
859
883
|
'#/properties/eth_accounts/$ref',
|
|
860
884
|
'#/eth_accounts',
|
|
861
885
|
),
|
|
@@ -889,12 +913,12 @@ export function validateRequest(value) {
|
|
|
889
913
|
return false
|
|
890
914
|
}
|
|
891
915
|
if (0 in data && hasOwn(data, 0)) {
|
|
892
|
-
const
|
|
893
|
-
const
|
|
894
|
-
const
|
|
895
|
-
validate.errors =
|
|
896
|
-
if (!
|
|
897
|
-
validate.errors = [errorMerge(
|
|
916
|
+
const err36 = validate.errors
|
|
917
|
+
const res36 = ref12(data[0])
|
|
918
|
+
const suberr36 = ref12.errors
|
|
919
|
+
validate.errors = err36
|
|
920
|
+
if (!res36) {
|
|
921
|
+
validate.errors = [errorMerge(suberr36[0], '#/0/$ref', '#/0')]
|
|
898
922
|
return false
|
|
899
923
|
}
|
|
900
924
|
}
|
|
@@ -953,7 +977,7 @@ export function validateRequest(value) {
|
|
|
953
977
|
]
|
|
954
978
|
return false
|
|
955
979
|
}
|
|
956
|
-
if (!
|
|
980
|
+
if (!format2.test(data.address)) {
|
|
957
981
|
validate.errors = [
|
|
958
982
|
{
|
|
959
983
|
keywordLocation: '#/properties/address/format',
|
|
@@ -1004,21 +1028,21 @@ export function validateRequest(value) {
|
|
|
1004
1028
|
}
|
|
1005
1029
|
if ('image' in data && hasOwn(data, 'image')) {
|
|
1006
1030
|
let passes4 = 0
|
|
1007
|
-
const
|
|
1031
|
+
const sub20 = (() => {
|
|
1008
1032
|
if (!(typeof data.image === 'string')) return false
|
|
1009
1033
|
if (!format6.test(data.image)) return false
|
|
1010
1034
|
return true
|
|
1011
1035
|
})()
|
|
1012
|
-
if (
|
|
1013
|
-
const
|
|
1014
|
-
const
|
|
1015
|
-
const
|
|
1016
|
-
const
|
|
1017
|
-
validate.errors =
|
|
1018
|
-
if (!
|
|
1036
|
+
if (sub20) passes4++
|
|
1037
|
+
const sub21 = (() => {
|
|
1038
|
+
const err38 = validate.errors
|
|
1039
|
+
const res38 = ref16(data.image)
|
|
1040
|
+
const suberr38 = ref16.errors
|
|
1041
|
+
validate.errors = err38
|
|
1042
|
+
if (!res38) return false
|
|
1019
1043
|
return true
|
|
1020
1044
|
})()
|
|
1021
|
-
if (
|
|
1045
|
+
if (sub21) passes4++
|
|
1022
1046
|
if (passes4 !== 1) {
|
|
1023
1047
|
validate.errors = [
|
|
1024
1048
|
{
|
|
@@ -1092,13 +1116,13 @@ export function validateRequest(value) {
|
|
|
1092
1116
|
]
|
|
1093
1117
|
return false
|
|
1094
1118
|
}
|
|
1095
|
-
const
|
|
1096
|
-
const
|
|
1097
|
-
const
|
|
1098
|
-
validate.errors =
|
|
1099
|
-
if (!
|
|
1119
|
+
const err39 = validate.errors
|
|
1120
|
+
const res39 = ref15(data.options)
|
|
1121
|
+
const suberr39 = ref15.errors
|
|
1122
|
+
validate.errors = err39
|
|
1123
|
+
if (!res39) {
|
|
1100
1124
|
validate.errors = [
|
|
1101
|
-
errorMerge(
|
|
1125
|
+
errorMerge(suberr39[0], '#/properties/options/$ref', '#/options'),
|
|
1102
1126
|
]
|
|
1103
1127
|
return false
|
|
1104
1128
|
}
|
|
@@ -1258,14 +1282,14 @@ export function validateRequest(value) {
|
|
|
1258
1282
|
]
|
|
1259
1283
|
return false
|
|
1260
1284
|
}
|
|
1261
|
-
const
|
|
1262
|
-
const
|
|
1263
|
-
const
|
|
1264
|
-
validate.errors =
|
|
1265
|
-
if (!
|
|
1285
|
+
const err1 = validate.errors
|
|
1286
|
+
const res1 = ref1(data.params)
|
|
1287
|
+
const suberr1 = ref1.errors
|
|
1288
|
+
validate.errors = err1
|
|
1289
|
+
if (!res1) {
|
|
1266
1290
|
validate.errors = [
|
|
1267
1291
|
errorMerge(
|
|
1268
|
-
|
|
1292
|
+
suberr1[0],
|
|
1269
1293
|
'#/oneOf/3/properties/params/$ref',
|
|
1270
1294
|
'#/params',
|
|
1271
1295
|
),
|
|
@@ -1303,14 +1327,14 @@ export function validateRequest(value) {
|
|
|
1303
1327
|
]
|
|
1304
1328
|
return false
|
|
1305
1329
|
}
|
|
1306
|
-
const
|
|
1307
|
-
const
|
|
1308
|
-
const
|
|
1309
|
-
validate.errors =
|
|
1310
|
-
if (!
|
|
1330
|
+
const err2 = validate.errors
|
|
1331
|
+
const res2 = ref1(data.params)
|
|
1332
|
+
const suberr2 = ref1.errors
|
|
1333
|
+
validate.errors = err2
|
|
1334
|
+
if (!res2) {
|
|
1311
1335
|
validate.errors = [
|
|
1312
1336
|
errorMerge(
|
|
1313
|
-
|
|
1337
|
+
suberr2[0],
|
|
1314
1338
|
'#/oneOf/5/properties/params/$ref',
|
|
1315
1339
|
'#/params',
|
|
1316
1340
|
),
|
|
@@ -1328,14 +1352,14 @@ export function validateRequest(value) {
|
|
|
1328
1352
|
]
|
|
1329
1353
|
return false
|
|
1330
1354
|
}
|
|
1331
|
-
const
|
|
1332
|
-
const
|
|
1333
|
-
const
|
|
1334
|
-
validate.errors =
|
|
1335
|
-
if (!
|
|
1355
|
+
const err3 = validate.errors
|
|
1356
|
+
const res3 = ref1(data.params)
|
|
1357
|
+
const suberr3 = ref1.errors
|
|
1358
|
+
validate.errors = err3
|
|
1359
|
+
if (!res3) {
|
|
1336
1360
|
validate.errors = [
|
|
1337
1361
|
errorMerge(
|
|
1338
|
-
|
|
1362
|
+
suberr3[0],
|
|
1339
1363
|
'#/oneOf/6/properties/params/$ref',
|
|
1340
1364
|
'#/params',
|
|
1341
1365
|
),
|
|
@@ -1353,14 +1377,14 @@ export function validateRequest(value) {
|
|
|
1353
1377
|
]
|
|
1354
1378
|
return false
|
|
1355
1379
|
}
|
|
1356
|
-
const
|
|
1357
|
-
const
|
|
1358
|
-
const
|
|
1359
|
-
validate.errors =
|
|
1360
|
-
if (!
|
|
1380
|
+
const err4 = validate.errors
|
|
1381
|
+
const res4 = ref1(data.params)
|
|
1382
|
+
const suberr4 = ref1.errors
|
|
1383
|
+
validate.errors = err4
|
|
1384
|
+
if (!res4) {
|
|
1361
1385
|
validate.errors = [
|
|
1362
1386
|
errorMerge(
|
|
1363
|
-
|
|
1387
|
+
suberr4[0],
|
|
1364
1388
|
'#/oneOf/7/properties/params/$ref',
|
|
1365
1389
|
'#/params',
|
|
1366
1390
|
),
|
|
@@ -1398,31 +1422,6 @@ export function validateRequest(value) {
|
|
|
1398
1422
|
]
|
|
1399
1423
|
return false
|
|
1400
1424
|
}
|
|
1401
|
-
const err4 = validate.errors
|
|
1402
|
-
const res4 = ref1(data.params)
|
|
1403
|
-
const suberr4 = ref1.errors
|
|
1404
|
-
validate.errors = err4
|
|
1405
|
-
if (!res4) {
|
|
1406
|
-
validate.errors = [
|
|
1407
|
-
errorMerge(
|
|
1408
|
-
suberr4[0],
|
|
1409
|
-
'#/oneOf/9/properties/params/$ref',
|
|
1410
|
-
'#/params',
|
|
1411
|
-
),
|
|
1412
|
-
]
|
|
1413
|
-
return false
|
|
1414
|
-
}
|
|
1415
|
-
break
|
|
1416
|
-
case 'eth_getBlockByHash':
|
|
1417
|
-
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1418
|
-
validate.errors = [
|
|
1419
|
-
{
|
|
1420
|
-
keywordLocation: '#/oneOf/10/required',
|
|
1421
|
-
instanceLocation: '#/params',
|
|
1422
|
-
},
|
|
1423
|
-
]
|
|
1424
|
-
return false
|
|
1425
|
-
}
|
|
1426
1425
|
const err5 = validate.errors
|
|
1427
1426
|
const res5 = ref1(data.params)
|
|
1428
1427
|
const suberr5 = ref1.errors
|
|
@@ -1431,18 +1430,18 @@ export function validateRequest(value) {
|
|
|
1431
1430
|
validate.errors = [
|
|
1432
1431
|
errorMerge(
|
|
1433
1432
|
suberr5[0],
|
|
1434
|
-
'#/oneOf/
|
|
1433
|
+
'#/oneOf/9/properties/params/$ref',
|
|
1435
1434
|
'#/params',
|
|
1436
1435
|
),
|
|
1437
1436
|
]
|
|
1438
1437
|
return false
|
|
1439
1438
|
}
|
|
1440
1439
|
break
|
|
1441
|
-
case '
|
|
1440
|
+
case 'eth_getBlockByHash':
|
|
1442
1441
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1443
1442
|
validate.errors = [
|
|
1444
1443
|
{
|
|
1445
|
-
keywordLocation: '#/oneOf/
|
|
1444
|
+
keywordLocation: '#/oneOf/10/required',
|
|
1446
1445
|
instanceLocation: '#/params',
|
|
1447
1446
|
},
|
|
1448
1447
|
]
|
|
@@ -1456,18 +1455,18 @@ export function validateRequest(value) {
|
|
|
1456
1455
|
validate.errors = [
|
|
1457
1456
|
errorMerge(
|
|
1458
1457
|
suberr6[0],
|
|
1459
|
-
'#/oneOf/
|
|
1458
|
+
'#/oneOf/10/properties/params/$ref',
|
|
1460
1459
|
'#/params',
|
|
1461
1460
|
),
|
|
1462
1461
|
]
|
|
1463
1462
|
return false
|
|
1464
1463
|
}
|
|
1465
1464
|
break
|
|
1466
|
-
case '
|
|
1465
|
+
case 'eth_getBlockByNumber':
|
|
1467
1466
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1468
1467
|
validate.errors = [
|
|
1469
1468
|
{
|
|
1470
|
-
keywordLocation: '#/oneOf/
|
|
1469
|
+
keywordLocation: '#/oneOf/11/required',
|
|
1471
1470
|
instanceLocation: '#/params',
|
|
1472
1471
|
},
|
|
1473
1472
|
]
|
|
@@ -1481,18 +1480,18 @@ export function validateRequest(value) {
|
|
|
1481
1480
|
validate.errors = [
|
|
1482
1481
|
errorMerge(
|
|
1483
1482
|
suberr7[0],
|
|
1484
|
-
'#/oneOf/
|
|
1483
|
+
'#/oneOf/11/properties/params/$ref',
|
|
1485
1484
|
'#/params',
|
|
1486
1485
|
),
|
|
1487
1486
|
]
|
|
1488
1487
|
return false
|
|
1489
1488
|
}
|
|
1490
1489
|
break
|
|
1491
|
-
case '
|
|
1490
|
+
case 'eth_getBlockTransactionCountByHash':
|
|
1492
1491
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1493
1492
|
validate.errors = [
|
|
1494
1493
|
{
|
|
1495
|
-
keywordLocation: '#/oneOf/
|
|
1494
|
+
keywordLocation: '#/oneOf/12/required',
|
|
1496
1495
|
instanceLocation: '#/params',
|
|
1497
1496
|
},
|
|
1498
1497
|
]
|
|
@@ -1506,18 +1505,18 @@ export function validateRequest(value) {
|
|
|
1506
1505
|
validate.errors = [
|
|
1507
1506
|
errorMerge(
|
|
1508
1507
|
suberr8[0],
|
|
1509
|
-
'#/oneOf/
|
|
1508
|
+
'#/oneOf/12/properties/params/$ref',
|
|
1510
1509
|
'#/params',
|
|
1511
1510
|
),
|
|
1512
1511
|
]
|
|
1513
1512
|
return false
|
|
1514
1513
|
}
|
|
1515
1514
|
break
|
|
1516
|
-
case '
|
|
1515
|
+
case 'eth_getBlockTransactionCountByNumber':
|
|
1517
1516
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1518
1517
|
validate.errors = [
|
|
1519
1518
|
{
|
|
1520
|
-
keywordLocation: '#/oneOf/
|
|
1519
|
+
keywordLocation: '#/oneOf/13/required',
|
|
1521
1520
|
instanceLocation: '#/params',
|
|
1522
1521
|
},
|
|
1523
1522
|
]
|
|
@@ -1531,63 +1530,63 @@ export function validateRequest(value) {
|
|
|
1531
1530
|
validate.errors = [
|
|
1532
1531
|
errorMerge(
|
|
1533
1532
|
suberr9[0],
|
|
1534
|
-
'#/oneOf/
|
|
1533
|
+
'#/oneOf/13/properties/params/$ref',
|
|
1535
1534
|
'#/params',
|
|
1536
1535
|
),
|
|
1537
1536
|
]
|
|
1538
1537
|
return false
|
|
1539
1538
|
}
|
|
1540
1539
|
break
|
|
1541
|
-
case '
|
|
1540
|
+
case 'eth_getCode':
|
|
1542
1541
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1543
1542
|
validate.errors = [
|
|
1544
1543
|
{
|
|
1545
|
-
keywordLocation: '#/oneOf/
|
|
1544
|
+
keywordLocation: '#/oneOf/14/required',
|
|
1546
1545
|
instanceLocation: '#/params',
|
|
1547
1546
|
},
|
|
1548
1547
|
]
|
|
1549
1548
|
return false
|
|
1550
1549
|
}
|
|
1551
|
-
|
|
1550
|
+
const err10 = validate.errors
|
|
1551
|
+
const res10 = ref1(data.params)
|
|
1552
|
+
const suberr10 = ref1.errors
|
|
1553
|
+
validate.errors = err10
|
|
1554
|
+
if (!res10) {
|
|
1552
1555
|
validate.errors = [
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1556
|
+
errorMerge(
|
|
1557
|
+
suberr10[0],
|
|
1558
|
+
'#/oneOf/14/properties/params/$ref',
|
|
1559
|
+
'#/params',
|
|
1560
|
+
),
|
|
1557
1561
|
]
|
|
1558
1562
|
return false
|
|
1559
1563
|
}
|
|
1560
1564
|
break
|
|
1561
|
-
case '
|
|
1565
|
+
case 'eth_getCompilers':
|
|
1562
1566
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1563
1567
|
validate.errors = [
|
|
1564
1568
|
{
|
|
1565
|
-
keywordLocation: '#/oneOf/
|
|
1569
|
+
keywordLocation: '#/oneOf/15/required',
|
|
1566
1570
|
instanceLocation: '#/params',
|
|
1567
1571
|
},
|
|
1568
1572
|
]
|
|
1569
1573
|
return false
|
|
1570
1574
|
}
|
|
1571
|
-
|
|
1572
|
-
const res10 = ref1(data.params)
|
|
1573
|
-
const suberr10 = ref1.errors
|
|
1574
|
-
validate.errors = err10
|
|
1575
|
-
if (!res10) {
|
|
1575
|
+
if (!(Array.isArray(data.params) && data.params.length === 0)) {
|
|
1576
1576
|
validate.errors = [
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
'#/
|
|
1580
|
-
|
|
1581
|
-
),
|
|
1577
|
+
{
|
|
1578
|
+
keywordLocation: '#/oneOf/15/properties/params/const',
|
|
1579
|
+
instanceLocation: '#/params',
|
|
1580
|
+
},
|
|
1582
1581
|
]
|
|
1583
1582
|
return false
|
|
1584
1583
|
}
|
|
1585
1584
|
break
|
|
1586
|
-
case '
|
|
1585
|
+
case 'eth_getLogs':
|
|
1587
1586
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1588
1587
|
validate.errors = [
|
|
1589
1588
|
{
|
|
1590
|
-
keywordLocation: '#/oneOf/
|
|
1589
|
+
keywordLocation: '#/oneOf/16/required',
|
|
1591
1590
|
instanceLocation: '#/params',
|
|
1592
1591
|
},
|
|
1593
1592
|
]
|
|
@@ -1601,18 +1600,18 @@ export function validateRequest(value) {
|
|
|
1601
1600
|
validate.errors = [
|
|
1602
1601
|
errorMerge(
|
|
1603
1602
|
suberr11[0],
|
|
1604
|
-
'#/oneOf/
|
|
1603
|
+
'#/oneOf/16/properties/params/$ref',
|
|
1605
1604
|
'#/params',
|
|
1606
1605
|
),
|
|
1607
1606
|
]
|
|
1608
1607
|
return false
|
|
1609
1608
|
}
|
|
1610
1609
|
break
|
|
1611
|
-
case '
|
|
1610
|
+
case 'eth_getProof':
|
|
1612
1611
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1613
1612
|
validate.errors = [
|
|
1614
1613
|
{
|
|
1615
|
-
keywordLocation: '#/oneOf/
|
|
1614
|
+
keywordLocation: '#/oneOf/17/required',
|
|
1616
1615
|
instanceLocation: '#/params',
|
|
1617
1616
|
},
|
|
1618
1617
|
]
|
|
@@ -1626,18 +1625,18 @@ export function validateRequest(value) {
|
|
|
1626
1625
|
validate.errors = [
|
|
1627
1626
|
errorMerge(
|
|
1628
1627
|
suberr12[0],
|
|
1629
|
-
'#/oneOf/
|
|
1628
|
+
'#/oneOf/17/properties/params/$ref',
|
|
1630
1629
|
'#/params',
|
|
1631
1630
|
),
|
|
1632
1631
|
]
|
|
1633
1632
|
return false
|
|
1634
1633
|
}
|
|
1635
1634
|
break
|
|
1636
|
-
case '
|
|
1635
|
+
case 'eth_getStorageAt':
|
|
1637
1636
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1638
1637
|
validate.errors = [
|
|
1639
1638
|
{
|
|
1640
|
-
keywordLocation: '#/oneOf/
|
|
1639
|
+
keywordLocation: '#/oneOf/18/required',
|
|
1641
1640
|
instanceLocation: '#/params',
|
|
1642
1641
|
},
|
|
1643
1642
|
]
|
|
@@ -1651,18 +1650,18 @@ export function validateRequest(value) {
|
|
|
1651
1650
|
validate.errors = [
|
|
1652
1651
|
errorMerge(
|
|
1653
1652
|
suberr13[0],
|
|
1654
|
-
'#/oneOf/
|
|
1653
|
+
'#/oneOf/18/properties/params/$ref',
|
|
1655
1654
|
'#/params',
|
|
1656
1655
|
),
|
|
1657
1656
|
]
|
|
1658
1657
|
return false
|
|
1659
1658
|
}
|
|
1660
1659
|
break
|
|
1661
|
-
case '
|
|
1660
|
+
case 'eth_getTransactionByBlockHashAndIndex':
|
|
1662
1661
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1663
1662
|
validate.errors = [
|
|
1664
1663
|
{
|
|
1665
|
-
keywordLocation: '#/oneOf/
|
|
1664
|
+
keywordLocation: '#/oneOf/19/required',
|
|
1666
1665
|
instanceLocation: '#/params',
|
|
1667
1666
|
},
|
|
1668
1667
|
]
|
|
@@ -1676,18 +1675,18 @@ export function validateRequest(value) {
|
|
|
1676
1675
|
validate.errors = [
|
|
1677
1676
|
errorMerge(
|
|
1678
1677
|
suberr14[0],
|
|
1679
|
-
'#/oneOf/
|
|
1678
|
+
'#/oneOf/19/properties/params/$ref',
|
|
1680
1679
|
'#/params',
|
|
1681
1680
|
),
|
|
1682
1681
|
]
|
|
1683
1682
|
return false
|
|
1684
1683
|
}
|
|
1685
1684
|
break
|
|
1686
|
-
case '
|
|
1685
|
+
case 'eth_getTransactionByBlockNumberAndIndex':
|
|
1687
1686
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1688
1687
|
validate.errors = [
|
|
1689
1688
|
{
|
|
1690
|
-
keywordLocation: '#/oneOf/
|
|
1689
|
+
keywordLocation: '#/oneOf/20/required',
|
|
1691
1690
|
instanceLocation: '#/params',
|
|
1692
1691
|
},
|
|
1693
1692
|
]
|
|
@@ -1701,18 +1700,18 @@ export function validateRequest(value) {
|
|
|
1701
1700
|
validate.errors = [
|
|
1702
1701
|
errorMerge(
|
|
1703
1702
|
suberr15[0],
|
|
1704
|
-
'#/oneOf/
|
|
1703
|
+
'#/oneOf/20/properties/params/$ref',
|
|
1705
1704
|
'#/params',
|
|
1706
1705
|
),
|
|
1707
1706
|
]
|
|
1708
1707
|
return false
|
|
1709
1708
|
}
|
|
1710
1709
|
break
|
|
1711
|
-
case '
|
|
1710
|
+
case 'eth_getTransactionByHash':
|
|
1712
1711
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1713
1712
|
validate.errors = [
|
|
1714
1713
|
{
|
|
1715
|
-
keywordLocation: '#/oneOf/
|
|
1714
|
+
keywordLocation: '#/oneOf/21/required',
|
|
1716
1715
|
instanceLocation: '#/params',
|
|
1717
1716
|
},
|
|
1718
1717
|
]
|
|
@@ -1726,18 +1725,18 @@ export function validateRequest(value) {
|
|
|
1726
1725
|
validate.errors = [
|
|
1727
1726
|
errorMerge(
|
|
1728
1727
|
suberr16[0],
|
|
1729
|
-
'#/oneOf/
|
|
1728
|
+
'#/oneOf/21/properties/params/$ref',
|
|
1730
1729
|
'#/params',
|
|
1731
1730
|
),
|
|
1732
1731
|
]
|
|
1733
1732
|
return false
|
|
1734
1733
|
}
|
|
1735
1734
|
break
|
|
1736
|
-
case '
|
|
1735
|
+
case 'eth_getTransactionCount':
|
|
1737
1736
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1738
1737
|
validate.errors = [
|
|
1739
1738
|
{
|
|
1740
|
-
keywordLocation: '#/oneOf/
|
|
1739
|
+
keywordLocation: '#/oneOf/22/required',
|
|
1741
1740
|
instanceLocation: '#/params',
|
|
1742
1741
|
},
|
|
1743
1742
|
]
|
|
@@ -1751,18 +1750,18 @@ export function validateRequest(value) {
|
|
|
1751
1750
|
validate.errors = [
|
|
1752
1751
|
errorMerge(
|
|
1753
1752
|
suberr17[0],
|
|
1754
|
-
'#/oneOf/
|
|
1753
|
+
'#/oneOf/22/properties/params/$ref',
|
|
1755
1754
|
'#/params',
|
|
1756
1755
|
),
|
|
1757
1756
|
]
|
|
1758
1757
|
return false
|
|
1759
1758
|
}
|
|
1760
1759
|
break
|
|
1761
|
-
case '
|
|
1760
|
+
case 'eth_getTransactionReceipt':
|
|
1762
1761
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1763
1762
|
validate.errors = [
|
|
1764
1763
|
{
|
|
1765
|
-
keywordLocation: '#/oneOf/
|
|
1764
|
+
keywordLocation: '#/oneOf/23/required',
|
|
1766
1765
|
instanceLocation: '#/params',
|
|
1767
1766
|
},
|
|
1768
1767
|
]
|
|
@@ -1776,18 +1775,18 @@ export function validateRequest(value) {
|
|
|
1776
1775
|
validate.errors = [
|
|
1777
1776
|
errorMerge(
|
|
1778
1777
|
suberr18[0],
|
|
1779
|
-
'#/oneOf/
|
|
1778
|
+
'#/oneOf/23/properties/params/$ref',
|
|
1780
1779
|
'#/params',
|
|
1781
1780
|
),
|
|
1782
1781
|
]
|
|
1783
1782
|
return false
|
|
1784
1783
|
}
|
|
1785
1784
|
break
|
|
1786
|
-
case '
|
|
1785
|
+
case 'eth_getUncleCountByBlockHash':
|
|
1787
1786
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1788
1787
|
validate.errors = [
|
|
1789
1788
|
{
|
|
1790
|
-
keywordLocation: '#/oneOf/
|
|
1789
|
+
keywordLocation: '#/oneOf/24/required',
|
|
1791
1790
|
instanceLocation: '#/params',
|
|
1792
1791
|
},
|
|
1793
1792
|
]
|
|
@@ -1801,18 +1800,18 @@ export function validateRequest(value) {
|
|
|
1801
1800
|
validate.errors = [
|
|
1802
1801
|
errorMerge(
|
|
1803
1802
|
suberr19[0],
|
|
1804
|
-
'#/oneOf/
|
|
1803
|
+
'#/oneOf/24/properties/params/$ref',
|
|
1805
1804
|
'#/params',
|
|
1806
1805
|
),
|
|
1807
1806
|
]
|
|
1808
1807
|
return false
|
|
1809
1808
|
}
|
|
1810
1809
|
break
|
|
1811
|
-
case '
|
|
1810
|
+
case 'eth_getUncleByBlockHashAndIndex':
|
|
1812
1811
|
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1813
1812
|
validate.errors = [
|
|
1814
1813
|
{
|
|
1815
|
-
keywordLocation: '#/oneOf/
|
|
1814
|
+
keywordLocation: '#/oneOf/25/required',
|
|
1816
1815
|
instanceLocation: '#/params',
|
|
1817
1816
|
},
|
|
1818
1817
|
]
|
|
@@ -1826,6 +1825,31 @@ export function validateRequest(value) {
|
|
|
1826
1825
|
validate.errors = [
|
|
1827
1826
|
errorMerge(
|
|
1828
1827
|
suberr20[0],
|
|
1828
|
+
'#/oneOf/25/properties/params/$ref',
|
|
1829
|
+
'#/params',
|
|
1830
|
+
),
|
|
1831
|
+
]
|
|
1832
|
+
return false
|
|
1833
|
+
}
|
|
1834
|
+
break
|
|
1835
|
+
case 'eth_getUncleByBlockNumberAndIndex':
|
|
1836
|
+
if (!('params' in data && hasOwn(data, 'params'))) {
|
|
1837
|
+
validate.errors = [
|
|
1838
|
+
{
|
|
1839
|
+
keywordLocation: '#/oneOf/26/required',
|
|
1840
|
+
instanceLocation: '#/params',
|
|
1841
|
+
},
|
|
1842
|
+
]
|
|
1843
|
+
return false
|
|
1844
|
+
}
|
|
1845
|
+
const err21 = validate.errors
|
|
1846
|
+
const res21 = ref1(data.params)
|
|
1847
|
+
const suberr21 = ref1.errors
|
|
1848
|
+
validate.errors = err21
|
|
1849
|
+
if (!res21) {
|
|
1850
|
+
validate.errors = [
|
|
1851
|
+
errorMerge(
|
|
1852
|
+
suberr21[0],
|
|
1829
1853
|
'#/oneOf/26/properties/params/$ref',
|
|
1830
1854
|
'#/params',
|
|
1831
1855
|
),
|
|
@@ -1923,14 +1947,14 @@ export function validateRequest(value) {
|
|
|
1923
1947
|
]
|
|
1924
1948
|
return false
|
|
1925
1949
|
}
|
|
1926
|
-
const
|
|
1927
|
-
const
|
|
1928
|
-
const
|
|
1929
|
-
validate.errors =
|
|
1930
|
-
if (!
|
|
1950
|
+
const err22 = validate.errors
|
|
1951
|
+
const res22 = ref2(data.params)
|
|
1952
|
+
const suberr22 = ref2.errors
|
|
1953
|
+
validate.errors = err22
|
|
1954
|
+
if (!res22) {
|
|
1931
1955
|
validate.errors = [
|
|
1932
1956
|
errorMerge(
|
|
1933
|
-
|
|
1957
|
+
suberr22[0],
|
|
1934
1958
|
'#/oneOf/31/properties/params/$ref',
|
|
1935
1959
|
'#/params',
|
|
1936
1960
|
),
|
|
@@ -1948,14 +1972,14 @@ export function validateRequest(value) {
|
|
|
1948
1972
|
]
|
|
1949
1973
|
return false
|
|
1950
1974
|
}
|
|
1951
|
-
const
|
|
1952
|
-
const
|
|
1953
|
-
const
|
|
1954
|
-
validate.errors =
|
|
1955
|
-
if (!
|
|
1975
|
+
const err24 = validate.errors
|
|
1976
|
+
const res24 = ref3(data.params)
|
|
1977
|
+
const suberr24 = ref3.errors
|
|
1978
|
+
validate.errors = err24
|
|
1979
|
+
if (!res24) {
|
|
1956
1980
|
validate.errors = [
|
|
1957
1981
|
errorMerge(
|
|
1958
|
-
|
|
1982
|
+
suberr24[0],
|
|
1959
1983
|
'#/oneOf/32/properties/params/$ref',
|
|
1960
1984
|
'#/params',
|
|
1961
1985
|
),
|
|
@@ -1973,14 +1997,14 @@ export function validateRequest(value) {
|
|
|
1973
1997
|
]
|
|
1974
1998
|
return false
|
|
1975
1999
|
}
|
|
1976
|
-
const
|
|
1977
|
-
const
|
|
1978
|
-
const
|
|
1979
|
-
validate.errors =
|
|
1980
|
-
if (!
|
|
2000
|
+
const err25 = validate.errors
|
|
2001
|
+
const res25 = ref5(data.params)
|
|
2002
|
+
const suberr25 = ref5.errors
|
|
2003
|
+
validate.errors = err25
|
|
2004
|
+
if (!res25) {
|
|
1981
2005
|
validate.errors = [
|
|
1982
2006
|
errorMerge(
|
|
1983
|
-
|
|
2007
|
+
suberr25[0],
|
|
1984
2008
|
'#/oneOf/33/properties/params/$ref',
|
|
1985
2009
|
'#/params',
|
|
1986
2010
|
),
|
|
@@ -1998,14 +2022,14 @@ export function validateRequest(value) {
|
|
|
1998
2022
|
]
|
|
1999
2023
|
return false
|
|
2000
2024
|
}
|
|
2001
|
-
const
|
|
2002
|
-
const
|
|
2003
|
-
const
|
|
2004
|
-
validate.errors =
|
|
2005
|
-
if (!
|
|
2025
|
+
const err27 = validate.errors
|
|
2026
|
+
const res27 = ref6(data.params)
|
|
2027
|
+
const suberr27 = ref6.errors
|
|
2028
|
+
validate.errors = err27
|
|
2029
|
+
if (!res27) {
|
|
2006
2030
|
validate.errors = [
|
|
2007
2031
|
errorMerge(
|
|
2008
|
-
|
|
2032
|
+
suberr27[0],
|
|
2009
2033
|
'#/oneOf/34/properties/params/$ref',
|
|
2010
2034
|
'#/params',
|
|
2011
2035
|
),
|
|
@@ -2023,14 +2047,14 @@ export function validateRequest(value) {
|
|
|
2023
2047
|
]
|
|
2024
2048
|
return false
|
|
2025
2049
|
}
|
|
2026
|
-
const
|
|
2027
|
-
const
|
|
2028
|
-
const
|
|
2029
|
-
validate.errors =
|
|
2030
|
-
if (!
|
|
2050
|
+
const err28 = validate.errors
|
|
2051
|
+
const res28 = ref7(data.params)
|
|
2052
|
+
const suberr28 = ref7.errors
|
|
2053
|
+
validate.errors = err28
|
|
2054
|
+
if (!res28) {
|
|
2031
2055
|
validate.errors = [
|
|
2032
2056
|
errorMerge(
|
|
2033
|
-
|
|
2057
|
+
suberr28[0],
|
|
2034
2058
|
'#/oneOf/35/properties/params/$ref',
|
|
2035
2059
|
'#/params',
|
|
2036
2060
|
),
|
|
@@ -2048,14 +2072,14 @@ export function validateRequest(value) {
|
|
|
2048
2072
|
]
|
|
2049
2073
|
return false
|
|
2050
2074
|
}
|
|
2051
|
-
const
|
|
2052
|
-
const
|
|
2053
|
-
const
|
|
2054
|
-
validate.errors =
|
|
2055
|
-
if (!
|
|
2075
|
+
const err30 = validate.errors
|
|
2076
|
+
const res30 = ref8(data.params)
|
|
2077
|
+
const suberr30 = ref8.errors
|
|
2078
|
+
validate.errors = err30
|
|
2079
|
+
if (!res30) {
|
|
2056
2080
|
validate.errors = [
|
|
2057
2081
|
errorMerge(
|
|
2058
|
-
|
|
2082
|
+
suberr30[0],
|
|
2059
2083
|
'#/oneOf/36/properties/params/$ref',
|
|
2060
2084
|
'#/params',
|
|
2061
2085
|
),
|
|
@@ -2073,14 +2097,14 @@ export function validateRequest(value) {
|
|
|
2073
2097
|
]
|
|
2074
2098
|
return false
|
|
2075
2099
|
}
|
|
2076
|
-
const
|
|
2077
|
-
const
|
|
2078
|
-
const
|
|
2079
|
-
validate.errors =
|
|
2080
|
-
if (!
|
|
2100
|
+
const err31 = validate.errors
|
|
2101
|
+
const res31 = ref7(data.params)
|
|
2102
|
+
const suberr31 = ref7.errors
|
|
2103
|
+
validate.errors = err31
|
|
2104
|
+
if (!res31) {
|
|
2081
2105
|
validate.errors = [
|
|
2082
2106
|
errorMerge(
|
|
2083
|
-
|
|
2107
|
+
suberr31[0],
|
|
2084
2108
|
'#/oneOf/37/properties/params/$ref',
|
|
2085
2109
|
'#/params',
|
|
2086
2110
|
),
|
|
@@ -2098,14 +2122,14 @@ export function validateRequest(value) {
|
|
|
2098
2122
|
]
|
|
2099
2123
|
return false
|
|
2100
2124
|
}
|
|
2101
|
-
const
|
|
2102
|
-
const
|
|
2103
|
-
const
|
|
2104
|
-
validate.errors =
|
|
2105
|
-
if (!
|
|
2125
|
+
const err32 = validate.errors
|
|
2126
|
+
const res32 = ref7(data.params)
|
|
2127
|
+
const suberr32 = ref7.errors
|
|
2128
|
+
validate.errors = err32
|
|
2129
|
+
if (!res32) {
|
|
2106
2130
|
validate.errors = [
|
|
2107
2131
|
errorMerge(
|
|
2108
|
-
|
|
2132
|
+
suberr32[0],
|
|
2109
2133
|
'#/oneOf/38/properties/params/$ref',
|
|
2110
2134
|
'#/params',
|
|
2111
2135
|
),
|
|
@@ -2123,14 +2147,14 @@ export function validateRequest(value) {
|
|
|
2123
2147
|
]
|
|
2124
2148
|
return false
|
|
2125
2149
|
}
|
|
2126
|
-
const
|
|
2127
|
-
const
|
|
2128
|
-
const
|
|
2129
|
-
validate.errors =
|
|
2130
|
-
if (!
|
|
2150
|
+
const err33 = validate.errors
|
|
2151
|
+
const res33 = ref1(data.params)
|
|
2152
|
+
const suberr33 = ref1.errors
|
|
2153
|
+
validate.errors = err33
|
|
2154
|
+
if (!res33) {
|
|
2131
2155
|
validate.errors = [
|
|
2132
2156
|
errorMerge(
|
|
2133
|
-
|
|
2157
|
+
suberr33[0],
|
|
2134
2158
|
'#/oneOf/39/properties/params/$ref',
|
|
2135
2159
|
'#/params',
|
|
2136
2160
|
),
|
|
@@ -2148,14 +2172,14 @@ export function validateRequest(value) {
|
|
|
2148
2172
|
]
|
|
2149
2173
|
return false
|
|
2150
2174
|
}
|
|
2151
|
-
const
|
|
2152
|
-
const
|
|
2153
|
-
const
|
|
2154
|
-
validate.errors =
|
|
2155
|
-
if (!
|
|
2175
|
+
const err34 = validate.errors
|
|
2176
|
+
const res34 = ref10(data.params)
|
|
2177
|
+
const suberr34 = ref10.errors
|
|
2178
|
+
validate.errors = err34
|
|
2179
|
+
if (!res34) {
|
|
2156
2180
|
validate.errors = [
|
|
2157
2181
|
errorMerge(
|
|
2158
|
-
|
|
2182
|
+
suberr34[0],
|
|
2159
2183
|
'#/oneOf/40/properties/params/$ref',
|
|
2160
2184
|
'#/params',
|
|
2161
2185
|
),
|
|
@@ -2213,14 +2237,14 @@ export function validateRequest(value) {
|
|
|
2213
2237
|
]
|
|
2214
2238
|
return false
|
|
2215
2239
|
}
|
|
2216
|
-
const
|
|
2217
|
-
const
|
|
2218
|
-
const
|
|
2219
|
-
validate.errors =
|
|
2220
|
-
if (!
|
|
2240
|
+
const err37 = validate.errors
|
|
2241
|
+
const res37 = ref11(data.params)
|
|
2242
|
+
const suberr37 = ref11.errors
|
|
2243
|
+
validate.errors = err37
|
|
2244
|
+
if (!res37) {
|
|
2221
2245
|
validate.errors = [
|
|
2222
2246
|
errorMerge(
|
|
2223
|
-
|
|
2247
|
+
suberr37[0],
|
|
2224
2248
|
'#/oneOf/43/properties/params/$ref',
|
|
2225
2249
|
'#/params',
|
|
2226
2250
|
),
|
|
@@ -2238,14 +2262,14 @@ export function validateRequest(value) {
|
|
|
2238
2262
|
]
|
|
2239
2263
|
return false
|
|
2240
2264
|
}
|
|
2241
|
-
const
|
|
2242
|
-
const
|
|
2243
|
-
const
|
|
2244
|
-
validate.errors =
|
|
2245
|
-
if (!
|
|
2265
|
+
const err40 = validate.errors
|
|
2266
|
+
const res40 = ref14(data.params)
|
|
2267
|
+
const suberr40 = ref14.errors
|
|
2268
|
+
validate.errors = err40
|
|
2269
|
+
if (!res40) {
|
|
2246
2270
|
validate.errors = [
|
|
2247
2271
|
errorMerge(
|
|
2248
|
-
|
|
2272
|
+
suberr40[0],
|
|
2249
2273
|
'#/oneOf/44/properties/params/$ref',
|
|
2250
2274
|
'#/params',
|
|
2251
2275
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EthTransaction } from '@exodus/web3-ethereum-utils';
|
|
2
1
|
import type { Asset, EthBalanceChanges } from './types.js';
|
|
2
|
+
import type { EthTransaction } from '@exodus/web3-ethereum-utils';
|
|
3
3
|
export declare const simulateTransaction: (asset: Asset, transaction: EthTransaction) => Promise<{
|
|
4
4
|
assetName: string;
|
|
5
5
|
advancedDetails: never[];
|
package/lib/simulation/utils.js
CHANGED
|
@@ -10,7 +10,8 @@ export function getEthereumDisplayInfo(balanceChanges) {
|
|
|
10
10
|
const isApproveTransaction = balanceChanges.willApprove.length;
|
|
11
11
|
if (isApproveTransaction) {
|
|
12
12
|
const tokenName = balanceChanges.willApprove[0].unitName;
|
|
13
|
-
title
|
|
13
|
+
// Don't change the title if 'tokenName' is undefined
|
|
14
|
+
title = tokenName ? `Approve ${tokenName} Transactions?` : title;
|
|
14
15
|
}
|
|
15
16
|
return { title };
|
|
16
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Wallet } from '@wallet-standard/base';
|
|
2
1
|
import type { EthereumProvider } from '../provider/provider.js';
|
|
2
|
+
import type { Wallet } from '@wallet-standard/base';
|
|
3
3
|
export declare type EthereumProviderFeature = {
|
|
4
4
|
'ethereum:provider': {
|
|
5
5
|
provider: EthereumProvider;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/web3-ethereum",
|
|
3
3
|
"description": "Apps connectivity library for EVM-compatible chains.",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"module": "lib/index.js",
|
|
@@ -33,21 +33,22 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@exodus/currency": "^2.1.2",
|
|
35
35
|
"@exodus/ethereum-api": "^3.2.4",
|
|
36
|
-
"@exodus/web3-constants": "^1.
|
|
37
|
-
"@exodus/web3-ethereum-utils": "^1.
|
|
38
|
-
"@exodus/web3-provider": "^2.
|
|
36
|
+
"@exodus/web3-constants": "^1.14.0",
|
|
37
|
+
"@exodus/web3-ethereum-utils": "^1.8.0",
|
|
38
|
+
"@exodus/web3-provider": "^2.12.0",
|
|
39
|
+
"@exodus/web3-rpc-handlers": "^0.7.0",
|
|
39
40
|
"eth-rpc-errors": "^4.0.3"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@exodus/assets": "^8.0.72",
|
|
43
44
|
"@exodus/json-rpc": "^1.11.0",
|
|
44
45
|
"@exodus/schemasafe": "^1.0.0",
|
|
45
|
-
"@exodus/web3-types": "^1.
|
|
46
|
-
"@exodus/web3-validation": "^1.
|
|
46
|
+
"@exodus/web3-types": "^1.10.0",
|
|
47
|
+
"@exodus/web3-validation": "^1.29.1",
|
|
47
48
|
"@wallet-standard/base": "^1.0.1"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
51
|
"@exodus/assets": "^8.0.72"
|
|
51
52
|
},
|
|
52
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "e48f74f32e040de9e86ef77ea48058d5c0b36c86"
|
|
53
54
|
}
|