API Reference

To read account data you need to either authenticate via signed message or attach a authentication cookie to each request.

The response from this endpoint will have a set-cookieheader that will need to be attached to authenticated requests to access private endpoints.

Signature generation

The api expects a EIP712 signature constructed with the following typed data:

{
  EIP712Domain: [
    {
      name: 'name', // rysk
      type: 'string',
    },
    {
      name: 'version', // "0.0.0"
      type: 'string',
    },
    {
      name: 'chainId', 
      type: 'uint256',
    },
    {
      name: 'verifyingContract',  // <OrderDispatchAddress> 
      type: 'address',
    },
  ],
  LoginMessage: [
    {
      name: 'account', // address of the account logging in
      type: 'address',
    },
    {
      name: 'message', // e.g. "I want to log into rysk.finance"
      type: 'string',
    },
    {
      name: 'timestamp', // current timestamp in ms (will be rejected if older than 10s, easiest to send in a time in the future)
      type: 'uint64',
    },
  ],
}

Example request:

{
  "account": "0x1234",                          // Address of the account logging in
  "message": "I wish to log into rysk.finance", // A login message
  "signature":"0x1234...",                      // Signature for verifying the order
  "timestamp": 123456678                        // Current timestamp in milliseconds since epoch, will be rejected if older than 10s
}

Example response:

{
  "name": "connectedAddress",         // the name of the cookie
  "value": "signedTokenExample",     // the value of the cookie
  "path": "/",                       // the path scope of the cookie
  "domain": "",                      // the domain scope of the cookie
  "max_age": 21600,                  // the maximum age of the cookie in seconds
  "expires": "2024-06-17T18:40:58Z", // the expiration date of the cookie
  "secure": true,                    // whether the cookie is secure (sent only over HTTPS)
  "http_only": true,                 // whether the cookie is HTTP only (not accessible via JavaScript)
  "same_site": "",                   // the SameSite attribute of the cookie
  "session_only": false              // whether the cookie is session-only (deleted when the browser is closed)
}

Language
Click Try It! to start a request and see the response here!