Skip to main content

tonapi/rest_api/
models.rs

1use serde::Deserialize;
2use std::collections::HashMap;
3
4#[derive(Debug, Deserialize)]
5#[serde(untagged)]
6pub enum ApiResponse<T> {
7    Success {
8        #[serde(flatten)]
9        result: T,
10    },
11    Error {
12        error: String,
13    },
14}
15
16#[derive(Debug, Deserialize)]
17pub struct Accounts {
18    pub accounts: Vec<Account>,
19}
20
21#[derive(Debug, Deserialize)]
22pub struct Account {
23    pub address: String,
24    pub balance: i64,
25    pub currencies_balance: Option<HashMap<String, f64>>,
26    pub last_activity: i64,
27    pub status: AccountStatus,
28    pub interfaces: Option<Vec<String>>,
29    pub name: Option<String>,
30    pub is_scam: Option<bool>,
31    pub icon: Option<String>,
32    pub memo_required: Option<bool>,
33    pub get_methods: Vec<String>,
34    pub is_suspended: Option<bool>,
35    pub is_wallet: bool,
36}
37
38#[derive(Debug, Deserialize)]
39#[serde(rename_all = "lowercase")]
40pub enum AccountStatus {
41    Nonexist,
42    Uninit,
43    Active,
44    Frozen,
45}
46
47#[derive(Debug, Deserialize)]
48pub struct DomainNames {
49    pub domains: Vec<String>,
50}
51
52#[derive(Debug, Deserialize)]
53pub struct JettonBalances {
54    pub balances: Vec<JettonBalance>,
55}
56
57#[derive(Debug, Deserialize)]
58pub struct JettonBalance {
59    pub balance: String,
60    pub price: Option<TokenRates>,
61    pub wallet_address: AccountAddress,
62    pub jetton: JettonPreview,
63    pub extensions: Option<Vec<String>>,
64    pub lock: Option<Lock>,
65}
66
67#[derive(Debug, Deserialize)]
68pub struct TokenRates {
69    pub prices: Option<HashMap<String, f64>>,
70    pub diff_24h: Option<HashMap<String, String>>,
71    pub diff_7d: Option<HashMap<String, String>>,
72    pub diff_30d: Option<HashMap<String, String>>,
73}
74
75#[derive(Debug, Deserialize)]
76pub struct AccountAddress {
77    pub address: String,
78    pub name: Option<String>,
79    pub is_scam: bool,
80    pub icon: Option<String>,
81    pub is_wallet: bool,
82}
83
84#[derive(Debug, Deserialize)]
85pub struct JettonPreview {
86    pub address: String,
87    pub name: String,
88    pub symbol: String,
89    pub decimals: u32,
90    pub image: String,
91    pub verification: JettonVerificationType,
92}
93
94#[derive(Debug, Deserialize)]
95#[serde(rename_all = "lowercase")]
96pub enum JettonVerificationType {
97    Whitelist,
98    GrayList,
99    Blacklist,
100    None,
101}
102
103#[derive(Debug, Deserialize)]
104pub struct Lock {
105    pub amount: String,
106    pub till: i64, // Unix timestamp
107}
108
109#[derive(Debug, Deserialize)]
110pub struct AccountEvents {
111    pub events: Vec<AccountEvent>,
112    pub next_from: i64,
113}
114
115#[derive(Debug, Deserialize)]
116pub struct AccountEvent {
117    pub event_id: String,
118    pub timestamp: i64,
119    pub actions: Vec<Action>,
120    pub account: AccountAddress,
121    pub is_scam: bool,
122    pub lt: i64,
123    pub in_progress: bool,
124    pub extra: i64,
125}
126
127#[derive(Debug, Deserialize)]
128pub struct Action {
129    pub r#type: ActionType,
130    pub status: ActionStatus,
131    pub simple_preview: ActionSimplePreview,
132    pub base_transactions: Vec<String>,
133    pub ton_transfer: Option<TonTransferAction>,
134    pub contract_deploy: Option<ContractDeployAction>,
135    pub jetton_transfer: Option<JettonTransferAction>,
136    pub jetton_burn: Option<JettonBurnAction>,
137    pub jetton_mint: Option<JettonMintAction>,
138    pub nft_item_transfer: Option<NftItemTransferAction>,
139    pub subscribe: Option<SubscriptionAction>,
140    pub unsubscribe: Option<UnSubscriptionAction>,
141    pub auction_bid: Option<AuctionBidAction>,
142    pub nft_purchase: Option<NftPurchaseAction>,
143    pub deposit_stake: Option<DepositStakeAction>,
144    pub withdraw_stake: Option<WithdrawStakeAction>,
145    pub withdraw_stake_request: Option<WithdrawStakeRequestAction>,
146    pub elections_deposit_stake: Option<ElectionsDepositStakeAction>,
147    pub elections_recover_stake: Option<ElectionsRecoverStakeAction>,
148    pub jetton_swap: Option<JettonSwapAction>,
149    pub smart_contract_exec: Option<SmartContractAction>,
150    pub domain_renew: Option<DomainRenewAction>,
151    pub inscription_transfer: Option<InscriptionTransferAction>,
152    pub inscription_mint: Option<InscriptionMintAction>,
153}
154
155#[derive(Debug, Deserialize)]
156pub enum ActionType {
157    TonTransfer,
158    JettonTransfer,
159    JettonBurn,
160    JettonMint,
161    NftItemTransfer,
162    ContractDeploy,
163    Subscribe,
164    UnSubscribe,
165    AuctionBid,
166    NftPurchase,
167    DepositStake,
168    WithdrawStake,
169    WithdrawStakeRequest,
170    JettonSwap,
171    SmartContractExec,
172    ElectionsRecoverStake,
173    ElectionsDepositStake,
174    DomainRenew,
175    InscriptionTransfer,
176    InscriptionMint,
177    Unknown,
178}
179
180#[derive(Debug, Deserialize)]
181#[serde(rename_all = "lowercase")]
182pub enum ActionStatus {
183    Ok,
184    Failed,
185}
186
187#[derive(Debug, Deserialize)]
188pub struct ActionSimplePreview {
189    pub name: String,
190    pub description: String,
191    pub action_image: Option<String>,
192    pub value: Option<String>,
193    pub value_image: Option<String>,
194    pub accounts: Vec<AccountAddress>,
195}
196
197#[derive(Debug, Deserialize)]
198pub struct TonTransferAction {
199    pub sender: AccountAddress,
200    pub recipient: AccountAddress,
201    pub amount: i64,
202    pub comment: Option<String>,
203    pub encrypted_comment: Option<EncryptedComment>,
204    pub refund: Option<Refund>,
205}
206
207#[derive(Debug, Deserialize)]
208pub struct EncryptedComment {
209    pub encryption_type: String,
210    pub cipher_text: String,
211}
212
213#[derive(Debug, Deserialize)]
214pub struct Refund {
215    pub r#type: RefundType,
216    pub origin: String,
217}
218
219#[derive(Debug, Deserialize)]
220pub enum RefundType {
221    #[serde(rename = "DNS.ton")]
222    DnsTon,
223    #[serde(rename = "DNS.tg")]
224    DnsTg,
225    #[serde(rename = "GetGems")]
226    GetGems,
227}
228
229#[derive(Debug, Deserialize)]
230pub struct ContractDeployAction {
231    pub address: String,
232    pub interfaces: Vec<String>,
233}
234
235#[derive(Debug, Deserialize)]
236pub struct JettonTransferAction {
237    pub sender: AccountAddress,
238    pub recipient: AccountAddress,
239    pub senders_wallet: String,
240    pub recipients_wallet: String,
241    pub amount: String,
242    pub comment: Option<String>,
243    pub encrypted_comment: Option<EncryptedComment>,
244    pub refund: Option<Refund>,
245    pub jetton: JettonPreview,
246}
247
248#[derive(Debug, Deserialize)]
249pub struct JettonBurnAction {
250    pub sender: AccountAddress,
251    pub senders_wallet: String,
252    pub amount: String,
253    pub jetton: JettonPreview,
254}
255
256#[derive(Debug, Deserialize)]
257pub struct JettonMintAction {
258    pub recipient: AccountAddress,
259    pub recipients_wallet: String,
260    pub amount: String,
261    pub jetton: JettonPreview,
262}
263
264#[derive(Debug, Deserialize)]
265pub struct NftItemTransferAction {
266    pub sender: Option<AccountAddress>,
267    pub recipient: Option<AccountAddress>,
268    pub nft: String,
269    pub comment: Option<String>,
270    pub encrypted_comment: Option<EncryptedComment>,
271    pub payload: Option<String>,
272    pub refund: Option<Refund>,
273}
274
275#[derive(Debug, Deserialize)]
276pub struct SubscriptionAction {
277    pub subscriber: AccountAddress,
278    pub subscription: String,
279    pub beneficiary: AccountAddress,
280    pub amount: i64,
281    pub initial: bool,
282}
283
284#[derive(Debug, Deserialize)]
285pub struct UnSubscriptionAction {
286    pub subscriber: AccountAddress,
287    pub subscription: String,
288    pub beneficiary: AccountAddress,
289}
290
291#[derive(Debug, Deserialize)]
292pub struct AuctionBidAction {
293    pub auction_type: AuctionType,
294    pub amount: Price,
295    pub nft: NftItem,
296    pub bidder: AccountAddress,
297    pub auction: AccountAddress,
298}
299
300#[derive(Debug, Deserialize)]
301pub enum AuctionType {
302    #[serde(rename = "DNS.ton")]
303    DnsTon,
304    #[serde(rename = "DNS.tg")]
305    DnsTg,
306    #[serde(rename = "NUMBER.tg")]
307    NumberTg,
308    #[serde(rename = "getgems")]
309    Getgems,
310}
311
312#[derive(Debug, Deserialize)]
313pub struct Price {
314    pub value: String,
315    pub token_name: String,
316}
317
318#[derive(Debug, Deserialize)]
319pub struct NftItem {
320    pub address: String,
321    pub index: i64,
322    pub owner: Option<AccountAddress>,
323    pub collection: Option<Collection>,
324    pub verified: bool,
325    pub metadata: HashMap<String, serde_json::Value>,
326    pub sale: Option<Sale>,
327    pub previews: Option<Vec<ImagePreview>>,
328    pub dns: Option<String>,
329    pub approved_by: Option<NftApprovedBy>,
330    pub include_cnft: Option<bool>,
331    pub trust: Option<TrustType>,
332}
333
334#[derive(Debug, Deserialize)]
335pub struct Collection {
336    pub address: String,
337    pub name: String,
338    pub description: String,
339}
340
341#[derive(Debug, Deserialize)]
342pub struct Sale {
343    pub address: String,
344    pub market: AccountAddress,
345    pub owner: Option<AccountAddress>,
346    pub price: Price,
347}
348
349#[derive(Debug, Deserialize)]
350pub struct ImagePreview {
351    pub resolution: String,
352    pub url: String,
353}
354
355#[derive(Debug, Deserialize)]
356pub enum NftApprovalSource {
357    #[serde(rename = "getgems")]
358    Getgems,
359    #[serde(rename = "tonkeeper")]
360    Tonkeeper,
361    #[serde(rename = "ton.diamonds")]
362    TonDiamonds,
363}
364
365#[derive(Debug, Deserialize)]
366pub struct NftApprovedBy(pub Vec<NftApprovalSource>);
367
368#[derive(Debug, Deserialize)]
369#[serde(rename_all = "lowercase")]
370pub enum TrustType {
371    Whitelist,
372    Graylist,
373    Blacklist,
374    None,
375}
376
377#[derive(Debug, Deserialize)]
378pub struct NftPurchaseAction {
379    pub auction_type: AuctionType,
380    pub amount: Price,
381    pub nft: NftItem,
382    pub seller: AccountAddress,
383    pub buyer: AccountAddress,
384}
385
386#[derive(Debug, Deserialize)]
387pub struct DepositStakeAction {
388    pub amount: i64,
389    pub staker: AccountAddress,
390    pub pool: AccountAddress,
391    pub implementation: PoolImplementationType,
392}
393
394#[derive(Debug, Deserialize)]
395pub enum PoolImplementationType {
396    #[serde(rename = "whales")]
397    Whales,
398    #[serde(rename = "tf")]
399    Tf,
400    #[serde(rename = "liquidTF")]
401    LiquidTF,
402}
403
404#[derive(Debug, Deserialize)]
405pub struct WithdrawStakeAction {
406    pub amount: i64,
407    pub staker: AccountAddress,
408    pub pool: AccountAddress,
409    pub implementation: PoolImplementationType,
410}
411
412#[derive(Debug, Deserialize)]
413pub struct WithdrawStakeRequestAction {
414    pub amount: Option<i64>,
415    pub staker: AccountAddress,
416    pub pool: AccountAddress,
417    pub implementation: PoolImplementationType,
418}
419
420#[derive(Debug, Deserialize)]
421pub struct ElectionsDepositStakeAction {
422    pub amount: i64,
423    pub staker: AccountAddress,
424}
425
426#[derive(Debug, Deserialize)]
427pub struct ElectionsRecoverStakeAction {
428    pub amount: i64,
429    pub staker: AccountAddress,
430}
431
432#[derive(Debug, Deserialize)]
433pub struct JettonSwapAction {
434    pub dex: DexType,
435    pub amount_in: String,
436    pub amount_out: String,
437    pub ton_in: Option<i64>,
438    pub ton_out: Option<i64>,
439    pub user_wallet: AccountAddress,
440    pub router: AccountAddress,
441    pub jetton_master_in: Option<JettonPreview>,
442    pub jetton_master_out: Option<JettonPreview>,
443}
444
445#[derive(Debug, Deserialize)]
446#[serde(rename_all = "lowercase")]
447pub enum DexType {
448    Stonfi,
449    Dedust,
450    Megatonfi,
451}
452
453#[derive(Debug, Deserialize)]
454pub struct SmartContractAction {
455    pub executor: AccountAddress,
456    pub contract: AccountAddress,
457    pub ton_attached: i64, // Amount in nanotons
458    pub operation: String,
459    pub payload: Option<String>,
460    pub refund: Option<Refund>,
461}
462
463#[derive(Debug, Deserialize)]
464pub struct DomainRenewAction {
465    pub domain: String,
466    pub contract_address: String, // Address in string format
467    pub renewer: AccountAddress,
468}
469
470#[derive(Debug, Deserialize)]
471pub struct InscriptionTransferAction {
472    pub sender: AccountAddress,
473    pub recipient: AccountAddress,
474    pub amount: String, // Amount is in string format as per the example
475    pub comment: Option<String>,
476    #[serde(rename = "type")]
477    pub transfer_type: String, // The type field is renamed to transfer_type to avoid keyword conflict
478    pub ticker: String,
479    pub decimals: i32,
480}
481
482#[derive(Debug, Deserialize)]
483pub struct InscriptionMintAction {
484    #[serde(rename = "type")]
485    pub mint_type: String, // The type field is renamed to mint_type to avoid keyword conflict
486    pub ticker: String,
487    pub recipient: AccountAddress,
488    pub amount: String, // Amount is in string format as per the example
489    pub decimals: i32,
490}
491
492#[derive(Debug, Deserialize)]
493pub struct NftItems {
494    pub nft_items: Vec<NftItem>,
495}
496
497#[derive(Debug, Deserialize)]
498pub struct TraceIds {
499    pub traces: Vec<TraceId>,
500}
501
502#[derive(Debug, Deserialize)]
503pub struct TraceId {
504    pub id: String,
505    pub utime: i64,
506}
507
508#[derive(Debug, Deserialize)]
509pub struct Subscriptions {
510    pub subscriptions: Vec<Subscription>,
511}
512
513#[derive(Debug, Deserialize)]
514pub struct Subscription {
515    pub address: String,
516    pub wallet_address: String,
517    pub beneficiary_address: String,
518    pub amount: i64,
519    pub period: i64,
520    pub start_time: i64,
521    pub timeout: i64,
522    pub last_payment_time: i64,
523    pub last_request_time: i64,
524    pub subscription_id: i64,
525    pub failed_attempts: i32,
526}
527
528#[derive(Debug, Deserialize)]
529pub struct FoundAccounts {
530    pub addresses: Vec<FoundAccountAddress>,
531}
532
533#[derive(Debug, Deserialize)]
534pub struct FoundAccountAddress {
535    pub address: String,
536    pub name: String,
537    pub preview: String,
538}
539
540#[derive(Debug, Deserialize)]
541pub struct DnsExpiring {
542    pub items: Vec<DnsExpiringItem>,
543}
544
545#[derive(Debug, Deserialize)]
546pub struct DnsExpiringItem {
547    pub expiring_at: i64,
548    pub name: String,
549    pub dns_item: NftItem,
550}
551
552#[derive(Debug, Deserialize)]
553pub struct PublicKey {
554    pub public_key: String,
555}
556
557#[derive(Debug, Deserialize)]
558pub struct Multisigs {
559    pub multisigs: Vec<Multisig>,
560}
561
562#[derive(Debug, Deserialize)]
563pub struct Multisig {
564    pub address: String,
565    pub seqno: i64,
566    pub threshold: i32,
567    pub signers: Vec<String>,
568    pub proposers: Vec<String>,
569    pub orders: Vec<MultisigOrder>,
570}
571
572#[derive(Debug, Deserialize)]
573pub struct MultisigOrder {
574    pub address: String,
575    pub order_seqno: i64,
576    pub threshold: i32,
577    pub sent_for_execution: bool,
578    pub signers: Vec<String>,
579    pub approvals_num: i32,
580    pub expiration_date: i64,
581    pub risk: Risk,
582}
583
584#[derive(Debug, Deserialize)]
585pub struct Risk {
586    pub transfer_all_remaining_balance: bool,
587    pub ton: i64,
588    pub jettons: Vec<JettonQuantity>,
589    pub nfts: Vec<NftItem>,
590}
591
592#[derive(Debug, Deserialize)]
593pub struct JettonQuantity {
594    pub quantity: String,
595    pub wallet_address: AccountAddress,
596    pub jetton: JettonPreview,
597}
598
599#[derive(Debug, Deserialize)]
600pub struct BalanceChange {
601    pub balance_change: i64,
602}
603
604#[derive(Debug, Deserialize)]
605pub struct NftCollections {
606    pub nft_collections: Vec<NftCollection>,
607}
608
609#[derive(Debug, Deserialize)]
610pub struct NftCollection {
611    pub address: String,
612    pub next_item_index: i64,
613    pub owner: Option<AccountAddress>,
614    pub raw_collection_content: String,
615    pub metadata: Option<HashMap<String, serde_json::Value>>,
616    pub previews: Option<Vec<ImagePreview>>,
617    pub approved_by: NftApprovedBy,
618}
619
620#[derive(Debug, Deserialize)]
621pub struct Jettons {
622    pub jettons: Vec<JettonInfo>,
623}
624
625#[derive(Debug, Deserialize)]
626pub struct JettonInfo {
627    pub mintable: bool,
628    pub total_supply: String,
629    pub admin: Option<AccountAddress>,
630    pub metadata: JettonMetadata,
631    pub verification: JettonVerificationType,
632    pub holders_count: i32,
633}
634
635#[derive(Debug, Deserialize)]
636pub struct JettonMetadata {
637    pub address: String,
638    pub name: String,
639    pub symbol: String,
640    pub decimals: String,
641    pub image: Option<String>,
642    pub description: Option<String>,
643    pub social: Option<Vec<String>>,
644    pub websites: Option<Vec<String>>,
645    pub catalogs: Option<Vec<String>>,
646}
647
648#[derive(Debug, Deserialize)]
649pub struct JettonHolders {
650    pub addresses: Vec<JettonHolderAddress>,
651    pub total: i64,
652}
653
654#[derive(Debug, Deserialize)]
655pub struct JettonHolderAddress {
656    pub address: String,
657    pub owner: AccountAddress,
658    pub balance: String,
659}
660
661#[derive(Debug, Deserialize)]
662pub struct JettonTransferPayload {
663    pub custom_payload: Option<String>,
664    pub state_init: Option<String>,
665}
666
667#[derive(Debug, Deserialize)]
668pub struct Event {
669    pub event_id: String,
670    pub timestamp: i64,
671    pub actions: Vec<Action>,
672    pub value_flow: Vec<ValueFlow>,
673    pub is_scam: bool,
674    pub lt: i64,
675    pub in_progress: bool,
676}
677
678#[derive(Debug, Deserialize)]
679pub struct ValueFlow {
680    pub account: AccountAddress,
681    pub ton: i64,
682    pub fees: i64,
683    pub jettons: Option<Vec<JettonFlow>>,
684}
685
686#[derive(Debug, Deserialize)]
687pub struct JettonFlow {
688    pub account: AccountAddress,
689    pub jetton: JettonPreview,
690    pub quantity: i64,
691}
692
693#[derive(Debug, Deserialize)]
694pub struct DomainInfo {
695    pub name: String,
696    pub expiring_at: Option<i64>,
697    pub item: Option<NftItem>,
698}
699
700#[derive(Debug, Deserialize)]
701pub struct DnsRecord {
702    pub wallet: Option<WalletDns>,
703    pub next_resolver: Option<String>,
704    pub sites: Vec<String>,
705    pub storage: Option<String>,
706}
707
708#[derive(Debug, Deserialize)]
709pub struct WalletDns {
710    pub address: String,
711    pub account: AccountAddress,
712    pub is_wallet: bool,
713    pub has_method_pubkey: bool,
714    pub has_method_seqno: bool,
715    pub names: Vec<String>,
716}
717
718#[derive(Debug, Deserialize)]
719pub struct DomainBids {
720    pub data: Vec<DomainBid>,
721}
722
723#[derive(Debug, Deserialize)]
724pub struct DomainBid {
725    pub success: bool,
726    pub value: i64,
727    #[serde(rename = "txTime")]
728    pub tx_time: i64,
729    #[serde(rename = "txHash")]
730    pub tx_hash: String,
731    pub bidder: AccountAddress,
732}
733
734#[derive(Debug, Deserialize)]
735pub struct Auctions {
736    pub data: Vec<Auction>,
737    pub total: i64,
738}
739
740#[derive(Debug, Deserialize)]
741pub struct Auction {
742    pub domain: String,
743    pub owner: String,
744    pub price: i64,
745    pub bids: i64,
746    pub date: i64,
747}
748
749#[derive(Debug, Deserialize)]
750pub struct Dump {
751    pub dump: String,
752}
753
754#[derive(Debug, Deserialize)]
755pub struct AuthToken {
756    pub token: String,
757}
758
759#[derive(Debug, Deserialize)]
760pub struct AccountSeqno {
761    pub seqno: i64,
762}
763
764#[derive(Debug, Deserialize)]
765pub struct MessageConsequences {
766    pub trace: Trace,
767    pub risk: Risk,
768    pub event: AccountEvent,
769}
770
771#[derive(Debug, Deserialize)]
772pub struct Trace {
773    pub transaction: Transaction,
774    pub interfaces: Vec<String>,
775    pub children: Option<Vec<Trace>>,
776    pub emulated: Option<bool>,
777}
778
779#[derive(Debug, Deserialize)]
780pub struct Transaction {
781    pub hash: String,
782    pub lt: i64,
783    pub account: AccountAddress,
784    pub success: bool,
785    pub utime: i64,
786    pub orig_status: AccountStatus,
787    pub end_status: AccountStatus,
788    pub total_fees: i64,
789    pub end_balance: i64,
790    pub transaction_type: TransactionType,
791    pub state_update_old: String,
792    pub state_update_new: String,
793    pub in_msg: Option<Message>,
794    pub out_msgs: Vec<Message>,
795    pub block: String,
796    pub prev_trans_hash: Option<String>,
797    pub prev_trans_lt: Option<i64>,
798    pub compute_phase: Option<ComputePhase>,
799    pub storage_phase: Option<StoragePhase>,
800    pub credit_phase: Option<CreditPhase>,
801    pub action_phase: Option<ActionPhase>,
802    pub bounce_phase: Option<BouncePhaseType>,
803    pub aborted: bool,
804    pub destroyed: bool,
805    pub raw: String,
806}
807
808#[derive(Debug, Deserialize)]
809pub enum TransactionType {
810    TransOrd,
811    TransTickTock,
812    TransSplitPrepare,
813    TransSplitInstall,
814    TransMergePrepare,
815    TransMergeInstall,
816    TransStorage,
817}
818
819#[derive(Debug, Deserialize)]
820pub struct Message {
821    pub msg_type: MsgType,
822    pub created_lt: i64,
823    pub ihr_disabled: bool,
824    pub bounce: bool,
825    pub bounced: bool,
826    pub value: i64,
827    pub fwd_fee: i64,
828    pub ihr_fee: i64,
829    pub destination: Option<AccountAddress>,
830    pub source: Option<AccountAddress>,
831    pub import_fee: i64,
832    pub created_at: i64,
833    pub op_code: Option<String>,
834    pub init: Option<StateInit>,
835    pub hash: String,
836    pub raw_body: Option<String>,
837    pub decoded_op_name: Option<String>,
838    pub decoded_body: Option<serde_json::Value>,
839}
840
841#[derive(Debug, Deserialize)]
842#[serde(rename_all = "snake_case")]
843pub enum MsgType {
844    IntMsg,
845    ExtInMsg,
846    ExtOutMsg,
847}
848
849#[derive(Debug, Deserialize)]
850pub struct StateInit {
851    pub boc: String,
852    pub interfaces: Vec<String>,
853}
854
855#[derive(Debug, Deserialize)]
856pub struct ComputePhase {
857    pub skipped: bool,
858    pub skip_reason: Option<ComputeSkipReason>,
859    pub success: Option<bool>,
860    pub gas_fees: Option<i64>,
861    pub gas_used: Option<i64>,
862    pub vm_steps: Option<i32>,
863    pub exit_code: Option<i32>,
864    pub exit_code_description: Option<String>,
865}
866
867#[derive(Debug, Deserialize)]
868#[serde(rename_all = "snake_case")]
869pub enum ComputeSkipReason {
870    CskipNoState,
871    CskipBadState,
872    CskipNoGas,
873}
874
875#[derive(Debug, Deserialize)]
876pub struct StoragePhase {
877    pub fees_collected: i64,
878    pub fees_due: Option<i64>,
879    pub status_change: AccStatusChange,
880}
881
882#[derive(Debug, Deserialize)]
883#[serde(rename_all = "snake_case")]
884pub enum AccStatusChange {
885    AcstUnchanged,
886    AcstFrozen,
887    AcstDeleted,
888}
889
890#[derive(Debug, Deserialize)]
891pub struct CreditPhase {
892    pub fees_collected: i64,
893    pub credit: i64,
894}
895
896#[derive(Debug, Deserialize)]
897pub struct ActionPhase {
898    pub success: bool,
899    pub result_code: i32,
900    pub total_actions: i32,
901    pub skipped_actions: i32,
902    pub fwd_fees: i64,
903    pub total_fees: i64,
904    pub result_code_description: Option<String>,
905}
906
907#[derive(Debug, Deserialize)]
908pub enum BouncePhaseType {
909    #[serde(rename = "TrPhaseBounceNegfunds")]
910    TrPhaseBounceNegFunds,
911    #[serde(rename = "TrPhaseBounceNofunds")]
912    TrPhaseBounceNoFunds,
913    TrPhaseBounceOk,
914}
915
916#[derive(Debug, Deserialize)]
917pub struct Rates {
918    pub rates: TokenRates,
919}
920
921#[derive(Debug, Deserialize)]
922pub struct RateChart {
923    pub points: Vec<Point>,
924}
925
926#[derive(Debug, Deserialize)]
927pub struct Point(
928    pub u64, // timestamp
929    pub f64, // value
930);
931
932#[derive(Debug, Deserialize)]
933pub struct MarketRates {
934    pub markets: Vec<MarketTonRates>,
935}
936
937#[derive(Debug, Deserialize)]
938pub struct MarketTonRates {
939    pub market: String,
940    pub usd_price: f64,
941    pub last_date_update: i64,
942}
943
944#[derive(Debug, Deserialize)]
945pub struct AccountStaking {
946    pub pools: Vec<AccountStakingInfo>,
947}
948
949#[derive(Debug, Deserialize)]
950pub struct AccountStakingInfo {
951    pub pool: String,
952    pub amount: i64,
953    pub pending_deposit: i64,
954    pub pending_withdraw: i64,
955    pub ready_withdraw: i64,
956}
957
958#[derive(Debug, Deserialize)]
959pub struct StakingPoolInfo {
960    pub implementation: PoolImplementation,
961    pub pool: PoolInfo,
962}
963
964#[derive(Debug, Deserialize)]
965pub struct PoolImplementation {
966    pub name: String,
967    pub description: String,
968    pub url: String,
969    pub socials: Vec<String>,
970}
971
972#[derive(Debug, Deserialize)]
973pub struct PoolInfo {
974    pub address: String,
975    pub name: String,
976    pub total_amount: i64,
977    pub implementation: PoolImplementationType,
978    pub apy: f64,
979    pub min_stake: i64,
980    pub cycle_start: i64,
981    pub cycle_end: i64,
982    pub verified: bool,
983    pub current_nominators: i32,
984    pub max_nominators: i32,
985    pub liquid_jetton_master: Option<String>,
986    pub nominators_stake: i64,
987    pub validator_stake: i64,
988    pub cycle_length: Option<i64>,
989}
990
991#[derive(Debug, Deserialize)]
992pub struct StakingPoolHistory {
993    pub apy: ApyHistory,
994}
995
996#[derive(Debug, Deserialize)]
997pub struct ApyHistory {
998    pub apy: f64,
999    pub time: i64,
1000}
1001
1002#[derive(Debug, Deserialize)]
1003pub struct StakingPools {
1004    pub implementations: HashMap<String, PoolImplementation>,
1005    pub pools: Vec<PoolInfo>,
1006}
1007
1008#[derive(Debug, Deserialize)]
1009pub struct StorageProviders {
1010    pub providers: Vec<StorageProvider>,
1011}
1012
1013#[derive(Debug, Deserialize)]
1014pub struct StorageProvider {
1015    pub address: String,
1016    pub accept_new_contracts: bool,
1017    pub rate_per_mb_day: i64,
1018    pub max_span: i64,
1019    pub minimal_file_size: i64,
1020    pub maximal_file_size: i64,
1021}
1022
1023#[derive(Debug, Deserialize)]
1024pub struct TonConnectPayload {
1025    pub payload: String,
1026}
1027
1028#[derive(Debug, Deserialize)]
1029pub struct AccountInfo {
1030    pub public_key: String,
1031    pub address: String,
1032}
1033
1034#[derive(Debug, Deserialize)]
1035pub struct GaslessConfig {
1036    pub relay_address: String,
1037    pub gas_jettons: Vec<GasJetton>,
1038}
1039
1040#[derive(Debug, Deserialize)]
1041pub struct GasJetton {
1042    pub master_id: String,
1043}
1044
1045#[derive(Debug, Deserialize)]
1046pub struct SignRawParams {
1047    pub relay_address: String,
1048    pub commission: String,
1049    pub from: String,
1050    pub valid_until: i64,
1051    pub messages: Vec<SignRawMessage>,
1052}
1053
1054#[derive(Debug, Deserialize)]
1055pub struct SignRawMessage {
1056    pub address: String,
1057    pub amount: String,
1058    pub payload: Option<String>,
1059    pub state_init: Option<String>,
1060}
1061
1062#[derive(Debug, Deserialize)]
1063pub struct ReducedBlocks {
1064    pub blocks: Vec<ReducedBlock>,
1065}
1066
1067#[derive(Debug, Deserialize)]
1068pub struct ReducedBlock {
1069    pub workchain_id: i32,
1070    pub shard: String,
1071    pub seqno: i32,
1072    pub master_ref: Option<String>,
1073    pub tx_quantity: i32,
1074    pub utime: i64,
1075    pub shards_blocks: Vec<String>,
1076    pub parent: Vec<String>,
1077}
1078
1079#[derive(Debug, Deserialize)]
1080pub struct BlockchainBlock {
1081    pub workchain_id: i32,
1082    pub shard: String,
1083    pub seqno: i32,
1084    pub root_hash: String,
1085    pub file_hash: String,
1086    pub global_id: i32,
1087    pub value_flow: BlockValueFlow,
1088    pub version: i32,
1089    pub after_merge: bool,
1090    pub before_split: bool,
1091    pub after_split: bool,
1092    pub want_split: bool,
1093    pub want_merge: bool,
1094    pub key_block: bool,
1095    pub gen_utime: i64,
1096    pub start_lt: i64,
1097    pub end_lt: i64,
1098    pub vert_seqno: i32,
1099    pub gen_catchain_seqno: i32,
1100    pub min_ref_mc_seqno: i32,
1101    pub prev_key_block_seqno: i32,
1102    pub gen_software_version: Option<i32>,
1103    pub gen_software_capabilities: Option<i64>,
1104    pub master_ref: Option<String>,
1105    pub prev_refs: Option<Vec<String>>,
1106    pub in_msg_descr_length: i64,
1107    pub out_msg_descr_length: i64,
1108    pub rand_seed: String,
1109    pub created_by: String,
1110    pub tx_quantity: i32,
1111}
1112
1113#[derive(Debug, Deserialize)]
1114pub struct BlockValueFlow {
1115    pub from_prev_blk: BlockCurrencyCollection,
1116    pub to_next_blk: BlockCurrencyCollection,
1117    pub imported: BlockCurrencyCollection,
1118    pub exported: BlockCurrencyCollection,
1119    pub fees_collected: BlockCurrencyCollection,
1120    pub burned: Option<BlockCurrencyCollection>,
1121    pub fees_imported: BlockCurrencyCollection,
1122    pub recovered: BlockCurrencyCollection,
1123    pub created: BlockCurrencyCollection,
1124    pub minted: BlockCurrencyCollection,
1125}
1126
1127#[derive(Debug, Deserialize)]
1128pub struct BlockCurrencyCollection {
1129    pub grams: i64,
1130    pub other: Vec<OtherCurrency>,
1131}
1132
1133#[derive(Debug, Deserialize)]
1134pub struct OtherCurrency {
1135    pub id: i64,
1136    pub value: String,
1137}
1138
1139#[derive(Debug, Deserialize)]
1140pub struct BlockchainBlockShards {
1141    pub shards: Vec<Shard>,
1142}
1143
1144#[derive(Debug, Deserialize)]
1145pub struct Shard {
1146    pub last_known_block_id: String,
1147    pub last_known_block: BlockchainBlock,
1148}
1149
1150#[derive(Debug, Deserialize)]
1151pub struct BlockchainBlocks {
1152    pub blocks: Vec<BlockchainBlock>,
1153}
1154
1155#[derive(Debug, Deserialize)]
1156pub struct Transactions {
1157    pub transactions: Vec<Transaction>,
1158}
1159
1160#[derive(Debug, Deserialize)]
1161pub struct BlockchainConfig {
1162    pub raw: String,
1163    #[serde(rename = "0")]
1164    pub config_address: String,
1165    #[serde(rename = "1")]
1166    pub elector_address: String,
1167    #[serde(rename = "2")]
1168    pub minter_address: String,
1169    #[serde(rename = "3")]
1170    pub fee_collector_address: Option<String>,
1171    #[serde(rename = "4")]
1172    pub dns_root_address: String,
1173    #[serde(rename = "5")]
1174    pub fee_burn_config: Option<FeeBurnConfig>,
1175    #[serde(rename = "6")]
1176    pub minting_fees: Option<MintingFees>,
1177    #[serde(rename = "7")]
1178    pub currency_volumes: Option<CurrencyVolumes>,
1179    #[serde(rename = "8")]
1180    pub network_version: Option<NetworkVersion>,
1181    #[serde(rename = "9")]
1182    pub mandatory_params: Option<MandatoryParams>,
1183    #[serde(rename = "10")]
1184    pub critical_params: Option<CriticalParams>,
1185    #[serde(rename = "11")]
1186    pub proposal_setup: Option<ConfigProposal>,
1187    #[serde(rename = "12")]
1188    pub workchains: Option<WorkchainsWrapper>,
1189    #[serde(rename = "13")]
1190    pub complaint_fees: Option<ComplaintFees>,
1191    #[serde(rename = "14")]
1192    pub block_creation_rewards: Option<BlockCreationRewards>,
1193    #[serde(rename = "15")]
1194    pub validator_election: Option<ValidatorElection>,
1195    #[serde(rename = "16")]
1196    pub validator_limits: Option<ValidatorLimits>,
1197    #[serde(rename = "17")]
1198    pub stake_params: Option<StakeParams>,
1199    #[serde(rename = "18")]
1200    pub storage_prices: Option<StoragePrices>,
1201    #[serde(rename = "20")]
1202    pub gas_limits_masterchain: Option<GasLimitPricesWrapper>,
1203    #[serde(rename = "21")]
1204    pub gas_limits_basechain: Option<GasLimitPricesWrapper>,
1205    #[serde(rename = "22")]
1206    pub block_limits_masterchain: Option<BlockLimitsWrapper>,
1207    #[serde(rename = "23")]
1208    pub block_limits_basechain: Option<BlockLimitsWrapper>,
1209    #[serde(rename = "24")]
1210    pub msg_forward_prices_masterchain: Option<MsgForwardPricesWrapper>,
1211    #[serde(rename = "25")]
1212    pub msg_forward_prices_basechain: Option<MsgForwardPricesWrapper>,
1213    #[serde(rename = "28")]
1214    pub catchain_config: Option<CatchainConfig>,
1215    #[serde(rename = "29")]
1216    pub consensus_config: Option<ConsensusConfig>,
1217    #[serde(rename = "31")]
1218    pub fundamental_smc_addr: Option<FundamentalSmcAddr>,
1219    #[serde(rename = "32")]
1220    pub validators_set_32: Option<ValidatorsSet>,
1221    #[serde(rename = "33")]
1222    pub validators_set_33: Option<ValidatorsSet>,
1223    #[serde(rename = "34")]
1224    pub validators_set_34: Option<ValidatorsSet>,
1225    #[serde(rename = "35")]
1226    pub validators_set_35: Option<ValidatorsSet>,
1227    #[serde(rename = "36")]
1228    pub validators_set_36: Option<ValidatorsSet>,
1229    #[serde(rename = "37")]
1230    pub validators_set_37: Option<ValidatorsSet>,
1231    #[serde(rename = "40")]
1232    pub misbehaviour_punishment: Option<MisbehaviourPunishmentConfig>,
1233    #[serde(rename = "43")]
1234    pub size_limits_config: Option<SizeLimitsConfig>,
1235    #[serde(rename = "44")]
1236    pub suspended_accounts: SuspendedAccounts,
1237    #[serde(rename = "71")]
1238    pub oracle_bridge_params_71: Option<OracleBridgeParamsWrapper>,
1239    #[serde(rename = "72")]
1240    pub oracle_bridge_params_72: Option<OracleBridgeParamsWrapper>,
1241    #[serde(rename = "73")]
1242    pub oracle_bridge_params_73: Option<OracleBridgeParamsWrapper>,
1243    #[serde(rename = "79")]
1244    pub jetton_bridge_params_79: Option<JettonBridgeParamsWrapper>,
1245    #[serde(rename = "81")]
1246    pub jetton_bridge_params_81: Option<JettonBridgeParamsWrapper>,
1247    #[serde(rename = "82")]
1248    pub jetton_bridge_params_82: Option<JettonBridgeParamsWrapper>,
1249}
1250
1251#[derive(Debug, Deserialize)]
1252pub struct FeeBurnConfig {
1253    pub blackhole_addr: Option<String>,
1254    pub fee_burn_nom: i64,
1255    pub fee_burn_denom: i64,
1256}
1257
1258#[derive(Debug, Deserialize)]
1259pub struct MintingFees {
1260    pub mint_new_price: i64,
1261    pub mint_add_price: i64,
1262}
1263
1264#[derive(Debug, Deserialize)]
1265pub struct CurrencyVolumes {
1266    pub currencies: Vec<Currency>,
1267}
1268
1269#[derive(Debug, Deserialize)]
1270pub struct Currency {
1271    pub currency_id: i64,
1272    pub amount: String,
1273}
1274
1275#[derive(Debug, Deserialize)]
1276pub struct NetworkVersion {
1277    pub version: i64,
1278    pub capabilities: i64,
1279}
1280
1281#[derive(Debug, Deserialize)]
1282pub struct MandatoryParams {
1283    pub mandatory_params: Vec<i32>,
1284}
1285
1286#[derive(Debug, Deserialize)]
1287pub struct CriticalParams {
1288    pub critical_params: Vec<i32>,
1289}
1290
1291#[derive(Debug, Deserialize)]
1292pub struct ConfigProposal {
1293    pub normal_params: ConfigProposalSetup,
1294    pub critical_params: ConfigProposalSetup,
1295}
1296
1297#[derive(Debug, Deserialize)]
1298pub struct ConfigProposalSetup {
1299    pub min_tot_rounds: i32,
1300    pub max_tot_rounds: i32,
1301    pub min_wins: i32,
1302    pub max_losses: i32,
1303    pub min_store_sec: i64,
1304    pub max_store_sec: i64,
1305    pub bit_price: i64,
1306    pub cell_price: i64,
1307}
1308
1309#[derive(Debug, Deserialize)]
1310pub struct WorkchainsWrapper {
1311    pub workchains: Vec<WorkchainDescr>,
1312}
1313
1314#[derive(Debug, Deserialize)]
1315pub struct WorkchainDescr {
1316    pub workchain: i32,
1317    pub enabled_since: i64,
1318    pub actual_min_split: i32,
1319    pub min_split: i32,
1320    pub max_split: i32,
1321    pub basic: i32,
1322    pub active: bool,
1323    pub accept_msgs: bool,
1324    pub flags: i32,
1325    pub zerostate_root_hash: String,
1326    pub zerostate_file_hash: String,
1327    pub version: i64,
1328}
1329
1330#[derive(Debug, Deserialize)]
1331pub struct ComplaintFees {
1332    pub deposit: i64,
1333    pub bit_price: i64,
1334    pub cell_price: i64,
1335}
1336
1337#[derive(Debug, Deserialize)]
1338pub struct BlockCreationRewards {
1339    pub masterchain_block_fee: i64,
1340    pub basechain_block_fee: i64,
1341}
1342
1343#[derive(Debug, Deserialize)]
1344pub struct ValidatorElection {
1345    pub validators_elected_for: i64,
1346    pub elections_start_before: i64,
1347    pub elections_end_before: i64,
1348    pub stake_held_for: i64,
1349}
1350
1351#[derive(Debug, Deserialize)]
1352pub struct ValidatorLimits {
1353    pub max_validators: i32,
1354    pub max_main_validators: i32,
1355    pub min_validators: i32,
1356}
1357
1358#[derive(Debug, Deserialize)]
1359pub struct StakeParams {
1360    pub min_stake: String,
1361    pub max_stake: String,
1362    pub min_total_stake: String,
1363    pub max_stake_factor: i64,
1364}
1365
1366#[derive(Debug, Deserialize)]
1367pub struct StoragePrices {
1368    pub storage_prices: Vec<StoragePrice>,
1369}
1370
1371#[derive(Debug, Deserialize)]
1372pub struct StoragePrice {
1373    pub utime_since: i64,
1374    pub bit_price_ps: i64,
1375    pub cell_price_ps: i64,
1376    pub mc_bit_price_ps: i64,
1377    pub mc_cell_price_ps: i64,
1378}
1379
1380#[derive(Debug, Deserialize)]
1381pub struct GasLimitPricesWrapper {
1382    pub gas_limits_prices: GasLimitPrices,
1383}
1384
1385#[derive(Debug, Deserialize)]
1386pub struct GasLimitPrices {
1387    pub gas_price: i64,
1388    pub gas_limit: i64,
1389    pub gas_credit: i64,
1390    pub block_gas_limit: i64,
1391    pub freeze_due_limit: i64,
1392    pub delete_due_limit: i64,
1393    pub special_gas_limit: Option<i64>,
1394    pub flat_gas_limit: Option<i64>,
1395    pub flat_gas_price: Option<i64>,
1396}
1397
1398#[derive(Debug, Deserialize)]
1399pub struct BlockParamLimits {
1400    pub underload: i64,
1401    pub soft_limit: i64,
1402    pub hard_limit: i64,
1403}
1404
1405#[derive(Debug, Deserialize)]
1406pub struct BlockLimitsWrapper {
1407    pub block_limits: BlockLimits,
1408}
1409
1410#[derive(Debug, Deserialize)]
1411pub struct BlockLimits {
1412    pub bytes: BlockParamLimits,
1413    pub gas: BlockParamLimits,
1414    pub lt_delta: BlockParamLimits,
1415}
1416
1417#[derive(Debug, Deserialize)]
1418pub struct MsgForwardPricesWrapper {
1419    pub msg_forward_prices: MsgForwardPrices,
1420}
1421
1422#[derive(Debug, Deserialize)]
1423pub struct MsgForwardPrices {
1424    pub lump_price: i64,
1425    pub bit_price: i64,
1426    pub cell_price: i64,
1427    pub ihr_price_factor: i64,
1428    pub first_frac: i64,
1429    pub next_frac: i64,
1430}
1431
1432#[derive(Debug, Deserialize)]
1433pub struct CatchainConfig {
1434    pub mc_catchain_lifetime: i64,
1435    pub shard_catchain_lifetime: i64,
1436    pub shard_validators_lifetime: i64,
1437    pub shard_validators_num: i64,
1438    pub flags: Option<i32>,
1439    pub shuffle_mc_validators: Option<bool>,
1440}
1441
1442#[derive(Debug, Deserialize)]
1443pub struct ConsensusConfig {
1444    pub round_candidates: i64,
1445    pub next_candidate_delay_ms: i64,
1446    pub consensus_timeout_ms: i64,
1447    pub fast_attempts: i64,
1448    pub attempt_duration: i64,
1449    pub catchain_max_deps: i64,
1450    pub max_block_bytes: i64,
1451    pub max_collated_bytes: i64,
1452    pub proto_version: i64,
1453    pub catchain_max_blocks_coeff: i64,
1454    pub flags: Option<i32>,
1455    pub new_catchain_ids: Option<bool>,
1456}
1457
1458#[derive(Debug, Deserialize)]
1459pub struct FundamentalSmcAddr {
1460    pub fundamental_smc_addr: Vec<String>,
1461}
1462
1463#[derive(Debug, Deserialize)]
1464pub struct ValidatorsSet {
1465    pub utime_since: i64,
1466    pub utime_until: i64,
1467    pub total: i32,
1468    pub main: i32,
1469    pub total_weight: String,
1470    pub list: Vec<ValidatorInfo>,
1471}
1472
1473#[derive(Debug, Deserialize)]
1474pub struct ValidatorInfo {
1475    pub public_key: String,
1476    pub weight: i64,
1477    pub adnl_addr: Option<String>,
1478}
1479
1480#[derive(Debug, Deserialize)]
1481pub struct MisbehaviourPunishmentConfig {
1482    pub default_flat_fine: i64,
1483    pub default_proportional_fine: i64,
1484    pub severity_flat_mult: i64,
1485    pub severity_proportional_mult: i64,
1486    pub unpunishable_interval: i64,
1487    pub long_interval: i64,
1488    pub long_flat_mult: i64,
1489    pub long_proportional_mult: i64,
1490    pub medium_interval: i64,
1491    pub medium_flat_mult: i64,
1492    pub medium_proportional_mult: i64,
1493}
1494
1495#[derive(Debug, Deserialize)]
1496pub struct SizeLimitsConfig {
1497    pub max_msg_bits: i64,
1498    pub max_msg_cells: i64,
1499    pub max_library_cells: i64,
1500    pub max_vm_data_depth: i32,
1501    pub max_ext_msg_size: i64,
1502    pub max_ext_msg_depth: i32,
1503    pub max_acc_state_cells: Option<i64>,
1504    pub max_acc_state_bits: Option<i64>,
1505}
1506
1507#[derive(Debug, Deserialize)]
1508pub struct SuspendedAccounts {
1509    pub accounts: Vec<String>,
1510    pub suspended_until: i64,
1511}
1512
1513#[derive(Debug, Deserialize)]
1514pub struct OracleBridgeParamsWrapper {
1515    pub oracle_bridge_params: OracleBridgeParams,
1516}
1517
1518#[derive(Debug, Deserialize)]
1519pub struct OracleBridgeParams {
1520    pub bridge_addr: String,
1521    pub oracle_multisig_address: String,
1522    pub external_chain_address: String,
1523    pub oracles: Vec<Oracle>,
1524}
1525
1526#[derive(Debug, Deserialize)]
1527pub struct Oracle {
1528    pub address: String,
1529    pub secp_pubkey: String,
1530}
1531
1532#[derive(Debug, Deserialize)]
1533pub struct JettonBridgeParamsWrapper {
1534    pub jetton_bridge_params: JettonBridgeParams,
1535}
1536
1537#[derive(Debug, Deserialize)]
1538pub struct JettonBridgeParams {
1539    pub bridge_address: String,
1540    pub oracles_address: String,
1541    pub state_flags: i64,
1542    pub burn_bridge_fee: Option<i64>,
1543    pub oracles: Vec<Oracle>,
1544    pub external_chain_address: Option<String>,
1545    pub prices: Option<JettonBridgePrices>,
1546}
1547
1548#[derive(Debug, Deserialize)]
1549pub struct JettonBridgePrices {
1550    pub bridge_burn_fee: i64,
1551    pub bridge_mint_fee: i64,
1552    pub wallet_min_tons_for_storage: i64,
1553    pub wallet_gas_consumption: i64,
1554    pub minter_min_tons_for_storage: i64,
1555    pub discover_gas_consumption: i64,
1556}
1557
1558#[derive(Debug, Deserialize)]
1559pub struct RawBlockchainConfig {
1560    pub config: HashMap<String, serde_json::Value>,
1561}
1562
1563#[derive(Debug, Deserialize)]
1564pub struct Validators {
1565    pub elect_at: i64,
1566    pub elect_close: i64,
1567    pub min_stake: i64,
1568    pub total_stake: i64,
1569    pub validators: Vec<Validator>,
1570}
1571
1572#[derive(Debug, Deserialize)]
1573pub struct Validator {
1574    pub address: String,
1575    pub adnl_address: String,
1576    pub stake: i64,
1577    pub max_factor: i64,
1578}
1579
1580#[derive(Debug, Deserialize)]
1581pub struct BlockchainRawAccount {
1582    pub address: String,
1583    pub balance: i64,
1584    pub extra_balance: Option<HashMap<String, String>>,
1585    pub code: Option<String>,
1586    pub data: Option<String>,
1587    pub last_transaction_lt: i64,
1588    pub last_transaction_hash: Option<String>,
1589    pub frozen_hash: Option<String>,
1590    pub status: AccountStatus,
1591    pub storage: AccountStorageInfo,
1592    pub libraries: Option<Vec<AccountLibrary>>,
1593}
1594
1595#[derive(Debug, Deserialize)]
1596pub struct AccountStorageInfo {
1597    pub used_cells: i64,
1598    pub used_bits: i64,
1599    pub used_public_cells: i64,
1600    pub last_paid: i64,
1601    pub due_payment: i64,
1602}
1603
1604#[derive(Debug, Deserialize)]
1605pub struct AccountLibrary {
1606    pub public: bool,
1607    pub root: String,
1608}
1609
1610#[derive(Debug, Deserialize)]
1611pub struct MethodExecutionResult {
1612    pub success: bool,
1613    pub exit_code: i32,
1614    pub stack: Vec<TvmStackRecord>,
1615    pub decoded: Option<serde_json::Value>,
1616}
1617
1618#[derive(Debug, Deserialize)]
1619#[serde(tag = "type")]
1620pub enum TvmStackRecord {
1621    #[serde(rename = "cell")]
1622    Cell {
1623        #[serde(skip_serializing_if = "Option::is_none")]
1624        cell: Option<String>,
1625    },
1626    #[serde(rename = "slice")]
1627    Slice {
1628        #[serde(skip_serializing_if = "Option::is_none")]
1629        slice: Option<String>,
1630    },
1631    #[serde(rename = "num")]
1632    Num {
1633        #[serde(skip_serializing_if = "Option::is_none")]
1634        num: Option<String>,
1635    },
1636    #[serde(rename = "tuple")]
1637    Tuple {
1638        #[serde(skip_serializing_if = "Option::is_none")]
1639        tuple: Option<Vec<TvmStackRecord>>,
1640    },
1641    #[serde(rename = "nan")]
1642    Nan,
1643    #[serde(rename = "null")]
1644    Null,
1645}
1646
1647#[derive(Debug, Deserialize)]
1648pub struct BlockchainAccountInspect {
1649    pub code: String,
1650    pub code_hash: String,
1651    pub methods: Vec<Method>,
1652    pub compiler: Option<String>,
1653}
1654
1655#[derive(Debug, Deserialize)]
1656pub struct Method {
1657    pub id: i64,
1658    pub method: String,
1659}
1660
1661#[derive(Debug, Deserialize)]
1662pub struct RawMasterchainInfo {
1663    pub last: BlockRaw,
1664    pub state_root_hash: String,
1665    pub init: InitStateRaw,
1666}
1667
1668#[derive(Debug, Deserialize)]
1669pub struct BlockRaw {
1670    pub workchain: i32,
1671    pub shard: String,
1672    pub seqno: i32,
1673    pub root_hash: String,
1674    pub file_hash: String,
1675}
1676
1677#[derive(Debug, Deserialize)]
1678pub struct InitStateRaw {
1679    pub workchain: i32,
1680    pub root_hash: String,
1681    pub file_hash: String,
1682}
1683
1684#[derive(Deserialize, Debug)]
1685pub struct RawMasterchainInfoExt {
1686    pub mode: i32,
1687    pub version: i32,
1688    pub capabilities: i64,
1689    pub last: BlockRaw,
1690    pub last_utime: i32,
1691    pub now: i32,
1692    pub state_root_hash: String,
1693    pub init: InitStateRaw,
1694}
1695
1696#[derive(Deserialize, Debug)]
1697pub struct RawTime {
1698    pub time: i32,
1699}
1700
1701#[derive(Deserialize, Debug)]
1702pub struct RawBlockchainBlock {
1703    pub id: BlockRaw,
1704    pub data: String,
1705}
1706
1707#[derive(Deserialize, Debug)]
1708pub struct RawBlockchainBlockState {
1709    pub id: BlockRaw,
1710    pub root_hash: String,
1711    pub file_hash: String,
1712    pub data: String,
1713}
1714
1715#[derive(Deserialize, Debug)]
1716pub struct RawBlockchainBlockHeader {
1717    pub id: BlockRaw,
1718    pub mode: i32,
1719    pub header_proof: String,
1720}
1721
1722#[derive(Deserialize, Debug)]
1723pub struct SendMessageResponse {
1724    pub code: i32,
1725}
1726
1727#[derive(Deserialize, Debug)]
1728pub struct RawAccountState {
1729    pub id: BlockRaw,
1730    pub shardblk: BlockRaw,
1731    pub shard_proof: String,
1732    pub proof: String,
1733    pub state: String,
1734}
1735
1736#[derive(Deserialize, Debug)]
1737pub struct RawShardInfo {
1738    pub id: BlockRaw,
1739    pub shardblk: BlockRaw,
1740    pub shard_proof: String,
1741    pub shard_descr: String,
1742}
1743
1744#[derive(Deserialize, Debug)]
1745pub struct AllRawShardsInfo {
1746    pub id: BlockRaw,
1747    pub proof: String,
1748    pub data: String,
1749}
1750
1751#[derive(Deserialize, Debug)]
1752pub struct RawTransactions {
1753    pub ids: Vec<BlockRaw>,
1754    pub transactions: String,
1755}
1756
1757#[derive(Deserialize, Debug)]
1758pub struct RawListBlockTransactions {
1759    pub id: BlockRaw,
1760    pub req_count: i32,
1761    pub incomplete: bool,
1762    pub ids: Vec<TransactionId>,
1763    pub proof: String,
1764}
1765
1766#[derive(Deserialize, Debug)]
1767pub struct TransactionId {
1768    pub mode: i32,
1769    pub account: Option<String>,
1770    pub lt: Option<i64>,
1771    pub hash: Option<String>,
1772}
1773
1774#[derive(Deserialize, Debug)]
1775pub struct RawBlockProof {
1776    pub complete: bool,
1777    pub from: BlockRaw,
1778    pub to: BlockRaw,
1779    pub steps: Vec<BlockProofStep>,
1780}
1781
1782#[derive(Deserialize, Debug)]
1783pub struct BlockProofStep {
1784    pub lite_server_block_link_back: LiteServerBlockLinkBack,
1785    pub lite_server_block_link_forward: LiteServerBlockLinkForward,
1786}
1787
1788#[derive(Deserialize, Debug)]
1789pub struct LiteServerBlockLinkBack {
1790    pub to_key_block: bool,
1791    pub from: BlockRaw,
1792    pub to: BlockRaw,
1793    pub dest_proof: String,
1794    pub proof: String,
1795    pub state_proof: String,
1796}
1797
1798#[derive(Deserialize, Debug)]
1799pub struct LiteServerBlockLinkForward {
1800    pub to_key_block: bool,
1801    pub from: BlockRaw,
1802    pub to: BlockRaw,
1803    pub dest_proof: String,
1804    pub config_proof: String,
1805    pub signatures: Signatures,
1806}
1807
1808#[derive(Deserialize, Debug)]
1809pub struct Signatures {
1810    pub validator_set_hash: i64,
1811    pub catchain_seqno: i32,
1812    pub signatures: Vec<Signature>,
1813}
1814
1815#[derive(Deserialize, Debug)]
1816pub struct Signature {
1817    pub node_id_short: String,
1818    pub signature: String,
1819}
1820
1821#[derive(Deserialize, Debug)]
1822pub struct RawConfig {
1823    pub mode: i32,
1824    pub id: BlockRaw,
1825    pub state_proof: String,
1826    pub config_proof: String,
1827}
1828
1829#[derive(Deserialize, Debug)]
1830pub struct RawShardBlockProof {
1831    pub masterchain_id: BlockRaw,
1832    pub links: Vec<ShardBlockProofLink>,
1833}
1834
1835#[derive(Deserialize, Debug)]
1836pub struct ShardBlockProofLink {
1837    pub id: BlockRaw,
1838    pub proof: String,
1839}
1840
1841#[derive(Deserialize, Debug)]
1842pub struct OutMsgQueueSizes {
1843    pub ext_msg_queue_size_limit: u32,
1844    pub shards: Vec<ShardQueueSize>,
1845}
1846
1847#[derive(Deserialize, Debug)]
1848pub struct ShardQueueSize {
1849    pub id: BlockRaw,
1850    pub size: u32,
1851}
1852
1853#[derive(Debug, Deserialize)]
1854pub struct DecodedMessage {
1855    pub destination: AccountAddress,
1856    pub destination_wallet_version: String,
1857    pub ext_in_msg_decoded: Option<ExtInMsgDecoded>,
1858}
1859
1860#[derive(Debug, Deserialize)]
1861pub struct ExtInMsgDecoded {
1862    pub wallet_v3: Option<WalletV3Message>,
1863    pub wallet_v4: Option<WalletV4Message>,
1864    pub wallet_highload_v2: Option<WalletHighloadV2Message>,
1865}
1866
1867#[derive(Debug, Deserialize)]
1868pub struct WalletV3Message {
1869    pub subwallet_id: i64,
1870    pub valid_until: i64,
1871    pub seqno: i64,
1872    pub raw_messages: Vec<DecodedRawMessage>,
1873}
1874
1875#[derive(Debug, Deserialize)]
1876pub struct WalletV4Message {
1877    pub subwallet_id: i64,
1878    pub valid_until: i64,
1879    pub seqno: i64,
1880    pub op: i32,
1881    pub raw_messages: Vec<DecodedRawMessage>,
1882}
1883
1884#[derive(Debug, Deserialize)]
1885pub struct WalletHighloadV2Message {
1886    pub subwallet_id: i64,
1887    pub bounded_query_id: String,
1888    pub raw_messages: Vec<DecodedRawMessage>,
1889}
1890
1891#[derive(Debug, Deserialize)]
1892pub struct DecodedRawMessage {
1893    pub message: DecodedMessageDetails,
1894    pub mode: i32,
1895}
1896
1897#[derive(Debug, Deserialize)]
1898pub struct DecodedMessageDetails {
1899    pub boc: String,
1900    pub decoded_op_name: Option<String>,
1901    pub op_code: Option<String>,
1902    pub decoded_body: Option<serde_json::Value>,
1903}
1904
1905#[derive(Debug, Deserialize)]
1906pub struct InscriptionBalances {
1907    pub inscriptions: Vec<InscriptionBalance>,
1908}
1909
1910#[derive(Debug, Deserialize)]
1911pub struct InscriptionBalance {
1912    #[serde(rename = "type")]
1913    pub inscription_type: String,
1914    pub ticker: String,
1915    pub balance: String,
1916    pub decimals: i32,
1917}
1918
1919#[derive(Deserialize, Debug)]
1920pub struct InscriptionOpTemplate {
1921    pub comment: String,
1922    pub destination: String,
1923}
1924
1925#[derive(Deserialize, Debug)]
1926pub struct ServiceStatus {
1927    pub rest_online: bool,
1928    pub indexing_latency: i64,
1929    pub last_known_masterchain_seqno: i32,
1930}
1931
1932#[derive(Deserialize, Debug)]
1933pub struct ParsedAddress {
1934    pub raw_form: String,
1935    pub bounceable: AddressFormat,
1936    pub non_bounceable: AddressFormat,
1937    pub given_type: String,
1938    pub test_only: bool,
1939}
1940
1941#[derive(Deserialize, Debug)]
1942pub struct AddressFormat {
1943    pub b64: String,
1944    pub b64url: String,
1945}