diff options
author | Yigit Sever | 2021-04-19 18:21:06 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-19 18:21:06 +0300 |
commit | 81ebd267c89011ca65cd5cfe382e10fabd9017ac (patch) | |
tree | 4e1f17b897bc9e3850e9c50861fd4893371f05e4 /site/public/transaction-docs | |
parent | 202625e0e1a4a6a85c895d9cd71a9f419a3b2173 (diff) | |
download | gradecoin-81ebd267c89011ca65cd5cfe382e10fabd9017ac.tar.gz gradecoin-81ebd267c89011ca65cd5cfe382e10fabd9017ac.tar.bz2 gradecoin-81ebd267c89011ca65cd5cfe382e10fabd9017ac.zip |
Moving site to separate repo
Diffstat (limited to 'site/public/transaction-docs')
-rw-r--r-- | site/public/transaction-docs/index.html | 196 |
1 files changed, 0 insertions, 196 deletions
diff --git a/site/public/transaction-docs/index.html b/site/public/transaction-docs/index.html deleted file mode 100644 index 593bcfe..0000000 --- a/site/public/transaction-docs/index.html +++ /dev/null | |||
@@ -1,196 +0,0 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | |||
4 | <head> | ||
5 | <meta charset="UTF-8"> | ||
6 | <title>Transactions | Gradecoin </title> | ||
7 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
8 | <style> | ||
9 | :root { | ||
10 | /* Primary theme color */ | ||
11 | --primary-color: #F8D12F; | ||
12 | /* Primary theme text color */ | ||
13 | --primary-text-color: #1E2329; | ||
14 | /* Primary theme link color */ | ||
15 | --primary-link-color: #2F57F7; | ||
16 | /* Secondary color: the background body color */ | ||
17 | --secondary-color: #FAFAFA; | ||
18 | --secondary-text-color: #303030; | ||
19 | /* Highlight text color of table of content */ | ||
20 | --toc-highlight-text-color: #d46e13; | ||
21 | } | ||
22 | </style> | ||
23 | |||
24 | <link href="https://fonts.googleapis.com/css?family=Alfa+Slab+One&display=swap" rel="stylesheet"> | ||
25 | <link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600&display=swap" rel="stylesheet"> | ||
26 | <link rel="stylesheet" href="/normalize.css"> | ||
27 | <link rel="stylesheet" href="https://gradecoin.xyz/juice.css"> | ||
28 | |||
29 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" /> | ||
30 | <link rel="stylesheet" href="/site.css" /> | ||
31 | |||
32 | </head> | ||
33 | |||
34 | <body> | ||
35 | |||
36 | <header class="box-shadow"> | ||
37 | |||
38 | |||
39 | <a href="https://gradecoin.xyz/"> | ||
40 | <div class="logo"> | ||
41 | <img src="https://gradecoin.xyz/gradecoin.png" alt="logo"> | ||
42 | Gradecoin | ||
43 | </div> | ||
44 | </a> | ||
45 | |||
46 | <nav> | ||
47 | |||
48 | <a class="nav-item subtitle-text" href="https://gradecoin.xyz/register-docs/">Register</a> | ||
49 | |||
50 | <a class="nav-item subtitle-text" href="https://gradecoin.xyz/jwt/">JWT</a> | ||
51 | |||
52 | <a class="nav-item subtitle-text" href="https://gradecoin.xyz/transaction-docs/">Transactions</a> | ||
53 | |||
54 | <a class="nav-item subtitle-text" href="https://gradecoin.xyz/block-docs/">Blocks</a> | ||
55 | |||
56 | <a class="nav-item subtitle-text" href="https://gradecoin.xyz/misc-docs/">Misc</a> | ||
57 | |||
58 | |||
59 | |||
60 | <a class="nav-item subtitle-text" href="https://github.com/zhuowei/nft_ptr#why">why?</a> | ||
61 | |||
62 | |||
63 | </nav> | ||
64 | |||
65 | </header> | ||
66 | |||
67 | |||
68 | <main> | ||
69 | |||
70 | |||
71 | |||
72 | |||
73 | |||
74 | <div class="toc"> | ||
75 | <div class="toc-sticky"> | ||
76 | |||
77 | <div class="toc-item"> | ||
78 | <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#requests">Requests</a> | ||
79 | </div> | ||
80 | |||
81 | |||
82 | <div class="toc-item-child"> | ||
83 | <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#get"><small>- GET</small></a> | ||
84 | </div> | ||
85 | |||
86 | <div class="toc-item-child"> | ||
87 | <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#post"><small>- POST</small></a> | ||
88 | </div> | ||
89 | |||
90 | |||
91 | |||
92 | <div class="toc-item"> | ||
93 | <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#fields">Fields</a> | ||
94 | </div> | ||
95 | |||
96 | |||
97 | <div class="toc-item"> | ||
98 | <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#hash">Hash</a> | ||
99 | </div> | ||
100 | |||
101 | |||
102 | <div class="toc-item"> | ||
103 | <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#bank">Bank</a> | ||
104 | </div> | ||
105 | |||
106 | |||
107 | </div> | ||
108 | </div> | ||
109 | |||
110 | |||
111 | |||
112 | <div class="content text"> | ||
113 | |||
114 | <div class="heading-text">Transaction documentation</div> | ||
115 | <p>A transaction request between <code>source</code> and <code>target</code> to move <code>amount</code> Gradecoin.</p> | ||
116 | <h1 id="requests">Requests</h1> | ||
117 | <h2 id="get">GET</h2> | ||
118 | <p>A HTTP <code>GET</code> request to <a href="/transaction">/transaction</a> endpoint will return the current list of pending transactions.</p> | ||
119 | <h2 id="post">POST</h2> | ||
120 | <p>A HTTP <code>POST</code> request with Authorization using JWT to <a href="/transactions">/transaction</a> will allow you to propose your own transactions.</p> | ||
121 | <h1 id="fields">Fields</h1> | ||
122 | <pre style="background-color:#ffffff;"> | ||
123 | <code><span style="color:#545052;">by: Fingerprint | ||
124 | source: Fingerprint | ||
125 | target: Fingerprint | ||
126 | amount: unsigned 16 bit integer | ||
127 | timestamp: ISO 8601 <date>T<time> | ||
128 | </span></code></pre><h1 id="hash">Hash</h1> | ||
129 | <p><code>tha</code> field in <a href="https://gradecoin.xyz/jwt/">jwt documentation</a> in fact stands for "The Hash", in the case of a post request for a transaction, you need the Md5 hash of the serialized JSON representation of transaction. The resulting JSON string should look something like;</p> | ||
130 | <pre style="background-color:#ffffff;"> | ||
131 | <code><span style="color:#545052;">{"by":"foo","source":"bar","target":"baz","amount":2,"timestamp":"2021-04-18T21:49:00"} | ||
132 | </span></code></pre> | ||
133 | <p>Or; without any whitespace, separated with <code>:</code> and <code>,</code>.</p> | ||
134 | <h1 id="bank">Bank</h1> | ||
135 | <p>There is a <code>bank</code> account with Fingerprint <code>31415926535897932384626433832795028841971693993751058209749445923</code></p> | ||
136 | <blockquote class="tidbit"> | ||
137 | <p> | ||
138 | First 64 digits of Pi | ||
139 | </p> | ||
140 | </blockquote> | ||
141 | <p>This is the only account that will let you <em>withdraw</em> from them.</p> | ||
142 | <pre style="background-color:#ffffff;"> | ||
143 | <code><span style="color:#545052;">by: this has to be your Fingerprint | ||
144 | source: this can be either you or the bank | ||
145 | target: this can be a valid fingerprint or yourself if source is the bank | ||
146 | ... | ||
147 | </span></code></pre> | ||
148 | |||
149 | </div> | ||
150 | |||
151 | |||
152 | |||
153 | </main> | ||
154 | |||
155 | |||
156 | <footer> | ||
157 | Built For ⁂ CENG489 ⁂ Introduction to Computer Security | ||
158 | </footer> | ||
159 | |||
160 | </body> | ||
161 | <script> | ||
162 | function highlightNav(heading) { | ||
163 | let pathname = location.pathname; | ||
164 | document.querySelectorAll(".toc a").forEach((item) => { | ||
165 | item.classList.remove("active"); | ||
166 | }); | ||
167 | document.querySelector(".toc a[href$='" + pathname + "#" + heading + "']").classList.add("active"); | ||
168 | } | ||
169 | |||
170 | let currentHeading = ""; | ||
171 | window.onscroll = function () { | ||
172 | let h = document.querySelectorAll("h1,h2,h3,h4,h5,h6"); | ||
173 | let elementArr = []; | ||
174 | |||
175 | h.forEach(item => { | ||
176 | if (item.id !== "") { | ||
177 | elementArr[item.id] = item.getBoundingClientRect().top; | ||
178 | } | ||
179 | }); | ||
180 | elementArr.sort(); | ||
181 | for (let key in elementArr) { | ||
182 | if (!elementArr.hasOwnProperty(key)) { | ||
183 | continue; | ||
184 | } | ||
185 | if (elementArr[key] > 0 && elementArr[key] < 300) { | ||
186 | if (currentHeading !== key) { | ||
187 | highlightNav(key); | ||
188 | currentHeading = key; | ||
189 | } | ||
190 | break; | ||
191 | } | ||
192 | } | ||
193 | } | ||
194 | </script> | ||
195 | |||
196 | </html> | ||