-
Notifications
You must be signed in to change notification settings - Fork 20
/
index.html
198 lines (192 loc) · 8.53 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
<!doctype html>
<html lang="en" class="h-100">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Simple Utilities for Substrate">
<meta name="author" content="Shawn Tabrizi">
<title>Substrate JS Utilities</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- Custom styles for this template -->
<link href="custom.css" rel="stylesheet">
<!-- Simple Analytics -->
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt=""
referrerpolicy="no-referrer-when-downgrade" /></noscript>
</head>
<body class="d-flex flex-column h-100">
<main role="main" class="flex-shrink-0">
<div class="container">
<h1 class="mt-5">Substrate Utilities</h1>
<p class="lead">Hopefully this page helps you do something.</p>
<div class="row">
<div class="col">
<h4>More Utilities</h4>
<ul>
<li><a href="./codec/">SCALE Decoder</a></li>
<li><a href="./indices/">Query Indices</a></li>
<li><a href="./versions/">Network Versions</a></li>
<li><a href="./nominations/">Query Nominations</a></li>
<li><a href="./event-count/">Query Event Count</a></li>
<li><a href="https://www.shawntabrizi.com/substrate-balance-graph/">Graph Balances</a></li>
<li><a href="https://www.shawntabrizi.com/substrate-weight-graph/">Graph Weights</a></li>
<li><a href="https://www.shawntabrizi.com/substrate-balance-calculator/">Calculate Reserved
Balances</a></li>
<li><a href="https://shawntabrizi.github.io/substrate-known-keys/">Substrate Known Keys</a></li>
</ul>
</div>
</div>
<div class="row">
<div class="col">
<div class="mb-3">
<h4>String to Hex</h4>
<div class="input-group">
<input type="text" class="form-control" id="string-s2h" placeholder="String">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">⇄</span>
</div>
<input type="text" class="form-control" id="hex-s2h" placeholder="Hex">
</div>
<h4>Balance to Hex (Little Endian)</h4>
<div class="input-group">
<input type="text" class="form-control" id="balance-b2h" placeholder="Balance">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">⇄</span>
</div>
<input type="text" class="form-control" id="hex-b2h" placeholder="Hex">
</div>
<h4>AccountId to Hex</h4>
<div class="input-group">
<input type="text" class="form-control" id="account-a2h" placeholder="AccountId">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">⇄</span>
</div>
<input type="text" class="form-control" id="hex-a2h" placeholder="Hex">
</div>
<h4>Blake2 a String</h4>
<div class="input-group">
<input type="text" class="form-control col-5" id="input-blake2" placeholder="Input">
<input type="text" class="form-control col-1" id="bits-blake2" placeholder="Bits"
value="256">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">→</span>
</div>
<div type="text" class="form-control" id="hash-blake2">Hash</div>
</div>
<h4>Blake2 Concat a String</h4>
<div class="input-group">
<input type="text" class="form-control col-5" id="input-blake2-concat" placeholder="Input">
<input type="text" class="form-control col-1" id="bits-blake2-concat" placeholder="Bits"
value="128">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">→</span>
</div>
<div type="text" class="form-control" id="hash-blake2-concat">Hash</div>
</div>
<h4>XXHash a String</h4>
<div class="input-group">
<input type="text" class="form-control col-5" id="input-xxhash" placeholder="Input">
<input type="text" class="form-control col-1" id="bits-xxhash" placeholder="Bits"
value="128">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">→</span>
</div>
<div type="text" class="form-control" id="hash-xxhash">Hash</div>
</div>
<h4>XXHash Concat a String</h4>
<div class="input-group">
<input type="text" class="form-control col-5" id="input-xxhash-concat" placeholder="Input">
<input type="text" class="form-control col-1" id="bits-xxhash-concat" placeholder="Bits"
value="64">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">→</span>
</div>
<div type="text" class="form-control" id="hash-xxhash-concat">Hash</div>
</div>
<h4>Seed to Address</h4>
<div class="input-group">
<input type="text" class="form-control" id="seed-s2a" placeholder="Input">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">→</span>
</div>
<div type="text" class="form-control" id="address-s2a">Address
</div>
</div>
<h4>Change Address Prefix
<a
href="https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)#address-type">(Prefix
Lookup)</a>
</h4>
<div class="input-group">
<input type="text" class="form-control col-5" id="address-cap" placeholder="Address">
<input type="text" class="form-control col-1" id="prefix-cap" placeholder="Prefix">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">→</span>
</div>
<div type="text" class="form-control" id="result-cap">Address
</div>
</div>
<h4>"Module ID" to Address</h4>
<div class="input-group">
<input type="text" class="form-control" id="moduleId-modid" placeholder="ModuleId">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">→</span>
</div>
<div type="text" class="form-control" id="address-modid">Address
</div>
</div>
<h4>"Para ID" to Address</h4>
<div class="input-group">
<input type="text" class="form-control col-5" id="paraId-paraid" placeholder="ParaId">
<select id="type-paraid" class="form-control col-1">
<option value="para" selected="selected">Child</option>
<option value="sibl">Sibling</option>
</select>
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">→</span>
</div>
<div type="text" class="form-control" id="address-paraid">Address
</div>
</div>
<h4>Sub-Account Generator</h4>
<div class="input-group">
<input type="text" class="form-control col-5" id="address-subid" placeholder="Address">
<input type="text" class="form-control col-1" id="index-subid" placeholder="Index">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">→</span>
</div>
<div type="text" class="form-control" id="subid-subid">Sub-Account
</div>
</div>
<h4>u8 Array to Hex</h4>
<div class="input-group">
<input type="text" class="form-control" id="u8a-u82h"
placeholder="Comma Separated u8a Array">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">⇄</span>
</div>
<input type="text" class="form-control" id="hex-u82h" placeholder="Hex">
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="footer mt-auto py-3">
<div class="container">
<span class="text-muted">
Substrate JS Utilities
- Created by <a href="https://shawntabrizi.com">Shawn Tabrizi</a>
- Source on <a href="https://github.com/shawntabrizi/substrate-js-utilities">GitHub</a>
- Using <a href="https://polkadot.js.org/common/">polkadot-js/common</a>
</span>
</div>
</footer>
<script src="https://unpkg.com/@polkadot/util/bundle-polkadot-util.js"></script>
<script src="https://unpkg.com/@polkadot/util-crypto/bundle-polkadot-util-crypto.js"></script>
<script src="https://unpkg.com/@polkadot/keyring/bundle-polkadot-keyring.js"></script>
<script src="utilities.js"></script>
</body>
</html>