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
There is a lot of data that www.lamdenlink.com has to aggregate during a swap to be able to determine the status of the swap and when to continue to the next step. When a user refreshes the site in the middle of a swap then tracking the state of the swap is lost.
All of this data could be better aggregated by an API which the UI can just listen to and be told when to move on. The UI could also be given a swap history for the connected lamden wallet from the API and provide an option to resume incomplete ones.
A high level description of how lamden link works can be referenced here #28
Work
Create an API which aggregates the transactions and events to from all the lamden link contracts (on Lamden, BSC and ETH).
The API should track events/transactions on ETH/BSC contracts
The API should use a Lamden Blockservice to discover events on the Lamden Blockchain (help on setting this up can be provided)
This API should be able to detect when swaps are started and track their progress
For example in a Lamden to BSC swap tokens are Burned on Lamden. The API should detect this transaction and then check BSC transaction from the Bridge contract that transfers that same amount to the metamask address contained in the Burn transaction (this is now Lamden Link works).
The UI should implement socket.io websockets to allow the UI to join rooms based on wallet address to receive updates about swaps
The API should also query price information for each token to be able to prove this to the UI. This would allow the UI to display the USD value of an asset when the user is inputting the amounts.
The API should estimate gas for ETH transactions so the UI can provide that information to the user before they decide to swap. This prevents a user from bridging $10 of WETH and getting hit with a $60 tx fee.
Details
Data
swap_id
A UID for each swap for the API to reference/store each swap. This is up for discussion but I would use the tx hash that first makes the API aware of the swap. So for a Lamden -> ETH/BSC swap that would be the tx_hash of the Lamden Burn transaction. All tx hashes are unique on Lamden as well as ETH/BSC so I don't think we should have any crossover.
Endpoints
** any amount provided should be in both token amount and USD value
/swaps GET
params
page (int) allows getting more results
response Provide a list of recent completed swaps, default 10, should paginate via params
Scope
Problem
There is a lot of data that www.lamdenlink.com has to aggregate during a swap to be able to determine the status of the swap and when to continue to the next step. When a user refreshes the site in the middle of a swap then tracking the state of the swap is lost.
All of this data could be better aggregated by an API which the UI can just listen to and be told when to move on. The UI could also be given a swap history for the connected lamden wallet from the API and provide an option to resume incomplete ones.
A high level description of how lamden link works can be referenced here #28
Work
Details
Data
swap_id
A UID for each swap for the API to reference/store each swap. This is up for discussion but I would use the tx hash that first makes the API aware of the swap. So for a Lamden -> ETH/BSC swap that would be the tx_hash of the Lamden Burn transaction. All tx hashes are unique on Lamden as well as ETH/BSC so I don't think we should have any crossover.
Endpoints
** any amount provided should be in both token amount and USD value
/swaps
GET
page (int)
allows getting more results/swaps/:lamden_wallet_address/pending
GET
page (int)
allows getting more resultspending
swaps associated with the lamden account provided/swaps/:lamden_wallet_address/successful
GET
page (int)
allows getting more resultssuccessful
swaps associated with the lamden account provided/status/:swap_id
GET
Socket.io Websockets
Rooms
successful_swaps
new
event::swap_id
update
eventprice_updates
update
eventThe text was updated successfully, but these errors were encountered: