Skip to content

Commit aaff3ff

Browse files
fix(docs): replace FSA instruction IDs with correct values
1 parent e43d054 commit aaff3ff

File tree

1 file changed

+35
-26
lines changed

1 file changed

+35
-26
lines changed

docs/smart-accounts/2-fasset-instructions.mdx

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,20 @@ The instructions fall under three types: `FXRP`, `Firelight`, and `Upshift`.
3535
Each type supports different instruction commands.
3636
The `FXRP` commands allow interaction with the base FAssets system, whereas `Firelight` and `Upshift` give access to actions pertaining to the corresponding vault architectures.
3737

38-
{/* TODO:(Nik) explain walletId */}
38+
The first byte of each encoded instruction is the instruction ID.
39+
It is further subdivided into the instruction type (first half-byte), and instruction command (second half-byte).
40+
The values for the instruction type Id nad the command ID range from `0` to `f` (`15` in hexadecimal);
41+
thus the instruction IDs range from `00` to `ff`.
3942

40-
## `00` FXRP
43+
The second byte is the `walletID`.
44+
This value is assigned individually by the Flare, and is intended for wallet identification by the operator.
45+
46+
## FXRP
4147

4248
The commands of the `FXRP` type give access to base FAsset actions.
49+
The ID of the `FXRP` type is `0`.
4350

44-
### `01` Collateral reservation
51+
### `00` Collateral reservation
4552

4653
Collateral reservation is the first step in the FAssets minting process.
4754
In anticipation of the transfer of XRP to the agent's underlying address on XRPL, a portion of its collateral is locked to prevent accidental under-collateralization.
@@ -57,7 +64,7 @@ A collateral reservation payment reference is a 32-byte value:
5764

5865
- byte representation of the instruction ID in the first byte:
5966
- type ID `00` in the first nibble,
60-
- command ID `01` in the second nibble,
67+
- command ID `00` in the second nibble,
6168
- byte representation of `walletId` in the second byte
6269
- byte representation of `value` in the next 10 bytes
6370
- byte representation of `agentVaultId` in the next two bytes
@@ -85,7 +92,7 @@ A collateral reservation payment reference is a 32-byte value:
8592
/>
8693
</div>
8794

88-
### `02` Transfer
95+
### `01` Transfer
8996

9097
Transfer `value` of drops of FXRP to the `recipientAddress`.
9198
The FXRP is sent from the personal account that belongs to the XRPL address that sent the instruction, if the FXRP balance is sufficient.
@@ -119,7 +126,7 @@ A transfer payment reference is a 32-byte value:
119126
/>
120127
</div>
121128

122-
### `03` Redeem
129+
### `02` Redeem
123130

124131
Redemption is the process of converting FXRP back to XRP.
125132
A `value` of lots of FXRP are burned from the personal account belonging to the XRPL address that sent the instruction;
@@ -155,11 +162,12 @@ A redeem payment reference is the 32-byte value:
155162
/>
156163
</div>
157164

158-
## `01` Firelight
165+
## Firelight
159166

160167
The commands of the `Firelight` type allow interaction with Firelight-type vaults.
168+
The ID of the `Firelight` type is `1`.
161169

162-
### `01` Collateral reservation and deposit
170+
### `00` Collateral reservation and deposit
163171

164172
Reserve the collateral for `value` lots of FXRP with the agent's vault, registered with the `agentVaultId` with the `MasterAccountController` contract.
165173
When minting is completed, deposit `value` lots of FXRP into a Firelight-type vault at the address registered with the `MasterAccountController` contract with the `vaultId`.
@@ -171,7 +179,7 @@ A collateral reservation and deposit instruction payment reference is the 32-byt
171179

172180
- byte representation of the instruction ID in the first byte:
173181
- type ID `01` in the first nibble,
174-
- command ID `01` in the second nibble,
182+
- command ID `00` in the second nibble,
175183
- byte representation of `walletId` in the second byte
176184
- byte representation of `value` in the next 10 bytes
177185
- byte representation of `agentVaultId` in the next 2 bytes
@@ -200,15 +208,15 @@ A collateral reservation and deposit instruction payment reference is the 32-byt
200208
/>
201209
</div>
202210

203-
### `02` Deposit
211+
### `01` Deposit
204212

205213
Deposit `value` lots of FXRP into a Firelight-type vault at the address registered with the `MasterAccountController` contract with the `vaultId`.
206214

207215
A deposit instruction payment reference is the 32-byte value:
208216

209217
- byte representation of the instruction ID in the first byte:
210218
- type ID `01` in the first nibble,
211-
- command ID `02` in the second nibble,
219+
- command ID `01` in the second nibble,
212220
- byte representation of `walletId` in the second byte
213221
- byte representation of `value` in the next 10 bytes
214222
- the next two bytes are ignored and can have an arbitrary value
@@ -237,7 +245,7 @@ A deposit instruction payment reference is the 32-byte value:
237245
/>
238246
</div>
239247

240-
### `03` Redeem
248+
### `02` Redeem
241249

242250
The first part of the withdrawal process from a Firelight vault.
243251

@@ -247,7 +255,7 @@ A redeem instruction payment reference is the 32-byte value:
247255

248256
- byte representation of the instruction ID in the first byte:
249257
- type ID `01` in the first nibble,
250-
- command ID `03` in the second nibble,
258+
- command ID `02` in the second nibble,
251259
- byte representation of `walletId` in the second byte
252260
- byte representation of `value` in the next 10 bytes
253261
- the next two bytes are ignored and can have an arbitrary value
@@ -276,7 +284,7 @@ A redeem instruction payment reference is the 32-byte value:
276284
/>
277285
</div>
278286

279-
### `04` Claim withdraw
287+
### `03` Claim withdraw
280288

281289
The second part of the withdrawal process from a Firelight vault.
282290
Claim the pending withdrawal from the `value` period, from the Firelight vault at the address registered with the `MasterAccountController` contract with the `vaultId`.
@@ -318,11 +326,12 @@ A claim withdrawal payment reference is a 32-byte value:
318326
/>
319327
</div>
320328

321-
## `02` Upshift
329+
## Upshift
322330

323331
The commands of the `Upshift` type allow interaction with Upshift-type vaults.
332+
The ID of the `Upshift` type is `2`.
324333

325-
### `01` Collateral reservation and deposit
334+
### `00` Collateral reservation and deposit
326335

327336
Reserve the collateral for `value` lots of FXRP with the agent's vault, registered with the `agentVaultId` with the `MasterAccountController` contract.
328337
When minting is completed, deposit `value` lots of FXRP into an Upshift-type vault at the address registered with the `MasterAccountController` contract with the `vaultId`.
@@ -333,8 +342,8 @@ This cuts the total waiting time in half and reduces the total number of transac
333342
A collateral reservation and deposit instruction payment reference is the 32-byte value:
334343

335344
- byte representation of the instruction ID in the first byte:
336-
- type ID `01` in the first nibble,
337-
- command ID `01` in the second nibble,
345+
- type ID `02` in the first nibble,
346+
- command ID `00` in the second nibble,
338347
- byte representation of `walletId` in the second byte
339348
- byte representation of `value` in the next 10 bytes
340349
- byte representation of `agentVaultId` in the next 2 bytes
@@ -363,15 +372,15 @@ A collateral reservation and deposit instruction payment reference is the 32-byt
363372
/>
364373
</div>
365374

366-
### `02` Deposit
375+
### `01` Deposit
367376

368377
Deposit `value` lots of FXRP into an Upshift type vault at the address registered with the `MasterAccountController` contract with the `vaultId`.
369378

370379
A deposit instruction payment reference is the 32-byte value:
371380

372381
- byte representation of the instruction ID in the first byte:
373-
- type ID `01` in the first nibble,
374-
- command ID `02` in the second nibble,
382+
- type ID `02` in the first nibble,
383+
- command ID `01` in the second nibble,
375384
- byte representation of `walletId` in the second byte
376385
- byte representation of `value` in the next 10 bytes
377386
- the next two bytes are ignored and can have an arbitrary value
@@ -400,7 +409,7 @@ A deposit instruction payment reference is the 32-byte value:
400409
/>
401410
</div>
402411

403-
### `03` Request redeem
412+
### `02` Request redeem
404413

405414
The first part of the withdrawal process from an Upshift vault.
406415

@@ -409,8 +418,8 @@ Initiate a withdrawal request of `value` of FXRP from the Upshift vault at the a
409418
A request redeem instruction payment reference is the 32-byte value:
410419

411420
- byte representation of the instruction ID in the first byte:
412-
- type ID `01` in the first nibble,
413-
- command ID `03` in the second nibble,
421+
- type ID `02` in the first nibble,
422+
- command ID `02` in the second nibble,
414423
- byte representation of `walletId` in the second byte
415424
- byte representation of `value` in the next 10 bytes
416425
- the next two bytes are ignored and can have an arbitrary value
@@ -439,7 +448,7 @@ A request redeem instruction payment reference is the 32-byte value:
439448
/>
440449
</div>
441450

442-
### `04` Claim
451+
### `03` Claim
443452

444453
The second part of the withdrawal process from an Upshift vault.
445454
Claim the pending withdrawal from the `value` period, from the Upshift vault at the address registered with the `MasterAccountController` contract with the `vaultId`.
@@ -452,7 +461,7 @@ It is an 8-digit number `YYYYMMDD`, where `YYYY` is the year, `MM` the month (fr
452461
A claim payment reference is a 32-byte value:
453462

454463
- byte representation of the instruction ID in the first byte:
455-
- type ID `01` in the first nibble,
464+
- type ID `02` in the first nibble,
456465
- command ID `03` in the second nibble,
457466
- byte representation of `walletId` in the second byte
458467
- byte representation of `value` in the next 10 bytes

0 commit comments

Comments
 (0)