Skip to content

Commit b93fed6

Browse files
feat(docs): update fsa to new version (#1080)
2 parents 50de394 + 78cd5f3 commit b93fed6

38 files changed

+479
-298
lines changed

docs/smart-accounts/1-overview.mdx

Lines changed: 165 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 1
33
slug: overview
44
title: Flare Smart Accounts
5-
authors: [nikerzetic, filipkoprivec]
5+
authors: [nikerzetic]
66
description: The Flare Smart Accounts is an account abstraction that performs actions on behalf of XRPL users.
77
tags: [quickstart, ethereum, flare-smart-accounts]
88
keywords:
@@ -41,82 +41,176 @@ This is done through a `Payment` to an XRPL address, designated by the operator
4141
The payment must transfer sufficient funds, as specified by the operator, and must include the proper payment receipt in the memo field.
4242

4343
The payment receipt is a `bytes32` value.
44-
The first byte is reserved for the instruction code, a byte representation of a two-digit number.
44+
The first byte is reserved for the instruction code.
45+
The second byte is a wallet identifier;
46+
this is a number assigned to wallet providers by the Flare Foundation, and should otherwise be `0`.
4547
The remaining 31 bytes are the parameters for the chosen instruction.
4648

4749
In practice, the payment receipt should be prepared by a backend, through a web form.
4850

51+
The first, instruction code, byte is further subdivided into two half-bytes.
52+
The first nibble is the instruction type;
53+
this is either `FXRP`, `Firelight` or `Upshift` (with corresponding type IDS `0`, `1` and `2`).
54+
The second nibble is the instruction command; the available commands are different for each instruction type.
55+
4956
<details>
5057
<summary>Table of instruction IDs and corresponding actions.</summary>
51-
<table>
52-
<thead>
53-
<tr>
54-
<td>&nbsp;**Instruction ID**</td>
55-
<td>**Action**&nbsp;</td>
56-
<td>**Description**&nbsp;</td>
57-
</tr>
58-
</thead>
59-
<tbody>
60-
<tr>
61-
<td>&nbsp;01</td>
62-
<td>&nbsp;deposit</td>
63-
<td>
64-
&nbsp;Deposit an `amount` of FXRP into the Firelight vault, designated
65-
by the `MasterAccountController` contract.
66-
</td>
67-
</tr>
68-
<tr>
69-
<td>&nbsp;02</td>
70-
<td>&nbsp;withdraw</td>
71-
<td>
72-
&nbsp;Withdraw an `amount` of FXRP from the Firelight vault,
73-
designated by the `MasterAccountController` contract.
74-
</td>
75-
</tr>
76-
<tr>
77-
<td>&nbsp;03</td>
78-
<td>&nbsp;approve</td>
79-
<td>
80-
&nbsp;**Deprecated.** Approve the Firelight vault, designated by the
81-
`MasterAccountController` contract, to spend an `amount` of FXRP from
82-
your account.
83-
</td>
84-
</tr>
85-
<tr>
86-
<td>&nbsp;04</td>
87-
<td>&nbsp;redeem</td>
88-
<td>
89-
&nbsp;Redeem `lots` of FXRP. The redemption will be handled by the
90-
`executor`, specified by the `MasterAccountController` contract.
91-
</td>
92-
</tr>
93-
<tr>
94-
<td>&nbsp;05</td>
95-
<td>&nbsp;reserveCollateral</td>
96-
<td>
97-
&nbsp;Reserve `lots` of collateral in the `agentVault`, specified by
98-
the `MasterAccountController` contract. The collateral reservation
99-
will be handled by the `executor`, also specified by the
100-
`MasterAccountController` contract.
101-
</td>
102-
</tr>
103-
<tr>
104-
<td>&nbsp;06</td>
105-
<td>&nbsp;claimWithdraw</td>
106-
<td>&nbsp;Claim the withdrawal from the Firelight vault.</td>
107-
</tr>
108-
<tr>
109-
<td>&nbsp;99</td>
110-
<td>&nbsp;custom</td>
111-
<td>
112-
&nbsp;Execute a list of custom function calls. The custom instructions
113-
need to be registered in advance, with the `MasterAccountController`
114-
(`registerCustomInstruction` function).
115-
</td>
116-
</tr>
117-
</tbody>
118-
</table>
119-
<p>&nbsp;</p>
58+
59+
### FXRP
60+
61+
Instructions for interacting with the `FXRP` token.
62+
63+
**Type ID:** `00`.
64+
65+
<table>
66+
<thead>
67+
<tr>
68+
<td>&nbsp;**Command ID**</td>
69+
<td>**Action**&nbsp;</td>
70+
<td>**Description**&nbsp;</td>
71+
</tr>
72+
</thead>
73+
<tbody>
74+
<tr>
75+
<td>&nbsp;00</td>
76+
<td>&nbsp;collateralReservation</td>
77+
<td>
78+
&nbsp;Reserve a `value` of lots of collateral in the agent vault,
79+
registered under the `agentVaultId` with the `MasterAccountController`
80+
contract.
81+
</td>
82+
</tr>
83+
<tr>
84+
<td>&nbsp;01</td>
85+
<td>&nbsp;transfer</td>
86+
<td>
87+
&nbsp;Transfer a `value` (in drops) of FXRP to the `recipientAddress`.
88+
</td>
89+
</tr>
90+
<tr>
91+
<td>&nbsp;02</td>
92+
<td>&nbsp;redeem</td>
93+
<td>&nbsp;Redeem a `value` of lots of FXRP.</td>
94+
</tr>
95+
</tbody>
96+
</table>
97+
<p>&nbsp;</p>
98+
99+
### Firelight
100+
101+
Instructions for interacting with a Firelight type vault.
102+
103+
**Type ID:** `01`.
104+
105+
<table>
106+
<thead>
107+
<tr>
108+
<td>&nbsp;**Command ID**</td>
109+
<td>**Action**&nbsp;</td>
110+
<td>**Description**&nbsp;</td>
111+
</tr>
112+
</thead>
113+
<tr>
114+
<td>&nbsp;00</td>
115+
<td>&nbsp;collateralReservationAndDeposit</td>
116+
<td>
117+
&nbsp;Reserve a `value` of lots of collateral in the agent vault,
118+
registered under the `agentVaultId` with the `MasterAccountController`
119+
contract. After successful minting, deposit the FXRP into the Firelight
120+
type vault, registered under the `vaultId` with the
121+
`MasterAccountController` contract. Equivalent to sending a
122+
`collateralReservation` instruction and a Firelight `deposit` instruction.
123+
</td>
124+
</tr>
125+
<tbody>
126+
<tr>
127+
<td>&nbsp;01</td>
128+
<td>&nbsp;deposit</td>
129+
<td>
130+
&nbsp;Deposit a `value` of FXRP into the Firelight type vault,
131+
registered under the `vaultId` with the `MasterAccountController`
132+
contract.
133+
</td>
134+
</tr>
135+
<tr>
136+
<td>&nbsp;02</td>
137+
<td>&nbsp;redeem</td>
138+
<td>
139+
&nbsp;Start the withdrawal process for a `value` of FXRP from the
140+
Firelight type vault, registered under the `vaultId` with the
141+
`MasterAccountController` contract.
142+
</td>
143+
</tr>
144+
<tr>
145+
<td>&nbsp;03</td>
146+
<td>&nbsp;claimWithdraw</td>
147+
<td>
148+
&nbsp;Withdraw the `FXRP`, requested in the `value` period, from
149+
Firelight type vault, registered under the `vaultId` with the
150+
`MasterAccountController` contract.
151+
</td>
152+
</tr>
153+
</tbody>
154+
</table>
155+
<p>&nbsp;</p>
156+
157+
### Upshift
158+
159+
Instructions for interacting with an upshift type vault.
160+
161+
**Type ID:** `02`.
162+
163+
<table>
164+
<thead>
165+
<tr>
166+
<td>&nbsp;**Command ID**</td>
167+
<td>**Action**&nbsp;</td>
168+
<td>**Description**&nbsp;</td>
169+
</tr>
170+
</thead>
171+
<tr>
172+
<td>&nbsp;00</td>
173+
<td>&nbsp;collateralReservationAndDeposit</td>
174+
<td>
175+
&nbsp;Reserve a `value` of lots of collateral in the agent vault,
176+
registered under the `agentVaultId` with the `MasterAccountController`
177+
contract. After successful minting, deposit the FXRP into the Upshift
178+
type vault, registered under the `vaultId` with the
179+
`MasterAccountController` contract. Equivalent to sending a
180+
`collateralReservation` instruction and a Upshift `deposit` instruction.
181+
</td>
182+
</tr>
183+
<tbody>
184+
<tr>
185+
<td>&nbsp;01</td>
186+
<td>&nbsp;deposit</td>
187+
<td>
188+
&nbsp;Deposit a `value` of FXRP into the Upshift type vault,
189+
registered under the `vaultId` with the `MasterAccountController`
190+
contract.
191+
</td>
192+
</tr>
193+
<tr>
194+
<td>&nbsp;02</td>
195+
<td>&nbsp;requestRedeem</td>
196+
<td>
197+
&nbsp;Start the withdrawal process for a `value` of FXRP from the
198+
Upshift type vault, registered under the `vaultId` with the
199+
`MasterAccountController` contract.
200+
</td>
201+
</tr>
202+
<tr>
203+
<td>&nbsp;03</td>
204+
<td>&nbsp;claim</td>
205+
<td>
206+
&nbsp;Withdraw the `FXRP`, requested in the `value` period, from
207+
Upshift type vault, registered under the `vaultId` with the
208+
`MasterAccountController` contract.
209+
</td>
210+
</tr>
211+
</tbody>
212+
</table>
213+
<p>&nbsp;</p>
120214
</details>
121215

122216
## 2. Payment proof on Flare

0 commit comments

Comments
 (0)