cielo-rs-sdk 0.1.0

Rust library for interacting with the Cielo API.
Documentation
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
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
//! This module contains the data structures for the Cielo feed endpoint response.

use serde::{Deserialize, Serialize};

/// Represents an item in the feed.
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(untagged)]
pub enum Item {
    /// A swap transaction.
    Swap(Swap),
    /// A liquidity pool (LP) transaction.
    Lp(Lp),
    /// A transfer transaction.
    Transfer(Transfer),
    /// A lending transaction.
    Lending(Lending),
    /// An NFT minting transaction.
    NftMint(NftMint),
    /// An NFT trading transaction.
    NftTrade(NftTrade),
    /// An NFT transfer transaction.
    NftTransfer(NftTransfer),
    /// An NFT lending transaction.
    NftLending(NftLending),
    /// A bridge transaction.
    Bridge(Bridge),
    /// A contract interaction.
    ContractInteraction(ContractInteraction),
    /// A wrap transaction.
    Wrap(Wrap),
    /// A Sudo Pool transaction.
    SudoPool(SudoPool),
    /// A reward transaction.
    Reward(Reward),
    /// A staking transaction.
    Staking(Staking),
    /// A perpetual transaction.
    Perp(Perp),
    /// A flashloan transaction.
    Flashloan(Flashloan),
    /// A contract creation transaction.
    ContractCreation(ContractCreation),
    /// An NFT liquidation transaction.
    NftLiquidation(NftLiquidation),
    /// An option event transaction.
    Option(OptionType),
    /// An NFT sweep transaction.
    NftSweep(NftSweep),
}

/// Represents a swap transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Swap {
    /// The wallet address that initiated the swap transaction.
    pub wallet: String,
    /// A readable label for the wallet address.
    pub wallet_label: String,
    /// The unique hash identifier of the swap transaction.
    pub tx_hash: String,
    /// Specifies the type of transaction (e.g., token swap).
    pub tx_type: String,
    /// The blockchain network where the swap transaction occurred.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The decentralized exchange where the swap transaction took place.
    pub dex: String,
    /// The originating wallet address of the transaction.
    pub from: String,
    /// The destination wallet address of the transaction.
    pub to: String,
    /// The address of the first token involved in the swap.
    pub token0_address: String,
    /// The amount of the first token involved in the swap.
    pub token0_amount: f64,
    /// The USD value of the first token amount at the time of the swap.
    pub token0_amount_usd: f64,
    /// The name of the first token involved in the swap.
    pub token0_name: String,
    /// The price of the first token in USD.
    pub token0_price_usd: f64,
    /// The symbol of the first token involved in the swap.
    pub token0_symbol: String,
    /// A link to the icon of the token involved in the transaction.
    pub token0_icon_link: String,
    /// The address of the second token involved in the swap.
    pub token1_address: String,
    /// The amount of the second token involved in the swap.
    pub token1_amount: f64,
    /// The USD value of the second token amount at the time of the swap.
    pub token1_amount_usd: f64,
    /// The name of the second token involved in the swap.
    pub token1_name: String,
    /// The price of the second token in USD.
    pub token1_price_usd: f64,
    /// The symbol of the second token involved in the swap.
    pub token1_symbol: String,
    /// A link to the icon of the second token involved in the transaction.
    pub token1_icon_link: String,
    /// Indicates if this was the first interaction between involved wallet addresses.
    pub first_interaction: bool,
    /// Market cap and liquidity details of the tokens involved.
    pub token_market_cap: Option<TokenMarketCap>,
}

/// Represents the market cap and liquidity details of a token.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct TokenMarketCap {
    /// The address of the token.
    pub token_address: String,
    /// The market capitalization of the token.
    pub market_cap: f64,
    /// The liquidity of the token.
    pub liquidity: f64,
}

/// Represents a liquidity pool (LP) transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Lp {
    /// The wallet address participating in the LP transaction.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific LP transaction.
    pub tx_hash: String,
    /// Indicates the type of transaction, in this case, liquidity pool (LP) related.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The name of the decentralized exchange where the LP transaction occurred.
    pub dex: String,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// Specifies the nature of the LP transaction, such as 'add' or 'remove'.
    pub r#type: String,
    /// The address of the first token involved in the LP transaction.
    pub token0_address: String,
    /// The amount of the first token involved in the transaction.
    pub token0_amount: f64,
    /// The USD value of the first token amount at the time of the transaction.
    pub token0_amount_usd: f64,
    /// The name of the first token involved in the transaction.
    pub token0_name: String,
    /// The price of the first token in USD.
    pub token0_price_usd: f64,
    /// The symbol of the first token involved in the transaction.
    pub token0_symbol: String,
    /// A link to the icon of the token involved in the transaction.
    pub token0_icon_link: String,
    /// The address of the second token involved in the LP transaction.
    pub token1_address: String,
    /// The amount of the second token involved in the transaction.
    pub token1_amount: f64,
    /// The USD value of the second token amount at the time of the transaction.
    pub token1_amount_usd: f64,
    /// The name of the second token involved in the transaction.
    pub token1_name: String,
    /// The price of the second token in USD.
    pub token1_price_usd: f64,
    /// The symbol of the second token involved in the transaction.
    pub token1_symbol: String,
    /// A link to the icon of the second token involved in the transaction.
    pub token1_icon_link: String,
    /// Indicates the lower bound of the price range for the LP position, relevant in certain types of liquidity pools.
    pub lower_bound: f64,
    /// Indicates the upper bound of the price range for the LP position, relevant in certain types of liquidity pools.
    pub upper_bound: f64,
}

/// Represents a transfer transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Transfer {
    /// The wallet address involved in the transfer transaction.
    pub wallet: String,
    /// A readable label for the wallet address.
    pub wallet_label: String,
    /// The unique hash identifier of the transfer transaction.
    pub tx_hash: String,
    /// Specifies the type of transaction, in this case, a token transfer.
    pub tx_type: String,
    /// The blockchain network where the transfer transaction occurred.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The originating wallet address of the transaction.
    pub from: String,
    /// The destination wallet address of the transaction.
    pub to: String,
    /// A readable version of the 'from' wallet address.
    pub from_label: String,
    /// A readable version of the 'to' wallet address.
    pub to_label: String,
    /// The USD value of the amount transferred in the transaction.
    pub amount_usd: f64,
    /// The blockchain address of the contract under which the token is registered.
    pub contract_address: String,
    /// The name of the token being transferred.
    pub name: String,
    /// The symbol of the token being transferred.
    pub symbol: String,
    /// The price of the token in USD at the time of the transaction.
    pub token_price_usd: f64,
    /// Indicates the contract standard of the token, such as ERC20.
    pub r#type: String,
    /// A URL link to the token's icon image.
    pub token_icon_link: String,
    /// Contains the market capitalization and liquidity details of the tokens involved in the swap transaction.
    pub token_market_cap: Option<TokenMarketCap>,
}

/// Represents a lending transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Lending {
    /// The wallet address associated with the transaction.
    pub wallet: String,
    /// A more readable, shortened version of the wallet address.
    pub wallet_label: String,
    /// The unique identifier of the transaction, represented as a hash.
    pub tx_hash: String,
    /// Specifies the type of DeFi transaction, such as lending, borrowing, etc.
    pub tx_type: String,
    /// Indicates the blockchain network on which the transaction occurred.
    pub chain: String,
    /// A sequential index or identifier for the transaction within a particular dataset or list.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number in the blockchain where this transaction is recorded.
    pub block: u64,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// A readable, abbreviated form of the 'from' wallet address.
    pub from_label: String,
    /// Describes the action taken in the transaction, such as 'Repaid' in a lending scenario.
    pub action: String,
    /// The smart contract address involved in the transaction.
    pub address: String,
    /// The amount of the asset involved in the transaction.
    pub amount: f64,
    /// The equivalent value of the transaction amount in USD.
    pub amount_usd: f64,
    /// The decentralized exchange or platform where the transaction occurred, such as AaveV2.
    pub dex: String,
    /// A metric specific to lending platforms, indicating the health of the loan or position.
    pub health_factor: f64,
    /// The name of the asset involved in the transaction.
    pub name: String,
    /// The DeFi platform associated with the transaction, like AaveV3.
    pub platform: String,
    /// The price of the asset in USD at the time of the transaction.
    pub price_usd: f64,
    /// The symbol of the asset involved in the transaction.
    pub symbol: String,
    /// A URL link to the icon image of the token involved in the transaction.
    pub token_icon_link: String,
}

