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

API endpoint for UDC contract to deposit and withdraw RDN tokens #5497

Closed
Dominik1999 opened this issue Dec 12, 2019 · 1 comment · Fixed by #6821
Closed

API endpoint for UDC contract to deposit and withdraw RDN tokens #5497

Dominik1999 opened this issue Dec 12, 2019 · 1 comment · Fixed by #6821
Assignees
Labels
Component / API Issues that relate the the APIs Raiden provides.

Comments

@Dominik1999
Copy link
Contributor

We need an API endpoint to be able to deposit RDN tokens (or services tokens on the testnet) into the UDC.

This is related to #5407

@palango palango added the Component / API Issues that relate the the APIs Raiden provides. label Feb 4, 2020
@manuelwedler manuelwedler self-assigned this Jan 21, 2021
@manuelwedler manuelwedler changed the title API endpoint for UDC contract to deposit RDN tokens API endpoint for UDC contract to deposit and withdraw RDN tokens Jan 21, 2021
@manuelwedler
Copy link
Contributor

manuelwedler commented Jan 22, 2021

I'm taking this over now to provide a better UX. After a discussion with @karlb, we decided to have 3 API calls: deposit, plan withdraw and withdraw.

For this it makes sense to have a new endpoint. I propose for it to be /api/<version>/user_deposit.

Methods:

  • POST /api/<version>/user_deposit
    {total_deposit: <amount>}
  • POST /api/<version>/user_deposit
    {planned_withdraw_amount: <amount>}
  • POST /api/<version>/user_deposit
    {withdraw_amount: <amount>}

The first two are idempotent. The parameters are exactly what the respective contract functions expect. The requirements for doing the transactions (e.g. there must be a planned withdraw before withdrawing) should get checked in the API before sending a transaction to avoid it to be failing.

As we do with the other API calls which trigger an on-chain transaction we should wait for the transaction to be mined before returning the response. The call for planning a withdraw can then respond with the number of blocks for it to be ready.

manuelwedler added a commit to manuelwedler/raiden that referenced this issue Feb 12, 2021
This includes three POST requests:
- deposit to UDC
- plan withdraw from UDC
- withdraw from UDC

Resolves raiden-network#5497
manuelwedler added a commit to manuelwedler/raiden that referenced this issue Feb 25, 2021
This includes three POST requests:
- deposit to UDC
- plan withdraw from UDC
- withdraw from UDC

Resolves raiden-network#5497
manuelwedler added a commit that referenced this issue Feb 25, 2021
This includes three POST requests:
- deposit to UDC
- plan withdraw from UDC
- withdraw from UDC

Resolves #5497
netcriptus pushed a commit to netcriptus/raiden that referenced this issue Mar 23, 2021
This includes three POST requests:
- deposit to UDC
- plan withdraw from UDC
- withdraw from UDC

Resolves raiden-network#5497
netcriptus pushed a commit to netcriptus/raiden that referenced this issue Mar 23, 2021
This includes three POST requests:
- deposit to UDC
- plan withdraw from UDC
- withdraw from UDC

Resolves raiden-network#5497
karlb pushed a commit that referenced this issue Apr 23, 2021
This includes three POST requests:
- deposit to UDC
- plan withdraw from UDC
- withdraw from UDC

Resolves #5497
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component / API Issues that relate the the APIs Raiden provides.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants