-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathITonClient.cs
More file actions
173 lines (155 loc) · 8.74 KB
/
ITonClient.cs
File metadata and controls
173 lines (155 loc) · 8.74 KB
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
using System.Threading.Tasks;
using TonSdk.Client.Stack;
using TonSdk.Core;
using TonSdk.Core.Block;
using TonSdk.Core.Boc;
namespace TonSdk.Client
{
public interface ITonClient
{
Jetton Jetton { get; }
Nft Nft { get; }
Wallet Wallet { get; }
Dns Dns { get; }
TonClientType GetClientType();
/// <summary>
/// Retrieves the balance of the specified address.
/// </summary>
/// <param name="address">The address to retrieve the balance for.</param>
/// <param name="block">Can be provided to fetch in specific block, requires LiteClient (optional).</param>
/// <returns>The task result contains the balance as a Coins instance.</returns>
Task<Coins> GetBalance(Address address, BlockIdExtended? block = null);
/// <summary>
/// Checks if a contract is deployed at the specified address.
/// </summary>
/// <param name="address">The address to check.</param>
/// <param name="block">Can be provided to fetch in specific block, requires LiteClient (optional).</param>
/// <returns>The task result indicates whether a contract is deployed (true) or not (false) at the specified address.</returns>
Task<bool> IsContractDeployed(Address address, BlockIdExtended? block = null);
/// <summary>
/// Retrieves the address information for the specified address.
/// </summary>
/// <param name="address">The address object to retrieve information for.</param>
/// <param name="block">Can be provided to fetch in specific block, requires LiteClient (optional).</param>
/// <returns>An object containing the address information.</returns>
Task<AddressInformationResult?> GetAddressInformation(Address address, BlockIdExtended? block = null);
/// <summary>
/// Retrieves the wallet information for the specified address.
/// </summary>
/// <param name="address">The address object to retrieve information for.</param>
/// <param name="block">Can be provided to fetch in specific block, requires LiteClient (optional).</param>
/// <returns>An object containing the wallet information.</returns>
Task<WalletInformationResult?> GetWalletInformation(Address address, BlockIdExtended? block = null);
/// <summary>
/// Get up-to-date masterchain state.
/// </summary>
/// <returns>An object containing the masterchain information.</returns>
Task<MasterchainInformationResult?> GetMasterchainInfo();
/// <summary>
/// Look up block by either seqno, lt or unixTime.
/// </summary>
/// <returns>An object containing the block information.</returns>
Task<BlockIdExtended> LookUpBlock(int workchain, long shard, long? seqno = null, ulong? lt = null, ulong? unixTime = null);
/// <summary>
/// Get metadata of a given block.
/// </summary>
/// <returns>An object containing the block metadata.</returns>
Task<BlockDataResult?> GetBlockData(int workchain,
long shard,
long seqno,
string rootHash = null,
string fileHash = null);
/// <summary>
/// Get transactions of the given block.
/// </summary>
/// <param name="workchain"></param>
/// <param name="shard"></param>
/// <param name="seqno"></param>
/// <param name="rootHash"></param>
/// <param name="fileHash"></param>
/// <param name="afterLt"></param>
/// <param name="afterHash"></param>
/// <param name="count"></param>
/// <returns>An object containing the shards information.</returns>
Task<BlockTransactionsResult?> GetBlockTransactions(
int workchain,
long shard,
long seqno,
string rootHash = null,
string fileHash = null,
ulong? afterLt = null,
string afterHash = null,
uint count = 10);
/// <summary>
/// Retrieves transaction information for the specified address.
/// </summary>
/// <param name="address">The address object to retrieve transaction information for.</param>
/// <param name="limit">The maximum number of transactions to retrieve (default: 10).</param>
/// <param name="lt">The logical time of the transaction to start retrieving from (optional).</param>
/// <param name="hash">The hash of the transaction to start retrieving from (optional).</param>
/// <param name="to_lt">The logical time of the transaction to retrieve up to (optional).</param>
/// <param name="archival">Specifies whether to retrieve transactions from archival nodes (optional).</param>
/// <returns>An array of transaction information results.</returns>
Task<TransactionsInformationResult[]> GetTransactions(Address address, uint limit = 10,
ulong? lt = null, string hash = null, ulong? to_lt = null, bool? archival = null);
/// <summary>
/// Retrieves transaction information for the specified parameters.
/// </summary>
/// <param name="msgHash">Message hash of transaction.</param>
/// <param name="bodyHash">Body hash of transaction.</param>
/// <param name="opcode">Opcode of message in hex or signed 32-bit decimal form.</param>
/// <param name="direction">Direction of message.</param>
/// <param name="offset">Skip first N rows. Use with limit to batch read.</param>
/// <param name="count">Limit number of queried rows. Use with offset to batch read.</param>
/// <returns>An array of transaction information results.</returns>
Task<TransactionsInformationResultExtended[]> GetTransactionsByMessage(string msgHash = null, string bodyHash = null, string opcode = null, MessageDirection? direction = null, int? offset = null, int? count = 10);
/// <summary>
/// Executes a specific method on the specified address.
/// </summary>
/// <param name="address">The address object to execute the method on.</param>
/// <param name="method">The name of the method to execute.</param>
/// <param name="stackItems">The stack parameters for the method (optional).</param>
/// <param name="block">Can be provided to fetch in specific block, requires LiteClient (optional).</param>
/// <returns>The result of the executed method.</returns>
Task<RunGetMethodResult?> RunGetMethod(Address address, string method, IStackItem[] stackItems, BlockIdExtended? block = null);
/// <summary>
/// Executes a specific method on the specified address.
/// </summary>
/// <param name="address">The address object to execute the method on.</param>
/// <param name="method">The name of the method to execute.</param>
/// <param name="stack">The stack parameters for the method (optional).</param>
/// <returns>The result of the executed method.</returns>
Task<RunGetMethodResult?> RunGetMethod(Address address, string method, string[][] stack);
/// <summary>
/// Sends a Bag of Cells (BoC) to the network.
/// </summary>
/// <param name="boc">The Cell object representing the Bag of Cells.</param>
/// <returns>The result of sending the Bag of Cells.</returns>
Task<SendBocResult?> SendBoc(Cell boc);
/// <summary>
/// Retrieves a configuration parameter by its ID.
/// </summary>
/// <param name="configId">The ID of the configuration parameter to retrieve.</param>
/// <param name="seqno">The sequence number of the configuration parameter (optional).</param>
/// <returns>The result of the configuration parameter retrieval.</returns>
Task<ConfigParamResult?> GetConfigParam(int configId, int? seqno = null);
/// <summary>
/// Get shards information.
/// </summary>
/// <param name="seqno">Masterchain seqno to fetch shards of.</param>
/// <returns>An object containing the shards information.</returns>
Task<ShardsInformationResult?> Shards(long seqno);
/// <summary>
/// Estimates fee for the message
/// </summary>
/// <param name="message">The message for which you need to calculate the fees</param>
/// <returns>The result of estimation fees.</returns>
Task<IEstimateFeeResult> EstimateFee(MessageX message, bool ignoreChksig = true);
/// <summary>
/// Sends a Bag of Cells (BoC) to the network.
/// </summary>
/// <param name="boc">The Cell object representing the Bag of Cells.</param>
/// <returns>The result of sending the Bag of Cells.</returns>
Task<SendBocResult?> SendBocReturnHash(Cell boc);
}
}