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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dashboard | Arching Kaos</title>
<style type="text/css">
pre { white-space: pre-wrap; }
#stellar-freigher-connect-address-button {
position: fixed;
top: 0;
right: 2vw;
padding: 2vh 2vw;
}
</style>
<link rel="icon" href="https://ipfs.arching-kaos.com/ipfs/QmagKP1zLWaGHLR4191dpvsCYHS8tuPCRYJgfK9Zdr6i9S?filename=logo.png" sizes="32x32">
<link rel="icon" href="https://ipfs.arching-kaos.com/ipfs/QmagKP1zLWaGHLR4191dpvsCYHS8tuPCRYJgfK9Zdr6i9S?filename=logo.png" sizes="192x192">
<link rel="apple-touch-icon" href="https://ipfs.arching-kaos.com/ipfs/QmagKP1zLWaGHLR4191dpvsCYHS8tuPCRYJgfK9Zdr6i9S?filename=logo.png">
<meta name="msapplication-TileImage" content="https://ipfs.arching-kaos.com/ipfs/QmagKP1zLWaGHLR4191dpvsCYHS8tuPCRYJgfK9Zdr6i9S?filename=logo.png">
<link rel="stylesheet" type="text/css" href="//ipfs.arching-kaos.com/ipfs/Qmcusex5HCKKeKAouXtUiwGoFxZzzsvcmo4dGewKBETwDv?filename=style2.css">
<link rel="stylesheet" type="text/css" href="//ipfs.arching-kaos.com/ipfs/Qme4Lao1ffeyDtn4r9z8ZPCUPipRWJHPJig9Kh9XHw1ete?filename=style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdnjs.cloudflare.com/ajax/libs/stellar-freighter-api/1.1.2/index.min.js"></script>
</head>
<body>
<div class="header">
<img src="//ipfs.arching-kaos.com/ipfs/QmcyDhApg19qDcjdCpTFaezXrjfcUrC9MZq9wKo69trRDH">
<h1 style="text-align: center;">Arching Kaos</h1>
</div>
<hr>
<div id="menu" class="linkin">
<span id="mypage-section-link"><a href="#mypage-section" onclick="menusel(this)">My page</a> | </span>
<a href="#mixtapes-section" onclick="menusel(this)">Mixtapes</a> |
<a href="#news-section" onclick="menusel(this)">News</a> |
<span id="stellar-balances-link"><a href="#stellar-balances" onclick="menusel(this)">Balances</a> | </span>
<span id="stellar-data-config-link"><a href="#stellar-data-config" onclick="menusel(this)">Data</a> | </span>
<span id="arching-kaos-id-link"><a href="#arching-kaos-id" onclick="menusel(this)">AKID</a> | </span>
<a href="#zchain-data-section" onclick="menusel(this)">zchain</a> |
<a href="#stats-section" onclick="menusel(this)">Stats</a> |
<a href="#chat-section" onclick="menusel(this)">Chat</a> |
<a href="#about-section" onclick="menusel(this)">About</a>
</div>
<hr>
<p class="sub-input" id="stellar-freigher-connect-address-button" onclick="connect()" >Connect with Stellar address</p>
<div>
<div id="about-section">
<h2>About</h2>
<p>Arching Kaos is a project about radio, music, communications and decentralization. On site, you can listen to the latest mixes of music (menu entry "Mixtapes"), read latest news of the network and chat.</p>
<p>Note that to participate you will need to set up your Arching Kaos set, which is not so convinient yet (under development).</p>
<p>Furthermore, if you are using Freighter extension you can additionally see:</p>
<ol>
<li>Your balances on your wallet</li>
<li>Your configuration IPNS address (if any)</li>
<li>Your Arching Kaos configuration (if any)</li>
<li>Your zchain (...)</li>
<li>Your posted newsfeed (...)</li>
</ol>
<p>Finally, on the stats page you can find people that are participating over the Stellar Network, using the ARCHINGKAOS token/asset/coin.</p>
</div>
<div id="stellar-balances"><h2>Balances</h2></div>
<div id="stellar-data-config"><h2>Data</h2><p>The following was found on your wallet's "config" variable:</p></div>
<div id="arching-kaos-id"><h2>AKID</h2></div>
<div id="zchain-data-section"><h2>zchain</h2></div>
<div id="news-section"><h2>News</h2></div>
<div id="mixtapes-section"><h2>Mixtapes</h2></div>
<div id="chat-section"><h2>Chat</h2>
<iframe src="https://irc.arching-kaos.com" style="width: -moz-available; height: 80vh;"></iframe>
</div>
<div id="stats-section"><h2>Stats</h2></div>
<div id="mypage-section">
<h2>My page</h2>
<div id="my-news"></div>
<div id="my-mixtapes"></div>
<div id="my-zchain"></div>
</div>
</div>
<hr>
<div class="footer">
Arching Kaos <a target="_blank" href="https://git.kaotisk-hund.com/arching-kaos-tools/.git">Tools</a>, <a target="_blank" href="https://arching-kaos.org">Org</a>, <a target="_blank" href="https://arching-kaos.net">Net</a> |
Powered by <a target="_blank" href="https://www.kaotisk-hund.com">Kaotisk Hund</a>.
</div>
</body>
<script src="//cdnjs.cloudflare.com/ajax/libs/stellar-sdk/10.0.1/stellar-sdk.js"></script>
<script>
var profilemenuids = []
var menuids = ['#about-section','#zchain-data-section','#news-section','#stats-section','#mixtapes-section','#chat-section','#mypage-section','#stellar-balances','#stellar-data-config','#arching-kaos-id'];
function menuinit(){
menuids.forEach(m=>document.querySelector(m).hidden=true)
}
menuinit()
document.querySelector('#about-section').hidden=false
function menusel(m){
menuinit();
console.log(m)
document.querySelector(m.hash).hidden=false
}
function gettrustlines(){
var url='https://horizon.stellar.org/assets?asset_code=ARCHINGKAOS&asset_issuer=GB4QVKD6NW3CSNO5TNPARAWNPPXOPSSTKB35XCWB7PUNBIQTK3DVELB2'
fetch(url, {
method:'GET',
headers:{
Accept: 'application/json'
}
}).then(response=>{
if(response.ok){
response.json().then(json=>{
var stats = document.querySelector('#stats-section')
var small = document.createElement("small")
small.innerHTML = 'Connected trustlines: ' + json._embedded.records[0].accounts.authorized
stats.appendChild(small)
})
}
})
}
gettrustlines()
function getholders(a=0){
var url='https://horizon.stellar.org/accounts?asset=ARCHINGKAOS:GB4QVKD6NW3CSNO5TNPARAWNPPXOPSSTKB35XCWB7PUNBIQTK3DVELB2&limit=200'
fetch(url, {
method:'GET',
headers:{
Accept: 'application/json'
}
}).then(response=>{
if(response.ok){
response.json().then(json=>{
var stats = document.querySelector('#stats-section')
json._embedded.records.forEach(r=>{
var p = document.createElement("p")
p.innerHTML = r.account_id
p.id = r.account_id
checkforconfig(r.account_id)
stats.appendChild(p)
})
// if (json._links.next) getholders(json._links.next.href)
})
}
})
}
getholders()
function checkforconfig(addr) {
url='https://horizon.stellar.org/accounts/'+addr+'/data/config'
fetch(url, {
method:'GET',
headers:{
Accept: 'application/json'
}
}).then(response=>{
if(response.ok){
response.json().then(json=>{
var cnf = document.createElement("p")
cnf.innerHTML = atob(json.value)
document.querySelector('#'+addr).appendChild(cnf)
getnickname(atob(json.value),addr)
})
}
})
}
function getnickname(a,eid){
url='https://ipfs.arching-kaos.com/ipns/'+a
fetch(url, {
method:'GET',
headers:{
Accept: 'application/json'
}
}).then(response=>{
if(response.ok){
response.json().then(json=>{
/* Could be json object with
* - genesis
* - gpg
* - profile {
* - nickname
* }
* - zchain
*/
var divs = document.querySelector('#'+eid)
if(json.genesis){
var p = document.createElement("p")
p.innerHTML="Genesis: " +json.genesis
divs.appendChild(p)
}
if(json.gpg){
var p = document.createElement("p")
p.innerHTML="GPG: " +json.gpg
divs.appendChild(p)
}
if(json.profile.nickname){
var p = document.createElement("p")
p.innerHTML="Nickname: " +json.profile.nickname
divs.appendChild(p)
}
if(json.zchain){
var p = document.createElement("p")
p.innerHTML="zchain: " +json.zchain
divs.appendChild(p)
}
zseek(json.zchain)
})
}
})
}
var server = new StellarSdk.Server('https://horizon.stellar.org');
function letme(a){
server.accounts()
.accountId(a)
.call().then(function(r){ const L = r; putit(r); });
}
function putit(i){
var ta=document.querySelector("#stellar-balances")
readit(i)
for (b in i.balances) {
x = i.balances[b]
console.log(x)
var as = document.createElement("p")
as.innerHTML = x.balance + " "+ ( x.asset_code && x.asset_code != "undefined" ? x.asset_code :
|