Token Platform
Issuer DashboardInvestor DashboardPT-BR Version
  • ๐ŸŸขOverview
    • Introduction
    • Meet the Products
    • FAQ
    • Support and Feedback
  • ๐Ÿ“’Issuer Dashboard
    • KYB
    • Analytics
    • Token Issuance
    • Types of Tokens
    • BRLA Stablecoin
  • ๐Ÿ’ฒInvestor Dashboard
    • White-Label App
    • Investor Registration
      • KYC & AML
      • Investor Profile
    • Token Marketplace
    • Token Purchase Process
    • Investor Wallet
      • Wallet Balance
      • Tokens in Wallet
      • Statement
      • Deposits and Withdrawals
  • ๐Ÿง‘โ€๐Ÿš€Engineering
    • Stacks Used
    • AWS Infrastructure
    • Product Roadmap
    • Team Structure
  • โš™๏ธAPI
    • API Documentation
Powered by GitBook
On this page
  1. API

API Documentation

Last updated 10 months ago

Welcome to the API documentation for managing Users, Transactions, and Token Contracts. This API allows developers to interact with the app programmatically, enabling functionalities such as user management, token transactions, and retrieval of token contract information.

Authentication

This API uses JWT for authentication along with an API key. Every request to the API must include a valid JWT in the Authorization header and an API key in the X-API-Key header.

  • JWT: The JWT should be included in the Authorization header as a Bearer token.

  • API Key: The API key should be included in the X-API-Key header.

Base URL

The base URL for the API is:

https://api.sonica.xyz/v0/rwa

Available Endpoints

Getting Started

To begin using the API, you need to obtain an API key and generate a JWT token. Include these credentials in your requests to authenticate and interact with the endpoints. Each endpoint description in this documentation includes details about the required parameters, request body, and response structure.


User

Transactions

Token Contracts

โš™๏ธ

Get all users

get
Authorizations
Responses
200
List of users
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/users HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
{
  "type": "ok",
  "title": "SuccessfulRequest",
  "status": 200,
  "data": [
    {
      "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
      "email": "user@example.com",
      "fullName": "John Doe",
      "walletAddress": "0xabcdef1234567890abcdef1234567890abcdef12",
      "role": "user",
      "lastLoginAt": "2024-01-01T00:00:00Z",
      "createdAt": "2024-01-01T00:00:00Z",
      "updatedAt": "2024-01-01T00:00:00Z"
    }
  ]
}

Get a user by ID

get
Authorizations
Path parameters
idintegerRequired
Responses
200
User details
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
404
Not found error
application/json
406
Not acceptable error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/user/{id} HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
{
  "type": "ok",
  "title": "SuccessfulRequest",
  "status": 200,
  "data": [
    {
      "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
      "email": "user@example.com",
      "fullName": "John Doe",
      "walletAddress": "0xabcdef1234567890abcdef1234567890abcdef12",
      "role": "user",
      "lastLoginAt": "2024-01-01T00:00:00Z",
      "createdAt": "2024-01-01T00:00:00Z",
      "updatedAt": "2024-01-01T00:00:00Z"
    }
  ]
}

Get a user by email

get
Authorizations
Path parameters
emailstring ยท max: 255RequiredPattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Responses
200
User details
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
404
Not found error
application/json
406
Not acceptable error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/user/email/{email} HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
{
  "type": "ok",
  "title": "SuccessfulRequest",
  "status": 200,
  "data": [
    {
      "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
      "email": "user@example.com",
      "fullName": "John Doe",
      "walletAddress": "0xabcdef1234567890abcdef1234567890abcdef12",
      "role": "user",
      "lastLoginAt": "2024-01-01T00:00:00Z",
      "createdAt": "2024-01-01T00:00:00Z",
      "updatedAt": "2024-01-01T00:00:00Z"
    }
  ]
}

Get all transactions

get
Authorizations
Responses
200
List of transactions
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/transactions HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
[
  {
    "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
    "to": "0xabcdef1234567890abcdef1234567890abcdef12",
    "tokenHash": "0xabcdef1234567890abcdef1234567890abcdef12",
    "amount": 10,
    "status": "pending",
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z"
  }
]

Get a transaction by ID