/// Represents an NFT minting transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct NftMint {
    /// The wallet address involved in the NFT minting transaction.
    pub wallet: String,
    /// A more readable label or identifier for the wallet address.
    pub wallet_label: String,
    /// The unique hash identifier of the NFT minting transaction.
    pub tx_hash: String,
    /// Specifies the type of transaction, in this case, NFT minting.
    pub tx_type: String,
    /// The blockchain network on which the minting transaction was conducted.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The originating wallet address of the transaction.
    pub from: String,
    /// The destination wallet address of the transaction.
    pub to: String,
    /// A readable version of the 'from' wallet address.
    pub from_label: String,
    /// A readable version of the 'to' wallet address.
    pub to_label: String,
    /// A thumbnail image URL of the NFT involved in the transaction.
    pub thumbnail: String,
    /// A full image URL of the NFT.
    pub image: String,
    /// The number of items of the NFT minted in the transaction.
    pub amount: f64,
    /// The blockchain address of the contract under which the NFT is minted.
    pub contract_address: String,
    /// The type of contract used for the NFT, such as ERC721.
    pub contract_type: String,
    /// The transaction fee incurred for minting the NFT.
    pub fee: f64,
    /// The name of the NFT minted.
    pub nft_name: String,
    /// The symbol associated with the NFT.
    pub nft_symbol: String,
    /// The unique token ID of the minted NFT.
    pub nft_token_id: String,
    /// The symbol of the currency used in the transaction (e.g., ETH, MATIC).
    pub currency_symbol: String,
    /// Indicates the contract standard of the NFT, such as ERC721.
    pub r#type: String,
    /// The value of the transaction. For minting, this is often zero since the NFT is being created.
    pub value: f64,
    /// The equivalent USD value of the transaction.
    pub value_usd: f64,
}

/// Represents an NFT trading transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct NftTrade {
    /// The wallet address involved in the NFT trading transaction.
    pub wallet: String,
    /// A readable label for the wallet address.
    pub wallet_label: String,
    /// The unique hash identifier of the NFT trading transaction.
    pub tx_hash: String,
    /// Specifies the type of transaction, in this case, NFT trading.
    pub tx_type: String,
    /// The blockchain network where the trading transaction occurred.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The originating wallet address of the transaction.
    pub from: String,
    /// The destination wallet address of the transaction.
    pub to: String,
    /// A thumbnail image URL of the NFT involved in the transaction.
    pub thumbnail: String,
    /// A full image URL of the NFT.
    pub image: String,
    /// Describes the action taken in the NFT trade, such as 'buy' or 'sell'.
    pub action: String,
    /// The blockchain contract address associated with the NFT.
    pub contract: String,
    /// The marketplace where the NFT trade occurred, such as OpenSea.
    pub marketplace: String,
    /// The blockchain address of the NFT involved in the trade.
    pub nft_address: String,
    /// The name of the NFT traded.
    pub nft_name: String,
    /// The symbol associated with the NFT.
    pub nft_symbol: String,
    /// The unique token ID of the NFT involved in the trade.
    pub nft_token_id: String,
    /// The price at which the NFT was traded.
    pub price: f64,
    /// The equivalent USD value of the NFT trade.
    pub price_usd: f64,
    /// The profit earned from the trade. This may be zero in some transactions.
    pub profit: f64,
    /// The symbol of the currency used in the trade, such as WETH or ETH.
    pub currency_symbol: String,
    /// The wallet address of the buyer in the trade.
    pub buyer: String,
    /// The wallet address of the seller in the trade.
    pub seller: String,
    /// The token type used in the transaction.
    pub token: String,
    /// Indicates whether this was the first interaction between the buyer and seller.
    pub first_interaction: bool,
    /// Specifies if the transaction involved a bid being accepted.
    pub bid_accepted: bool,
}

