-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.html
More file actions
226 lines (207 loc) · 9.72 KB
/
api.html
File metadata and controls
226 lines (207 loc) · 9.72 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title></title>
<link rel="preload" href="./fonts/Mulish-VariableFont_wght.ttf" as="font" type="font/ttf" crossorigin="">
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/markdown.min.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
</head>
<body>
<main>
<div class="container">
<header class="d-flex flex-wrap justify-content-between">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
<div class="logo">
<svg width="32" height="32" viewBox="0 0 460 460" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="logo-diamond" fill-rule="evenodd" clip-rule="evenodd" d="M166 152L295 152C299.564 152 304.124 152.67 308.89 154.892C314.604 157.555 317.633 161.753 319.755 164.857C319.921 165.098 320.075 165.347 320.218 165.602C322.714 170.044 324 174.841 324 180C324 184.902 322.834 190.243 320.218 194.898C320.193 194.943 320.168 194.987 320.142 195.031L238.642 335.031C236.845 338.118 233.537 340.013 229.965 340C226.392 339.987 223.098 338.07 221.322 334.97L141.318 195.268C141.295 195.23 141.272 195.192 141.249 195.154C139.418 192.137 136.587 187.471 136.092 181.45C135.637 175.913 136.881 170.365 139.663 165.555C142.445 160.744 146.634 156.898 151.671 154.544C157.073 152.02 162.548 152 166 152ZM220 172L166 172C162.452 172 161.09 172.218 160.138 172.663C158.822 173.278 157.716 174.289 156.976 175.567C156.237 176.846 155.903 178.328 156.025 179.811C156.095 180.662 156.441 181.634 158.485 185.006C158.528 185.077 158.57 185.148 158.611 185.22L220 292.416V172ZM240 172V292.945L302.811 185.05C303.52 183.762 304 181.901 304 180C304 178.458 303.681 177.119 302.966 175.738C302.216 174.66 301.759 174.089 301.377 173.698C301.049 173.364 300.797 173.185 300.441 173.019C298.956 172.327 297.436 172 295 172L240 172Z" fill="#303757"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M460 230C460 357.025 357.025 460 230 460C102.974 460 0 357.025 0 230C0 102.974 102.974 0 230 0C357.025 0 460 102.974 460 230ZM440 230C440 345.98 345.98 440 230 440C114.02 440 20 345.98 20 230C20 114.02 114.02 20 230 20C345.98 20 440 114.02 440 230Z" fill="#0088CC"/>
</svg>
<span class="logo testnet">
TON.SH
</span>
</div>
</a>
<ul class="nav nav-pills">
<li class="nav-item"><a href="#" class="nav-link" >Api</a></li>
<li class="nav-item"><a href="#" class="nav-link active">Explorer</a></li>
</ul>
</header>
<div class="api markdown-body">
<h1 style="margin-top: 44px;">TON.sh Public API
</h1>
<blockquote class="blockquote">
<p class="mb-0">HTTP-based experimental interface created for developers.</p>
</blockquote>
<h2>Making requests</h2>
<p>All queries to the TON.sh Public API must be served over HTTPS and need to be presented in this form:
<code>
https://api.ton.sh/METHOD_NAME
</code>
</p>
<p>Example: <br/><code>https://api.ton.sh/getAddressInformation?address=EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N</code></p>
<p>We support GET and POST HTTP methods. Use <span class="text-monospace">application/x-www-form-urlencoded</span> header for POST requests.</p>
<p>The response contains a JSON object, which always has a boolean field <code>ok</code> and may have an optional string field <code>description</code> with a human-readable description of the result. If <code>ok</code> equals true, the request was successful and the result of the query can be found in the <code>result</code> field. In case of an unsuccessful request, <code>ok</code> equals false and the error is explained in the <code>description</code>.</p>
<h2>Blockchain ID</h2>
<p>Any method supports <code>blockchain_id</code> parameter.</p>
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>blockchain_id</td>
<td>Identifier of target blockchain ID, either "mainnet" or "test"</td>
</tr>
</tbody>
</table>
<h2>Limits</h2>
<p>TON.sh Public API will not allow more than <span class="text-monospace">30 requests per minute</span>. Should you go over that limit, your IP will be blocked for 1 minute, you'll begin receiving 429 errors.</p>
<hr>
<h2>getAddressInformation</h2>
<p>Use this method to get balance (in nanotons) and state of a given address.</p>
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>address</td>
<td>Identifier of target account in TON</td>
</tr>
</tbody>
</table>
<h2>getTransactions</h2>
<p>Use this method to get transaction history of a given address. Along with <code>result</code>, API may return <code>previous_transaction</code> with <code>lt</code> and <code>hash</code> fields, if there are more transactions to see. Use them to get more transactions.</p>
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Required</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>address</td>
<td>Yes</td>
<td>Identifier of target account in TON</td>
</tr>
<tr>
<td>limit</td>
<td>Optional</td>
<td>Limits the number of transactions to be retrieved. Values between 1—10 are accepted. Defaults to 10.</td>
</tr>
<tr>
<td>lt</td>
<td>Optional</td>
<td>Logical time of transaction to start with, must be sent with hash</td>
</tr>
<tr>
<td>hash</td>
<td>Optional</td>
<td>Hash of transaction to start with, must be sent with lt</td>
</tr>
</tbody>
</table>
<h2>getAddressBalance</h2>
<p>Use this method to get balance (in nanotons) of a given address.</p>
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>address</td>
<td>Identifier of target account in TON</td>
</tr>
</tbody>
</table>
<h2>getAddressState</h2>
<p>Use this method to get state of a given address. State can be either <code>unitialized</code>, <code>active</code> or <code>frozen</code>.</p>
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>address</td>
<td>Identifier of target account in TON</td>
</tr>
</tbody>
</table>
<h2>unpackAddress</h2>
<p>Use this method to convert an address from human-readable to raw format.</p>
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>address</td>
<td>Identifier of target account in TON in human-readable format</td>
</tr>
</tbody>
</table>
<h2>packAddress</h2>
<p>Use this method to convert an address from raw to human-readable format.</p>
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>address</td>
<td>Identifier of target account in TON in raw format</td>
</tr>
</tbody>
</table>
<h2>getServerTime</h2>
<p>Get TON node time (not TON.sh server time).</p>
</div>
</main>
<footer>
<div class="container">
<div class="nav-header">
<a href="/" class="d-flex align-items-center mb-md-0 me-md-auto text-dark text-decoration-none">
<div class="logo">
<svg width="32" height="32" viewBox="0 0 460 460" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="logo-diamond" fill-rule="evenodd" clip-rule="evenodd" d="M166 152L295 152C299.564 152 304.124 152.67 308.89 154.892C314.604 157.555 317.633 161.753 319.755 164.857C319.921 165.098 320.075 165.347 320.218 165.602C322.714 170.044 324 174.841 324 180C324 184.902 322.834 190.243 320.218 194.898C320.193 194.943 320.168 194.987 320.142 195.031L238.642 335.031C236.845 338.118 233.537 340.013 229.965 340C226.392 339.987 223.098 338.07 221.322 334.97L141.318 195.268C141.295 195.23 141.272 195.192 141.249 195.154C139.418 192.137 136.587 187.471 136.092 181.45C135.637 175.913 136.881 170.365 139.663 165.555C142.445 160.744 146.634 156.898 151.671 154.544C157.073 152.02 162.548 152 166 152ZM220 172L166 172C162.452 172 161.09 172.218 160.138 172.663C158.822 173.278 157.716 174.289 156.976 175.567C156.237 176.846 155.903 178.328 156.025 179.811C156.095 180.662 156.441 181.634 158.485 185.006C158.528 185.077 158.57 185.148 158.611 185.22L220 292.416V172ZM240 172V292.945L302.811 185.05C303.52 183.762 304 181.901 304 180C304 178.458 303.681 177.119 302.966 175.738C302.216 174.66 301.759 174.089 301.377 173.698C301.049 173.364 300.797 173.185 300.441 173.019C298.956 172.327 297.436 172 295 172L240 172Z" fill="#303757"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M460 230C460 357.025 357.025 460 230 460C102.974 460 0 357.025 0 230C0 102.974 102.974 0 230 0C357.025 0 460 102.974 460 230ZM440 230C440 345.98 345.98 440 230 440C114.02 440 20 345.98 20 230C20 114.02 114.02 20 230 20C345.98 20 440 114.02 440 230Z" fill="#0088CC"/>
</svg>
<span class="logo">
TON.SH
</span>
</div>
</a>
</div>
<div class="bubble">
</div>
</div>
</footer>
<script src="./js/bootstrap.bundle.min.js"></script>
</body>
</html>