You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/smart-accounts/2-fasset-instructions.mdx
+35-26Lines changed: 35 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,13 +35,20 @@ The instructions fall under three types: `FXRP`, `Firelight`, and `Upshift`.
35
35
Each type supports different instruction commands.
36
36
The `FXRP` commands allow interaction with the base FAssets system, whereas `Firelight` and `Upshift` give access to actions pertaining to the corresponding vault architectures.
37
37
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`.
39
42
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
41
47
42
48
The commands of the `FXRP` type give access to base FAsset actions.
49
+
The ID of the `FXRP` type is `0`.
43
50
44
-
### `01` Collateral reservation
51
+
### `00` Collateral reservation
45
52
46
53
Collateral reservation is the first step in the FAssets minting process.
47
54
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:
57
64
58
65
- byte representation of the instruction ID in the first byte:
59
66
- type ID `00` in the first nibble,
60
-
- command ID `01` in the second nibble,
67
+
- command ID `00` in the second nibble,
61
68
- byte representation of `walletId` in the second byte
62
69
- byte representation of `value` in the next 10 bytes
63
70
- byte representation of `agentVaultId` in the next two bytes
@@ -85,7 +92,7 @@ A collateral reservation payment reference is a 32-byte value:
85
92
/>
86
93
</div>
87
94
88
-
### `02` Transfer
95
+
### `01` Transfer
89
96
90
97
Transfer `value` of drops of FXRP to the `recipientAddress`.
91
98
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:
119
126
/>
120
127
</div>
121
128
122
-
### `03` Redeem
129
+
### `02` Redeem
123
130
124
131
Redemption is the process of converting FXRP back to XRP.
125
132
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:
155
162
/>
156
163
</div>
157
164
158
-
## `01`Firelight
165
+
## Firelight
159
166
160
167
The commands of the `Firelight` type allow interaction with Firelight-type vaults.
168
+
The ID of the `Firelight` type is `1`.
161
169
162
-
### `01` Collateral reservation and deposit
170
+
### `00` Collateral reservation and deposit
163
171
164
172
Reserve the collateral for `value` lots of FXRP with the agent's vault, registered with the `agentVaultId` with the `MasterAccountController` contract.
165
173
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
171
179
172
180
- byte representation of the instruction ID in the first byte:
173
181
- type ID `01` in the first nibble,
174
-
- command ID `01` in the second nibble,
182
+
- command ID `00` in the second nibble,
175
183
- byte representation of `walletId` in the second byte
176
184
- byte representation of `value` in the next 10 bytes
177
185
- 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
200
208
/>
201
209
</div>
202
210
203
-
### `02` Deposit
211
+
### `01` Deposit
204
212
205
213
Deposit `value` lots of FXRP into a Firelight-type vault at the address registered with the `MasterAccountController` contract with the `vaultId`.
206
214
207
215
A deposit instruction payment reference is the 32-byte value:
208
216
209
217
- byte representation of the instruction ID in the first byte:
210
218
- type ID `01` in the first nibble,
211
-
- command ID `02` in the second nibble,
219
+
- command ID `01` in the second nibble,
212
220
- byte representation of `walletId` in the second byte
213
221
- byte representation of `value` in the next 10 bytes
214
222
- 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:
237
245
/>
238
246
</div>
239
247
240
-
### `03` Redeem
248
+
### `02` Redeem
241
249
242
250
The first part of the withdrawal process from a Firelight vault.
243
251
@@ -247,7 +255,7 @@ A redeem instruction payment reference is the 32-byte value:
247
255
248
256
- byte representation of the instruction ID in the first byte:
249
257
- type ID `01` in the first nibble,
250
-
- command ID `03` in the second nibble,
258
+
- command ID `02` in the second nibble,
251
259
- byte representation of `walletId` in the second byte
252
260
- byte representation of `value` in the next 10 bytes
253
261
- 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:
276
284
/>
277
285
</div>
278
286
279
-
### `04` Claim withdraw
287
+
### `03` Claim withdraw
280
288
281
289
The second part of the withdrawal process from a Firelight vault.
282
290
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:
318
326
/>
319
327
</div>
320
328
321
-
## `02`Upshift
329
+
## Upshift
322
330
323
331
The commands of the `Upshift` type allow interaction with Upshift-type vaults.
332
+
The ID of the `Upshift` type is `2`.
324
333
325
-
### `01` Collateral reservation and deposit
334
+
### `00` Collateral reservation and deposit
326
335
327
336
Reserve the collateral for `value` lots of FXRP with the agent's vault, registered with the `agentVaultId` with the `MasterAccountController` contract.
328
337
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
333
342
A collateral reservation and deposit instruction payment reference is the 32-byte value:
334
343
335
344
- 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,
338
347
- byte representation of `walletId` in the second byte
339
348
- byte representation of `value` in the next 10 bytes
340
349
- 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
363
372
/>
364
373
</div>
365
374
366
-
### `02` Deposit
375
+
### `01` Deposit
367
376
368
377
Deposit `value` lots of FXRP into an Upshift type vault at the address registered with the `MasterAccountController` contract with the `vaultId`.
369
378
370
379
A deposit instruction payment reference is the 32-byte value:
371
380
372
381
- 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,
375
384
- byte representation of `walletId` in the second byte
376
385
- byte representation of `value` in the next 10 bytes
377
386
- 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:
400
409
/>
401
410
</div>
402
411
403
-
### `03` Request redeem
412
+
### `02` Request redeem
404
413
405
414
The first part of the withdrawal process from an Upshift vault.
406
415
@@ -409,8 +418,8 @@ Initiate a withdrawal request of `value` of FXRP from the Upshift vault at the a
409
418
A request redeem instruction payment reference is the 32-byte value:
410
419
411
420
- 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,
414
423
- byte representation of `walletId` in the second byte
415
424
- byte representation of `value` in the next 10 bytes
416
425
- 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:
439
448
/>
440
449
</div>
441
450
442
-
### `04` Claim
451
+
### `03` Claim
443
452
444
453
The second part of the withdrawal process from an Upshift vault.
445
454
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
452
461
A claim payment reference is a 32-byte value:
453
462
454
463
- 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,
456
465
- command ID `03` in the second nibble,
457
466
- byte representation of `walletId` in the second byte
458
467
- byte representation of `value` in the next 10 bytes
0 commit comments