๐Ÿ›ก๏ธ
DYOR_API
  • Welcome!
  • Reference
    • API Reference
      • ๐ŸŒNetwork
      • ๐Ÿ“‚Portfolio
      • ๐Ÿ”“Auth
      • ๐Ÿคนโ€โ™‚๏ธSwap
      • โ„ข๏ธTrade
      • ๐Ÿ“ˆTransfer
      • ๐Ÿ’ฐWallet
      • ๐Ÿ“บWatchlist
      • ๐Ÿ‘จโ€๐ŸญAccount
      • ๐Ÿ’ฒPrice
      • ๐Ÿ—ƒ๏ธProject
Powered by GitBook
On this page
Export as PDF
  1. Reference
  2. API Reference

Auth

PreviousPortfolioNextSwap

Last updated 2 years ago

Needs Wallet Authentication

Needs Wallet Authentication

๐Ÿ”“

Logs out of the app by deleting session.

delete

This route logouts of the app.The route first checks and finds the session saved in the database.The route then deletes the session found related to the wallet.

Responses
200
Successful
application/json
401
Unauthorized
application/json
500
Internal Server Error
application/json
401001
application/json
401002
application/json
401003
application/json
401004
application/json
delete
DELETE /api/v1/auth/logout HTTP/1.1
Host: www.dyorbackend.tk
Accept: */*
{
  "ok": true,
  "result": {}
}

Refreshes the wallet session and generates new tokens.

get

This route refreshes the wallet session.The route first checks and finds the wallet session saved in the database.The route then deletes the session, creates a new one and generates new tokens.

Responses
200
Successful
application/json
401
Unauthorized
application/json
500
Internal Server Error
application/json
401001
application/json
401002
application/json
401003
application/json
401004
application/json
get
GET /api/v1/auth/refresh HTTP/1.1
Host: www.dyorbackend.tk
Accept: */*
{
  "ok": true,
  "result": {
    "access": "text",
    "refresh": "text"
  }
}
  • POSTLogins to app by proving ownership of the address.
  • GETGets nonce of a given wallet.
  • DELETELogs out of the app by deleting session.
  • GETRefreshes the wallet session and generates new tokens.

Gets nonce of a given wallet.

get

This route retrieves the cryptographic nonce of a wallet by address.The route first queries the database for the wallet by address provided.The route then returns the nonce of the found wallet.

Path parameters
addressstringRequired
Responses
200
Successful
application/json
404
Unauthorized
application/json
500
Internal Server Error
application/json
get
GET /api/v1/auth/nonce/{address} HTTP/1.1
Host: www.dyorbackend.tk
Accept: */*
{
  "ok": true,
  "result": {
    "nonce": 608560748621946800000
  }
}

Logins to app by proving ownership of the address.

post

This route verifies the signature and the address provided. The route first checks if the nonce has been correctly signed by the user. The route then creates a session and generates tokens if the ownership of the public address is proven.

Body
addressstringOptional
signaturestringOptional
Responses
200
Successful
application/json
401
Unauthorized
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
post
POST /api/v1/auth/login HTTP/1.1
Host: www.dyorbackend.tk
Content-Type: application/json
Accept: */*
Content-Length: 37

{
  "address": "text",
  "signature": "text"
}
{
  "ok": true,
  "result": {
    "access": "text",
    "refresh": "text"
  }
}