diff --git a/README.md b/README.md index f7c3b29..0d9b7b0 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ As the fee should be larger than the claiming transaction cost, there might be a ## Deposits Deposits follow the flow described in the first 3 steps above. + +![Sessions diagram](/docs/deposit_diagram.png) + For more details please see the `deposit` function at [Deposit example](./lib/deposit.ts). ## Claiming @@ -25,6 +28,8 @@ Claiming can be done in two ways: The recipient uses the private key to craft a transaction to claim the gift. The `fee_amount` will be used to cover the transaction fees, so the recipient only gets the `gift_amount`. The recipient doesn’t need to have any funds in their wallet or even a deployed wallet to claim the gift using this method. +![Sessions diagram](/docs/internal_claim.png) + Edge cases: - Insufficient `fee_amount`: Alternative options are "external claiming", waiting for transaction price to go down, or canceling the gift (see below). @@ -39,6 +44,8 @@ It is also possible for someone else to pay for the claim fees. This can be usef The receiver can use the private key sign a message containing the address receiving the address (and optionally some address that will receive the dust). Using this signature, anybody can execute a transaction to perform the claim. To do so, they should call `claim_external` on the escrow account (through the `execute_action` entrypoint). +![Sessions diagram](/docs/external_claim.png) + For more details please see the `claimExternal` function at [Claim External Example](./lib/claim.ts). ## Cancelling Gifts diff --git a/docs/deposit_diagram.png b/docs/deposit_diagram.png new file mode 100644 index 0000000..fbca629 Binary files /dev/null and b/docs/deposit_diagram.png differ diff --git a/docs/diagrams.drawio b/docs/diagrams.drawio new file mode 100644 index 0000000..71b298b --- /dev/null +++ b/docs/diagrams.drawio @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/external_claim.png b/docs/external_claim.png new file mode 100644 index 0000000..5621512 Binary files /dev/null and b/docs/external_claim.png differ diff --git a/docs/internal_claim.png b/docs/internal_claim.png new file mode 100644 index 0000000..3465309 Binary files /dev/null and b/docs/internal_claim.png differ