/// Represents an NFT transfer transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct NftTransfer {
    /// The wallet address involved in the NFT transfer transaction.
    pub wallet: String,
    /// A readable label for the wallet address.
    pub wallet_label: String,
    /// The unique hash identifier of the NFT transfer transaction.
    pub tx_hash: String,
    /// Specifies the type of transaction, in this case, NFT transfer.
    pub tx_type: String,
    /// The blockchain network where the transfer transaction occurred.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The originating wallet address of the transaction.
    pub from: String,
    /// The destination wallet address of the transaction.
    pub to: String,
    /// A readable version of the 'from' wallet address.
    pub from_label: String,
    /// A readable version of the 'to' wallet address.
    pub to_label: String,
    /// A thumbnail image URL of the NFT involved in the transaction.
    pub thumbnail: String,
    /// A full image URL of the NFT.
    pub image: String,
    /// The blockchain address of the contract under which the NFT is registered.
    pub contract_address: String,
    /// The type of contract used for the NFT, such as ERC721.
    pub contract_type: String,
    /// The transaction fee incurred for the transfer of the NFT.
    pub fee: f64,
    /// The name of the NFT being transferred.
    pub nft_name: String,
    /// The symbol associated with the NFT.
    pub nft_symbol: String,
    /// The unique token ID of the NFT involved in the transfer.
    pub nft_token_id: String,
    /// Indicates the contract standard of the NFT, such as ERC721.
    pub r#type: String,
    /// The value of the NFT at the time of the transfer, typically in the native cryptocurrency of the blockchain.
    pub value: f64,
}

/// Represents an NFT lending transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct NftLending {
    /// The wallet address involved in the NFT lending transaction.
    pub wallet: String,
    /// A more readable label or identifier for the wallet address.
    pub wallet_label: String,
    /// The unique hash identifier of the NFT lending transaction.
    pub tx_hash: String,
    /// Specifies the type of transaction, in this case, NFT lending.
    pub tx_type: String,
    /// The blockchain network on which the transaction was conducted.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The originating wallet address of the transaction.
    pub from: String,
    /// The destination wallet address of the transaction.
    pub to: String,
    /// A readable version of the 'from' wallet address.
    pub from_label: String,
    /// A readable version of the 'to' wallet address.
    pub to_label: String,
    /// A thumbnail image URL of the NFT involved in the transaction.
    pub thumbnail: String,
    /// A full image URL of the NFT.
    pub image: String,
    /// Describes the action taken in the NFT lending transaction, such as 'lend'.
    pub action: String,
    /// The blockchain address of the currency used in the transaction.
    pub currency_address: String,
    /// The symbol of the currency used in the transaction.
    pub currency_symbol: String,
    /// The interest rate applied in the NFT lending transaction.
    pub interest: f64,
    /// The blockchain address of the NFT involved in the transaction.
    pub nft_address: String,
    /// The name of the NFT.
    pub nft_name: String,
    /// The symbol of the NFT.
    pub nft_symbol: String,
    /// The platform or service through which the NFT lending transaction was conducted.
    pub platform: String,
    /// The unique identifier for the specific NFT within its collection.
    pub nft_token_id: String,
    /// The price at which the NFT was lent or transacted.
    pub price: f64,
    /// The equivalent USD value of the transaction price.
    pub price_usd: f64,
    /// Specifies the terms of the NFT lending agreement.
    pub terms: f64,
    /// Indicates whether the transaction involved refinancing of the NFT.
    pub refinance: bool,
}

