-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
264 lines (240 loc) · 9.04 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ron's API Server</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:[email protected]&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #0c1015;
font-family: 'Kode Mono', monospace;
color: #00ff00;
line-height: 1.6;
padding: 20px;
max-width: 1200px;
margin: 0 auto;
}
.container {
background-color: rgba(2, 6, 12, 0.95);
border: 1px solid #1a2634;
border-radius: 8px;
padding: 30px;
margin-top: 20px;
box-shadow: 0 4px 6px rgba(0, 255, 0, 0.1);
}
.title {
font-size: 28px;
margin-bottom: 30px;
border-bottom: 2px solid #1a2634;
padding-bottom: 15px;
color: #fff;
}
.endpoint {
margin: 30px 0;
padding: 25px;
background-color: rgba(26, 38, 52, 0.4);
border-radius: 8px;
border: 1px solid #1a2634;
}
.endpoint-title {
font-size: 20px;
margin-bottom: 15px;
color: #fff;
display: flex;
align-items: center;
gap: 10px;
}
.endpoint-description {
color: #7f8ea3;
margin-bottom: 20px;
font-size: 14px;
line-height: 1.6;
padding: 10px;
background-color: rgba(26, 38, 52, 0.4);
border-radius: 4px;
}
.input-group {
margin: 15px 0;
display: flex;
flex-wrap: wrap;
gap: 10px;
align-items: flex-start;
}
.input-wrapper {
display: flex;
flex-direction: column;
gap: 5px;
}
.input-label {
font-size: 12px;
color: #7f8ea3;
}
input {
background-color: rgba(12, 16, 21, 0.8);
border: 1px solid #1a2634;
color: #fff;
padding: 10px;
font-family: 'Kode Mono', monospace;
border-radius: 4px;
min-width: 200px;
transition: all 0.3s ease;
}
input:focus {
outline: none;
border-color: #61d7ff;
box-shadow: 0 0 0 2px rgba(0, 255, 0, 0.1);
}
input[type="number"] {
min-width: 100px;
}
#requestKey {
min-width: 400px; /* Adjust this value as needed */
width: 100%;
}
button {
background-color: #1a2634;
color: #fff;
border: 1px solid #61d7ff;
padding: 10px 20px;
cursor: pointer;
font-family: 'Kode Mono', monospace;
border-radius: 4px;
transition: all 0.3s ease;
margin-top: 20px;
}
button:hover {
background-color: #61d7ff;
color: #0c1015;
}
.url-display {
word-break: break-all;
margin: 15px 0;
padding: 15px;
background-color: rgba(12, 16, 21, 0.8);
border-radius: 4px;
border: 1px solid #1a2634;
display: none;
}
.url-display a {
color: #fff;
text-decoration: none;
}
.url-display a:hover {
text-decoration: underline;
}
.endpoint-icon {
width: 24px;
height: 24px;
fill: #00ff00;
}
</style>
</head>
<body>
<div class="container">
<div class="title">
<span id="welcome">Welcome to Ron's API Server</span>
</div>
<!-- First endpoint card -->
<div class="endpoint">
<div class="endpoint-title">
Account Balance Endpoint
</div>
<div class="endpoint-description">
Retrieve account balance for all tokens, or optionally specify an asset ID/namespace to get a specific token balance for the account.
</div>
<div class="input-group">
<div class="input-wrapper">
<span class="input-label">Wallet Address (required)</span>
<input type="text" id="accountInput1" placeholder="account" />
</div>
<div class="input-wrapper">
<span class="input-label">Asset ID (optional)</span>
<input type="text" id="assetId" placeholder="Asset ID" />
</div>
</div>
<button onclick="generateUrl(1)">Generate URL</button>
<div id="url1" class="url-display"></div>
</div>
<!-- Second endpoint card -->
<div class="endpoint">
<div class="endpoint-title">
Transfers History Endpoint
</div>
<div class="endpoint-description">
Fetch transfer history for a specific account with pagination support.
Use Page ID to navigate through results and Page Size to control the number of records per page.
Results are sequential, so Page ID 0 and Page Size 10 will load the 10 most recent transfers, but Page ID 1 and Page Size 10 will load the next 10 transfers.
</div>
<div class="input-group">
<div class="input-wrapper">
<span class="input-label">Wallet Address (required)</span>
<input type="text" id="accountInput2" placeholder="account" />
</div>
<div class="input-wrapper">
<span class="input-label">Page ID (optional, default: 0)</span>
<input type="number" id="pageId" placeholder="0" value="0" min="0" />
</div>
<div class="input-wrapper">
<span class="input-label">Results per page (optional, default: 10, less than 500)</span>
<input type="number" id="pageSize" placeholder="10" value="10" min="1" max="100" />
</div>
</div>
<button onclick="generateUrl(2)">Generate URL</button>
<div id="url2" class="url-display"></div>
</div>
<!-- Third endpoint card -->
<div class="endpoint">
<div class="endpoint-title">
Transaction Details Endpoint
</div>
<div class="endpoint-description">
View details of a transaction using the request key from a previously submitted transaction.
</div>
<div class="input-group">
<div class="input-wrapper">
<span class="input-label">Request Key (required)</span>
<input type="text" id="requestKey" placeholder="Request Key" />
</div>
</div>
<button onclick="generateUrl(3)">Generate URL</button>
<div id="url3" class="url-display"></div>
</div>
</div>
<script>
function generateUrl(endpoint) {
let url;
switch (endpoint) {
case 1:
const account1 = document.getElementById('accountInput1').value;
const assetId = document.getElementById('assetId').value;
url = `https://rons-server.netlify.app/.netlify/functions/server/api/account/${account1}${assetId ? '/' + assetId : ''}`;
document.getElementById('url1').style.display = 'block';
document.getElementById('url1').innerHTML = `<a href="${url}" target="_blank">${url}</a>`;
break;
case 2:
const account2 = document.getElementById('accountInput2').value;
const pageId = document.getElementById('pageId').value || 0;
const pageSize = document.getElementById('pageSize').value || 10;
url = `https://rons-server.netlify.app/.netlify/functions/server/api/transfers-history/${account2}?pageId=${pageId}&pageSize=${pageSize}`;
document.getElementById('url2').style.display = 'block';
document.getElementById('url2').innerHTML = `<a href="${url}" target="_blank">${url}</a>`;
break;
case 3:
const requestKey = document.getElementById('requestKey').value;
url = `https://rons-server.netlify.app/.netlify/functions/server/api/txn/${requestKey}`;
document.getElementById('url3').style.display = 'block';
document.getElementById('url3').innerHTML = `<a href="${url}" target="_blank">${url}</a>`;
break;
default:
break;
}
}
</script>
</body>
</html>