Skip to content

Commit

Permalink
add diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
sgc-code committed Jul 1, 2024
1 parent eca7529 commit e422a9d
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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).
Expand All @@ -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
Expand Down
Binary file added docs/deposit_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e422a9d

Please sign in to comment.