1
+ using System . Threading . Tasks ;
2
+ using TonSdk . Client . Stack ;
3
+ using TonSdk . Core ;
4
+ using TonSdk . Core . Block ;
5
+ using TonSdk . Core . Boc ;
6
+
7
+ namespace TonSdk . Client
8
+ {
9
+ public interface ITonClient
10
+ {
11
+ Jetton Jetton { get ; }
12
+ Nft Nft { get ; }
13
+ Wallet Wallet { get ; }
14
+ Dns Dns { get ; }
15
+ TonClientType GetClientType ( ) ;
16
+
17
+ /// <summary>
18
+ /// Retrieves the balance of the specified address.
19
+ /// </summary>
20
+ /// <param name="address">The address to retrieve the balance for.</param>
21
+ /// <returns>The task result contains the balance as a Coins instance.</returns>
22
+ Task < Coins > GetBalance ( Address address ) ;
23
+
24
+ /// <summary>
25
+ /// Checks if a contract is deployed at the specified address.
26
+ /// </summary>
27
+ /// <param name="address">The address to check.</param>
28
+ /// <returns>The task result indicates whether a contract is deployed (true) or not (false) at the specified address.</returns>
29
+ Task < bool > IsContractDeployed ( Address address ) ;
30
+
31
+ /// <summary>
32
+ /// Retrieves the address information for the specified address.
33
+ /// </summary>
34
+ /// <param name="address">The address object to retrieve information for.</param>
35
+ /// <returns>An object containing the address information.</returns>
36
+ Task < AddressInformationResult ? > GetAddressInformation ( Address address ) ;
37
+
38
+ /// <summary>
39
+ /// Retrieves the wallet information for the specified address.
40
+ /// </summary>
41
+ /// <param name="address">The address object to retrieve information for.</param>
42
+ /// <returns>An object containing the wallet information.</returns>
43
+ Task < WalletInformationResult ? > GetWalletInformation ( Address address ) ;
44
+
45
+ /// <summary>
46
+ /// Get up-to-date masterchain state.
47
+ /// </summary>
48
+ /// <returns>An object containing the masterchain information.</returns>
49
+ Task < MasterchainInformationResult ? > GetMasterchainInfo ( ) ;
50
+
51
+ /// <summary>
52
+ /// Look up block by either seqno, lt or unixTime.
53
+ /// </summary>
54
+ /// <returns>An object containing the block information.</returns>
55
+ Task < BlockIdExtended > LookUpBlock ( int workchain , long shard , long ? seqno = null , ulong ? lt = null , ulong ? unixTime = null ) ;
56
+
57
+ /// <summary>
58
+ /// Get metadata of a given block.
59
+ /// </summary>
60
+ /// <returns>An object containing the block metadata.</returns>
61
+ Task < BlockDataResult ? > GetBlockData ( int workchain ,
62
+ long shard ,
63
+ long seqno ,
64
+ string rootHash = null ,
65
+ string fileHash = null ) ;
66
+
67
+ /// <summary>
68
+ /// Get transactions of the given block.
69
+ /// </summary>
70
+ /// <param name="workchain"></param>
71
+ /// <param name="shard"></param>
72
+ /// <param name="seqno"></param>
73
+ /// <param name="rootHash"></param>
74
+ /// <param name="fileHash"></param>
75
+ /// <param name="afterLt"></param>
76
+ /// <param name="afterHash"></param>
77
+ /// <param name="count"></param>
78
+ /// <returns>An object containing the shards information.</returns>
79
+ Task < BlockTransactionsResult ? > GetBlockTransactions (
80
+ int workchain ,
81
+ long shard ,
82
+ long seqno ,
83
+ string rootHash = null ,
84
+ string fileHash = null ,
85
+ ulong ? afterLt = null ,
86
+ string afterHash = null ,
87
+ uint count = 10 ) ;
88
+
89
+ /// <summary>
90
+ /// Retrieves transaction information for the specified address.
91
+ /// </summary>
92
+ /// <param name="address">The address object to retrieve transaction information for.</param>
93
+ /// <param name="limit">The maximum number of transactions to retrieve (default: 10).</param>
94
+ /// <param name="lt">The logical time of the transaction to start retrieving from (optional).</param>
95
+ /// <param name="hash">The hash of the transaction to start retrieving from (optional).</param>
96
+ /// <param name="to_lt">The logical time of the transaction to retrieve up to (optional).</param>
97
+ /// <param name="archival">Specifies whether to retrieve transactions from archival nodes (optional).</param>
98
+ /// <returns>An array of transaction information results.</returns>
99
+ Task < TransactionsInformationResult [ ] > GetTransactions ( Address address , uint limit = 10 ,
100
+ ulong ? lt = null , string hash = null , ulong ? to_lt = null , bool ? archival = null ) ;
101
+
102
+ /// <summary>
103
+ /// Executes a specific method on the specified address.
104
+ /// </summary>
105
+ /// <param name="address">The address object to execute the method on.</param>
106
+ /// <param name="method">The name of the method to execute.</param>
107
+ /// <param name="stackItems">The stack parameters for the method (optional).</param>
108
+ /// <returns>The result of the executed method.</returns>
109
+ Task < RunGetMethodResult ? > RunGetMethod ( Address address , string method , IStackItem [ ] stackItems ) ;
110
+
111
+ /// <summary>
112
+ /// Executes a specific method on the specified address.
113
+ /// </summary>
114
+ /// <param name="address">The address object to execute the method on.</param>
115
+ /// <param name="method">The name of the method to execute.</param>
116
+ /// <param name="stack">The stack parameters for the method (optional).</param>
117
+ /// <returns>The result of the executed method.</returns>
118
+ Task < RunGetMethodResult ? > RunGetMethod ( Address address , string method , string [ ] [ ] stack ) ;
119
+
120
+ /// <summary>
121
+ /// Sends a Bag of Cells (BoC) to the network.
122
+ /// </summary>
123
+ /// <param name="boc">The Cell object representing the Bag of Cells.</param>
124
+ /// <returns>The result of sending the Bag of Cells.</returns>
125
+ Task < SendBocResult ? > SendBoc ( Cell boc ) ;
126
+
127
+ /// <summary>
128
+ /// Retrieves a configuration parameter by its ID.
129
+ /// </summary>
130
+ /// <param name="configId">The ID of the configuration parameter to retrieve.</param>
131
+ /// <param name="seqno">The sequence number of the configuration parameter (optional).</param>
132
+ /// <returns>The result of the configuration parameter retrieval.</returns>
133
+ Task < ConfigParamResult ? > GetConfigParam ( int configId , int ? seqno = null ) ;
134
+
135
+ /// <summary>
136
+ /// Get shards information.
137
+ /// </summary>
138
+ /// <param name="seqno">Masterchain seqno to fetch shards of.</param>
139
+ /// <returns>An object containing the shards information.</returns>
140
+ Task < ShardsInformationResult ? > Shards ( long seqno ) ;
141
+
142
+ /// <summary>
143
+ /// Estimates fee for the message
144
+ /// </summary>
145
+ /// <param name="message">The message for which you need to calculate the fees</param>
146
+ /// <returns>The result of estimation fees.</returns>
147
+ Task < IEstimateFeeResult > EstimateFee ( MessageX message , bool ignoreChksig = true ) ;
148
+ }
149
+ }
0 commit comments