From 81d089db6ca8c14075a6d2760d6dc8720dd84c83 Mon Sep 17 00:00:00 2001 From: morkeltry Date: Sun, 13 Oct 2024 16:33:34 +0100 Subject: [PATCH] =?UTF-8?q?add=20punctuation=20=F0=9F=98=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 97f7e89..4bc45d8 100644 --- a/README.md +++ b/README.md @@ -75,55 +75,47 @@ The only fucntion that requires any authentication is `withdrawTo`, and the auth #### functions: ###### new_auth_out (preferred_auth : authOut) + ``` if preferred_auth exists already as a key in balances, then report error. - if not, then add it as a key with balance 0 and report success. +``` ###### link_payment_reference (auth : authOut, payment_ref : ref) +``` if auth does not exist as a key in balances, then report error. - if not: - if payment_ref already exists as a key in paymentRefs, then randomly generate an alternative and set payment_ref to that. - add payment_ref as a key in paymentRefs and set its value to auth - +``` ###### accept_payment (payment_ref : ref, amount : u__, encrypt_to : Option(pubkey)) +``` <<< future work: - if payment_ref is encrypted with secret contract's own pubkey - decrypt it and set payment_ref to the decrypted version >>> +``` +``` if payment_ref not exist as a key in paymentRefs, then report error. - if it does: - add amount to balances[ paymentRefs[payment_ref] ] - create a receipt (eg json) { payment_ref, amount } - sign the receipt with the secret contract's privkey - if encrypt_to contains a pubkey: - encrypt the receipt and signature with pubkey and return them - if not, - return the receipt and signature - +``` ###### withdraw_to (auth : authOut, amount : u__, withdrawal_address : address) +``` if auth does not exist as a key in balances, then report error. - if balances[auth] < amount then report error. - if neither error: - - return DO_THE_WITHDRAWAL (withdrawal_address, amount) - + return DO_THE_WITHDRAWAL (withdrawal_address, amount) +``` ###### retrieve_pubkey () + ``` return the secret contract's own pubkey +```