/// Represents a bridge transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Bridge {
    /// The wallet address involved in the transaction.
    pub wallet: String,
    /// A shortened, more readable version of the wallet address.
    pub wallet_label: String,
    /// The unique hash identifier of the transaction.
    pub tx_hash: String,
    /// The type of transaction.
    pub tx_type: String,
    /// The blockchain on which the transaction occurred, like 'ethereum'.
    pub chain: String,
    /// A numeric index or identifier for the transaction.
    pub index: u32,
    /// The timestamp when the transaction occurred.
    pub timestamp: u64,
    /// The block number on the blockchain in which the transaction is included.
    pub block: u64,
    /// The originating wallet address of the transaction.
    pub from: String,
    /// The destination wallet address of the transaction.
    pub to: String,
    /// A shortened, more readable version of the originating wallet address.
    pub from_label: String,
    /// A shortened, more readable version of the destination wallet address.
    pub to_label: String,
    /// The address of the token involved in the transaction.
    pub token_address: String,
    /// The name of the token involved in the transaction.
    pub token_name: String,
    /// The symbol of the token involved in the transaction.
    pub token_symbol: String,
    /// A link to the icon of the token involved in the transaction.
    pub token_icon_link: String,
    /// The amount of the token involved in the transaction.
    pub amount: f64,
    /// The equivalent amount in USD of the tokens involved in the transaction.
    pub amount_usd: f64,
    /// The originating chain of the transaction, in cases of cross-chain activities.
    pub from_chain: String,
    /// The destination chain of the transaction, in cases of cross-chain activities.
    pub to_chain: String,
    /// The platform or service used for the transaction.
    pub platform: String,
    /// The price of the token at the time of the transaction.
    pub price: f64,
    /// Specifies the nature of the transaction, like 'withdraw', 'deposit', etc.
    pub r#type: String,
}

/// Represents a contract interaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ContractInteraction {
    /// The wallet address participating in the contract interaction.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific contract interaction.
    pub tx_hash: String,
    /// Indicates the type of transaction.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// The destination wallet address for the transaction.
    pub to: String,
    /// The address of the smart contract involved in the interaction.
    pub contract_address: String,
    /// A human-readable label or name associated with the smart contract.
    pub contract_label: String,
}

/// Represents a wrap transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Wrap {
    /// The wallet address participating in the wrap transaction.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific wrap transaction.
    pub tx_hash: String,
    /// Indicates the type of transaction, in this case, wrap related.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The decentralized exchange where the wrap transaction occurred.
    pub dex: String,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// The destination wallet address for the transaction.
    pub to: String,
    /// The action describing the wrap process (e.g., wrap or unwrap).
    pub action: String,
    /// The amount of tokens wrapped in the transaction.
    pub amount: f64,
    /// The equivalent amount in USD of the wrapped tokens.
    pub amount_usd: f64,
    /// The address of the smart contract involved in the interaction.
    pub contract_address: String,
    /// The name of the token wrapped in the transaction.
    pub name: String,
    /// The symbol of the token wrapped in the transaction.
    pub symbol: String,
    /// The price of the token in USD at the time of the transaction.
    pub token_price_usd: f64,
    /// The type of token wrapped in the transaction.
    pub token_type: String,
    /// A link to the icon of the token involved in the transaction.
    pub token_icon_link: String,
}