get
Authorizations
Path parameters
transactionIdstring ยท max: 36RequiredExample: b92787c0-3525-4e2a-96f4-9d0d13123e5ePattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$
Responses
200
Transaction details
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
404
Not found error
application/json
406
Not acceptable error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/transaction/{transactionId} HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
{
  "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
  "to": "0xabcdef1234567890abcdef1234567890abcdef12",
  "tokenHash": "0xabcdef1234567890abcdef1234567890abcdef12",
  "amount": 10,
  "status": "pending",
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z"
}

Get transactions by date

get
Authorizations
Responses
200
List of transactions by date
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/transactions/date HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
[
  {
    "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
    "to": "0xabcdef1234567890abcdef1234567890abcdef12",
    "tokenHash": "0xabcdef1234567890abcdef1234567890abcdef12",
    "amount": 10,
    "status": "pending",
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z"
  }
]

Get transactions by date range

get
Authorizations
Responses
200
List of transactions by date range
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/transactions/range HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
[
  {
    "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
    "to": "0xabcdef1234567890abcdef1234567890abcdef12",
    "tokenHash": "0xabcdef1234567890abcdef1234567890abcdef12",
    "amount": 10,
    "status": "pending",
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z"
  }
]

Get all contracts

get
Authorizations
Responses
200
List of contracts
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/contracts HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
[
  {
    "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
    "address": "0x1234567890abcdef1234567890abcdef12345678",
    "network": 1,
    "type": "ERC20",
    "admins": [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ],
    "editors": [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ],
    "hidden": [
      [
        "0xabcdef1234567890abcdef1234567890abcdef12"
      ]
    ],
    "isActive": true
  }
]

Get all active contracts

get
Authorizations
Responses
200
List of active contracts
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/contracts/active HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
[
  {
    "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
    "address": "0x1234567890abcdef1234567890abcdef12345678",
    "network": 1,
    "type": "ERC20",
    "admins": [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ],
    "editors": [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ],
    "hidden": [
      [
        "0xabcdef1234567890abcdef1234567890abcdef12"
      ]
    ],
    "isActive": true
  }
]

Get a contract by ID

get
Authorizations
Path parameters
idstringRequired
Responses
200
Contract details
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
404
Not found error
application/json
406
Not acceptable error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/contract/{id} HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
{
  "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
  "address": "0x1234567890abcdef1234567890abcdef12345678",
  "network": 1,
  "type": "ERC20",
  "admins": [
    "0xabcdef1234567890abcdef1234567890abcdef12"
  ],
  "editors": [
    "0xabcdef1234567890abcdef1234567890abcdef12"
  ],
  "hidden": [
    [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ]
  ],
  "isActive": true
}

Get a contract by network and address

