Skip to content

Commit

Permalink
Merge pull request #58 from argentlabs/add-diagrams
Browse files Browse the repository at this point in the history
Add diagrams
  • Loading branch information
sgc-code authored Jul 3, 2024
2 parents a61e5b4 + 2d671cc commit da52dcf
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 3 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
3 changes: 0 additions & 3 deletions deployments.md

This file was deleted.

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 da52dcf

Please sign in to comment.