/// Represents a Sudo Pool transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct SudoPool {
    /// The wallet address participating in the Sudo Pool transaction.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific Sudo Pool transaction.
    pub tx_hash: String,
    /// Indicates the type of transaction, in this case, liquidity pool (LP) related.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: Option<u64>,
    /// The decentralized exchange where the Sudo Pool transaction occurred.
    pub dex: Option<String>,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// The address of the NFT contract involved in the interaction.
    pub nft_address: String,
    /// The amount of NFTs involved in the transaction.
    pub nft_amount: u32,
    /// The price of the NFT in the transaction.
    pub nft_price: f64,
    /// The symbol of the NFT in the transaction.
    pub nft_symbol: String,
    /// The destination wallet address for the transaction.
    pub to: String,
    /// The address of the first token in the LP pair.
    pub token0_address: String,
    /// The amount of the first token in the LP pair.
    pub token0_amount: f64,
    /// The equivalent amount in USD of the first token in the LP pair.
    pub token0_amount_usd: f64,
    /// The name of the first token in the LP pair.
    pub token0_name: String,
    /// The price of the first token in the LP pair in USD.
    pub token0_price_usd: f64,
    /// The symbol of the first token in the LP pair.
    pub token0_symbol: String,
    /// A link to the icon of the first token involved in the transaction.
    pub token0_icon_link: String,
}

/// Represents a reward transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Reward {
    /// The wallet address participating in the reward transaction.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific reward transaction.
    pub tx_hash: String,
    /// Indicates the type of transaction, in this case, reward related.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The address of the token involved in the transaction.
    pub address: String,
    /// The amount of tokens involved in the transaction.
    pub amount: f64,
    /// The equivalent amount in USD of the tokens involved in the transaction.
    pub amount_usd: f64,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// The name of the token involved in the transaction.
    pub name: String,
    /// The price of the token in USD.
    pub price_usd: f64,
    /// The symbol of the token involved in the transaction.
    pub symbol: String,
}

/// Represents a staking transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Staking {
    /// The wallet address participating in the staking transaction.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific staking transaction.
    pub tx_hash: String,
    /// Indicates the type of transaction, in this case, staking related.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// The destination wallet address for the transaction.
    pub to: String,
    /// A human-readable label or name associated with the originating wallet.
    pub from_label: String,
    /// A human-readable label or name associated with the destination wallet.
    pub to_label: String,
    /// The amount of tokens staked in the transaction.
    pub amount: f64,
    /// The equivalent amount in USD of the staked tokens.
    pub amount_usd: f64,
    /// The price of the token in USD.
    pub token_price_usd: f64,
    /// The address of the smart contract involved in the interaction.
    pub contract_address: String,
    /// The symbol of the token staked in the transaction.
    pub symbol: String,
    /// The name of the token staked in the transaction.
    pub name: String,
    /// The action taken in the staking transaction (e.g., 'stake', 'unstake').
    pub action: String,
}

