-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite-env.d.ts
870 lines (760 loc) · 16.7 KB
/
vite-env.d.ts
1
2
3
4
5
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
import type { UnwrapNestedRefs } from 'nuxt/dist/app/compat/capi'
interface Window {
ethereum: any
}
declare module '*.svg?component' {
import type { FunctionalComponent, SVGAttributes } from 'vue'
const src: FunctionalComponent<SVGAttributes>
export default src
}
declare module '*.svg?url' {
const src: string
export default src
}
declare module '*.svg?raw' {
const src: string
export default src
}
declare module '*.svg?skipsvgo' {
import type { FunctionalComponent, SVGAttributes } from 'vue'
const src: FunctionalComponent<SVGAttributes>
export default src
}
declare global {
type ChainId = 1 | 137 | 42161 | 10 | 56 | 43114 | 100 | 1101 | 634 | 63400
interface IBlockQueryChain {
id: string
name: string
created_at: string
updated_at: string
native_token_address: string
wrapped_token_address: string
free_rpc_urls: string[]
}
interface Provider {
id: string
name: string
connect: () => Promise<any>
switchNetwork: (network: Network) => Promise<any>
}
interface Network {
name: string
debankName?: string
ankrName?: string
zerionName?: string
chainId: ChainId
color: string
isAvocado?: boolean
serverRpcUrl: string | undefined
balanceResolverAddress?: string
usdcAddress?: string
explorerUrl: string
fakeTransactionHash: string
apiURL?: string
params: {
chainName?: string
iconUrls?: string[]
rpcUrls: string[]
nativeCurrency?: {
name: string
symbol: string
decimals: number
}
}
}
interface NetworkVersion extends Network {
latestVersion: string
currentVersion: string
notdeployed?: boolean
currentImplementationAddress?: string
latestImplementationAddress?: string
}
interface ISafeOptions {
chainId: string | number
threshold: number
nonce: number
latestVersion: string
currentVersion: string
safeAddress: string
ownerAddress: string
notdeployed: boolean
server: boolean
domainName: string
}
interface IAvocadoTransaction {
id: number
chain_id: string
hash: string
from: string
to: string
data: string
fee: string
effective_fee: string
balance_transactions: IAvocadoBalanceTransaction[]
confirmations: number
status: 'pending' | 'confirming' | 'success' | 'failed' | 'dropped'
revert_reason?: string
gas_limit: string
gas_price: string
value: string
block_number: number
nonce: number
metadata: {
safe?: string
signer?: string
multisig: boolean
multisig_index: number
multisig_signers: string[]
multisig_hash?: string
owner?: string
source?: string
}
created_at: string
updated_at: string
decodedMetadata?: any
isBridge?: boolean
crosschain_transaction: ICrosschainTransaction | null
crosschain_transaction_id: string | null
cross: true
}
interface IBridgeResponse {
success: boolean
result: IBridgeResult
}
interface IBridgeResult {
routes: IRoute[]
fromAsset: FromAsset2
toAsset: ToAsset3
bridgeRouteErrors: BridgeRouteErrors
}
interface IBridgeTokensResult {
name: string
address: string
icon: string
decimals: number
symbol: string
logoURI: string
chainId: number
chainAgnosticId: string
balance?: string
price?: number
score?: number
}
interface IGenerateSignatureMessageParams {
chainId: string | number
actions: TransactionsAction[]
options?: any
}
interface ISignLegacyDataParams {
message: any
chainId: string | number
}
interface IBridgeTokensResponse {
success: boolean
result: IBridgeTokensResult[]
}
interface ISellToken {
name: string
address: string
decimals: number
symbol: string
price: number
verified: boolean
coingeckoId: string
sparklinePrice7d: number[]
}
interface IBuyToken {
name: string
address: string
decimals: number
symbol: string
chainId: string
price: number
verified: boolean
coingeckoId: string
sparklinePrice7d: number[]
}
interface IData {
sellToken: ISellToken
buyToken: IBuyToken
sellTokenAmount: string
buyTokenAmount: string
slippage: number
maxSlippage: number
minBuyAmountSlippage: string
totalAggregators: number
bestBuyTokenAmount: string
worstBuyTokenAmount: string
avgBuyTokenAmount: string
}
interface IConnector {
name: string
calldata: string
}
interface ISellToken2 {
name: string
address: string
decimals: number
symbol: string
chainId: string
price: number
verified: boolean
coingeckoId: string
sparklinePrice7d: number[]
}
interface IBuyToken2 {
name: string
address: string
decimals: number
symbol: string
chainId: string
price: number
verified: boolean
coingeckoId: string
sparklinePrice7d: number[]
}
interface IBatchJson {
version: string
batch: IBatch[]
}
interface BatchFormValues {
abi: string
toAddress: string
contractAddress: string
value: string
chainId: number
method: string
params?: string
raw?: string
[key: string]: any?
}
interface IBatch {
formValues: BatchFormValues
}
interface IDecodedParams {
method: string
builder: any
inputs: any
args: any
}
interface ICreateBatchModal {
chainId: number | string
batch: IBatch[]
mode: TxBuilderModes
}
interface IFromToken {
symbol: string
name: string
address: string
decimals: number
logoURI: string
eip2612: boolean
domainVersion: string
tags: string[]
}
interface IOptionsSafe {
multisig: number
multisig_index: number
owner_address: string
safe_address: string
}
interface IOptionsParams {
safe: IOptionsSafe
chainId: string | number
provider: ethers.providers.StaticJsonRpcProvider
server?: boolean
is_prod: boolean
}
interface IComputeSafeParams {
provider: ethers.providers.StaticJsonRpcProvider
accountAddress: string
isProd: boolean
}
interface IToToken {
symbol: string
name: string
decimals: number
address: string
logoURI: string
eip2612: boolean
tags: string[]
}
interface ITx {
from: string
to: string
data: string
value: string
gas: number
gasPrice: string
}
interface IRaw {
fromToken: IFromToken
toToken: IToToken
toTokenAmount: string
fromTokenAmount: string
protocols: any[]
tx: ITx
}
interface IData2 {
sellToken: ISellToken2
buyToken: IBuyToken2
sellTokenAmount: string
buyTokenAmount: string
unitAmt: string
to: string
allowanceSpender: string
calldata: string
gas: string
gasPrice: string
value: string
slippage: string
priceImpact: string
raw: IRaw
}
interface IAggregator {
name: string
connector: IConnector
data: IData2
}
interface ISwapResponse {
data: IData
aggregators: IAggregator[]
}
// type AtLeast<T, K extends keyof T> = Partial<T> & Pick<T, K>
interface IModal {
id: string
component: DefineComponent | ConcreteComponent
componentProps: any
options?: IOptions
destroy: () => void
async: boolean
onResolve: (success: boolean, payload?: any) => Promise<unknown>
onReject: (success: boolean, payload?: any) => Promise<unknown>
}
interface ISnackOptions {
message: string
type: 'success' | 'error' | 'info'
open?: boolean
timeout?: number
}
interface IMigrationTransaction {
chainId: string | number
txs: TransactionsAction[]
metadata: string[]
}
interface IConnectionMeta {
provider: string | null
}
interface IPendingTransactionModalParams {
hash: string
chainId: number | string
toChainId?: number | string
type?: IWeb3Action
async?: boolean
crossChain?: boolean
preventAutoClose?: boolean
}
interface IOptions {
raw?: boolean
closeButton?: boolean
clickToClose?: boolean
wrapperClass?: string
contentClass?: string
snackOptions?: ISnackOptions
sheetPosition?: 'top' | 'bottom'
}
interface IPendingTransactionModalParams {
hash: string
chainId: number | string
toChainId?: number | string
type?: IWeb3Action
async?: boolean
crossChain?: boolean
}
type IWeb3Action = 'transfer' | 'bridge' | 'swap' | 'gas-topup' | 'reedem' | 'claim' | 'deploy' | 'upgrade' | 'nft' | 'dapp'
type ISlackMessageType = 'danger' | 'error' | 'success' | 'banner' | 'observer'
interface MetadataProps {
type:
| 'transfer'
| 'bridge'
| 'swap'
| 'multi'
| 'gas-topup'
| 'upgrade'
| 'dapp'
| 'deploy'
| 'permit2'
encodedData: string
version?: string
}
interface SignMetadataProps {
token: string
spender: string
amount: string
expiration: string
}
interface DappMetadataProps {
name: string
url: string
}
interface SendMetadataProps {
token: string
amount: string
receiver: string
}
interface UpgradeMetadataProps {
version: string
walletImpl: string
}
interface TopupMetadataProps {
amount: string
token: string
onBehalf: string
}
interface BridgeMetadataProps {
amount: string
receiver: string
fromToken: string
toToken: string
toChainId: string
bridgeFee: string
nativeToken: string
}
interface SwapMetadataProps {
sellToken: string
buyToken: string
sellAmount: string
buyAmount: string
receiver: string
protocol?: string
}
interface DiscountDetails {
amount: number
name: string
description: string
}
interface CalculateFeeProps {
fee?: string
multiplier?: string
chainId: string
discountDetails?: DiscountDetails[]
}
interface BuildInfo {
version: string
commit: string
time: number
branch: string
env: string
}
interface ISimulation {
transaction: Transaction
simulation: ISimulationChange
}
interface ISimulationChange {
approveTokens: SimulationToken[]
sendTokens: SimulationToken[]
receiveTokens: SimulationToken[]
revokeTokens?: SimulationToken[]
}
interface SimulationToken {
token: string
from: string
to: string
amount: string
type?: 'NFT' | 'Burn' | 'Mint' | 'Flashloan' | null
nftMetadata?: {
tokenUrl: string
imageUrl: string
name: string
description: string
traits: any[]
contractType: string
}
}
interface Transaction {
simulationId: string
gasLimit: number
status: boolean
}
interface AppliedDiscountDetails extends DiscountDetails {
discountAmountMin: number
discountAmount: number
formattedDiscountAmount: string
}
interface ICalculatedFee {
discountDetails?: AppliedDiscountDetails[]
amountAfterDiscount: number
discountAvailable: boolean
min: number
max: number
formatted: string
formattedAmountAfterDiscount: string
minAmountAfterDiscount: number
maxAmountAfterDiscount: number
chainId: string
}
interface NFTAttributes {
type: string
value: string
}
interface IGasBalanceMigration {
safe: ISafe
amount: string
}
interface NFTData {
imageUrl: string
thumbnailUrl: string
collectionName: string
name: string
chainId: number
tokenId: string
contractAddress: string
contractType: string
attributes: NFTAttributes[]
animationUrl?: string
}
interface NFTParams {
pageSize: number
}
interface IContact {
name: string
address: string
chainId: number | string
owner?: boolean
notEditable?: boolean
notDeletable?: boolean
}
interface ITransferCount {
from: string
to: string
chainId: number | string
transferCount: number
}
interface ITokenPrice {
address: string
chain_id: string
name: string
symbol: string
decimals: number
logo_url: string
price: string
coingecko_id: string
sparkline_price_7d: number[]
}
interface ILogBalanceParams {
isPublic?: boolean
chainId: number
type: 'eoa-balances' | 'safe-balances' | 'options' | 'compute'
isPublic: boolean
}
interface IEstimatedFeeData {
fee: string
multiplier: string
discount: IEstimatedDiscount
}
interface IEstimatedFeeDataWithChainId extends IEstimatedFeeData {
chainId: string
}
interface IEstimatedActions {
actions: TransactionsAction[]
chainId: number | string
options: any
}
interface IEstimatedDiscount {
amount: number
transactionCount: number
program: string
name: string
description: string
}
interface Discount {
max: number
amount: number
}
type ImportProtocolKeys =
| 'aave-v3'
| 'aave-v2'
| 'compound'
| 'compound-v3'
| 'makerdao'
| 'lite'
interface DefiApis {
protocol: ImportProtocolKeys
protocolId: number
apiPath: string
chainId: number
logoURI?: string
label: string
instadappURL: string
defiURL: string
}
interface Positions extends DefiApis {
positions: {
data?: any[]
tokens?: any[]
healthFactor?: string
totalSupplyInUsd: string
totalBorrowInUsd: string
compPriceInUsd?: string
}
vaultId?: string
apy: string
healthFactor: string
id: string
suppliedTokens: any[]
borrowedTokens: any[]
}
interface MigrationPositions extends DefiApis {
positions: any
dsaId?: string
dsaAddress?: string
vaultId?: string
proceedOnNativeNetwork?: boolean
id: string
// permitData?: PermitSignature[];
}
interface IDsaAccount {
id: string
address: string
version: string
chainId: number
}
interface IDefiActions {
getApy: (positions: any) => any
getSuppliedTokens: (positions: any) => any[]
getBorrowedTokens: (positions: any) => any[]
}
interface IDefiToken {
key: string
price?: string
tokenAddress: string
}
interface ISafesResponse {
data: ISafe[]
page: number
totoal
}
interface ISafe {
fully_deployed: number
id: number
safe_address: string
owner_address: string
created_at: string
updated_at: string
multisig: 0 | 1 | number
mfa_email_verified: 0 | 1
mfa_phone_verified: 0 | 1
mfa_totp_verified: 0 | 1
deployed: Record<string, boolean>
version: Record<string, string>
authorities: Record<string, string[]>
signers: Record<string, string[]>
multisig_index: number
}
interface IRequiredSigners {
chainId: number | string
requiredSignerCount: number
signerCount: number
signers: string[]
}
interface ISigner {
address: string
chainIds: string[]
}
interface PwaInjection {
isInstalled: boolean
showInstallPrompt: Ref<boolean>
cancelInstall: () => void
install: () => Promise<void>
swActivated: Ref<boolean>
registrationError: Ref<boolean>
offlineReady: Ref<boolean>
needRefresh: Ref<boolean>
updateServiceWorker: (reloadPage?: boolean | undefined) => Promise<void>
cancelPrompt: () => Promise<void>
getSWRegistration: () => ServiceWorkerRegistration | undefined
}
declare module '#app' {
interface NuxtApp {
$pwa: UnwrapNestedRefs<PwaInjection>
}
}
type ChainFees = Record<string, ICalculatedFee>
type ChainFeeErrors = Record<string, string>
type ChainSigners = Record<number | string, string[]>
interface ISignerAddress {
name: string
address: string
ensName?: string
}
interface IWalletConnectBannedDappList {
bannedMessage: string
warningMessage: string
items: {
url: string
warn?: boolean
ban?: boolean
}[]
}
interface INavigationTab {
label: string
value: 'dapps' | 'balances' | 'bookmarks'
query?: string
count: number
}
interface IComputeAddresses {
address: string
multisigAddress: string
oldSafeAddress: string
}
type TxBuilderModes = 'expand' | 'collapse' | 'super-collapse' | 'raw'
interface IMfaAuthenticateParams {
}
type MfaRequestType = 'transaction' | 'delete' | 'update' | 'key'
interface IMfaActivateModalParams {
mfaType: IMfa
keyMfa: IKeyMfa
}
type MfaVerify = (mfa: IMfa, code: string) => Promise<boolean>
type MfaExpire = '3' | '5' | '10' | '15' | '30' | '60'
interface IMfaVerifyModalParams {
mfa: IMfa
mfaRequestType: MfaRequestType
verify?: MfaVerify
request?: Function
inputValue?: string
authenticate?: boolean
defaultSessionAvailable?: boolean
forceGrabSession?: boolean
expire?: MfaExpire
chainId?: number | string
}
interface IAuthVerifyParams {
mfa: IMfa
mfaRequestType: MfaRequestType
submitFn?: MfaVerify
defaultSessionAvailable?: boolean
forceGrabSession?: boolean
expire?: MfaExpire
chainId?: number | string
}
interface IAuthTransactionMfa {
_authMfa?: IMfa
submitFn?: MfaVerify
defaultSessionAvailable?: boolean
forceGrabSession?: boolean
expire?: MfaExpire
chainId?: number | string
}
interface IOpenReviewSignerProcessModalParams {
chainId: number | string
deleteSigner?: boolean
isInstadappSigner?: boolean
removeBackupSigner?: boolean
actions: {
actions: TransactionsAction[]
metadata: string
}
}
}
export {}