Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick exchange #2

Open
jondubois opened this issue Mar 12, 2021 · 0 comments
Open

Quick exchange #2

jondubois opened this issue Mar 12, 2021 · 0 comments
Assignees

Comments

@jondubois
Copy link
Contributor

This feature depends on #1

There needs to be a mechanism for easily converting between different blockchain tokens.
The user should be able to choose between the available tokens (from the config.json) or those which were added later via the modal.

The ldpos-wallet app should only support market orders and have a very simple/basic UI. It should show progress indicators so that the user knows when a trade is in progress and should show a message for when it has gone through. It is not necessary to show individual trades... Just letting the user know that a trade is pending and that their balances will be updated should duffice.

In order to convert from one token to another, the ldpos-wallet app just needs to make a transaction on the relevant chain which follows the lisk-dex protocol format (https://github.com/Capitalisk/lisk-dex#actions) - A market order is a transaction with a message property string in the format: ${targetChain},market,${targetWalletAddress}.

The targetChain is the networkSymbol of the blockchain which the user wants to convert their tokens to.
The ldpos-wallet app should figure out the targetWalletAddress automatically.

As mentioned in the previous issue #1, the same passphrase can be used with multiple blockchains; each blockchain will produce a different client.walletAddress for the same passphrase.

In order to execute a trade, you will need to connect two different LDPoSClient instances at the same time (one for each blockchain). Then, once connected you can use the targetChainClient.computeWalletAddressFromPassphrase(passphrase) to compute the targetWalletAddress to use inside the market order transaction. Then you need to prepare the transaction and post it using the sourceChainClient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants