aboutsummaryrefslogtreecommitdiffstats
path: root/content/transaction_docs.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/transaction_docs.md')
-rw-r--r--content/transaction_docs.md52
1 files changed, 52 insertions, 0 deletions
diff --git a/content/transaction_docs.md b/content/transaction_docs.md
new file mode 100644
index 0000000..05c1534
--- /dev/null
+++ b/content/transaction_docs.md
@@ -0,0 +1,52 @@
1+++
2title = "Transactions"
3description = "Transaction documentation"
4weight = 6
5+++
6
7A transaction request between `source` and `target` to move `amount` Gradecoin.
8
9# Requests
10
11## GET
12A HTTP `GET` request to [/transaction](/transaction) endpoint will return the current list of pending transactions.
13
14## POST
15
16A HTTP `POST` request with Authorization using JWT to [/transaction](/transactions) will allow you to propose your own transactions.
17
18# Fields
19```
20by: Fingerprint
21source: Fingerprint
22target: Fingerprint
23amount: unsigned 16 bit integer
24timestamp: ISO 8601 <date>T<time>
25```
26
27# Hash
28
29`tha` field in [jwt documentation](@/JWT.md) 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;
30
31```
32{"by":"foo","source":"bar","target":"baz","amount":2,"timestamp":"2021-04-18T21:49:00"}
33```
34
35Or; without any whitespace, separated with `:` and `,`.
36
37# Bank
38
39There is a `bank` account with Fingerprint `31415926535897932384626433832795028841971693993751058209749445923`
40
41{% tidbit() %}
42First 64 digits of Pi
43{% end %}
44
45This is the only account that will let you _withdraw_ from them.
46
47```
48by: this has to be your Fingerprint
49source: this can be either you or the bank
50target: this can be a valid fingerprint or yourself if source is the bank
51...
52```