Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add diagrams #58

Merged
merged 5 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor point but it says "send claim data with key" - should it not be "send gift data with key" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading