@rabby-wallet/rabby-api 0.9.21 → 0.9.23-beta.1

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/dist/types.d.ts CHANGED
@@ -1,1490 +1,1527 @@
1
- import { CHAINS_ENUM } from '@debank/common';
2
- export interface Chain {
3
- id: number;
4
- name: string;
5
- hex: string;
6
- logo: string;
7
- enum: CHAINS_ENUM;
8
- serverId: string;
9
- network: string;
10
- nativeTokenSymbol: string;
11
- whiteLogo?: string;
12
- nativeTokenLogo: string;
13
- nativeTokenAddress: string;
14
- scanLink: string;
15
- nativeTokenDecimals: number;
16
- selectChainLogo?: string;
17
- eip: Record<string, boolean>;
18
- }
19
- export interface ServerChain {
20
- id: string;
21
- community_id: number;
22
- name: string;
23
- native_token_id: string;
24
- logo_url: string;
25
- wrapped_token_id: string;
26
- symbol: string;
27
- is_support_history: boolean;
28
- born_at: number | null;
29
- }
30
- export interface ChainWithBalance extends ServerChain {
31
- usd_value: number;
32
- }
33
- export interface ChainWithPendingCount extends ServerChain {
34
- pending_tx_count: number;
35
- }
36
- export declare type SecurityCheckDecision = 'pass' | 'warning' | 'danger' | 'forbidden' | 'loading' | 'pending';
37
- export interface SecurityCheckItem {
38
- alert: string;
39
- description: string;
40
- is_alert: boolean;
41
- decision: SecurityCheckDecision;
42
- id: number;
43
- }
44
- export interface SecurityCheckResponse {
45
- decision: SecurityCheckDecision;
46
- alert: string;
47
- danger_list: SecurityCheckItem[];
48
- warning_list: SecurityCheckItem[];
49
- forbidden_list: SecurityCheckItem[];
50
- forbidden_count: number;
51
- warning_count: number;
52
- danger_count: number;
53
- alert_count: number;
54
- trace_id: string;
55
- error?: {
56
- code: number;
57
- msg: string;
58
- } | null;
59
- }
60
- export interface Tx {
61
- chainId: number;
62
- data: string;
63
- from: string;
64
- gas?: string;
65
- gasLimit?: string;
66
- maxFeePerGas?: string;
67
- maxPriorityFeePerGas?: string;
68
- gasPrice?: string;
69
- nonce: string;
70
- to: string;
71
- value: string;
72
- r?: string;
73
- s?: string;
74
- v?: string;
75
- }
76
- export interface Eip1559Tx {
77
- chainId: number;
78
- data: string;
79
- from: string;
80
- gas: string;
81
- maxFeePerGas: string;
82
- maxPriorityFeePerGas: string;
83
- nonce: string;
84
- to: string;
85
- value: string;
86
- r?: string;
87
- s?: string;
88
- v?: string;
89
- }
90
- export interface TotalBalanceResponse {
91
- total_usd_value: number;
92
- chain_list: ChainWithBalance[];
93
- error_code?: number;
94
- err_chain_ids?: string[];
95
- }
96
- export interface TokenEntityDetail {
97
- id: string;
98
- chain: string;
99
- token_id: string;
100
- symbol: string;
101
- domain_id: string;
102
- fdv: number;
103
- is_domain_verified: boolean;
104
- relate_domain_ids: string[];
105
- cmc_id: string;
106
- coingecko_id: string;
107
- bridge_ids: string[];
108
- origin_token?: TokenItem;
109
- listed_sites: {
110
- name: string;
111
- url: string;
112
- logo_url: string;
113
- }[];
114
- cex_list: {
115
- id: string;
116
- site_url: string;
117
- name: string;
118
- logo_url: string;
119
- }[];
120
- }
121
- export interface TokenItem {
122
- content_type?: 'image' | 'image_url' | 'video_url' | 'audio_url' | undefined;
123
- content?: string | undefined;
124
- inner_id?: any;
125
- amount: number;
126
- chain: string;
127
- decimals: number;
128
- display_symbol: string | null;
129
- id: string;
130
- is_core: boolean;
131
- credit_score?: number;
132
- is_verified: boolean;
133
- is_wallet: boolean;
134
- is_scam?: boolean;
135
- is_infinity?: boolean;
136
- is_suspicious?: boolean;
137
- logo_url: string;
138
- name: string;
139
- optimized_symbol: string;
140
- price: number;
141
- symbol: string;
142
- time_at: number;
143
- usd_value?: number;
144
- raw_amount?: string;
145
- raw_amount_hex_str?: string;
146
- price_24h_change?: number | null;
147
- low_credit_score?: boolean;
148
- }
149
- export interface TokenItemWithEntity extends TokenItem {
150
- identity?: TokenEntityDetail;
151
- }
152
- export interface TransferingNFTItem {
153
- chain: string;
154
- collection: {
155
- id: string;
156
- name: string;
157
- create_at: number;
158
- chains: string[];
159
- is_suspicious?: boolean;
160
- is_verified?: boolean;
161
- floor_price?: number | null;
162
- };
163
- content: string;
164
- content_type: NFTItem['content_type'];
165
- contract_id: string;
166
- description: string | null;
167
- detail_url: string;
168
- id: string;
169
- inner_id: string;
170
- name: string;
171
- total_supply: number;
172
- amount: number;
173
- }
174
- export interface NFTApprovalResponse {
175
- tokens: NFTApproval[];
176
- contracts: NFTApprovalContract[];
177
- total: string;
178
- }
179
- export interface NFTApprovalContract {
180
- chain: string;
181
- contract_name: string;
182
- contract_id: string;
183
- amount: string;
184
- spender: Spender;
185
- is_erc721: boolean;
186
- is_erc1155: boolean;
187
- }
188
- export interface NFTApprovalSpender {
189
- id: string;
190
- protocol: {
191
- id: string;
192
- name: string;
193
- logo_url: string;
194
- chain: string;
195
- } | null;
196
- }
197
- export interface NFTApproval {
198
- id: string;
199
- contract_id: string;
200
- inner_id: string;
201
- chain: string;
202
- name: null;
203
- symbol: string;
204
- description: null;
205
- content_type: 'image' | 'image_url' | 'video_url' | 'audio_url' | undefined;
206
- content: string;
207
- total_supply: number;
208
- detail_url: string;
209
- contract_name: string;
210
- is_erc721: boolean;
211
- is_erc1155: boolean;
212
- amount: string;
213
- spender: Spender;
214
- }
215
- export interface TokenApproval<SpenderType extends Spender = Spender> {
216
- id: string;
217
- name: string;
218
- symbol: string;
219
- logo_url: string;
220
- chain: string;
221
- price: number;
222
- balance: number;
223
- spenders: SpenderType[];
224
- sum_exposure_usd: number;
225
- /** @deprecated */
226
- exposure_balance?: number;
227
- }
228
- export interface Spender {
229
- id: string;
230
- permit2_id?: string;
231
- value: number;
232
- exposure_usd: number;
233
- protocol: {
234
- id: string;
235
- name: string;
236
- logo_url: string;
237
- chain: string;
238
- };
239
- /** @deprecated */
240
- is_contract?: boolean;
241
- /** @deprecated */
242
- is_open_source?: boolean;
243
- /** @deprecated */
244
- is_hacked?: boolean;
245
- /** @deprecated */
246
- is_abandoned?: boolean;
247
- risk_alert: string;
248
- risk_level: string;
249
- exposure_nft_usd_value?: number | null;
250
- exposure_usd_value?: number | null;
251
- spend_usd_value?: number | null;
252
- approve_user_count?: number | null;
253
- revoke_user_count?: number | null;
254
- last_approve_at: number | null;
255
- }
256
- export interface AssetItem {
257
- id: string;
258
- chain: string;
259
- name: string;
260
- site_url: string;
261
- logo_url: string;
262
- has_supported_portfolio: boolean;
263
- tvl: number;
264
- net_usd_value: number;
265
- asset_usd_value: number;
266
- debt_usd_value: number;
267
- }
268
- export interface NFTCollection {
269
- create_at: string;
270
- id: string;
271
- is_core: boolean;
272
- name: string;
273
- price: number;
274
- chain: string;
275
- tokens: NFTItem[];
276
- floor_price: number;
277
- is_scam: boolean;
278
- is_suspicious: boolean;
279
- is_verified: boolean;
280
- }
281
- export interface UserCollection {
282
- collection: Collection;
283
- list: NFTItem[];
284
- }
285
- export interface NFTItem {
286
- chain: string;
287
- id: string;
288
- contract_id: string;
289
- inner_id: string;
290
- token_id?: string;
291
- name: string;
292
- contract_name: string;
293
- description: string;
294
- usd_price?: number;
295
- amount: number;
296
- collection_id?: string;
297
- collection_name?: string;
298
- is_core?: boolean;
299
- pay_token?: {
300
- id: string;
301
- name: string;
302
- symbol: string;
303
- amount: number;
304
- logo_url: string;
305
- time_at: number;
306
- date_at?: string;
307
- price?: number;
308
- };
309
- content_type: 'image' | 'image_url' | 'video_url' | 'audio_url';
310
- content: string;
311
- detail_url: string;
312
- total_supply?: string;
313
- collection?: Collection | null;
314
- is_erc1155?: boolean;
315
- is_erc721: boolean;
316
- thumbnail_url?: string;
317
- }
318
- export interface Collection {
319
- id: string;
320
- name: string;
321
- description: null | string;
322
- logo_url: string;
323
- is_core: boolean;
324
- is_suspicious?: boolean;
325
- is_verified?: boolean;
326
- contract_uuids: string[];
327
- create_at: number;
328
- floor_price: number;
329
- is_scam: boolean;
330
- }
331
- export interface CollectionList {
332
- id: string;
333
- chain: string;
334
- name: string;
335
- description: string;
336
- logo_url: string;
337
- is_verified: boolean;
338
- credit_score: number;
339
- receive_addr_count: number;
340
- is_scam: boolean;
341
- is_suspicious: boolean;
342
- is_core: boolean;
343
- floor_price: number;
344
- nft_list: NFTItem[];
345
- native_token: TokenItem;
346
- }
347
- export interface TxDisplayItem extends TxHistoryItem {
348
- projectDict: TxHistoryResult['project_dict'];
349
- cateDict: TxHistoryResult['cate_dict'];
350
- tokenDict: TxHistoryResult['token_dict'];
351
- }
352
- export interface TxHistoryItem {
353
- cate_id: string | null;
354
- chain: string;
355
- debt_liquidated: null;
356
- id: string;
357
- is_scam: boolean;
358
- other_addr: string;
359
- project_id: null | string;
360
- receives: {
361
- amount: number;
362
- from_addr: string;
363
- token_id: string;
364
- }[];
365
- sends: {
366
- amount: number;
367
- to_addr: string;
368
- token_id: string;
369
- }[];
370
- time_at: number;
371
- token_approve: {
372
- spender: string;
373
- token_id: string;
374
- value: number;
375
- } | null;
376
- tx: {
377
- eth_gas_fee: number;
378
- from_addr: string;
379
- name: string;
380
- params: any[];
381
- status: number;
382
- to_addr: string;
383
- usd_gas_fee: number;
384
- value: number;
385
- message: string | null;
386
- } | null;
387
- }
388
- export interface TxHistoryResult {
389
- cate_dict: Record<string, {
390
- id: string;
391
- name: string;
392
- }>;
393
- history_list: TxHistoryItem[];
394
- project_dict: Record<string, {
395
- chain: string;
396
- id: string;
397
- logo_url: string;
398
- name: string;
399
- }>;
400
- token_dict: Record<string, TokenItem>;
401
- }
402
- export interface TxAllHistoryResult extends Omit<TxHistoryResult, 'token_dict'> {
403
- token_uuid_dict: Record<string, TokenItem>;
404
- project_dict: TxHistoryResult['project_dict'];
405
- }
406
- export interface GasResult {
407
- estimated_gas_cost_usd_value: number;
408
- estimated_gas_cost_value: number;
409
- estimated_gas_used: number;
410
- estimated_seconds: number;
411
- front_tx_count: number;
412
- max_gas_cost_usd_value: number;
413
- max_gas_cost_value: number;
414
- fail?: boolean;
415
- }
416
- export interface GasLevel {
417
- level: string;
418
- price: number;
419
- front_tx_count: number;
420
- estimated_seconds: number;
421
- priority_price: number | null;
422
- base_fee: number;
423
- }
424
- export interface BalanceChange<T = TokenItem, N = TransferingNFTItem> {
425
- error?: {
426
- code: number;
427
- msg: string;
428
- } | null;
429
- receive_nft_list: N[];
430
- receive_token_list: T[];
431
- send_nft_list: N[];
432
- send_token_list: T[];
433
- success: boolean;
434
- usd_value_change: number;
435
- }
436
- interface NFTContractItem {
437
- id: string;
438
- chain: string;
439
- name: string;
440
- symbol: string;
441
- is_core: boolean;
442
- time_at: number;
443
- collection: {
444
- id: string;
445
- name: string;
446
- create_at: number;
447
- };
448
- }
449
- export interface ExplainTxResponse {
450
- pre_exec_version: 'v0' | 'v1' | 'v2';
451
- abi?: {
452
- func: string;
453
- params: Array<string[] | number | string>;
454
- };
455
- abi_str?: string;
456
- balance_change: BalanceChange;
457
- gas: {
458
- success?: boolean;
459
- error?: {
460
- code: number;
461
- msg: string;
462
- } | null;
463
- gas_used: number;
464
- gas_ratio: number;
465
- gas_limit: number;
466
- estimated_gas_cost_usd_value: number;
467
- estimated_gas_cost_value: number;
468
- estimated_gas_used: number;
469
- estimated_seconds: number;
470
- };
471
- native_token: TokenItem;
472
- pre_exec: {
473
- success: boolean;
474
- error?: {
475
- code: number;
476
- msg: string;
477
- } | null;
478
- };
479
- trace_id: string;
480
- recommend: {
481
- gas: string;
482
- nonce: string;
483
- };
484
- support_balance_change: true;
485
- type_call?: {
486
- action: string;
487
- contract: string;
488
- contract_protocol_logo_url: string;
489
- contract_protocol_name: string;
490
- };
491
- type_send?: {
492
- to_addr: string;
493
- token_symbol: string;
494
- token_amount: number;
495
- token: TokenItem;
496
- };
497
- type_token_approval?: {
498
- spender: string;
499
- spender_protocol_logo_url: string;
500
- spender_protocol_name: string;
501
- token_symbol: string;
502
- token_amount: number;
503
- is_infinity: boolean;
504
- token: TokenItem;
505
- };
506
- type_cancel_token_approval?: {
507
- spender: string;
508
- spender_protocol_logo_url: string;
509
- spender_protocol_name: string;
510
- token_symbol: string;
511
- };
512
- type_cancel_tx?: any;
513
- type_deploy_contract?: any;
514
- is_gnosis?: boolean;
515
- gnosis?: ExplainTxResponse;
516
- type_cancel_single_nft_approval?: {
517
- spender: string;
518
- spender_protocol_name: null;
519
- spender_protocol_logo_url: string;
520
- token_symbol: null;
521
- is_nft: boolean;
522
- nft: NFTItem;
523
- };
524
- type_cancel_nft_collection_approval?: {
525
- spender: string;
526
- spender_protocol_name: string;
527
- spender_protocol_logo_url: string;
528
- token_symbol: string;
529
- is_nft: boolean;
530
- nft_contract: NFTContractItem;
531
- token: TokenItem;
532
- };
533
- type_nft_collection_approval?: {
534
- spender: string;
535
- spender_protocol_name: string;
536
- spender_protocol_logo_url: string;
537
- token_symbol: string;
538
- is_nft: boolean;
539
- nft_contract: NFTContractItem;
540
- token: TokenItem;
541
- token_amount: number;
542
- is_infinity: boolean;
543
- };
544
- type_single_nft_approval?: {
545
- spender: string;
546
- spender_protocol_name: string;
547
- spender_protocol_logo_url: string;
548
- token_symbol: string;
549
- is_nft: boolean;
550
- nft: NFTItem;
551
- token: TokenItem;
552
- token_amount: number;
553
- is_infinity: boolean;
554
- };
555
- type_nft_send?: {
556
- spender: string;
557
- spender_protocol_name: null;
558
- spender_protocol_logo_url: string;
559
- token_symbol: string;
560
- token_amount: number;
561
- is_infinity: boolean;
562
- is_nft: boolean;
563
- nft: NFTItem;
564
- };
565
- type_list_nft?: {
566
- action: string;
567
- contract: string;
568
- contract_protocol_logo_url: string;
569
- contract_protocol_name: string;
570
- offerer: string;
571
- total_usd_value: number;
572
- offer_list: {
573
- item_type: number;
574
- amount: number;
575
- nft: NFTItem;
576
- }[];
577
- buyer_list: {
578
- id: string;
579
- }[];
580
- };
581
- }
582
- export interface LatestExplainTxResponse {
583
- id: string;
584
- tx_id: string;
585
- block_height: number;
586
- gas_used: number;
587
- pre_exec_result: PreExecResult;
588
- create_at: number;
589
- }
590
- export interface RPCResponse<T> {
591
- result: T;
592
- id: number;
593
- jsonrpc: string;
594
- error?: {
595
- code: number;
596
- message: string;
597
- };
598
- }
599
- export interface GetTxResponse {
600
- blockHash: string;
601
- blockNumber: string;
602
- from: string;
603
- gas: string;
604
- gasPrice: string;
605
- hash: string;
606
- input: string;
607
- nonce: string;
608
- to: string;
609
- transactionIndex: string;
610
- value: string;
611
- type: string;
612
- v: string;
613
- r: string;
614
- s: string;
615
- front_tx_count: number;
616
- code: 0 | -1;
617
- status: -1 | 0 | 1;
618
- gas_used: number;
619
- token: TokenItem;
620
- }
621
- export interface ApprovalStatus {
622
- chain: string;
623
- token_approval_danger_cnt: number;
624
- nft_approval_danger_cnt: number;
625
- }
626
- export interface UsedChain {
627
- id: string;
628
- community_id: number;
629
- name: string;
630
- native_token_id: string;
631
- logo_url: string;
632
- wrapped_token_id: string;
633
- }
634
- export interface ProjectItem {
635
- id: string;
636
- name: string;
637
- site_url: string;
638
- logo_url: string;
639
- }
640
- export interface PoolItem {
641
- id: string;
642
- chain: string;
643
- project_id: string;
644
- adapter_id: string;
645
- controller: string;
646
- time_at: number;
647
- index?: number;
648
- }
649
- export interface PortfolioItemToken extends TokenItem {
650
- claimable_amount?: number;
651
- }
652
- export declare type NftCollection = {
653
- chain_id: string;
654
- id: string;
655
- name: string;
656
- symbol?: string;
657
- logo_url: string;
658
- is_core: boolean;
659
- amount?: number;
660
- floor_price_token?: PortfolioItemToken;
661
- };
662
- export declare type PortfolioItemNft = {
663
- id: string;
664
- contract_id: string;
665
- inner_id: string;
666
- name: string;
667
- content_url: string;
668
- thumbnail_url: string;
669
- collection: NftCollection;
670
- amount: number;
671
- };
672
- export interface PortfolioItemDetail {
673
- supply_token_list?: PortfolioItemToken[];
674
- borrow_token_list?: PortfolioItemToken[];
675
- health_rate?: number;
676
- reward_token_list?: PortfolioItemToken[];
677
- collateral_token_list?: PortfolioItemToken[];
678
- token_list?: PortfolioItemToken[];
679
- base_token?: PortfolioItemToken;
680
- position_token?: PortfolioItemToken;
681
- description?: string;
682
- token?: PortfolioItemToken;
683
- underlying_token?: PortfolioItemToken;
684
- strike_token?: PortfolioItemToken;
685
- quote_token?: PortfolioItemToken;
686
- margin_token?: PortfolioItemToken;
687
- supply_nft_list?: PortfolioItemNft[];
688
- nft_list?: PortfolioItemNft[];
689
- collection?: NftCollection;
690
- share_token?: PortfolioItemToken;
691
- exercise_end_at?: number;
692
- type?: string;
693
- side?: number;
694
- leverage?: number;
695
- expired_at: number;
696
- end_at: number;
697
- unlock_at: number;
698
- debt_ratio?: number;
699
- usd_value?: number;
700
- daily_unlock_amount: number;
701
- pnl_usd_value: number;
702
- }
703
- export interface PortfolioItem {
704
- asset_token_list: TokenItem[];
705
- stats: {
706
- asset_usd_value: number;
707
- debt_usd_value: number;
708
- net_usd_value: number;
709
- };
710
- asset_dict: Record<string, number>;
711
- update_at: number;
712
- name: string;
713
- detail_types: string[];
714
- detail: PortfolioItemDetail;
715
- proxy_detail: {
716
- project: ProjectItem;
717
- proxy_contract_id: string;
718
- };
719
- pool: PoolItem;
720
- position_index: string;
721
- }
722
- export interface Protocol {
723
- chain: string;
724
- dao_id: null | string;
725
- has_supported_portfolio: boolean;
726
- id: string;
727
- is_tvl: boolean;
728
- logo_url: string;
729
- name: string;
730
- platform_token_id: string;
731
- site_url: string;
732
- tag_ids: string[];
733
- tvl: number;
734
- }
735
- export interface ComplexProtocol {
736
- id: string;
737
- chain: string;
738
- name: string;
739
- site_url: string;
740
- logo_url: string;
741
- has_supported_portfolio: boolean;
742
- tvl: number;
743
- portfolio_item_list: PortfolioItem[];
744
- }
745
- export interface ExplainTypedDataResponse {
746
- type_list_nft?: ExplainTxResponse['type_list_nft'];
747
- type_token_approval?: ExplainTxResponse['type_token_approval'];
748
- type_common_sign?: {
749
- contract: string;
750
- contract_protocol_logo_url?: string;
751
- contract_protocol_name?: string;
752
- };
753
- }
754
- export interface CEXQuote {
755
- pay_token: TokenItem;
756
- receive_token: TokenItem;
757
- }
758
- export interface SwapItem {
759
- chain: string;
760
- tx_id: string;
761
- create_at: number;
762
- finished_at: number;
763
- status: 'Pending' | 'Completed' | 'Finished';
764
- dex_id: string;
765
- pay_token: TokenItem;
766
- receive_token: TokenItem;
767
- gas: {
768
- native_token: TokenItem;
769
- native_gas_fee: number;
770
- usd_gas_fee: number;
771
- gas_price: number;
772
- };
773
- quote: {
774
- pay_token_amount: number;
775
- receive_token_amount: number;
776
- slippage: number;
777
- };
778
- actual: {
779
- pay_token_amount: number;
780
- receive_token_amount: number;
781
- slippage: number;
782
- };
783
- }
784
- export interface SwapTradeList {
785
- history_list: SwapItem[];
786
- total_cnt: number;
787
- }
788
- export interface SlippageStatus {
789
- is_valid: boolean;
790
- suggest_slippage: number;
791
- }
792
- export interface SummaryToken {
793
- id: string;
794
- chain: string;
795
- name: string;
796
- symbol: string;
797
- display_symbol?: string;
798
- optimized_symbol: string;
799
- decimals: number;
800
- logo_url?: string;
801
- protocol_id: string;
802
- price: number;
803
- is_verified: boolean;
804
- is_core: boolean;
805
- is_wallet: boolean;
806
- time_at?: number;
807
- amount: number;
808
- }
809
- export interface SummaryCoin {
810
- id: string;
811
- symbol: string;
812
- logo_url: string;
813
- parent_coin_id?: string;
814
- token_uuids: string[];
815
- peg_token_uuids: string[];
816
- circulating_supply: number;
817
- total_supply: number;
818
- price: number;
819
- amount: number;
820
- }
821
- export interface Summary {
822
- token_list: SummaryToken[];
823
- coin_list: SummaryCoin[];
824
- }
825
- export interface Cex {
826
- id: string;
827
- logo_url: string;
828
- name: string;
829
- is_deposit: boolean;
830
- }
831
- export interface ContractCredit {
832
- value: null | number;
833
- rank_at: number | null;
834
- }
835
- export interface ContractDesc {
836
- multisig?: {
837
- id: string;
838
- logo_url: string;
839
- name: string;
840
- };
841
- create_at: number;
842
- is_danger?: boolean | null;
843
- }
844
- export interface AddrDescResponse {
845
- desc: {
846
- cex?: Cex;
847
- contract?: Record<string, ContractDesc>;
848
- usd_value: number;
849
- protocol?: Record<string, {
850
- id: string;
851
- logo_url: string;
852
- name: string;
853
- }>;
854
- born_at: number;
855
- is_danger: boolean | null;
856
- is_spam: boolean | null;
857
- is_scam: boolean | null;
858
- name: string;
859
- };
860
- }
861
- export interface SendAction {
862
- to: string;
863
- token: TokenItem;
864
- }
865
- export interface RevokeTokenApproveAction {
866
- spender: string;
867
- token: TokenItem;
868
- }
869
- export interface WrapTokenAction {
870
- pay_token: TokenItem;
871
- receive_token: SwapReceiveToken;
872
- receiver: string;
873
- }
874
- export interface UnWrapTokenAction {
875
- pay_token: TokenItem;
876
- receive_token: SwapReceiveToken;
877
- receiver: string;
878
- }
879
- export interface ApproveAction {
880
- spender: string;
881
- token: TokenItem;
882
- }
883
- export interface SwapReceiveToken extends TokenItem {
884
- min_amount: number;
885
- min_raw_amount: string;
886
- }
887
- export interface CrossSwapAction {
888
- pay_token: TokenItem;
889
- receive_token: SwapReceiveToken;
890
- receiver: string;
891
- }
892
- export interface CrossTokenAction {
893
- pay_token: TokenItem;
894
- receive_token: SwapReceiveToken;
895
- receiver: string;
896
- }
897
- export interface RevokePermit2Action {
898
- spender: string;
899
- token: TokenItem;
900
- }
901
- export interface SwapOrderAction {
902
- pay_token_list: TokenItem[];
903
- pay_nft_list: NFTItem[];
904
- takers: string[];
905
- receive_token_list: TokenItem[];
906
- receive_nft_list: NFTItem[];
907
- receiver: string | null;
908
- expire_at: string | null;
909
- }
910
- export interface MaxPayTokenItem extends TokenItem {
911
- max_amount: number;
912
- max_raw_amount: string;
913
- }
914
- export interface SwapLimitPay {
915
- pay_token: MaxPayTokenItem;
916
- receive_token: TokenItem;
917
- receiver: string;
918
- }
919
- export interface MultiSwapAction {
920
- pay_token_list: TokenItem[];
921
- receive_token_list: SwapReceiveToken[];
922
- receiver: string;
923
- }
924
- export interface TransferOwnerAction {
925
- description: string;
926
- from_addr: string;
927
- to_addr: string;
928
- }
929
- export interface SwapAction {
930
- pay_token: TokenItem;
931
- receive_token: SwapReceiveToken;
932
- receiver: string;
933
- }
934
- export interface SendNFTAction {
935
- to: string;
936
- nft: NFTItem;
937
- }
938
- export interface ApproveNFTAction {
939
- spender: string;
940
- nft: NFTItem;
941
- }
942
- export declare type RevokeNFTAction = ApproveNFTAction;
943
- export interface ApproveNFTCollectionAction {
944
- spender: string;
945
- collection: NFTCollection;
946
- }
947
- export interface PushMultiSigAction {
948
- multisig_id: string;
949
- }
950
- export declare type RevokeNFTCollectionAction = ApproveNFTCollectionAction;
951
- export interface ParseTxResponse {
952
- action: {
953
- type: string;
954
- data: SwapAction | ApproveAction | SendAction | SendNFTAction | ApproveNFTAction | RevokeNFTAction | ApproveNFTCollectionAction | RevokeNFTCollectionAction | RevokeTokenApproveAction | WrapTokenAction | UnWrapTokenAction | PushMultiSigAction | CrossSwapAction | CrossTokenAction | RevokePermit2Action | SwapOrderAction | TransferOwnerAction | MultiSwapAction | SwapLimitPay | null;
955
- };
956
- contract_call?: {
957
- func: string;
958
- contract: {
959
- id: string;
960
- protocol: {
961
- name: string;
962
- logo_url: string;
963
- };
964
- };
965
- };
966
- log_id: string;
967
- }
968
- export interface CollectionWithFloorPrice {
969
- id: string;
970
- name: string;
971
- floor_price: number;
972
- }
973
- export declare type TypedDataActionName = 'permit1_approve_token' | 'swap_token_order' | 'permit2_approve_token' | 'sell_nft_order' | 'sign_multisig' | 'buy_nft_order' | 'create_key' | 'verify_address' | 'sell_nft_list_order' | 'permit2_approve_token_list' | 'create_cobo_safe' | 'submit_safe_role_modification' | 'submit_delegated_address_modification' | 'submit_token_approval_modification' | 'send_token' | 'permit1_revoke_token' | 'swap_order' | 'approve_nft';
974
- export interface BuyNFTOrderAction {
975
- expire_at: string;
976
- pay_token: TokenItem;
977
- receive_nft: NFTItem;
978
- receiver: string;
979
- takers: string[];
980
- }
981
- export interface SellNFTOrderAction {
982
- pay_nft: NFTItem;
983
- receive_token: TokenItem;
984
- receiver: string;
985
- takers: string[];
986
- expire_at: string;
987
- }
988
- export interface BatchSellNFTOrderAction {
989
- pay_nft_list: NFTItem[];
990
- receive_token: TokenItem;
991
- receiver: string;
992
- takers: string[];
993
- expire_at: string;
994
- }
995
- export interface SwapTokenOrderAction {
996
- pay_token: TokenItem;
997
- receive_token: TokenItem;
998
- receiver: string;
999
- takers: string[];
1000
- expire_at: number | null;
1001
- }
1002
- export interface PermitAction {
1003
- spender: string;
1004
- token: TokenItem;
1005
- }
1006
- export interface PermitTokenItem extends TokenItem {
1007
- permit2_allowance_amount: number;
1008
- permit2_allowance_raw_amount: string;
1009
- }
1010
- export interface Permit2Action {
1011
- permit2_id: string;
1012
- spender: string;
1013
- token: PermitTokenItem;
1014
- expire_at: number | null;
1015
- }
1016
- export interface BatchPermit2Action {
1017
- permit2_id: string;
1018
- spender: string;
1019
- token_list: PermitTokenItem[];
1020
- expire_at: number | null;
1021
- }
1022
- export interface SignMultiSigActions {
1023
- multisig_id: string;
1024
- }
1025
- export interface CreateCoboSafeAction {
1026
- multisig_id: string;
1027
- desc: string;
1028
- brand: {
1029
- name: string;
1030
- logo_url: string;
1031
- };
1032
- }
1033
- export interface SubmitSafeRoleModificationAction {
1034
- multisig_id: string;
1035
- desc: string;
1036
- brand: {
1037
- name: string;
1038
- logo_url: string;
1039
- };
1040
- }
1041
- export interface SubmitDelegatedAddressModificationAction {
1042
- multisig_id: string;
1043
- desc: string;
1044
- brand: {
1045
- name: string;
1046
- logo_url: string;
1047
- };
1048
- }
1049
- export interface SubmitTokenApprovalModificationAction {
1050
- multisig_id: string;
1051
- desc: string;
1052
- brand: {
1053
- name: string;
1054
- logo_url: string;
1055
- };
1056
- }
1057
- export interface ParseTypedDataResponse {
1058
- action: {
1059
- type: TypedDataActionName;
1060
- expire_at?: number;
1061
- data: SellNFTOrderAction | BuyNFTOrderAction | SwapTokenOrderAction | PermitAction | Permit2Action | SignMultiSigActions | CreateKeyAction | VerifyAddressAction | BatchSellNFTOrderAction | BatchPermit2Action | CreateCoboSafeAction | SubmitSafeRoleModificationAction | SubmitDelegatedAddressModificationAction | SubmitTokenApprovalModificationAction | SendAction | SwapOrderAction | RevokeTokenApproveAction | ApproveNFTAction;
1062
- } | null;
1063
- log_id: string;
1064
- }
1065
- export declare type TextActionName = 'create_key' | 'verify_address';
1066
- export interface CreateKeyAction {
1067
- user: string;
1068
- allow_origins: string[];
1069
- protocol: {
1070
- name: string;
1071
- logo_url: string;
1072
- } | null;
1073
- desc: string;
1074
- }
1075
- export interface VerifyAddressAction {
1076
- user: string;
1077
- allow_origins: string[];
1078
- protocol: {
1079
- name: string;
1080
- logo_url: string;
1081
- } | null;
1082
- desc: string;
1083
- }
1084
- export interface ParseTextResponse {
1085
- action: {
1086
- type: TextActionName;
1087
- data: CreateKeyAction | VerifyAddressAction;
1088
- } | null;
1089
- log_id: string;
1090
- }
1091
- export declare type TxPushType = 'default' | 'low_gas' | 'mev';
1092
- export interface TxRequest {
1093
- id: string;
1094
- chain_id: string;
1095
- user_addr: string;
1096
- nonce: number;
1097
- signed_tx: Tx;
1098
- tx_id?: null | string;
1099
- push_type: TxPushType;
1100
- push_status?: 'success' | 'failed';
1101
- push_at?: number | null;
1102
- is_withdraw: boolean;
1103
- create_at: number;
1104
- low_gas_deadline?: number;
1105
- is_finished: boolean;
1106
- predict_packed_at?: number;
1107
- predict_err_code?: number;
1108
- push_at_list?: number[];
1109
- }
1110
- export interface MempoolCheckDetail {
1111
- id: string;
1112
- chain_id: string;
1113
- tx_id: string;
1114
- check_at: string;
1115
- check_success: boolean;
1116
- rpc: string;
1117
- name?: string;
1118
- operator?: string;
1119
- packed_rate?: number;
1120
- }
1121
- export interface JobResponse<T = any> {
1122
- create_at: number;
1123
- id: string;
1124
- result: {
1125
- create_at: number;
1126
- id: string;
1127
- data: T;
1128
- };
1129
- job: {
1130
- create_at: number;
1131
- id: string;
1132
- status: 'pending' | 'running';
1133
- } | null;
1134
- }
1135
- export interface PreExecResult {
1136
- balance_change: BalanceChange;
1137
- gas: {
1138
- success?: boolean;
1139
- error?: {
1140
- code: number;
1141
- msg: string;
1142
- } | null;
1143
- gas_used: number;
1144
- gas_limit: number;
1145
- };
1146
- is_multisig: boolean;
1147
- multisig?: any;
1148
- pre_exec: {
1149
- success: boolean;
1150
- error?: {
1151
- code: number;
1152
- msg: string;
1153
- } | null;
1154
- };
1155
- }
1156
- export interface PendingTxItem {
1157
- id: string;
1158
- action_data: ParseTxResponse['action']['data'];
1159
- action_type: ParseTxResponse['action']['type'];
1160
- block_height?: number | null;
1161
- gas_price?: number | null;
1162
- gas_used?: number | null;
1163
- pre_exec_at?: number | null;
1164
- pre_exec_result?: Omit<PreExecResult, 'balance_change'> & {
1165
- balance_change: BalanceChange<{
1166
- chain: string;
1167
- token_id: string;
1168
- amount: number;
1169
- }, {
1170
- chain: string;
1171
- token_id: string;
1172
- amount: number;
1173
- }>;
1174
- };
1175
- to_addr: string;
1176
- to_addr_desc: {
1177
- cex?: Cex | null;
1178
- protocol?: {
1179
- id: string;
1180
- logo_url: string;
1181
- name: string;
1182
- };
1183
- };
1184
- }
1185
- export interface BasicDappInfo {
1186
- id: string;
1187
- name: string;
1188
- logo_url: string | null;
1189
- description: string;
1190
- user_range: string;
1191
- tags: string[];
1192
- chain_ids: string[];
1193
- collected_list?: {
1194
- name: string;
1195
- logo_url: string;
1196
- }[];
1197
- }
1198
- export interface SupportedChain {
1199
- id: string;
1200
- community_id: number;
1201
- name: string;
1202
- native_token: {
1203
- id: string;
1204
- symbol: string;
1205
- logo: string;
1206
- decimals: number;
1207
- };
1208
- logo_url: string;
1209
- white_logo_url?: string;
1210
- need_estimate_gas?: boolean;
1211
- eip_1559: boolean;
1212
- is_disabled: boolean;
1213
- explorer_host: string;
1214
- }
1215
- export interface ChainListItem {
1216
- chain_id: number;
1217
- name: string;
1218
- short_name: string;
1219
- native_currency: {
1220
- name: string;
1221
- symbol: string;
1222
- decimals: number;
1223
- };
1224
- explorer: string | null;
1225
- rpc: null | string;
1226
- rpc_list?: string[];
1227
- }
1228
- export interface HistoryCurve {
1229
- create_at: number;
1230
- executor_name: string;
1231
- executor_params: {
1232
- addr: string;
1233
- };
1234
- executor_version: string;
1235
- id: string;
1236
- job?: null | {
1237
- create_at: number;
1238
- id: string;
1239
- status: 'pending' | 'running';
1240
- };
1241
- result?: null | {
1242
- create_at: number;
1243
- data: {
1244
- usd_value_list: number[][];
1245
- };
1246
- id: number;
1247
- };
1248
- }
1249
- export interface NodeStatus {
1250
- id: string;
1251
- chain_id: string;
1252
- features: {
1253
- signature_decode: boolean;
1254
- tx_simulation: boolean;
1255
- security_check: boolean;
1256
- evm_tracing: boolean;
1257
- };
1258
- tags: string[];
1259
- official_node_height: number;
1260
- official_node_timestamp: number;
1261
- rabby_node_height: number;
1262
- rabby_data_service_height: number;
1263
- chain: {
1264
- id: string;
1265
- network_id: number;
1266
- name: string;
1267
- token_id: string;
1268
- token_symbol: string;
1269
- logo_url: string;
1270
- svg_logo_url: string;
1271
- block_interval: number;
1272
- start_at: string;
1273
- prefix: string;
1274
- wrapped: string;
1275
- explorer_host: string;
1276
- is_support_archive: boolean;
1277
- eip_1559: boolean;
1278
- white_logo_url: string;
1279
- };
1280
- }
1281
- interface NodeServiceData {
1282
- node: NodeDetails;
1283
- height_list: [number, number, number][];
1284
- }
1285
- interface NodeDetails {
1286
- name: string;
1287
- tag: string[];
1288
- }
1289
- export interface NodeStatusDetail {
1290
- rabby_rpc: NodeServiceData[];
1291
- rabby_data_service: NodeServiceData[];
1292
- }
1293
- interface BridgeItem {
1294
- id: string;
1295
- name: string;
1296
- logo_url: string;
1297
- }
1298
- export interface BridgeAggregator {
1299
- id: string;
1300
- name: string;
1301
- logo_url: string;
1302
- bridge_list: BridgeItem[];
1303
- }
1304
- export interface BridgeTokenPair {
1305
- aggregator_id: string;
1306
- from_token: TokenItem;
1307
- to_token: TokenItem;
1308
- from_token_amount: number;
1309
- from_token_raw_amount_hex_str: string;
1310
- from_token_usd_value: number;
1311
- }
1312
- export interface BridgeQuote {
1313
- aggregator: Exclude<BridgeAggregator, 'bridge_list'>;
1314
- bridge_id: string;
1315
- bridge: BridgeItem;
1316
- to_token_amount: number;
1317
- to_token_raw_amount: number;
1318
- to_token_raw_amount_hex_str: string;
1319
- gas_fee: {
1320
- raw_amount_hex_str: string;
1321
- usd_value: number;
1322
- };
1323
- protocol_fee: {
1324
- raw_amount_hex_str: string;
1325
- usd_value: number;
1326
- };
1327
- rabby_fee: {
1328
- raw_amount_hex_str: string;
1329
- usd_value: number;
1330
- };
1331
- duration: number;
1332
- routePath: string;
1333
- approve_contract_id: string;
1334
- tx: {
1335
- chainId: number;
1336
- data: string;
1337
- from: string;
1338
- gasLimit: string;
1339
- gasPrice: string;
1340
- to: string;
1341
- value: string;
1342
- };
1343
- }
1344
- export interface BridgeHistory {
1345
- aggregator: Exclude<BridgeAggregator, 'bridge_list'>;
1346
- bridge: BridgeItem;
1347
- from_token: TokenItem;
1348
- to_token: TokenItem;
1349
- quote: {
1350
- pay_token_amount: number;
1351
- receive_token_amount: number;
1352
- };
1353
- actual: {
1354
- pay_token_amount: number;
1355
- receive_token_amount: number;
1356
- };
1357
- detail_url: string;
1358
- status: 'pending' | 'completed';
1359
- create_at: number;
1360
- from_gas: {
1361
- native_token: TokenItem;
1362
- gas_amount: number;
1363
- usd_gas_fee: number;
1364
- gas_price: number;
1365
- };
1366
- }
1367
- export interface DbkBridgeHistoryItem {
1368
- user_addr: string;
1369
- from_chain_id: string;
1370
- to_chain_id: string;
1371
- is_deposit: boolean;
1372
- tx_id: string;
1373
- create_at: number;
1374
- from_token_amount: number;
1375
- from_token_id: string;
1376
- }
1377
- export interface ContractInfo {
1378
- id: string;
1379
- credit: ContractCredit;
1380
- is_token: boolean;
1381
- token_approval_exposure: number;
1382
- top_nft_approval_exposure: number;
1383
- spend_usd_value: number;
1384
- top_nft_spend_usd_value: number;
1385
- create_at: number;
1386
- name: string | null;
1387
- protocol: {
1388
- id: string;
1389
- logo_url: string;
1390
- name: string;
1391
- } | null;
1392
- is_danger: {
1393
- auto: null | boolean;
1394
- edit: null | boolean;
1395
- };
1396
- is_phishing: boolean | null;
1397
- }
1398
- export interface GasAccountCheckResult {
1399
- gas_account_cost: {
1400
- total_cost: number;
1401
- tx_cost: number;
1402
- gas_cost: number;
1403
- estimate_tx_cost: number;
1404
- };
1405
- is_gas_account: boolean;
1406
- balance_is_enough: boolean;
1407
- chain_not_support: boolean;
1408
- }
1409
- export interface ParseCommonResponse {
1410
- input_type: 'typed_data' | 'text' | 'tx';
1411
- output_type: 'typed_data' | 'text' | 'tx';
1412
- action: ParseTypedDataResponse['action'] | ParseTextResponse['action'] | ParseTxResponse['action'];
1413
- log_id: string;
1414
- pre_exec_result: ExplainTxResponse | null;
1415
- contract_call_data: ParseTxResponse['contract_call'] | null;
1416
- pre_exec?: PreExecResult['pre_exec'];
1417
- }
1418
- export interface RechargeChainItem {
1419
- chain_id: string;
1420
- withdraw_limit: number;
1421
- withdraw_fee: number;
1422
- l1_balance: number;
1423
- }
1424
- export interface WithdrawListAddressItem {
1425
- recharge_addr: string;
1426
- total_withdraw_limit: number;
1427
- recharge_chain_list: RechargeChainItem[];
1428
- }
1429
- export interface BuyCountryItem {
1430
- id: string;
1431
- name: string;
1432
- image_url: string;
1433
- regions: null | {
1434
- regionCode: string;
1435
- name: string;
1436
- };
1437
- }
1438
- export interface BuyServiceProvider {
1439
- id: string;
1440
- name: string;
1441
- website_url: string;
1442
- customer_support_url: string;
1443
- image_url: string;
1444
- logo_url: string;
1445
- }
1446
- export interface BuyQuoteItem {
1447
- service_provider: BuyServiceProvider;
1448
- token_amount: number;
1449
- payment_method_type: string;
1450
- }
1451
- export interface BuyHistoryItem {
1452
- id: string;
1453
- user_addr: string;
1454
- status: string;
1455
- create_at: number;
1456
- service_provider: BuyServiceProvider;
1457
- service_provider_url: null | string;
1458
- pay_usd_amount: number;
1459
- pay_currency_code: string;
1460
- payment_type: string;
1461
- receive_chain_id: string;
1462
- receive_tx_id: string;
1463
- receive_token_id: string;
1464
- receive_amount: number;
1465
- receive_token: TokenItem;
1466
- }
1467
- export interface BuyHistoryList {
1468
- pagination: {
1469
- start: number;
1470
- limit: number;
1471
- total: number;
1472
- };
1473
- histories: BuyHistoryItem[];
1474
- }
1475
- export interface BuyPaymentMethod {
1476
- id: string;
1477
- name: string;
1478
- type: string;
1479
- logo_url: string;
1480
- }
1481
- export interface GasAccountInfo {
1482
- id: string;
1483
- balance: number;
1484
- create_at: number;
1485
- nonce: number;
1486
- uuid: string;
1487
- has_iap_order: boolean;
1488
- no_register: boolean;
1489
- }
1490
- export {};
1
+ import { CHAINS_ENUM } from '@debank/common';
2
+ export interface Chain {
3
+ id: number;
4
+ name: string;
5
+ hex: string;
6
+ logo: string;
7
+ enum: CHAINS_ENUM;
8
+ serverId: string;
9
+ network: string;
10
+ nativeTokenSymbol: string;
11
+ whiteLogo?: string;
12
+ nativeTokenLogo: string;
13
+ nativeTokenAddress: string;
14
+ scanLink: string;
15
+ nativeTokenDecimals: number;
16
+ selectChainLogo?: string;
17
+ eip: Record<string, boolean>;
18
+ }
19
+ export interface ServerChain {
20
+ id: string;
21
+ community_id: number;
22
+ name: string;
23
+ native_token_id: string;
24
+ logo_url: string;
25
+ wrapped_token_id: string;
26
+ symbol: string;
27
+ is_support_history: boolean;
28
+ born_at: number | null;
29
+ }
30
+ export interface ChainWithBalance extends ServerChain {
31
+ usd_value: number;
32
+ }
33
+ export interface ChainWithPendingCount extends ServerChain {
34
+ pending_tx_count: number;
35
+ }
36
+ export declare type SecurityCheckDecision = 'pass' | 'warning' | 'danger' | 'forbidden' | 'loading' | 'pending';
37
+ export interface SecurityCheckItem {
38
+ alert: string;
39
+ description: string;
40
+ is_alert: boolean;
41
+ decision: SecurityCheckDecision;
42
+ id: number;
43
+ }
44
+ export interface SecurityCheckResponse {
45
+ decision: SecurityCheckDecision;
46
+ alert: string;
47
+ danger_list: SecurityCheckItem[];
48
+ warning_list: SecurityCheckItem[];
49
+ forbidden_list: SecurityCheckItem[];
50
+ forbidden_count: number;
51
+ warning_count: number;
52
+ danger_count: number;
53
+ alert_count: number;
54
+ trace_id: string;
55
+ error?: {
56
+ code: number;
57
+ msg: string;
58
+ } | null;
59
+ }
60
+ export interface Tx {
61
+ chainId: number;
62
+ data: string;
63
+ from: string;
64
+ gas?: string;
65
+ gasLimit?: string;
66
+ maxFeePerGas?: string;
67
+ maxPriorityFeePerGas?: string;
68
+ gasPrice?: string;
69
+ nonce: string;
70
+ to: string;
71
+ value: string;
72
+ r?: string;
73
+ s?: string;
74
+ v?: string;
75
+ }
76
+ export interface CopyTradeTokenItem extends TokenItem {
77
+ fdv: number | null;
78
+ buy_amount_24h: number;
79
+ buy_usd_value_24h: number;
80
+ net_curve_24h: {
81
+ time_at: number;
82
+ price: number;
83
+ }[];
84
+ }
85
+ export interface CopyTradeTokenListResponse {
86
+ token_list: CopyTradeTokenItem[];
87
+ }
88
+ export interface CopyTradeRecentBuyItem {
89
+ id: string;
90
+ user_addr: string;
91
+ user_addr_pnl: {
92
+ id: string;
93
+ profit_usd: number;
94
+ };
95
+ chain_id: string;
96
+ token_id: string;
97
+ token_amount: number;
98
+ action: string;
99
+ usd_value: number;
100
+ create_at: number;
101
+ }
102
+ export interface CopyTradeRecentBuyListResponse {
103
+ recent_buy_list: CopyTradeRecentBuyItem[];
104
+ total: number;
105
+ }
106
+ export interface CopyTradePnlItem extends TokenItem {
107
+ profit_usd: number;
108
+ }
109
+ export interface CopyTradePnlListResponse {
110
+ pnl_list: CopyTradePnlItem[];
111
+ }
112
+ export interface Eip1559Tx {
113
+ chainId: number;
114
+ data: string;
115
+ from: string;
116
+ gas: string;
117
+ maxFeePerGas: string;
118
+ maxPriorityFeePerGas: string;
119
+ nonce: string;
120
+ to: string;
121
+ value: string;
122
+ r?: string;
123
+ s?: string;
124
+ v?: string;
125
+ }
126
+ export interface TotalBalanceResponse {
127
+ total_usd_value: number;
128
+ chain_list: ChainWithBalance[];
129
+ error_code?: number;
130
+ err_chain_ids?: string[];
131
+ }
132
+ export interface TokenEntityDetail {
133
+ id: string;
134
+ chain: string;
135
+ token_id: string;
136
+ symbol: string;
137
+ domain_id: string;
138
+ fdv: number;
139
+ is_domain_verified: boolean;
140
+ relate_domain_ids: string[];
141
+ cmc_id: string;
142
+ coingecko_id: string;
143
+ bridge_ids: string[];
144
+ origin_token?: TokenItem;
145
+ listed_sites: {
146
+ name: string;
147
+ url: string;
148
+ logo_url: string;
149
+ }[];
150
+ cex_list: {
151
+ id: string;
152
+ site_url: string;
153
+ name: string;
154
+ logo_url: string;
155
+ }[];
156
+ }
157
+ export interface TokenItem {
158
+ content_type?: 'image' | 'image_url' | 'video_url' | 'audio_url' | undefined;
159
+ content?: string | undefined;
160
+ inner_id?: any;
161
+ amount: number;
162
+ chain: string;
163
+ decimals: number;
164
+ display_symbol: string | null;
165
+ id: string;
166
+ is_core: boolean;
167
+ credit_score?: number;
168
+ is_verified: boolean;
169
+ is_wallet: boolean;
170
+ is_scam?: boolean;
171
+ is_infinity?: boolean;
172
+ is_suspicious?: boolean;
173
+ logo_url: string;
174
+ name: string;
175
+ optimized_symbol: string;
176
+ price: number;
177
+ symbol: string;
178
+ time_at: number;
179
+ usd_value?: number;
180
+ raw_amount?: string;
181
+ raw_amount_hex_str?: string;
182
+ price_24h_change?: number | null;
183
+ low_credit_score?: boolean;
184
+ }
185
+ export interface TokenItemWithEntity extends TokenItem {
186
+ identity?: TokenEntityDetail;
187
+ }
188
+ export interface TransferingNFTItem {
189
+ chain: string;
190
+ collection: {
191
+ id: string;
192
+ name: string;
193
+ create_at: number;
194
+ chains: string[];
195
+ is_suspicious?: boolean;
196
+ is_verified?: boolean;
197
+ floor_price?: number | null;
198
+ };
199
+ content: string;
200
+ content_type: NFTItem['content_type'];
201
+ contract_id: string;
202
+ description: string | null;
203
+ detail_url: string;
204
+ id: string;
205
+ inner_id: string;
206
+ name: string;
207
+ total_supply: number;
208
+ amount: number;
209
+ }
210
+ export interface NFTApprovalResponse {
211
+ tokens: NFTApproval[];
212
+ contracts: NFTApprovalContract[];
213
+ total: string;
214
+ }
215
+ export interface NFTApprovalContract {
216
+ chain: string;
217
+ contract_name: string;
218
+ contract_id: string;
219
+ amount: string;
220
+ spender: Spender;
221
+ is_erc721: boolean;
222
+ is_erc1155: boolean;
223
+ }
224
+ export interface NFTApprovalSpender {
225
+ id: string;
226
+ protocol: {
227
+ id: string;
228
+ name: string;
229
+ logo_url: string;
230
+ chain: string;
231
+ } | null;
232
+ }
233
+ export interface NFTApproval {
234
+ id: string;
235
+ contract_id: string;
236
+ inner_id: string;
237
+ chain: string;
238
+ name: null;
239
+ symbol: string;
240
+ description: null;
241
+ content_type: 'image' | 'image_url' | 'video_url' | 'audio_url' | undefined;
242
+ content: string;
243
+ total_supply: number;
244
+ detail_url: string;
245
+ contract_name: string;
246
+ is_erc721: boolean;
247
+ is_erc1155: boolean;
248
+ amount: string;
249
+ spender: Spender;
250
+ }
251
+ export interface TokenApproval<SpenderType extends Spender = Spender> {
252
+ id: string;
253
+ name: string;
254
+ symbol: string;
255
+ logo_url: string;
256
+ chain: string;
257
+ price: number;
258
+ balance: number;
259
+ spenders: SpenderType[];
260
+ sum_exposure_usd: number;
261
+ /** @deprecated */
262
+ exposure_balance?: number;
263
+ }
264
+ export interface Spender {
265
+ id: string;
266
+ permit2_id?: string;
267
+ value: number;
268
+ exposure_usd: number;
269
+ protocol: {
270
+ id: string;
271
+ name: string;
272
+ logo_url: string;
273
+ chain: string;
274
+ };
275
+ /** @deprecated */
276
+ is_contract?: boolean;
277
+ /** @deprecated */
278
+ is_open_source?: boolean;
279
+ /** @deprecated */
280
+ is_hacked?: boolean;
281
+ /** @deprecated */
282
+ is_abandoned?: boolean;
283
+ risk_alert: string;
284
+ risk_level: string;
285
+ exposure_nft_usd_value?: number | null;
286
+ exposure_usd_value?: number | null;
287
+ spend_usd_value?: number | null;
288
+ approve_user_count?: number | null;
289
+ revoke_user_count?: number | null;
290
+ last_approve_at: number | null;
291
+ }
292
+ export interface AssetItem {
293
+ id: string;
294
+ chain: string;
295
+ name: string;
296
+ site_url: string;
297
+ logo_url: string;
298
+ has_supported_portfolio: boolean;
299
+ tvl: number;
300
+ net_usd_value: number;
301
+ asset_usd_value: number;
302
+ debt_usd_value: number;
303
+ }
304
+ export interface NFTCollection {
305
+ create_at: string;
306
+ id: string;
307
+ is_core: boolean;
308
+ name: string;
309
+ price: number;
310
+ chain: string;
311
+ tokens: NFTItem[];
312
+ floor_price: number;
313
+ is_scam: boolean;
314
+ is_suspicious: boolean;
315
+ is_verified: boolean;
316
+ }
317
+ export interface UserCollection {
318
+ collection: Collection;
319
+ list: NFTItem[];
320
+ }
321
+ export interface NFTItem {
322
+ chain: string;
323
+ id: string;
324
+ contract_id: string;
325
+ inner_id: string;
326
+ token_id?: string;
327
+ name: string;
328
+ contract_name: string;
329
+ description: string;
330
+ usd_price?: number;
331
+ amount: number;
332
+ collection_id?: string;
333
+ collection_name?: string;
334
+ is_core?: boolean;
335
+ pay_token?: {
336
+ id: string;
337
+ name: string;
338
+ symbol: string;
339
+ amount: number;
340
+ logo_url: string;
341
+ time_at: number;
342
+ date_at?: string;
343
+ price?: number;
344
+ };
345
+ content_type: 'image' | 'image_url' | 'video_url' | 'audio_url';
346
+ content: string;
347
+ detail_url: string;
348
+ total_supply?: string;
349
+ collection?: Collection | null;
350
+ is_erc1155?: boolean;
351
+ is_erc721: boolean;
352
+ thumbnail_url?: string;
353
+ }
354
+ export interface Collection {
355
+ id: string;
356
+ name: string;
357
+ description: null | string;
358
+ logo_url: string;
359
+ is_core: boolean;
360
+ is_suspicious?: boolean;
361
+ is_verified?: boolean;
362
+ contract_uuids: string[];
363
+ create_at: number;
364
+ floor_price: number;
365
+ is_scam: boolean;
366
+ }
367
+ export interface CollectionList {
368
+ id: string;
369
+ chain: string;
370
+ name: string;
371
+ description: string;
372
+ logo_url: string;
373
+ is_verified: boolean;
374
+ credit_score: number;
375
+ receive_addr_count: number;
376
+ is_scam: boolean;
377
+ is_suspicious: boolean;
378
+ is_core: boolean;
379
+ floor_price: number;
380
+ nft_list: NFTItem[];
381
+ native_token: TokenItem;
382
+ }
383
+ export interface TxDisplayItem extends TxHistoryItem {
384
+ projectDict: TxHistoryResult['project_dict'];
385
+ cateDict: TxHistoryResult['cate_dict'];
386
+ tokenDict: TxHistoryResult['token_dict'];
387
+ }
388
+ export interface TxHistoryItem {
389
+ cate_id: string | null;
390
+ chain: string;
391
+ debt_liquidated: null;
392
+ id: string;
393
+ is_scam: boolean;
394
+ other_addr: string;
395
+ project_id: null | string;
396
+ receives: {
397
+ amount: number;
398
+ from_addr: string;
399
+ token_id: string;
400
+ }[];
401
+ sends: {
402
+ amount: number;
403
+ to_addr: string;
404
+ token_id: string;
405
+ }[];
406
+ time_at: number;
407
+ token_approve: {
408
+ spender: string;
409
+ token_id: string;
410
+ value: number;
411
+ } | null;
412
+ tx: {
413
+ eth_gas_fee: number;
414
+ from_addr: string;
415
+ name: string;
416
+ params: any[];
417
+ status: number;
418
+ to_addr: string;
419
+ usd_gas_fee: number;
420
+ value: number;
421
+ message: string | null;
422
+ } | null;
423
+ }
424
+ export interface TxHistoryResult {
425
+ cate_dict: Record<string, {
426
+ id: string;
427
+ name: string;
428
+ }>;
429
+ history_list: TxHistoryItem[];
430
+ project_dict: Record<string, {
431
+ chain: string;
432
+ id: string;
433
+ logo_url: string;
434
+ name: string;
435
+ }>;
436
+ token_dict: Record<string, TokenItem>;
437
+ }
438
+ export interface TxAllHistoryResult extends Omit<TxHistoryResult, 'token_dict'> {
439
+ token_uuid_dict: Record<string, TokenItem>;
440
+ project_dict: TxHistoryResult['project_dict'];
441
+ }
442
+ export interface GasResult {
443
+ estimated_gas_cost_usd_value: number;
444
+ estimated_gas_cost_value: number;
445
+ estimated_gas_used: number;
446
+ estimated_seconds: number;
447
+ front_tx_count: number;
448
+ max_gas_cost_usd_value: number;
449
+ max_gas_cost_value: number;
450
+ fail?: boolean;
451
+ }
452
+ export interface GasLevel {
453
+ level: string;
454
+ price: number;
455
+ front_tx_count: number;
456
+ estimated_seconds: number;
457
+ priority_price: number | null;
458
+ base_fee: number;
459
+ }
460
+ export interface BalanceChange<T = TokenItem, N = TransferingNFTItem> {
461
+ error?: {
462
+ code: number;
463
+ msg: string;
464
+ } | null;
465
+ receive_nft_list: N[];
466
+ receive_token_list: T[];
467
+ send_nft_list: N[];
468
+ send_token_list: T[];
469
+ success: boolean;
470
+ usd_value_change: number;
471
+ }
472
+ interface NFTContractItem {
473
+ id: string;
474
+ chain: string;
475
+ name: string;
476
+ symbol: string;
477
+ is_core: boolean;
478
+ time_at: number;
479
+ collection: {
480
+ id: string;
481
+ name: string;
482
+ create_at: number;
483
+ };
484
+ }
485
+ export interface ExplainTxResponse {
486
+ pre_exec_version: 'v0' | 'v1' | 'v2';
487
+ abi?: {
488
+ func: string;
489
+ params: Array<string[] | number | string>;
490
+ };
491
+ abi_str?: string;
492
+ balance_change: BalanceChange;
493
+ gas: {
494
+ success?: boolean;
495
+ error?: {
496
+ code: number;
497
+ msg: string;
498
+ } | null;
499
+ gas_used: number;
500
+ gas_ratio: number;
501
+ gas_limit: number;
502
+ estimated_gas_cost_usd_value: number;
503
+ estimated_gas_cost_value: number;
504
+ estimated_gas_used: number;
505
+ estimated_seconds: number;
506
+ };
507
+ native_token: TokenItem;
508
+ pre_exec: {
509
+ success: boolean;
510
+ error?: {
511
+ code: number;
512
+ msg: string;
513
+ } | null;
514
+ };
515
+ trace_id: string;
516
+ recommend: {
517
+ gas: string;
518
+ nonce: string;
519
+ };
520
+ support_balance_change: true;
521
+ type_call?: {
522
+ action: string;
523
+ contract: string;
524
+ contract_protocol_logo_url: string;
525
+ contract_protocol_name: string;
526
+ };
527
+ type_send?: {
528
+ to_addr: string;
529
+ token_symbol: string;
530
+ token_amount: number;
531
+ token: TokenItem;
532
+ };
533
+ type_token_approval?: {
534
+ spender: string;
535
+ spender_protocol_logo_url: string;
536
+ spender_protocol_name: string;
537
+ token_symbol: string;
538
+ token_amount: number;
539
+ is_infinity: boolean;
540
+ token: TokenItem;
541
+ };
542
+ type_cancel_token_approval?: {
543
+ spender: string;
544
+ spender_protocol_logo_url: string;
545
+ spender_protocol_name: string;
546
+ token_symbol: string;
547
+ };
548
+ type_cancel_tx?: any;
549
+ type_deploy_contract?: any;
550
+ is_gnosis?: boolean;
551
+ gnosis?: ExplainTxResponse;
552
+ type_cancel_single_nft_approval?: {
553
+ spender: string;
554
+ spender_protocol_name: null;
555
+ spender_protocol_logo_url: string;
556
+ token_symbol: null;
557
+ is_nft: boolean;
558
+ nft: NFTItem;
559
+ };
560
+ type_cancel_nft_collection_approval?: {
561
+ spender: string;
562
+ spender_protocol_name: string;
563
+ spender_protocol_logo_url: string;
564
+ token_symbol: string;
565
+ is_nft: boolean;
566
+ nft_contract: NFTContractItem;
567
+ token: TokenItem;
568
+ };
569
+ type_nft_collection_approval?: {
570
+ spender: string;
571
+ spender_protocol_name: string;
572
+ spender_protocol_logo_url: string;
573
+ token_symbol: string;
574
+ is_nft: boolean;
575
+ nft_contract: NFTContractItem;
576
+ token: TokenItem;
577
+ token_amount: number;
578
+ is_infinity: boolean;
579
+ };
580
+ type_single_nft_approval?: {
581
+ spender: string;
582
+ spender_protocol_name: string;
583
+ spender_protocol_logo_url: string;
584
+ token_symbol: string;
585
+ is_nft: boolean;
586
+ nft: NFTItem;
587
+ token: TokenItem;
588
+ token_amount: number;
589
+ is_infinity: boolean;
590
+ };
591
+ type_nft_send?: {
592
+ spender: string;
593
+ spender_protocol_name: null;
594
+ spender_protocol_logo_url: string;
595
+ token_symbol: string;
596
+ token_amount: number;
597
+ is_infinity: boolean;
598
+ is_nft: boolean;
599
+ nft: NFTItem;
600
+ };
601
+ type_list_nft?: {
602
+ action: string;
603
+ contract: string;
604
+ contract_protocol_logo_url: string;
605
+ contract_protocol_name: string;
606
+ offerer: string;
607
+ total_usd_value: number;
608
+ offer_list: {
609
+ item_type: number;
610
+ amount: number;
611
+ nft: NFTItem;
612
+ }[];
613
+ buyer_list: {
614
+ id: string;
615
+ }[];
616
+ };
617
+ }
618
+ export interface LatestExplainTxResponse {
619
+ id: string;
620
+ tx_id: string;
621
+ block_height: number;
622
+ gas_used: number;
623
+ pre_exec_result: PreExecResult;
624
+ create_at: number;
625
+ }
626
+ export interface RPCResponse<T> {
627
+ result: T;
628
+ id: number;
629
+ jsonrpc: string;
630
+ error?: {
631
+ code: number;
632
+ message: string;
633
+ };
634
+ }
635
+ export interface GetTxResponse {
636
+ blockHash: string;
637
+ blockNumber: string;
638
+ from: string;
639
+ gas: string;
640
+ gasPrice: string;
641
+ hash: string;
642
+ input: string;
643
+ nonce: string;
644
+ to: string;
645
+ transactionIndex: string;
646
+ value: string;
647
+ type: string;
648
+ v: string;
649
+ r: string;
650
+ s: string;
651
+ front_tx_count: number;
652
+ code: 0 | -1;
653
+ status: -1 | 0 | 1;
654
+ gas_used: number;
655
+ token: TokenItem;
656
+ }
657
+ export interface ApprovalStatus {
658
+ chain: string;
659
+ token_approval_danger_cnt: number;
660
+ nft_approval_danger_cnt: number;
661
+ }
662
+ export interface UsedChain {
663
+ id: string;
664
+ community_id: number;
665
+ name: string;
666
+ native_token_id: string;
667
+ logo_url: string;
668
+ wrapped_token_id: string;
669
+ }
670
+ export interface ProjectItem {
671
+ id: string;
672
+ name: string;
673
+ site_url: string;
674
+ logo_url: string;
675
+ }
676
+ export interface PoolItem {
677
+ id: string;
678
+ chain: string;
679
+ project_id: string;
680
+ adapter_id: string;
681
+ controller: string;
682
+ time_at: number;
683
+ index?: number;
684
+ }
685
+ export interface PortfolioItemToken extends TokenItem {
686
+ claimable_amount?: number;
687
+ }
688
+ export declare type NftCollection = {
689
+ chain_id: string;
690
+ id: string;
691
+ name: string;
692
+ symbol?: string;
693
+ logo_url: string;
694
+ is_core: boolean;
695
+ amount?: number;
696
+ floor_price_token?: PortfolioItemToken;
697
+ };
698
+ export declare type PortfolioItemNft = {
699
+ id: string;
700
+ contract_id: string;
701
+ inner_id: string;
702
+ name: string;
703
+ content_url: string;
704
+ thumbnail_url: string;
705
+ collection: NftCollection;
706
+ amount: number;
707
+ };
708
+ export interface PortfolioItemDetail {
709
+ supply_token_list?: PortfolioItemToken[];
710
+ borrow_token_list?: PortfolioItemToken[];
711
+ health_rate?: number;
712
+ reward_token_list?: PortfolioItemToken[];
713
+ collateral_token_list?: PortfolioItemToken[];
714
+ token_list?: PortfolioItemToken[];
715
+ base_token?: PortfolioItemToken;
716
+ position_token?: PortfolioItemToken;
717
+ description?: string;
718
+ token?: PortfolioItemToken;
719
+ underlying_token?: PortfolioItemToken;
720
+ strike_token?: PortfolioItemToken;
721
+ quote_token?: PortfolioItemToken;
722
+ margin_token?: PortfolioItemToken;
723
+ supply_nft_list?: PortfolioItemNft[];
724
+ nft_list?: PortfolioItemNft[];
725
+ collection?: NftCollection;
726
+ share_token?: PortfolioItemToken;
727
+ exercise_end_at?: number;
728
+ type?: string;
729
+ side?: number;
730
+ leverage?: number;
731
+ expired_at: number;
732
+ end_at: number;
733
+ unlock_at: number;
734
+ debt_ratio?: number;
735
+ usd_value?: number;
736
+ daily_unlock_amount: number;
737
+ pnl_usd_value: number;
738
+ }
739
+ export interface PortfolioItem {
740
+ asset_token_list: TokenItem[];
741
+ stats: {
742
+ asset_usd_value: number;
743
+ debt_usd_value: number;
744
+ net_usd_value: number;
745
+ };
746
+ asset_dict: Record<string, number>;
747
+ update_at: number;
748
+ name: string;
749
+ detail_types: string[];
750
+ detail: PortfolioItemDetail;
751
+ proxy_detail: {
752
+ project: ProjectItem;
753
+ proxy_contract_id: string;
754
+ };
755
+ pool: PoolItem;
756
+ position_index: string;
757
+ }
758
+ export interface Protocol {
759
+ chain: string;
760
+ dao_id: null | string;
761
+ has_supported_portfolio: boolean;
762
+ id: string;
763
+ is_tvl: boolean;
764
+ logo_url: string;
765
+ name: string;
766
+ platform_token_id: string;
767
+ site_url: string;
768
+ tag_ids: string[];
769
+ tvl: number;
770
+ }
771
+ export interface ComplexProtocol {
772
+ id: string;
773
+ chain: string;
774
+ name: string;
775
+ site_url: string;
776
+ logo_url: string;
777
+ has_supported_portfolio: boolean;
778
+ tvl: number;
779
+ portfolio_item_list: PortfolioItem[];
780
+ }
781
+ export interface ExplainTypedDataResponse {
782
+ type_list_nft?: ExplainTxResponse['type_list_nft'];
783
+ type_token_approval?: ExplainTxResponse['type_token_approval'];
784
+ type_common_sign?: {
785
+ contract: string;
786
+ contract_protocol_logo_url?: string;
787
+ contract_protocol_name?: string;
788
+ };
789
+ }
790
+ export interface CEXQuote {
791
+ pay_token: TokenItem;
792
+ receive_token: TokenItem;
793
+ }
794
+ export interface SwapItem {
795
+ chain: string;
796
+ tx_id: string;
797
+ create_at: number;
798
+ finished_at: number;
799
+ status: 'Pending' | 'Completed' | 'Finished';
800
+ dex_id: string;
801
+ pay_token: TokenItem;
802
+ receive_token: TokenItem;
803
+ gas: {
804
+ native_token: TokenItem;
805
+ native_gas_fee: number;
806
+ usd_gas_fee: number;
807
+ gas_price: number;
808
+ };
809
+ quote: {
810
+ pay_token_amount: number;
811
+ receive_token_amount: number;
812
+ slippage: number;
813
+ };
814
+ actual: {
815
+ pay_token_amount: number;
816
+ receive_token_amount: number;
817
+ slippage: number;
818
+ };
819
+ }
820
+ export interface SwapTradeList {
821
+ history_list: SwapItem[];
822
+ total_cnt: number;
823
+ }
824
+ export interface SlippageStatus {
825
+ is_valid: boolean;
826
+ suggest_slippage: number;
827
+ }
828
+ export interface SummaryToken {
829
+ id: string;
830
+ chain: string;
831
+ name: string;
832
+ symbol: string;
833
+ display_symbol?: string;
834
+ optimized_symbol: string;
835
+ decimals: number;
836
+ logo_url?: string;
837
+ protocol_id: string;
838
+ price: number;
839
+ is_verified: boolean;
840
+ is_core: boolean;
841
+ is_wallet: boolean;
842
+ time_at?: number;
843
+ amount: number;
844
+ }
845
+ export interface SummaryCoin {
846
+ id: string;
847
+ symbol: string;
848
+ logo_url: string;
849
+ parent_coin_id?: string;
850
+ token_uuids: string[];
851
+ peg_token_uuids: string[];
852
+ circulating_supply: number;
853
+ total_supply: number;
854
+ price: number;
855
+ amount: number;
856
+ }
857
+ export interface Summary {
858
+ token_list: SummaryToken[];
859
+ coin_list: SummaryCoin[];
860
+ }
861
+ export interface Cex {
862
+ id: string;
863
+ logo_url: string;
864
+ name: string;
865
+ is_deposit: boolean;
866
+ }
867
+ export interface ContractCredit {
868
+ value: null | number;
869
+ rank_at: number | null;
870
+ }
871
+ export interface ContractDesc {
872
+ multisig?: {
873
+ id: string;
874
+ logo_url: string;
875
+ name: string;
876
+ };
877
+ create_at: number;
878
+ is_danger?: boolean | null;
879
+ }
880
+ export interface AddrDescResponse {
881
+ desc: {
882
+ cex?: Cex;
883
+ contract?: Record<string, ContractDesc>;
884
+ usd_value: number;
885
+ protocol?: Record<string, {
886
+ id: string;
887
+ logo_url: string;
888
+ name: string;
889
+ }>;
890
+ born_at: number;
891
+ is_danger: boolean | null;
892
+ is_spam: boolean | null;
893
+ is_scam: boolean | null;
894
+ name: string;
895
+ };
896
+ }
897
+ export interface SendAction {
898
+ to: string;
899
+ token: TokenItem;
900
+ }
901
+ export interface RevokeTokenApproveAction {
902
+ spender: string;
903
+ token: TokenItem;
904
+ }
905
+ export interface WrapTokenAction {
906
+ pay_token: TokenItem;
907
+ receive_token: SwapReceiveToken;
908
+ receiver: string;
909
+ }
910
+ export interface UnWrapTokenAction {
911
+ pay_token: TokenItem;
912
+ receive_token: SwapReceiveToken;
913
+ receiver: string;
914
+ }
915
+ export interface ApproveAction {
916
+ spender: string;
917
+ token: TokenItem;
918
+ }
919
+ export interface SwapReceiveToken extends TokenItem {
920
+ min_amount: number;
921
+ min_raw_amount: string;
922
+ }
923
+ export interface CrossSwapAction {
924
+ pay_token: TokenItem;
925
+ receive_token: SwapReceiveToken;
926
+ receiver: string;
927
+ }
928
+ export interface CrossTokenAction {
929
+ pay_token: TokenItem;
930
+ receive_token: SwapReceiveToken;
931
+ receiver: string;
932
+ }
933
+ export interface RevokePermit2Action {
934
+ spender: string;
935
+ token: TokenItem;
936
+ }
937
+ export interface SwapOrderAction {
938
+ pay_token_list: TokenItem[];
939
+ pay_nft_list: NFTItem[];
940
+ takers: string[];
941
+ receive_token_list: TokenItem[];
942
+ receive_nft_list: NFTItem[];
943
+ receiver: string | null;
944
+ expire_at: string | null;
945
+ }
946
+ export interface MaxPayTokenItem extends TokenItem {
947
+ max_amount: number;
948
+ max_raw_amount: string;
949
+ }
950
+ export interface SwapLimitPay {
951
+ pay_token: MaxPayTokenItem;
952
+ receive_token: TokenItem;
953
+ receiver: string;
954
+ }
955
+ export interface MultiSwapAction {
956
+ pay_token_list: TokenItem[];
957
+ receive_token_list: SwapReceiveToken[];
958
+ receiver: string;
959
+ }
960
+ export interface TransferOwnerAction {
961
+ description: string;
962
+ from_addr: string;
963
+ to_addr: string;
964
+ }
965
+ export interface SwapAction {
966
+ pay_token: TokenItem;
967
+ receive_token: SwapReceiveToken;
968
+ receiver: string;
969
+ }
970
+ export interface SendNFTAction {
971
+ to: string;
972
+ nft: NFTItem;
973
+ }
974
+ export interface ApproveNFTAction {
975
+ spender: string;
976
+ nft: NFTItem;
977
+ }
978
+ export declare type RevokeNFTAction = ApproveNFTAction;
979
+ export interface ApproveNFTCollectionAction {
980
+ spender: string;
981
+ collection: NFTCollection;
982
+ }
983
+ export interface PushMultiSigAction {
984
+ multisig_id: string;
985
+ }
986
+ export declare type RevokeNFTCollectionAction = ApproveNFTCollectionAction;
987
+ export interface ParseTxResponse {
988
+ action: {
989
+ type: string;
990
+ data: SwapAction | ApproveAction | SendAction | SendNFTAction | ApproveNFTAction | RevokeNFTAction | ApproveNFTCollectionAction | RevokeNFTCollectionAction | RevokeTokenApproveAction | WrapTokenAction | UnWrapTokenAction | PushMultiSigAction | CrossSwapAction | CrossTokenAction | RevokePermit2Action | SwapOrderAction | TransferOwnerAction | MultiSwapAction | SwapLimitPay | null;
991
+ };
992
+ contract_call?: {
993
+ func: string;
994
+ contract: {
995
+ id: string;
996
+ protocol: {
997
+ name: string;
998
+ logo_url: string;
999
+ };
1000
+ };
1001
+ };
1002
+ log_id: string;
1003
+ }
1004
+ export interface CollectionWithFloorPrice {
1005
+ id: string;
1006
+ name: string;
1007
+ floor_price: number;
1008
+ }
1009
+ export declare type TypedDataActionName = 'permit1_approve_token' | 'swap_token_order' | 'permit2_approve_token' | 'sell_nft_order' | 'sign_multisig' | 'buy_nft_order' | 'create_key' | 'verify_address' | 'sell_nft_list_order' | 'permit2_approve_token_list' | 'create_cobo_safe' | 'submit_safe_role_modification' | 'submit_delegated_address_modification' | 'submit_token_approval_modification' | 'send_token' | 'permit1_revoke_token' | 'swap_order' | 'approve_nft';
1010
+ export interface BuyNFTOrderAction {
1011
+ expire_at: string;
1012
+ pay_token: TokenItem;
1013
+ receive_nft: NFTItem;
1014
+ receiver: string;
1015
+ takers: string[];
1016
+ }
1017
+ export interface SellNFTOrderAction {
1018
+ pay_nft: NFTItem;
1019
+ receive_token: TokenItem;
1020
+ receiver: string;
1021
+ takers: string[];
1022
+ expire_at: string;
1023
+ }
1024
+ export interface BatchSellNFTOrderAction {
1025
+ pay_nft_list: NFTItem[];
1026
+ receive_token: TokenItem;
1027
+ receiver: string;
1028
+ takers: string[];
1029
+ expire_at: string;
1030
+ }
1031
+ export interface SwapTokenOrderAction {
1032
+ pay_token: TokenItem;
1033
+ receive_token: TokenItem;
1034
+ receiver: string;
1035
+ takers: string[];
1036
+ expire_at: number | null;
1037
+ }
1038
+ export interface PermitAction {
1039
+ spender: string;
1040
+ token: TokenItem;
1041
+ }
1042
+ export interface PermitTokenItem extends TokenItem {
1043
+ permit2_allowance_amount: number;
1044
+ permit2_allowance_raw_amount: string;
1045
+ }
1046
+ export interface Permit2Action {
1047
+ permit2_id: string;
1048
+ spender: string;
1049
+ token: PermitTokenItem;
1050
+ expire_at: number | null;
1051
+ }
1052
+ export interface BatchPermit2Action {
1053
+ permit2_id: string;
1054
+ spender: string;
1055
+ token_list: PermitTokenItem[];
1056
+ expire_at: number | null;
1057
+ }
1058
+ export interface SignMultiSigActions {
1059
+ multisig_id: string;
1060
+ }
1061
+ export interface CreateCoboSafeAction {
1062
+ multisig_id: string;
1063
+ desc: string;
1064
+ brand: {
1065
+ name: string;
1066
+ logo_url: string;
1067
+ };
1068
+ }
1069
+ export interface SubmitSafeRoleModificationAction {
1070
+ multisig_id: string;
1071
+ desc: string;
1072
+ brand: {
1073
+ name: string;
1074
+ logo_url: string;
1075
+ };
1076
+ }
1077
+ export interface SubmitDelegatedAddressModificationAction {
1078
+ multisig_id: string;
1079
+ desc: string;
1080
+ brand: {
1081
+ name: string;
1082
+ logo_url: string;
1083
+ };
1084
+ }
1085
+ export interface SubmitTokenApprovalModificationAction {
1086
+ multisig_id: string;
1087
+ desc: string;
1088
+ brand: {
1089
+ name: string;
1090
+ logo_url: string;
1091
+ };
1092
+ }
1093
+ export interface ParseTypedDataResponse {
1094
+ action: {
1095
+ type: TypedDataActionName;
1096
+ expire_at?: number;
1097
+ data: SellNFTOrderAction | BuyNFTOrderAction | SwapTokenOrderAction | PermitAction | Permit2Action | SignMultiSigActions | CreateKeyAction | VerifyAddressAction | BatchSellNFTOrderAction | BatchPermit2Action | CreateCoboSafeAction | SubmitSafeRoleModificationAction | SubmitDelegatedAddressModificationAction | SubmitTokenApprovalModificationAction | SendAction | SwapOrderAction | RevokeTokenApproveAction | ApproveNFTAction;
1098
+ } | null;
1099
+ log_id: string;
1100
+ }
1101
+ export declare type TextActionName = 'create_key' | 'verify_address';
1102
+ export interface CreateKeyAction {
1103
+ user: string;
1104
+ allow_origins: string[];
1105
+ protocol: {
1106
+ name: string;
1107
+ logo_url: string;
1108
+ } | null;
1109
+ desc: string;
1110
+ }
1111
+ export interface VerifyAddressAction {
1112
+ user: string;
1113
+ allow_origins: string[];
1114
+ protocol: {
1115
+ name: string;
1116
+ logo_url: string;
1117
+ } | null;
1118
+ desc: string;
1119
+ }
1120
+ export interface ParseTextResponse {
1121
+ action: {
1122
+ type: TextActionName;
1123
+ data: CreateKeyAction | VerifyAddressAction;
1124
+ } | null;
1125
+ log_id: string;
1126
+ }
1127
+ export declare type TxPushType = 'default' | 'low_gas' | 'mev';
1128
+ export interface TxRequest {
1129
+ id: string;
1130
+ chain_id: string;
1131
+ user_addr: string;
1132
+ nonce: number;
1133
+ signed_tx: Tx;
1134
+ tx_id?: null | string;
1135
+ push_type: TxPushType;
1136
+ push_status?: 'success' | 'failed';
1137
+ push_at?: number | null;
1138
+ is_withdraw: boolean;
1139
+ create_at: number;
1140
+ low_gas_deadline?: number;
1141
+ is_finished: boolean;
1142
+ predict_packed_at?: number;
1143
+ predict_err_code?: number;
1144
+ push_at_list?: number[];
1145
+ }
1146
+ export interface MempoolCheckDetail {
1147
+ id: string;
1148
+ chain_id: string;
1149
+ tx_id: string;
1150
+ check_at: string;
1151
+ check_success: boolean;
1152
+ rpc: string;
1153
+ name?: string;
1154
+ operator?: string;
1155
+ packed_rate?: number;
1156
+ }
1157
+ export interface JobResponse<T = any> {
1158
+ create_at: number;
1159
+ id: string;
1160
+ result: {
1161
+ create_at: number;
1162
+ id: string;
1163
+ data: T;
1164
+ };
1165
+ job: {
1166
+ create_at: number;
1167
+ id: string;
1168
+ status: 'pending' | 'running';
1169
+ } | null;
1170
+ }
1171
+ export interface PreExecResult {
1172
+ balance_change: BalanceChange;
1173
+ gas: {
1174
+ success?: boolean;
1175
+ error?: {
1176
+ code: number;
1177
+ msg: string;
1178
+ } | null;
1179
+ gas_used: number;
1180
+ gas_limit: number;
1181
+ };
1182
+ is_multisig: boolean;
1183
+ multisig?: any;
1184
+ pre_exec: {
1185
+ success: boolean;
1186
+ error?: {
1187
+ code: number;
1188
+ msg: string;
1189
+ } | null;
1190
+ };
1191
+ }
1192
+ export interface PendingTxItem {
1193
+ id: string;
1194
+ action_data: ParseTxResponse['action']['data'];
1195
+ action_type: ParseTxResponse['action']['type'];
1196
+ block_height?: number | null;
1197
+ gas_price?: number | null;
1198
+ gas_used?: number | null;
1199
+ pre_exec_at?: number | null;
1200
+ pre_exec_result?: Omit<PreExecResult, 'balance_change'> & {
1201
+ balance_change: BalanceChange<{
1202
+ chain: string;
1203
+ token_id: string;
1204
+ amount: number;
1205
+ }, {
1206
+ chain: string;
1207
+ token_id: string;
1208
+ amount: number;
1209
+ }>;
1210
+ };
1211
+ to_addr: string;
1212
+ to_addr_desc: {
1213
+ cex?: Cex | null;
1214
+ protocol?: {
1215
+ id: string;
1216
+ logo_url: string;
1217
+ name: string;
1218
+ };
1219
+ };
1220
+ }
1221
+ export interface BasicDappInfo {
1222
+ id: string;
1223
+ name: string;
1224
+ logo_url: string | null;
1225
+ description: string;
1226
+ user_range: string;
1227
+ tags: string[];
1228
+ chain_ids: string[];
1229
+ collected_list?: {
1230
+ name: string;
1231
+ logo_url: string;
1232
+ }[];
1233
+ }
1234
+ export interface SupportedChain {
1235
+ id: string;
1236
+ community_id: number;
1237
+ name: string;
1238
+ native_token: {
1239
+ id: string;
1240
+ symbol: string;
1241
+ logo: string;
1242
+ decimals: number;
1243
+ };
1244
+ logo_url: string;
1245
+ white_logo_url?: string;
1246
+ need_estimate_gas?: boolean;
1247
+ eip_1559: boolean;
1248
+ is_disabled: boolean;
1249
+ explorer_host: string;
1250
+ block_interval: number;
1251
+ }
1252
+ export interface ChainListItem {
1253
+ chain_id: number;
1254
+ name: string;
1255
+ short_name: string;
1256
+ native_currency: {
1257
+ name: string;
1258
+ symbol: string;
1259
+ decimals: number;
1260
+ };
1261
+ explorer: string | null;
1262
+ rpc: null | string;
1263
+ rpc_list?: string[];
1264
+ }
1265
+ export interface HistoryCurve {
1266
+ create_at: number;
1267
+ executor_name: string;
1268
+ executor_params: {
1269
+ addr: string;
1270
+ };
1271
+ executor_version: string;
1272
+ id: string;
1273
+ job?: null | {
1274
+ create_at: number;
1275
+ id: string;
1276
+ status: 'pending' | 'running';
1277
+ };
1278
+ result?: null | {
1279
+ create_at: number;
1280
+ data: {
1281
+ usd_value_list: number[][];
1282
+ };
1283
+ id: number;
1284
+ };
1285
+ }
1286
+ export interface NodeStatus {
1287
+ id: string;
1288
+ chain_id: string;
1289
+ features: {
1290
+ signature_decode: boolean;
1291
+ tx_simulation: boolean;
1292
+ security_check: boolean;
1293
+ evm_tracing: boolean;
1294
+ };
1295
+ tags: string[];
1296
+ official_node_height: number;
1297
+ official_node_timestamp: number;
1298
+ rabby_node_height: number;
1299
+ rabby_data_service_height: number;
1300
+ chain: {
1301
+ id: string;
1302
+ network_id: number;
1303
+ name: string;
1304
+ token_id: string;
1305
+ token_symbol: string;
1306
+ logo_url: string;
1307
+ svg_logo_url: string;
1308
+ block_interval: number;
1309
+ start_at: string;
1310
+ prefix: string;
1311
+ wrapped: string;
1312
+ explorer_host: string;
1313
+ is_support_archive: boolean;
1314
+ eip_1559: boolean;
1315
+ white_logo_url: string;
1316
+ };
1317
+ }
1318
+ interface NodeServiceData {
1319
+ node: NodeDetails;
1320
+ height_list: [number, number, number][];
1321
+ }
1322
+ interface NodeDetails {
1323
+ name: string;
1324
+ tag: string[];
1325
+ }
1326
+ export interface NodeStatusDetail {
1327
+ rabby_rpc: NodeServiceData[];
1328
+ rabby_data_service: NodeServiceData[];
1329
+ }
1330
+ interface BridgeItem {
1331
+ id: string;
1332
+ name: string;
1333
+ logo_url: string;
1334
+ }
1335
+ export interface BridgeAggregator {
1336
+ id: string;
1337
+ name: string;
1338
+ logo_url: string;
1339
+ bridge_list: BridgeItem[];
1340
+ }
1341
+ export interface BridgeTokenPair {
1342
+ aggregator_id: string;
1343
+ from_token: TokenItem;
1344
+ to_token: TokenItem;
1345
+ from_token_amount: number;
1346
+ from_token_raw_amount_hex_str: string;
1347
+ from_token_usd_value: number;
1348
+ }
1349
+ export interface BridgeQuote {
1350
+ aggregator: Exclude<BridgeAggregator, 'bridge_list'>;
1351
+ bridge_id: string;
1352
+ bridge: BridgeItem;
1353
+ to_token_amount: number;
1354
+ to_token_raw_amount: number;
1355
+ to_token_raw_amount_hex_str: string;
1356
+ gas_fee: {
1357
+ raw_amount_hex_str: string;
1358
+ usd_value: number;
1359
+ };
1360
+ protocol_fee: {
1361
+ raw_amount_hex_str: string;
1362
+ usd_value: number;
1363
+ };
1364
+ rabby_fee: {
1365
+ raw_amount_hex_str: string;
1366
+ usd_value: number;
1367
+ };
1368
+ duration: number;
1369
+ routePath: string;
1370
+ approve_contract_id: string;
1371
+ tx: {
1372
+ chainId: number;
1373
+ data: string;
1374
+ from: string;
1375
+ gasLimit: string;
1376
+ gasPrice: string;
1377
+ to: string;
1378
+ value: string;
1379
+ };
1380
+ }
1381
+ export interface BridgeHistory {
1382
+ aggregator: Exclude<BridgeAggregator, 'bridge_list'>;
1383
+ bridge: BridgeItem;
1384
+ from_token: TokenItem;
1385
+ to_token: TokenItem;
1386
+ quote: {
1387
+ pay_token_amount: number;
1388
+ receive_token_amount: number;
1389
+ };
1390
+ actual: {
1391
+ pay_token_amount: number;
1392
+ receive_token_amount: number;
1393
+ };
1394
+ detail_url: string;
1395
+ status: 'pending' | 'completed';
1396
+ create_at: number;
1397
+ from_gas: {
1398
+ native_token: TokenItem;
1399
+ gas_amount: number;
1400
+ usd_gas_fee: number;
1401
+ gas_price: number;
1402
+ };
1403
+ }
1404
+ export interface DbkBridgeHistoryItem {
1405
+ user_addr: string;
1406
+ from_chain_id: string;
1407
+ to_chain_id: string;
1408
+ is_deposit: boolean;
1409
+ tx_id: string;
1410
+ create_at: number;
1411
+ from_token_amount: number;
1412
+ from_token_id: string;
1413
+ }
1414
+ export interface ContractInfo {
1415
+ id: string;
1416
+ credit: ContractCredit;
1417
+ is_token: boolean;
1418
+ token_approval_exposure: number;
1419
+ top_nft_approval_exposure: number;
1420
+ spend_usd_value: number;
1421
+ top_nft_spend_usd_value: number;
1422
+ create_at: number;
1423
+ name: string | null;
1424
+ protocol: {
1425
+ id: string;
1426
+ logo_url: string;
1427
+ name: string;
1428
+ } | null;
1429
+ is_danger: {
1430
+ auto: null | boolean;
1431
+ edit: null | boolean;
1432
+ };
1433
+ is_phishing: boolean | null;
1434
+ }
1435
+ export interface GasAccountCheckResult {
1436
+ gas_account_cost: {
1437
+ total_cost: number;
1438
+ tx_cost: number;
1439
+ gas_cost: number;
1440
+ estimate_tx_cost: number;
1441
+ };
1442
+ is_gas_account: boolean;
1443
+ balance_is_enough: boolean;
1444
+ chain_not_support: boolean;
1445
+ }
1446
+ export interface ParseCommonResponse {
1447
+ input_type: 'typed_data' | 'text' | 'tx';
1448
+ output_type: 'typed_data' | 'text' | 'tx';
1449
+ action: ParseTypedDataResponse['action'] | ParseTextResponse['action'] | ParseTxResponse['action'];
1450
+ log_id: string;
1451
+ pre_exec_result: ExplainTxResponse | null;
1452
+ contract_call_data: ParseTxResponse['contract_call'] | null;
1453
+ pre_exec?: PreExecResult['pre_exec'];
1454
+ }
1455
+ export interface RechargeChainItem {
1456
+ chain_id: string;
1457
+ withdraw_limit: number;
1458
+ withdraw_fee: number;
1459
+ l1_balance: number;
1460
+ }
1461
+ export interface WithdrawListAddressItem {
1462
+ recharge_addr: string;
1463
+ total_withdraw_limit: number;
1464
+ recharge_chain_list: RechargeChainItem[];
1465
+ }
1466
+ export interface BuyCountryItem {
1467
+ id: string;
1468
+ name: string;
1469
+ image_url: string;
1470
+ regions: null | {
1471
+ regionCode: string;
1472
+ name: string;
1473
+ };
1474
+ }
1475
+ export interface BuyServiceProvider {
1476
+ id: string;
1477
+ name: string;
1478
+ website_url: string;
1479
+ customer_support_url: string;
1480
+ image_url: string;
1481
+ logo_url: string;
1482
+ }
1483
+ export interface BuyQuoteItem {
1484
+ service_provider: BuyServiceProvider;
1485
+ token_amount: number;
1486
+ payment_method_type: string;
1487
+ }
1488
+ export interface BuyHistoryItem {
1489
+ id: string;
1490
+ user_addr: string;
1491
+ status: string;
1492
+ create_at: number;
1493
+ service_provider: BuyServiceProvider;
1494
+ service_provider_url: null | string;
1495
+ pay_usd_amount: number;
1496
+ pay_currency_code: string;
1497
+ payment_type: string;
1498
+ receive_chain_id: string;
1499
+ receive_tx_id: string;
1500
+ receive_token_id: string;
1501
+ receive_amount: number;
1502
+ receive_token: TokenItem;
1503
+ }
1504
+ export interface BuyHistoryList {
1505
+ pagination: {
1506
+ start: number;
1507
+ limit: number;
1508
+ total: number;
1509
+ };
1510
+ histories: BuyHistoryItem[];
1511
+ }
1512
+ export interface BuyPaymentMethod {
1513
+ id: string;
1514
+ name: string;
1515
+ type: string;
1516
+ logo_url: string;
1517
+ }
1518
+ export interface GasAccountInfo {
1519
+ id: string;
1520
+ balance: number;
1521
+ create_at: number;
1522
+ nonce: number;
1523
+ uuid: string;
1524
+ has_iap_order: boolean;
1525
+ no_register: boolean;
1526
+ }
1527
+ export {};