get
Authorizations
Path parameters
networkintegerRequired
addressstringRequired
Responses
200
Contract details
application/json
400
Bad request error
application/json
404
Not found error
application/json
406
Not acceptable error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
get
GET /v0/rwa/contract/{network}/{address} HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Accept: */*
{
  "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
  "address": "0x1234567890abcdef1234567890abcdef12345678",
  "network": 1,
  "type": "ERC20",
  "admins": [
    "0xabcdef1234567890abcdef1234567890abcdef12"
  ],
  "editors": [
    "0xabcdef1234567890abcdef1234567890abcdef12"
  ],
  "hidden": [
    [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ]
  ],
  "isActive": true
}
  • Authentication
  • Available Endpoints
  • User
  • GETGet all users
  • GETGet a user by ID
  • GETGet a user by email
  • POSTCreate a new user
  • PUTUpdate a user by ID
  • Transactions
  • GETGet all transactions
  • GETGet a transaction by ID
  • GETGet transactions by date
  • GETGet transactions by date range
  • POSTStart a buy transaction
  • POSTSign a transaction
  • PUTFinish a buy transaction
  • Token Contracts
  • GETGet all contracts
  • GETGet all active contracts
  • GETGet a contract by ID
  • GETGet a contract by network and address
  • POSTCreate a new contract
  • PUTUpdate contract activeness by network and address

Create a new user

post
Authorizations
Body

JSON defining a User object

fullNamestring ยท max: 255RequiredExample: John DoePattern: ^[a-z ,.'-]+$
emailstring ยท max: 255RequiredExample: user@example.comPattern: ^[^@\s]+@[^@\s]+\.[^@\s]+$
passwordstring ยท password ยท max: 255RequiredExample: password123Pattern: ^[a-zA-Z0-9]*$
Responses
200
User created successfully
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
406
Not acceptable error
application/json
409
Conflict error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
post
POST /v0/rwa/user HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 75

{
  "fullName": "John Doe",
  "email": "user@example.com",
  "password": "password123"
}
{
  "type": "ok",
  "title": "SuccessfulRequest",
  "status": 200,
  "data": [
    {
      "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
      "email": "user@example.com",
      "fullName": "John Doe",
      "walletAddress": "0xabcdef1234567890abcdef1234567890abcdef12",
      "role": "user",
      "lastLoginAt": "2024-01-01T00:00:00Z",
      "createdAt": "2024-01-01T00:00:00Z",
      "updatedAt": "2024-01-01T00:00:00Z"
    }
  ]
}

Update a user by ID

put
Authorizations
Path parameters
idstringRequired
Body

JSON defining a User object

emailstring ยท max: 255OptionalExample: user@example.comPattern: ^[^@\s]+@[^@\s]+\.[^@\s]+$
passwordstring ยท password ยท max: 255OptionalExample: password123Pattern: ^[a-zA-Z0-9]*$
fullNamestring ยท max: 255OptionalExample: John DoePattern: ^[a-z ,.'-]+$
Responses
200
User updated successfully
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
403
Forbidden error
application/json
404
Not found error
application/json
409
Conflict error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
put
PUT /v0/rwa/user/{id} HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 75

{
  "email": "user@example.com",
  "password": "password123",
  "fullName": "John Doe"
}
{
  "type": "ok",
  "title": "SuccessfulRequest",
  "status": 200,
  "data": [
    {
      "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
      "email": "user@example.com",
      "fullName": "John Doe",
      "walletAddress": "0xabcdef1234567890abcdef1234567890abcdef12",
      "role": "user",
      "lastLoginAt": "2024-01-01T00:00:00Z",
      "createdAt": "2024-01-01T00:00:00Z",
      "updatedAt": "2024-01-01T00:00:00Z"
    }
  ]
}

Start a buy transaction

post
Authorizations
Body
tostring ยท max: 42RequiredExample: 0xabcdef1234567890abcdef1234567890abcdef12Pattern: ^0x[a-fA-F0-9]{40}$
tokenHashstring ยท max: 42RequiredExample: 0xabcdef1234567890abcdef1234567890abcdef12Pattern: ^0x[a-fA-F0-9]{40}$
amountnumber ยท float ยท max: 1000RequiredExample: 10
Responses
200
Transaction started successfully
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
406
Not acceptable error
application/json
409
Conflict error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
post
POST /v0/rwa/transaction/buy/start HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 120

{
  "to": "0xabcdef1234567890abcdef1234567890abcdef12",
  "tokenHash": "0xabcdef1234567890abcdef1234567890abcdef12",
  "amount": 10
}
{
  "type": "ok",
  "title": "SuccessfulRequest",
  "status": 200,
  "data": [
    {
      "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
      "transaction": {
        "data": "0x84bb1e420000000000000000000000001bfad07c5118fbcc96ef6baf12d2945ca9d2548c000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
        "to": "0xabcdef1234567890abcdef1234567890abcdef12"
      }
    }
  ]
}

Sign a transaction

post
Authorizations
Body
idstring ยท max: 36OptionalExample: b92787c0-3525-4e2a-96f4-9d0d13123e5ePattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$
tostring ยท max: 42OptionalExample: 0xabcdef1234567890abcdef1234567890abcdef12Pattern: ^0x[a-fA-F0-9]{40}$
tokenHashstring ยท max: 42OptionalExample: 0xabcdef1234567890abcdef1234567890abcdef12Pattern: ^0x[a-fA-F0-9]{40}$
amountnumber ยท float ยท max: 1000OptionalExample: 10
statusstring ยท enumOptionalExample: pendingPossible values:
createdAtstring ยท date-time ยท max: 20OptionalExample: 2024-01-01T00:00:00Z
updatedAtstring ยท date-time ยท max: 20OptionalExample: 2024-01-01T00:00:00Z
Responses
200
Transaction signed successfully
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
406
Not acceptable error
application/json
409
Conflict error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
post
POST /v0/rwa/transaction/sign HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 253

{
  "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
  "to": "0xabcdef1234567890abcdef1234567890abcdef12",
  "tokenHash": "0xabcdef1234567890abcdef1234567890abcdef12",
  "amount": 10,
  "status": "pending",
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z"
}
{
  "transaction": "0xf9020e128509742328a88307a12094287c676e7c51556d0820a1f049f74aa3a206fa8880b901a484bb1e420000000000000000000000001bfad07c5118fbcc96ef6baf12d2945ca9d2548c000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000083027127a07b8b49ac49c2c862a697954115d244795d56e34c8e49410b79f1dafaf2b81548a07b397d0cd1f17edbfb8de38972fb2cedf713e1acab8542c951c75a208fe86f65"
}

Finish a buy transaction

put
Authorizations
Path parameters
transactionIdstring ยท max: 36RequiredExample: b92787c0-3525-4e2a-96f4-9d0d13123e5ePattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$
Body
transactionstring ยท max: 1000RequiredExample: 0xf9020e128509742328a88307a12094287c676e7c51556d0820a1f049f74aa3a206fa8880b901a484bb1e420000000000000000000000001bfad07c5118fbcc96ef6baf12d2945ca9d2548c000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000083027127a07b8b49ac49c2c862a697954115d244795d56e34c8e49410b79f1dafaf2b81548a07b397d0cd1f17edbfb8de38972fb2cedf713e1acab8542c951c75a208fe86f65Pattern: ^[a-zA-Z0-9]*$
Responses
200
Transaction finished successfully
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
403
Forbidden error
application/json
404
Not found error
application/json
409
Conflict error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
put
PUT /v0/rwa/transaction/buy/finish/{transactionId} HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1078

{
  "transaction": "0xf9020e128509742328a88307a12094287c676e7c51556d0820a1f049f74aa3a206fa8880b901a484bb1e420000000000000000000000001bfad07c5118fbcc96ef6baf12d2945ca9d2548c000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000083027127a07b8b49ac49c2c862a697954115d244795d56e34c8e49410b79f1dafaf2b81548a07b397d0cd1f17edbfb8de38972fb2cedf713e1acab8542c951c75a208fe86f65"
}
{
  "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
  "status": "completed",
  "description": "Transaction completed successfully",
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z"
}

Create a new contract

post
Authorizations
Body
addressstring ยท max: 42RequiredExample: 0x1234567890abcdef1234567890abcdef12345678Pattern: ^0x[a-fA-F0-9]{40}$
networkintegerRequiredExample: 1
typestringRequiredExample: ERC20
adminsstring[]RequiredExample: ["0xabcdef1234567890abcdef1234567890abcdef12"]
editorsstring[]RequiredExample: ["0xabcdef1234567890abcdef1234567890abcdef12"]
hiddenstring[]OptionalExample: ["0xabcdef1234567890abcdef1234567890abcdef12"]
Responses
200
Contract created successfully
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
406
Not acceptable error
application/json
409
Conflict error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
post
POST /v0/rwa/contract HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 258

{
  "address": "0x1234567890abcdef1234567890abcdef12345678",
  "network": 1,
  "type": "ERC20",
  "admins": [
    [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ]
  ],
  "editors": [
    [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ]
  ],
  "hidden": [
    [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ]
  ]
}
{
  "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
  "address": "0x1234567890abcdef1234567890abcdef12345678",
  "network": 1,
  "type": "ERC20",
  "admins": [
    "0xabcdef1234567890abcdef1234567890abcdef12"
  ],
  "editors": [
    "0xabcdef1234567890abcdef1234567890abcdef12"
  ],
  "hidden": [
    [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ]
  ],
  "isActive": true
}

Update contract activeness by network and address

put
Authorizations
Path parameters
networkintegerRequired
addressstringRequired
Body
isActivebooleanRequiredExample: true
Responses
200
Contract activeness updated successfully
application/json
400
Bad request error
application/json
401
Unauthorized error
application/json
403
Forbidden error
application/json
404
Not found error
application/json
409
Conflict error
application/json
422
Unprocessable entity error
application/json
429
Too many requests error
application/json
default
Internal server error
application/json
put
PUT /v0/rwa/contract/{network}/{address} HTTP/1.1
Host: api.sonica.xyz
api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "isActive": true
}
{
  "id": "b92787c0-3525-4e2a-96f4-9d0d13123e5e",
  "address": "0x1234567890abcdef1234567890abcdef12345678",
  "network": 1,
  "type": "ERC20",
  "admins": [
    "0xabcdef1234567890abcdef1234567890abcdef12"
  ],
  "editors": [
    "0xabcdef1234567890abcdef1234567890abcdef12"
  ],
  "hidden": [
    [
      "0xabcdef1234567890abcdef1234567890abcdef12"
    ]
  ],
  "isActive": true
}