/// Represents a Perpetual transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Perp {
    /// The wallet address participating in the Perpetual transaction.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific Perpetual transaction.
    pub tx_hash: String,
    /// Indicates the type of transaction, in this case, Perpetual related.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The action taken in the Perpetual event.
    pub action: String,
    /// The equivalent amount in USD of the tokens involved in the transaction.
    pub amount_usd: f64,
    /// The average price of the tokens involved in the transaction.
    pub average_price: f64,
    /// The address of the base token involved in the transaction.
    pub base_token_address: String,
    /// The amount of base tokens involved in the transaction.
    pub base_token_amount: f64,
    /// The symbol of the base token involved in the transaction.
    pub base_token_symbol: String,
    /// The decentralized exchange where the Perpetual transaction occurred.
    pub dex: String,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// Indicates whether the transaction was a liquidation.
    pub liquidation: bool,
    /// The price at which the liquidation occurred.
    pub liquidation_price: f64,
    /// The destination wallet address for the transaction.
    pub to: String,
    /// The direction of the trade in the Perpetual transaction (e.g., 'long', 'short').
    pub trade_direction: String,
    /// Additional details about the Perpetual transaction.
    pub perp_details: String,
    /// The address of the first token in the LP pair.
    pub token0_address: String,
    /// The amount of the first token in the LP pair.
    pub token0_amount: f64,
    /// The equivalent amount in USD of the first token in the LP pair.
    pub token0_amount_usd: f64,
    /// The name of the first token in the LP pair.
    pub token0_name: String,
    /// The price of the first token in the LP pair in USD.
    pub token0_price_usd: f64,
    /// The symbol of the first token in the LP pair.
    pub token0_symbol: String,
    /// A link to the icon of the first token involved in the transaction.
    pub token0_icon_link: String,
    /// The address of the second token in the LP pair.
    pub token1_address: String,
    /// The amount of the second token in the LP pair.
    pub token1_amount: f64,
    /// The equivalent amount in USD of the second token in the LP pair.
    pub token1_amount_usd: f64,
    /// The name of the second token in the LP pair.
    pub token1_name: String,
    /// The price of the second token in the LP pair in USD.
    pub token1_price_usd: f64,
    /// The symbol of the second token in the LP pair.
    pub token1_symbol: String,
    /// A link to the icon of the second token involved in the transaction.
    pub token1_icon_link: String,
    /// The realized profit and loss of the Perpetual transaction.
    pub realized_pnl: f64,
    /// Indicates whether the Perpetual transaction involves an NFT.
    pub is_nft_perp: bool,
    /// The size of the position in the Perpetual transaction.
    pub position_size: Option<f64>,
    /// The equivalent amount in USD of the position size.
    pub position_size_usd: Option<f64>,
    /// The leverage used in the Perpetual transaction.
    pub leverage: Option<f64>,
    /// The unrealized profit and loss of the Perpetual transaction.
    pub unrealized_pnl: Option<f64>,
}

/// Represents a flashloan transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Flashloan {
    /// The wallet address participating in the flashloan transaction.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific flashloan transaction.
    pub tx_hash: String,
    /// Indicates the type of transaction, in this case, flashloan related.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The address of the token involved in the transaction.
    pub address: String,
    /// The amount of tokens involved in the transaction.
    pub amount: f64,
    /// The equivalent amount in USD of the tokens involved in the transaction.
    pub amount_usd: f64,
    /// The decentralized exchange (DEX) where the flashloan transaction took place.
    pub dex: String,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// The health factor of the wallet after the flashloan transaction.
    pub health_factor: f64,
    /// The name of the token involved in the transaction.
    pub name: String,
    /// The platform where the flashloan transaction took place.
    pub platform: String,
    /// The price of the token in USD.
    pub price_usd: f64,
    /// The symbol of the token involved in the transaction.
    pub symbol: String,
    /// A link to the icon of the token involved in the transaction.
    pub token_icon_link: String,
}

/// Represents a contract creation transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ContractCreation {
    /// The wallet address participating in the contract creation transaction.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific contract creation transaction.
    pub tx_hash: String,
    /// Indicates the type of transaction, in this case, contract creation.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The equivalent amount in USD of the wrapped tokens.
    pub amount_usd: f64,
    /// The address of the smart contract involved in the interaction.
    pub contract_address: String,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// A human-readable label or name associated with the originating wallet.
    pub from_label: String,
}

/// Represents an NFT liquidation transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct NftLiquidation {
    /// The wallet address participating in the NFT liquidation transaction.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific NFT liquidation transaction.
    pub tx_hash: String,
    /// Indicates the type of transaction, in this case, NFT liquidation related.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The address of the NFT contract involved in the interaction.
    pub contract_address: String,
    /// The address of the currency involved in the transaction.
    pub currency_address: String,
    /// The symbol of the currency involved in the transaction.
    pub currency_symbol: String,
    /// The decentralized exchange where the NFT liquidation transaction occurred.
    pub dex: String,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// The address of the NFT contract involved in the interaction.
    pub nft_address: String,
    /// The name of the NFT in the transaction.
    pub nft_name: String,
    /// The symbol of the NFT in the transaction.
    pub nft_symbol: String,
    /// The platform where the NFT liquidation transaction took place.
    pub platform: String,
    /// The price of the NFT in the transaction.
    pub price: f64,
    /// The price of the NFT in USD.
    pub price_usd: f64,
    /// The destination wallet address for the transaction.
    pub to: String,
    /// The unique identifier of the NFT in the transaction.
    pub token_id: String,
}

