Redirects the client to the Discord OAuth flow.
This will redirect the user to /?session=
If the session
query parameter is supplied to any client page:
- Save the value in localStorage
- Remove
session=<SESSION>
from the URL
If this isn't supplied, the API will return status code 403.
For instance, you'd log out by calling GET /logout?session=<SESSION>
Invalidates the value.
{
valueCurrencyCode: string, # E.g. USD, GBP, EUR
totalValue: string,
currencies: [
{
name: string, # E.g. "United States Dollar", "Bitcoin"
code: string, # E.g. USD, BTC,
freeBalance: string,
lockedBalance: string,
totalBalance: string,
totalValue: string, # E.g. 5 (currency determined by valueCurrencyCode)
},
...
]
}
When viewing all assets, call this endpoint every 10 seconds to update the data. Show an indicator in the corner: countdown from 10 when waiting, or loading icon when fetching data.
{
name: string, # E.g. "United States Dollar", "Bitcoin"
freeBalance: string,
lockedBalance: string,
totalBalance: string,
valueCurrencyCode: string, # E.g. USD, GBP, EUR
totalValue: string, # E.g. 5 (currency determined by valueCurrencyCode),
orders: [
{
id: string,
type: "buy" | "sell",
amount: string,
rate: string | "market"
}
]
}
When viewing a particular asset, call this endpoint every 10 seconds to update the data. Show an indicator in the corner: countdown from 10 when waiting, or loading icon when fetching data.
{
type: "BUY" | "SELL"
currency: string, # E.g. "BTC"
amount: string,
rate: string | "market"
}
{
orderId: string,
message: "Order placed (or not, it depends)"
}
Once you get the response:
- Display the message as a toast
- Call GET
/asset/<CURRENCY_CODE>
to update the orders
{
orderId: string,
message: "Order placed (or not, it depends)"
}
{
address: string # Crypto address to send crypto currency to
}
{
address: string # Crypto address to withdraw crypto currency to
amount: string # How much to send, e.g. "12.345"
}
{
message: "Withdrawn, or not, depends really, just display this & refresh data"
}