@@ -21,13 +21,13 @@ import ThemedImage from "@theme/ThemedImage";
2121import useBaseUrl from " @docusaurus/useBaseUrl" ;
2222
2323In this guide, we will walk you through all aspects of the [ FAssets] ( /fassets/overview ) process.
24- We will start with an account on XRPL, we will send its assets to Flare, and then return them to XRPL .
24+ We will start with an account on XRPL, convert some of the XRP to FXRP on Flare, deposit it into an Upshift-type vault, redeem it from the vault, and then redeem FXRP back to XRP .
2525The steps we will take will be as follows:
2626
27- 1 . ` mint ` : convert XRP to FXRP
28- 2 . ` deposit ` : deposit FXRP to the Firelight vault
29- 3 . ` withdraw ` : withdraw FXRP from the Firelight vault
30- 4 . ` redeem ` : convert FXRP back to XRP
27+ 1 . ** mint and deposit: ** convert XRP to FXRP and deposit it to an Upshift-type vault
28+ 2 . ** request redeem: ** start the withdrawal process of the deposited FXRP the Upshift-type vault
29+ 3 . ** claim: ** finish the withdrawal process of FXRP from the Upshift-type vault
30+ 4 . ** redeem: ** convert FXRP back to XRP
3131
3232We will do all of that through the [ Flare Smart Accounts CLI] ( /smart-accounts/guides/fsa-cli ) .
3333The CLI allows us to make XRPL transactions through terminal commands.
@@ -36,210 +36,142 @@ The CLI allows us to make XRPL transactions through terminal commands.
3636The idea behind the Flare Smart Accounts is that we perform actions on the Flare chain through instructions sent on XRPL.
3737:::
3838
39- ## Mint
39+ The same process can be repeated for a Firelight-type vault, but in this guide, we will only focus on an Upshift-type vault.
40+
41+ ## Mint and deposit
4042
4143First, we mint FXRP by reserving the necessary collateral and then sending XRP to the agent's underlying address.
42- We will mint ` 1 ` lot of FXRP, with the agent at the address ` 0x55c815260cBE6c45Fe5bFe5FF32E3C7D746f14dC ` .
44+ We will mint ` 1 ` lot of FXRP, with the agent at the address whose vault has the ID ` 1 ` .
45+ Then, we deposit ` 10 ` FXRP into the Upshift-type vault, registered with the ` MasterAccountController ` with the ID ` 2 ` .
46+
4347The CLI command that does this is:
4448
4549``` sh
46- ./smart_accounts.py bridge mint --agent-address 0x55c815260cBE6c45Fe5bFe5FF32E3C7D746f14dC --lots 1
50+ ./smart_accounts.py encode upshift-cr-deposit --wallet-id 0 --value 1 --agent-vault-id 1 --vault-id 2 \
51+ | ./smart_accounts.py bridge instruction - \
52+ | ./smart_accounts.py bridge mint-tx --wait -
4753```
4854
4955<details >
5056<summary >Expected output</summary >
51-
52- The CLI prompts the user to press "enter" once in order to continue to the minting.
53- The number of ` . ` symbols, as well as XRPL transaction hashes are expected not to match the ones in this example.
54-
5557```
56- sent instruction on underlying: D1F3F68060C34771DD603C4597D20FF4EFFA53FCB1A9D3F2A06272CC1BB2BCB0
57- https://testnet.xrpl.org/transactions/D1F3F68060C34771DD603C4597D20FF4EFFA53FCB1A9D3F2A06272CC1BB2BCB0/detailed
58-
59- waiting to bridge...........
60- BRIDGED FOR 0xDC47B18B7aDC3DeaCA42651cAF5A91397b57BAD3
61- successfully bridged in tx 0xb64a6e46613aac437fc2ee3ed418f8f872e20d9aba7c95cc003f9f54dfec3553
62- https://coston2-explorer.flare.network/tx/0xb64a6e46613aac437fc2ee3ed418f8f872e20d9aba7c95cc003f9f54dfec3553?tab=logs
63-
64- successful collateral reservation, continue to 2nd part of mint... press enter
65- sent underlying assets in 0708E84E5E69731328DD357BDD934205A002876B8801813B7002EE315BB2AE8D
66- https://testnet.xrpl.org/transactions/0708E84E5E69731328DD357BDD934205A002876B8801813B7002EE315BB2AE8D/detailed
67- waiting for mint execution.............
68- successfully minted in tx 0x5e78e235dbfc7f0c1356635277b70bbaefe7ce01a948309fea9bb56d8e26d3d0
69- https://coston2-explorer.flare.network/tx/0x5e78e235dbfc7f0c1356635277b70bbaefe7ce01a948309fea9bb56d8e26d3d0?tab=logs
70-
58+ sent bridge instruction transaction: 77539CDED3BD58E151CD0000EEC611A43A5539620B7CE4198BB3D63B031E9818
59+ sent mint tx: 3C65E10D609AB3CC1DBD03C96E401704123C0630D8AE5622B651A1E0159C1D38
60+ 3C65E10D609AB3CC1DBD03C96E401704123C0630D8AE5622B651A1E0159C1D38
7161```
7262
7363</details >
7464
75- The CLI sends both the ` reserveCollateral ` instruction and the ` Payment ` transaction to the agent's underlying address.
65+ The CLI sends both the Upshift collateral reservation and deposit instruction, and the ` Payment ` transaction to the agent's underlying address.
7666
77- ## Deposit
67+ We could perform the minting and deposit steps separately.
68+ To do so, we would do so with the following commands.
69+ But that would take an additional transaction and twice as long, so it is recommended that we avoid it unless we have a very specific reason why the first command is not suitable.
7870
79- Next, we deposit ` 1 ` FXRP into the Firelight vault, specified by the ` MasterAccountController ` contract.
80- Here, the CLI sends the ` deposit ` instruction.
81- The command is:
71+ ``` sh
72+ ./smart_accounts.py encode fxrp-cr --wallet-id 0 --value 1 --agent-vault-id 1 \
73+ | ./smart_accounts.py bridge instruction - \
74+ | ./smart_accounts.py bridge mint-tx --wait -
75+ ```
76+
77+ The first command reserves ` 1 ` lot of collateral with the agent's vault with ID ` 1 ` , and makes a mint payment to its address.
8278
8379``` sh
84- ./smart_accounts.py bridge deposit --amount 1
80+ ./smart_accounts.py encode upshift-deposit --wallet-id 0 --value 10 --vault-id 2 \
81+ | ./smart_accounts.py bridge instruction -
8582```
8683
84+ The second command deposits ` 10 ` FXRP into an Upshift-type vault registered with the ID ` 2 ` .
85+
8786<details >
88- <summary >Expected output </summary >
87+ <summary >Expected outputs </summary >
8988
90- The CLI prompts the user to press "enter" once in order to continue to the minting.
91- The number of ` . ` symbols, as well as XRPL transaction hashes are expected not to match the ones in this example.
89+ Mint:
9290
91+ ``` sh
92+ sent bridge instruction transaction: 75FB3ED006417FC1537432DA2D7180BD5BED93F23B988F77E32ED0804CD1A332
93+ sent mint tx: 4BF8F3B32E234335F9EC6FE503E33B9EDF4E3E37D1E952DF28D260AC909609F1
94+ 4BF8F3B32E234335F9EC6FE503E33B9EDF4E3E37D1E952DF28D260AC909609F1
9395```
94- sent instruction on underlying: 185EE71ECEC28C5902D45ED8AB5FCB9A6F78845EE99EC4A66F81655F78EADC87
95- https://testnet.xrpl.org/transactions/185EE71ECEC28C5902D45ED8AB5FCB9A6F78845EE99EC4A66F81655F78EADC87/detailed
96-
97- waiting to bridge...............
98- BRIDGED FOR 0xF4CC61CCCDA8b792EAA112455D9DBc4bcb9AA9A0
99- successfully bridged in tx 0x12a69822e5d399a8918ff116a049b714ef76c29e1497857148e9fbc602d7994d
100- https://coston2-explorer.flare.network/tx/0x12a69822e5d399a8918ff116a049b714ef76c29e1497857148e9fbc602d7994d?tab=logs
10196
97+ Deposit:
10298
99+ ``` sh
100+ sent bridge instruction transaction: 404EE0470152513277B10E5ADB6388175010634CDAF1815979ED418CDBAD0C45
101+ 404EE0470152513277B10E5ADB6388175010634CDAF1815979ED418CDBAD0C45
103102```
104103
105104</details >
106105
107- ## Withdraw
106+ ## Request redeem
108107
109- We withdraw the same number of tokens that we have just deposited from the Firelight vault.
108+ We withdraw the same number of FXRP tokens that we have just deposited from the Firelight vault ( ` 10 ` ) .
110109The process involves two steps.
110+ Before we can withdraw the tokens, we need to request their withdrawal.
111+ In a production build, the tokens stay locked for a specified time.
112+
111113The CLI first sends the ` withdraw ` instruction, and afterwards, the ` claimWithdraw ` .
112114The first instruction starts the withdrawal process, and the second claims the FXRP once it is released.
113115
114- We use the command:
116+ To request the withdrawal of ` 10 ` FXRP from the Upshift-type vault with ID ` 2 ` , we use the command:
115117
116118``` sh
117- ./smart_accounts.py bridge withdraw --amount 1
119+ ./smart_accounts.py encode upshift-request-redeem --wallet-id 0 --value 10 --vault-id 2 \
120+ | ./smart_accounts.py bridge instruction -
118121```
119122
120123<details >
121124<summary >Expected output</summary >
122125
123- The CLI prompts the user to press "enter" once in order to continue to the minting.
124- The number of ` . ` symbols, as well as XRPL transaction hashes are expected not to match the ones in this example.
125-
126- ```
127- sent instruction on underlying: 2B1F76520C3EE921E22FE79F3DA29B1F2C64E602CD2A1C87F372E0AB8E75B270
128- https://testnet.xrpl.org/transactions/2B1F76520C3EE921E22FE79F3DA29B1F2C64E602CD2A1C87F372E0AB8E75B270/detailed
129-
130- waiting to bridge...........
131- BRIDGED FOR 0xF4CC61CCCDA8b792EAA112455D9DBc4bcb9AA9A0
132- successfully bridged in tx 0x43c13369b678c0e671d70035f8140b2cd6f4309735bce03d9e9fd0cc994792d7
133- https://coston2-explorer.flare.network/tx/0x43c13369b678c0e671d70035f8140b2cd6f4309735bce03d9e9fd0cc994792d7?tab=logs
134-
135-
126+ ``` sh
127+ sent bridge instruction transaction: 33B08253AE3907A8CE07EA3F5C9BE91EBCC6089339725A8BCFF371ED86F26238
128+ 33B08253AE3907A8CE07EA3F5C9BE91EBCC6089339725A8BCFF371ED86F26238
136129```
137130
138131</details >
139132
140- ## Redeem
133+ ## Claim
141134
142- The last step is to convert FXRP back to XRP.
143- We will redeem the ` 1 ` lot of FXRP we minted in the first step back to XRP.
144- We will invoke the CLI with the following command.
135+ After the waiting period has passed, we can claim the FXRP we requested.
136+ This is the second step of the withdrawal process.
137+ We need to specify the date when the redemption request was put in.
138+ We made the request on 28 Dec 2025, so the value parameter should be ` 20251218 ` .
139+ But in general, the value should be ` YYYYMMDD ` , where ` YYYY ` is the year, ` MM ` the month, and ` DD ` the date.
140+
141+ To complete the withdrawal from the Upshift-type vault with ID ` 2 ` , we use the command:
145142
146143``` sh
147- ./smart_accounts.py bridge redeem --lots 1
144+ ./smart_accounts.py encode upshift-claim --wallet-id 0 --value 20251218 --vault-id 2 \
145+ | ./smart_accounts.py bridge instruction -
148146```
149147
150148<details >
151149<summary >Expected output</summary >
152150
153- The CLI prompts the user to press "enter" once in order to continue to the minting.
154- The number of ` . ` symbols, as well as XRPL transaction hashes are expected not to match the ones in this example.
155-
156- ```
157- sent instruction on underlying: 1D6A35CB521D16E7379D0F1D4D1C4A8BB49497C4FDC27446C5D775605B802881
158- https://testnet.xrpl.org/transactions/1D6A35CB521D16E7379D0F1D4D1C4A8BB49497C4FDC27446C5D775605B802881/detailed
159-
160- waiting to bridge............
161- BRIDGED FOR 0xF4CC61CCCDA8b792EAA112455D9DBc4bcb9AA9A0
162- successfully bridged in tx 0x0600342c3a49f20676f3e1744a78f3c010e315c2f4da65edee047fa757605bb0
163- https://coston2-explorer.flare.network/tx/0x0600342c3a49f20676f3e1744a78f3c010e315c2f4da65edee047fa757605bb0?tab=logs
164-
151+ ``` sh
152+ sent bridge instruction transaction: 8D81F5A2625A927A6759646806BC8217147523F069899A4A2586562D6E0F105E
153+ 8D81F5A2625A927A6759646806BC8217147523F069899A4A2586562D6E0F105E
165154```
166155
167156</details >
168157
169- ## Simulation
158+ ## Redeem
170159
171- The above cycle can be simulated with a single CLI command:
160+ The last step is to convert FXRP back to XRP.
161+ We will redeem the ` 1 ` lot of FXRP we minted in the first step back to XRP.
162+ We will invoke the CLI with the following command:
172163
173164``` sh
174- ./smart_accounts.py debug simulation --agent-address 0x55c815260cBE6c45Fe5bFe5FF32E3C7D746f14dC --mint 1 --deposit 1
165+ ./smart_accounts.py encode fxrp-redeem --wallet-id 0 --value 1 \
166+ | ./smart_accounts.py bridge instruction -
175167```
176168
177169<details >
178170<summary >Expected output</summary >
179171
180- The CLI prompts the user to press "enter" five times in order to continue.
181- The number of ` . ` symbols, as well as XRPL transaction hashes are expected not to match the ones in this example.
182-
183- ```
184- sent instruction on underlying: AF8BDE9810B64B442F5D50C37D176B101996B75ED1586233028AC964606849B4
185- https://testnet.xrpl.org/transactions/AF8BDE9810B64B442F5D50C37D176B101996B75ED1586233028AC964606849B4/detailed
186-
187- waiting to bridge................
188- BRIDGED FOR 0xF4CC61CCCDA8b792EAA112455D9DBc4bcb9AA9A0
189- successfully bridged in tx 0xa25fcb34183e509948140346bd5d50b87c9af7b2ba1a597e116c9435d33a0602
190- https://coston2-explorer.flare.network/tx/0xa25fcb34183e509948140346bd5d50b87c9af7b2ba1a597e116c9435d33a0602?tab=logs
191-
192- successful collateral reservation, continue to 2nd part of mint... press enter
193- sent underlying assets in 7710196AF58BF63B1260E6B999C0FDAAA032F059713CE46D1E6F39853523FA52
194- https://testnet.xrpl.org/transactions/7710196AF58BF63B1260E6B999C0FDAAA032F059713CE46D1E6F39853523FA52/detailed
195- waiting for mint execution.............
196- successfully minted in tx 0x509de6a7dcc741814a11c51925b5947d3785655aac029ddb3cf829075d809bd7
197- https://coston2-explorer.flare.network/tx/0x509de6a7dcc741814a11c51925b5947d3785655aac029ddb3cf829075d809bd7?tab=logs
198-
199- minted fassets, check here:
200- https://coston2-explorer.flare.network/address/0x0b6A3645c240605887a5532109323A3E12273dc7?tab=read_proxy
201-
202- continue to deposit... press enter
203- sent instruction on underlying: CDB763ED1487DF49B1A6198BCBA919F9D1432EAA15D1A562F18C322137C52F65
204- https://testnet.xrpl.org/transactions/CDB763ED1487DF49B1A6198BCBA919F9D1432EAA15D1A562F18C322137C52F65/detailed
205-
206- waiting to bridge.............
207- BRIDGED FOR 0xF4CC61CCCDA8b792EAA112455D9DBc4bcb9AA9A0
208- successfully bridged in tx 0x84f9ae36727feadc4c113f74cdb221b140682c2c79d8ced495c457a43ac218d8
209- https://coston2-explorer.flare.network/tx/0x84f9ae36727feadc4c113f74cdb221b140682c2c79d8ced495c457a43ac218d8?tab=logs
210-
211- deposited into vault, check here:
212- https://coston2-explorer.flare.network/address/0x912DbF2173bD48ec0848357a128652D4c0fc33EB?tab=read_contract
213-
214- continue to withdraw... press enter
215- sent instruction on underlying: 51145A98CB7217499D8C80C13EB6BCC631D1184BE24E3E6B25E1C1B1A556B477
216- https://testnet.xrpl.org/transactions/51145A98CB7217499D8C80C13EB6BCC631D1184BE24E3E6B25E1C1B1A556B477/detailed
217-
218- waiting to bridge............
219- BRIDGED FOR 0xF4CC61CCCDA8b792EAA112455D9DBc4bcb9AA9A0
220- successfully bridged in tx 0x427bd56f04967580557a8be5eaa7edaa14c7f846a367cfdb54dedde11e42962b
221- https://coston2-explorer.flare.network/tx/0x427bd56f04967580557a8be5eaa7edaa14c7f846a367cfdb54dedde11e42962b?tab=logs
222-
223- sent instruction on underlying: 45E68D1B9EDB81B74765E23C342B148F7386B7DB3079C5D20DB85BCCC605B5ED
224- https://testnet.xrpl.org/transactions/45E68D1B9EDB81B74765E23C342B148F7386B7DB3079C5D20DB85BCCC605B5ED/detailed
225-
226- waiting to bridge...............
227- BRIDGED FOR 0xF4CC61CCCDA8b792EAA112455D9DBc4bcb9AA9A0
228- successfully bridged in tx 0xd82daff2fe59fe083d7d2481ef5ab216dfe59d6832526fe9c2218f19074d32d4
229- https://coston2-explorer.flare.network/tx/0xd82daff2fe59fe083d7d2481ef5ab216dfe59d6832526fe9c2218f19074d32d4?tab=logs
230-
231- withdrawn from vault, check here:
232- https://coston2-explorer.flare.network/address/0x912DbF2173bD48ec0848357a128652D4c0fc33EB?tab=read_contract
233-
234- continue to redeem... press enter
235- sent instruction on underlying: E4C383DDE924AF03BA13A8199EA8C9DC7CA9012D4666D43CC6E0245F64402F3B
236- https://testnet.xrpl.org/transactions/E4C383DDE924AF03BA13A8199EA8C9DC7CA9012D4666D43CC6E0245F64402F3B/detailed
237-
238- waiting to bridge..............
239- BRIDGED FOR 0xF4CC61CCCDA8b792EAA112455D9DBc4bcb9AA9A0
240- successfully bridged in tx 0xff80b1da1581304a2e9584159966ad231bc3352275fcad639d6130e905217213
241- https://coston2-explorer.flare.network/tx/0xff80b1da1581304a2e9584159966ad231bc3352275fcad639d6130e905217213?tab=logs
242-
172+ ``` sh
173+ sent bridge instruction transaction: FE9D00397D8F11364C6E2792D62F801AA8BEF3499EB5068B624CAD1477ED7721
174+ FE9D00397D8F11364C6E2792D62F801AA8BEF3499EB5068B624CAD1477ED7721
243175```
244176
245177</details >
0 commit comments