/// Represents an option event transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct OptionType {
    /// The wallet address participating in the option event.
    pub wallet: String,
    /// A human-readable label or name associated with the wallet, such as an ENS name.
    pub wallet_label: String,
    /// The unique transaction hash identifying this specific option event.
    pub tx_hash: String,
    /// Indicates the type of transaction, in this case, option-related.
    pub tx_type: String,
    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The action taken in the option event.
    pub action: String,
    /// The amount of tokens involved in the transaction.
    pub amount: f64,
    /// The asset involved in the option event.
    pub asset: String,
    /// The decentralized exchange (DEX) where the option event took place.
    pub dex: String,
    /// The direction of the option event (e.g., call or put).
    pub direction: String,
    /// The expiry date of the option.
    pub expiry: String,
    /// The originating wallet address for the transaction.
    pub from: String,
    /// The price of the option in USD.
    pub option_price_usd: f64,
    /// The status of the option position.
    pub position_status: String,
    /// The spot price of the asset in USD.
    pub spot_price_usd: f64,
    /// The status of the option event.
    pub status: String,
    /// The strike price of the option in USD.
    pub strike_price_usd: f64,
    /// The destination wallet address for the transaction.
    pub to: String,
    /// The type of option event (e.g., exercise, sell).
    pub r#type: String,
}

/// Represents an NFT sweep transaction.
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct NftSweep {
    /// The wallet address involved in the NFT sweep transaction.
    pub wallet: String,
    /// A readable label for the wallet address.
    pub wallet_label: String,
    /// The unique hash identifier of the NFT sweep transaction.
    pub tx_hash: String,
    /// Specifies the type of transaction, in this case, NFT sweep related.
    pub tx_type: String,
    /// The blockchain network where the sweep transaction occurred.
    pub chain: String,
    /// A numerical index or identifier for the transaction.
    pub index: u32,
    /// The timestamp marking when the transaction was executed.
    pub timestamp: u64,
    /// The block number on the blockchain where this transaction is recorded.
    pub block: u64,
    /// The originating wallet address of the transaction.
    pub from: String,
    /// The destination wallet address of the transaction.
    pub to: String,
    /// A thumbnail image URL of the NFT involved in the transaction.
    pub thumbnail: String,
    /// A full image URL of the NFT.
    pub image: String,
    /// Describes the action taken in the NFT sweep, such as 'buy' or 'sell'.
    pub action: String,
    /// The blockchain contract address associated with the NFT.
    pub contract: String,
    /// The marketplace where the NFT sweep occurred, such as OpenSea.
    pub marketplace: String,
    /// The blockchain address of the NFT involved in the sweep.
    pub nft_address: String,
    /// The name of the NFT swept.
    pub nft_name: String,
    /// The symbol associated with the NFT.
    pub nft_symbol: String,
    /// The unique token ID of the NFT involved in the sweep.
    pub nft_token_id: String,
    /// The price at which the NFT was traded.
    pub price: f64,
    /// The equivalent USD value of the NFT sweep.
    pub price_usd: f64,
    /// The profit earned from the trade. This may be zero in some transactions.
    pub profit: f64,
    /// The symbol of the currency used in the trade, such as WETH or ETH.
    pub currency_symbol: String,
    /// The wallet address of the buyer in the trade.
    pub buyer: String,
    /// The wallet address of the seller in the trade.
    pub seller: String,
    /// The token type used in the transaction.
    pub token: String,
    /// Indicates whether this was the first interaction between the buyer and seller.
    pub first_interaction: bool,
    /// Specifies if the transaction involved a bid being accepted.
    pub bid_accepted: bool,
}