Deposit integrated in UI
Closed this issue · 0 comments
prayagd commented
Description
Deposit assets from stellar to pendulum should also be available on the UI.
User Interface
- everything happens in one screen which is split in half
- left half: Stellar side
- right half: Pendulum side
- both screen halfes show the balances of the user in each chain
- "the user" is a single account registered with the UI
- the balances are updated in real time; no user interaction required
- in Stellar:
- the request to https://horizon-testnet.stellar.org/accounts/ returns all assets and their balances of the user
- but hard to use for real time updates
- so need to use streaming endpoints; can use stellar-sdk for this
- might need to use the effects streaming
- other strategy: use effect streaming endpoint and for every change poll the account information
- other strategy: use
createBalanceEmitter
from our DTransfer code base
- in Pendulum: this should already be in this code base because used in the other screens
- user interaction
- deposit
- parameters: stellar keypair (from stellar-sdk), asset, amount
- should create a claimable balance and send to escrow account
- withdraw
- parameters: private key and seed of user (in Substrate format), asset, amount
- our notion page describes how to initiate the withdrawal manually
- this needs to happen automatically instead
- deposit
Required logic
- function with callback that is called when Stellar balances change
- function with callback and asset that is called when Pendulum balances change (AP Torsten)
- function to execute deposit
- function to execute withdrawal