NFTRainbow
NFTRainbow 控制台GithubWhat's an NFT?
  • NFTRainbow - NFT 彩虹桥 🌈🌉🦄
  • Tutorials
    • Mints
      • 铸造NFT快速指南
    • Interactive Flowchart
    • By Community
      • NFTRainbow 使用教程
    • Account Solutions
    • Guides
      • 控制台合约代付设置
      • 元数据管理
      • Rainbow 铸造工具简介
  • Docs
    • FAQs
    • Changelog
    • RoadMap
    • Conflux Sponsor
    • Terminology
    • Prices
  • Products
    • Conflux RPC Bridge
    • ERC-6551
    • Web3 Services
  • API Reference
    • Open-API
      • Login
      • Files
      • Metadata
      • Contract
      • Mints
      • Transfers
      • Transaction
      • NFT
      • Burns
    • Swagger-Doc
    • Postman Collection
    • SDKs
      • Go-SDK
    • Common Errors
  • ABOUT THE APIs
    • Authentication
    • Error codes
    • Quotas and rate limits
Powered by GitBook
On this page
  1. API Reference
  2. Open-API

Contract

The contract API provide users the entries to interact with the ERC721 contracts, including deploying the contracts, setting the sponsors and so on.

PreviousMetadataNextMints

Last updated 1 year ago

Contract Actions

Deploy Contract

The Deploy contract API helps users to deploy a ERC721 or a ERC1155 contract.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Type
Required
Default

name

The name of the NFT

body

string

symbol

The symbol of the NFT

body

string

owner_address

The creater of the contract

body

string

type

The type of the contract, e.g., erc721, erc1155

body

string

base_uri

The uri of the NFT. For ERC721 contract, the token_uri is the base_uri. For ERC1155 contract, the token_uri is the base_uri/ token_id. During minting, if the metadata_uri is not null, the base_uri will be ignored.

body

string

null string

chain

The chain type, which can be conflux or conflux_test

body

string

royalties_bps

The price

of the royalties. When a transferring happens, the projector or creator of the NFT can obtain from the transaction.

body

integer

0

royalties_address

The address of the beneficiary. When a transaferring happens, this address can obtain from the transaction.

body

string

The owner of the contract

tokens_burnable

Whether the function of burning tokens by the token owner is supported

body

bool

false

tokens_transferable_by_admin

Whether the function of transferring tokens by the contract admin is supported

body

bool

false

tokens_transferable_by_user

Whether the function of transferring tokens by contract user is supported

body

bool

false

transfer_cooldown_time

The cooldown time of transfering tokens. Once a transfer transaction is confirmed, the cooldown time must pass before the transfer transaction can be proposed again.

body

integer

false

is_sponsor_for_all_user

Whether the contract can be called by all users free. If the function opens, all uesrs can call the contract free.

body

bool

auto_sponsor

Whether auto set sponsor for new created contract

body

bool

true

 {
    "chain": "conflux_test",
    "name": "NFT-name",
    "symbol": "ENFT",
    "owner_address": "cfxtest:aatk708nbb7573bkwumsu00h0r1rtkcdz2chwhttzk",
    "type": "erc721",
    "base_uri": "",
    "royalties_bps": 0,
    "royalties_address": "",
    "tokens_burnable": false,
    "tokens_transferable_by_admin": false,
    "tokens_transferable_by_user": false,
    "transfer_cooldown_time": 0,
    "is_sponsor_for_all_user": false
}
Name
Meaning
Type

created_at

The time of creating the item in the database

string

updated_at

The time of updating the item in the database

string

deleted_at

The time of deleting the item in the database

string

id

integer

app_id

The id of the app

integer

chain_id

The id of the chain. 1029-mainnet, 1-testnet

integer

chain_type

The type of the chain. 1-CFX, 2-ETH

integer

name

The name of the NFT

string

symbol

The symbol of the NFT

string

owner_address

The admin of the contract

string

type

The type of the contract, e.g., erc721, erc1155

string

base_uri

The uri of the NFT. For ERC721 contract, the token_uri is the base_uri. For ERC1155 contract, the token_uri is the base_uri/ token_id. During minting, if the metadata_uri is not null, the base_uri will be ignored.

string

address

string

royalties_bps

The price

of the royalties. When a transferring happens, the projector or creator of the NFT can obtain from the transaction.

integer

royalties_address

The address of the beneficiary. When a transaferring happens, this address can obtain from the transaction.

string

tokens_burnable

Whether the function of burning tokens by the token owner is supported

bool

tokens_transferable_by_admin

Whether the function of transferring tokens by the contract admin is supported

bool

tokens_transferable_by_user

Whether the function of transferring tokens by contract user is supported

bool

transfer_cooldown_time

The cooldown time of transfering tokens. Once a transfer transaction is confirmed, the cooldown time must pass before the transfer transaction can be proposed again.

integer

status

integer

tx_id

The id of the transaction

integer

hash

string

{
    "id": 20,
    "created_at": "2022-08-22T15:49:42.46+08:00",
    "updated_at": "2022-08-22T15:49:42.46+08:00",
    "deleted_at": null,
    "app_id": 4,
    "chain_type": 1,
    "chain_id": 1,
    "address": "",
    "owner_address": "cfxtest:aajb342mw5kzad6pjjkdz0wxx0tr54nfwpbu6yaj49",
    "type": 1,
    "base_uri": "",
    "name": "NFT-name",
    "symbol": "ENFT",
    "royalties_bps": 0,
    "royalties_address": "cfxtest:aajb342mw5kzad6pjjkdz0wxx0tr54nfwpbu6yaj49",
    "tokens_burnable": false,
    "tokens_transferable_by_admin": false,
    "tokens_transferable_by_user": false,
    "transfer_cooldown_time": 0,
    "hash": "",
    "tx_id": 64,
    "status": 0
}
curl --request POST \
  --url https://api.nftrainbow.cn/v1/contracts/ \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json' \
  --data-raw ' {
    "chain": "conflux_test",
    "name": "NFT-name",
    "symbol": "ENFT",
    "owner_address": "cfxtest:aatk708nbb7573bkwumsu00h0r1rtkcdz2chwhttzk",
    "type": "erc721",
    "base_uri": "",
    "royalties_bps": 0,
    "royalties_address": "",
    "tokens_burnable": false,
    "tokens_transferable_by_admin": false,
    "tokens_transferable_by_user": false,
    "transfer_cooldown_time": 0
}'

Update contract admin

The Update contract admin API provides users the entry to update the admin of the specific contract.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

address

The address of the contract

Path

string

admin_address

The address of the admin

body

string

Name
Meaning
Type

tx_id

The id of the transaction

integer

{
  "tx_id": 421312
}
curl --request PUT \
  --url https://api.nftrainbow.cn/v1/contracts/{address}/admin \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'

Set Sponsor

Good to know: Conflux provides users the sponsor function. Once a contract is sponsored by an account, the accounts in the contract white list can call this contracts for free.

The Set sponsor API provides users to set a sponser for a specific contract according to the sponsor' address.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

address

The address of the contract

Path

string

chain

The blockchain name: conflux, conflux_test(default)

query

string

auto_sponsor

Whether auto recharge sponsor balance when not enough

query

bool

Name
Meaning
Type

sponsor_gas_tx_id

The id of the sponsor gas setting transaction. gas is used for contract running.

integer

sponsor_collateral_tx_i

The id of the sponsor storage setting transaction. collateral is presented for storage.

integer

{
    "sponsor_gas_tx_id": 8475,
    "sponsor_collateral_tx_id": 8476
}
curl --request POST \
  --url https://api.nftrainbow.cn/v1/contracts/{address}/sponsor \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'

Add Contract Sponsor Users

The Add Contract Sponsor Users API provides users to add the address in the whitelist.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

users

body

[]string

address

The address of the contract

Path

string

Name
Meaning
Type

tx_id

The id of the transaction

integer

{
  "tx_id": 421312
}
curl --request POST \
  --url https://api.nftrainbow.cn/v1/contracts/{address}/sponsor/whitelist/ \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json' \
  --data-raw `["cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8"]`

Remove Contract Sponsor Users

The Remove Contract Sponsor Users API provides users to remove the address from the whitelist.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

address

The address of the contract

Path

string

Name
Meaning
Type

tx_id

The id of the transaction

integer

{
  "tx_id": 421312
}
curl --request DELETE \
  --url https://api.nftrainbow.cn/v1/contracts/{address}/sponsor/whitelist/ \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json' \
  --data-raw `["cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8"]`
  

Query Informations

Obtain Contract List

The Obtain contarct list API provides users the entry to get the inforamtion of the contracts deployed in a specified app. The parameter page and size are optional parameters.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required
Default

page

Page Query

query

integer

1

limit

Page Query

query

integer

10

Name
Meaning
Type

count

The number of the deployed contracts

integer

items

The contract information

[]Contract

The Contract Struct is listed as follow:

Name
Meaning
Type

created_at

The time of creating the item in the database

string

updated_at

The time of updating the item in the database

string

deleted_at

The time of deleting the item in the database

string

id

The id of the item in the database

integer

app_id

The id of the app

integer

chain_id

The id of the chain. 1029-mainnet, 1-testnet

integer

chain_type

The type of the chain. 1-CFX, 2-ETH

integer

name

The name of the NFT

string

symbol

The symbol of the NFT

string

owner_address

The admin of the contract

string

type

The type of the contract, e.g., erc721, erc1155

string

base_uri

The uri of the NFT. For ERC721 contract, the token_uri is the base_uri. For ERC1155 contract, the token_uri is the base_uri/ token_id. During minting, if the metadata_uri is not null, the base_uri will be ignored.

string

address

The address of the contract

string

royalties_bps

The price

of the royalties. When a transferring happens, the projector or creator of the NFT can obtain from the transaction.

integer

royalties_address

The address of the beneficiary. When a transaferring happens, this address can obtain from the transaction.

string

tokens_burnable

Whether the function of burning tokens by the token owner is supported

bool

tokens_transferable_by_admin

Whether the function of transferring tokens by the contract admin is supported

bool

tokens_transferable_by_user

Whether the function of transferring tokens by contract user is supported

bool

transfer_cooldown_time

The cooldown time of transfering tokens. Once a transfer transaction is confirmed, the cooldown time must pass before the transfer transaction can be proposed again.

integer

status

The status of the transaction. 0-pending, 1-success, 2-failed

integer

tx_id

The id of the transaction

integer

hash

The hash of the transaction

string

{
        "count": 1,
        "items": [
            {
                "id": 1,
                "created_at": "2022-08-19T10:48:13.049+08:00",
                "updated_at": "2022-08-19T10:49:15.853+08:00",
                "deleted_at": null,
                "app_id": 4,
                "chain_type": 1,
                "chain_id": 1,
                "address": "cfxtest:acdzrjc92rds9tuta8rdkx3mn10yzf0jny1z3s0s8e",
                "owner_address": "cfxtest:aajb342mw5kzad6pjjkdz0wxx0tr54nfwpbu6yaj49",
                "type": 1,
                "base_uri": "",
                "name": "ttt",
                "symbol": "test",
                "royalties_bps": 0,
                "royalties_address": "",
                "tokens_burnable": false,
               "tokens_transferable_by_admin": false,
                "tokens_transferable_by_user": false,
                "transfer_cooldown_time": 0,
                "hash": "0xcbcedb27eb941a9a4fb6008d343055d98d9fe1ccdba65268680f46af6bf3fa0a",
                "tx_id": 49,
                "status": 1
            }
        ]
    }
curl --request GET \
  --url https://api.nftrainbow.cn/v1/contracts/ \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'

Query detail contract

The Query detail contract API provides users the entry to get the detail contract information of a specific contract according to the contract's id. The parameter chain is optional, which can be used to choose the test or main network of conflux.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

id

The id of the contract

Path

integer

Name
Meaning
Type

created_at

The time of creating the item in the database

string

updated_at

The time of updating the item in the database

string

deleted_at

The time of deleting the item in the database

string

id

The id of the item in the database

integer

app_id

The id of the app

integer

chain_id

The id of the chain. 1029-mainnet, 1-testnet

integer

chain_type

The type of the chain. 1-CFX, 2-ETH

integer

name

The name of the NFT

string

symbol

The symbol of the NFT

string

owner_address

The admin of the contract

string

type

The type of the contract, e.g., erc721, erc1155

string

base_uri

The uri of the NFT. For ERC721 contract, the token_uri is the base_uri. For ERC1155 contract, the token_uri is the base_uri/ token_id. During minting, if the metadata_uri is not null, the base_uri will be ignored.

string

address

The address of the contract.

string

royalties_bps

The price

of the royalties. When a transferring happens, the projector or creator of the NFT can obtain from the transaction.

integer

royalties_address

The address of the beneficiary. When a transaferring happens, this address can obtain from the transaction.

string

tokens_burnable

Whether the function of burning tokens by the token owner is supported

bool

tokens_transferable_by_admin

Whether the function of transferring tokens by the contract admin is supported

bool

tokens_transferable_by_user

Whether the function of transferring tokens by contract user is supported

bool

transfer_cooldown_time

The cooldown time of transfering tokens. Once a transfer transaction is confirmed, the cooldown time must pass before the transfer transaction can be proposed again.

integer

status

The status of the transaction. 0-pending, 1-success, 2-failed

integer

tx_id

The id of the transaction

integer

hash

The hash of the transaction

string

{
    "id": 10,
    "created_at": "2022-08-19T10:48:13.049+08:00",
    "updated_at": "2022-08-19T10:49:15.853+08:00",
    "deleted_at": null,
    "app_id": 4,
    "chain_type": 1,
    "chain_id": 1,
    "address": "cfxtest:acdzrjc92rds9tuta8rdkx3mn10yzf0jny1z3s0s8e",
    "owner_address": "cfxtest:aajb342mw5kzad6pjjkdz0wxx0tr54nfwpbu6yaj49",
    "type": 1,
    "base_uri": "",
    "name": "ttt",
    "symbol": "test",
    "royalties_bps": 0,
    "royalties_address": "",
    "tokens_burnable": false,
    "tokens_transferable_by_admin": false,
    "tokens_transferable_by_user": false,
    "transfer_cooldown_time": 0,
    "hash": "0xcbcedb27eb941a9a4fb6008d343055d98d9fe1ccdba65268680f46af6bf3fa0a",
    "tx_id": 49,
    "status": 1
}
curl --request GET \
  --url https://api.nftrainbow.cn/v1/contracts/detail/{id} \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'

Query Sponsor

The Query sponsor API provides users the entry to get the sponsors of a specific contract according to the contract's address. The parameter chain is optional, which can be used to choose the test or main network of conflux.

Good to know: Conflux Network can be divided into the main network and the test network. The later is used to test the developed functions for developers.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

address

The address of the sponsor

Path

string

chain

The chain type, which can be conflux or conflux_test

query

string

Name
Meaning
Type

collateral_sponsor

The address of the collateral sponsor

string

collateral_sponsor_balance

The balance of the collateral sponsor

integer

gas_sponsor

The address of the gas sponsor

string

gas_sponsor_balance

The balance of the gas sponsor

integer

gas_upper_bound

The upper bound of using gas

integer

is_all_white_listed

wheter the sponsor in the all white list

bool

{
        "gas_sponsor": "cfxtest:aasr1hmezez1wepvh8ew8sk9p40khhhj1ymxwmpaf0",
        "gas_sponsor_balance": 10000000000000000000,
        "collateral_sponsor": "cfxtest:aasr1hmezez1wepvh8ew8sk9p40khhhj1ymxwmpaf0",
        "collateral_sponsor_balance": 100000000000000000000,
        "is_all_white_listed": true,
        "gas_upper_bound": 5000000000000000
}
curl --request GET \
  --url https://api.nftrainbow.cn/v1/contracts/{address}/sponsor \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'

Good to know: For more detailed information, please refer to the following link.

Query contract admin

The Query contract admin API provides users the entry to get the admin of the specific contract.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

address

The address of the contract

Path

string

{
  "cfxtest:aasr1hmezez1wepvh8ew8sk9p40khhhj1ymxwmpaf0"
}
curl --request GET \
  --url https://api.nftrainbow.cn/v1/contracts/{address}/admin \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'

Query Contract Whitelist

The Query Contract Whitelist API provides users to get the whitelist of the specific contract. Only the addresses in the whitelist can call the contract free.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

address

The address of the contract

Path

string

Return the slices of the addresses in the whiltelist.
["cfxtest:acexyjf36ddwcct171wr1k5srd289zp9te70p67zc1"]
curl --request GET \
  --url https://api.nftrainbow.cn/v1/contracts/{address}/sponsor/whitelist/ \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'

The id of the item in the database, which can be used to

The address of the contract. The response will be null after calling this interface. After several seconds, it can call according to the id.

The status of the transaction. 0-pending, 1-success, 2-failed. The response will be 0 after calling this interface. After several seconds, it can call according to the id.

The hash of the transaction. The response will be null after calling this interface. After several seconds, it can call according to the id.

When the API is called successfully, we need to use the id in response to call API to get the contract address. It takes several seconds that the contract address can be obtained from API.

Note: UP to now, Set sponsor API can only be called by users free in testnet. In mainnet, Users need to

The addresses being added into the

recharge their own wallet.
Query contract detail
Query contract detail
whitelist
query detail contract
query contract
query contract
query contract
Internal Contract | Conflux
SponsorWhitelistControl Contract
Logo

Set sponsor

post

Set the sponsor for a contract according to the address with specified value(gas-1, storage-50)

Path parameters
addressstringRequired

Contract address

Query parameters
chainstringOptional

chain

auto_sponsorbooleanOptional

Open auto sponsor or not, for mainnet contract keep user account have enough balance

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Responses
200
Transaction id" "success
application/json
400
Invalid address
application/json
500
Internal Server error
application/json
post
POST /v1/contracts/{address}/sponsor HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "sponsor_collateral_tx_id": 1,
  "sponsor_gas_tx_id": 1
}

Obtain contract list

get

Get the contract list containing the contracts deployed through the specified app.

Query parameters
pageintegerOptional

page

limitintegerOptional

limit

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Responses
200
OK
application/json
500
Internal Server error
application/json
get
GET /v1/contracts/ HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "count": 1,
  "items": [
    {
      "address": "text",
      "app_id": 1,
      "auto_sponsor": true,
      "base_uri": "text",
      "block_reason": 1,
      "chain_id": 1,
      "chain_type": 1,
      "created_at": "text",
      "deleted_at": {
        "time": "text",
        "valid": true
      },
      "error": "text",
      "hash": "text",
      "id": 1,
      "name": "text",
      "owner_address": "text",
      "royalties_address": "text",
      "royalties_bps": 1,
      "status": 1,
      "symbol": "text",
      "tokens_transferable_by_admin": true,
      "tokens_transferable_by_user": true,
      "transfer_cooldown_time": 1,
      "tx_id": 1,
      "type": 1,
      "updated_at": "text"
    }
  ]
}

Contract detail

get

Get Contract info

Path parameters
idintegerRequired

id

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Responses
200
OK
application/json
400
Invalid request
application/json
500
Internal Server error
application/json
get
GET /v1/contracts/detail/{id} HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "address": "text",
  "app_id": 1,
  "auto_sponsor": true,
  "base_uri": "text",
  "block_reason": 1,
  "chain_id": 1,
  "chain_type": 1,
  "created_at": "text",
  "deleted_at": {
    "time": "text",
    "valid": true
  },
  "error": "text",
  "hash": "text",
  "id": 1,
  "name": "text",
  "owner_address": "text",
  "royalties_address": "text",
  "royalties_bps": 1,
  "status": 1,
  "symbol": "text",
  "tokens_transferable_by_admin": true,
  "tokens_transferable_by_user": true,
  "transfer_cooldown_time": 1,
  "tx_id": 1,
  "type": 1,
  "updated_at": "text"
}

Query sponsor

get

Get the sponsor of the specified contract according to address.

Path parameters
addressstringRequired

address

Query parameters
chainstringOptional

chain

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Responses
200
OK
application/json
400
Invalid address
application/json
500
Internal Server error
application/json
get
GET /v1/contracts/{address}/sponsor HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "collateral_sponsor": "text",
  "collateral_sponsor_balance": "text",
  "gas_sponsor": "text",
  "gas_sponsor_balance": "text",
  "gas_upper_bound": "text",
  "is_all_white_listed": true
}

Get administrator of contract, only work on conflux chain

get

Get Contract Admin

Path parameters
addressstringRequired

contract address

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Responses
200
Admin address
application/json
Responsestring
400
Invalid request
application/json
500
Internal Server error
application/json
599
Businesss error
application/json
get
GET /v1/contracts/{address}/admin HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
text

Get contract sponsored whitelist

get

Get contract sponsored whitelist, only work on conflux chain

Path parameters
addressstringRequired

contract address

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Responses
200
Contract sponsored whitelist
application/json
Responsestring[]
400
Invalid request
application/json
500
Internal Server error
application/json
599
Businesss error
application/json
get
GET /v1/contracts/{address}/sponsor/whitelist HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
[
  "text"
]
  • Contract Actions
  • Deploy Contract
  • POSTDeploy contract
  • Update contract admin
  • PUTUpdate administrator of contract
  • Set Sponsor
  • POSTSet sponsor
  • Add Contract Sponsor Users
  • POSTAdd contract sponsored whitelist
  • Remove Contract Sponsor Users
  • DELETERemove contract sponsored whitelist
  • Query Informations
  • Obtain Contract List
  • GETObtain contract list
  • Query detail contract
  • GETContract detail
  • Query Sponsor
  • GETQuery sponsor
  • Query contract admin
  • GETGet administrator of contract, only work on conflux chain
  • Query Contract Whitelist
  • GETGet contract sponsored whitelist

Deploy contract

post

Deploy a ERC721 or ERC1155 contract. Deploy a ERC721 or ERC1155 contract.

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

AuthorizationstringRequired

Bearer Open_JWT

Body
auto_sponsorbooleanOptional

default: true

base_uristringOptional
chainstring · enumRequiredPossible values:
is_sponsor_for_all_userbooleanOptional

default: true

namestringRequired
owner_addressstringOptional
royalties_addressstringOptional
royalties_bpsintegerOptional
symbolstringRequired
tokens_transferable_by_adminbooleanOptional

default: true

tokens_transferable_by_userbooleanOptional

default: true

transfer_cooldown_timeintegerOptional

default: 0

typestring · enumRequiredPossible values:
Responses
200
OK
application/json
400
Invalid request
application/json
500
Internal Server error
application/json
post
POST /v1/contracts/ HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 300

{
  "auto_sponsor": true,
  "base_uri": "text",
  "chain": "conflux",
  "is_sponsor_for_all_user": true,
  "name": "text",
  "owner_address": "text",
  "royalties_address": "text",
  "royalties_bps": 1,
  "symbol": "text",
  "tokens_transferable_by_admin": true,
  "tokens_transferable_by_user": true,
  "transfer_cooldown_time": 1,
  "type": "erc721"
}
{
  "address": "text",
  "app_id": 1,
  "auto_sponsor": true,
  "base_uri": "text",
  "block_reason": 1,
  "chain_id": 1,
  "chain_type": 1,
  "created_at": "text",
  "deleted_at": {
    "time": "text",
    "valid": true
  },
  "error": "text",
  "hash": "text",
  "id": 1,
  "name": "text",
  "owner_address": "text",
  "royalties_address": "text",
  "royalties_bps": 1,
  "status": 1,
  "symbol": "text",
  "tokens_transferable_by_admin": true,
  "tokens_transferable_by_user": true,
  "transfer_cooldown_time": 1,
  "tx_id": 1,
  "type": 1,
  "updated_at": "text"
}

Update administrator of contract

put

Update administrator of contract, only work on conflux chain

Path parameters
addressstringRequired

contract address

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Body
admin_addressstringRequired

Chain string form:"chain" json:"chain" binding:"required,oneof=conflux conflux_test" ContractAddress string form:"contract_address" json:"contract_address" binding:"required"

Responses
200
Transaction id
application/json
400
Invalid request
application/json
500
Internal Server error
application/json
599
Businesss error
application/json
put
PUT /v1/contracts/{address}/admin HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 24

{
  "admin_address": "text"
}
{
  "tx_id": 1
}

Add contract sponsored whitelist

post

Add contract sponsored whitelist, only work on conflux chain

Path parameters
addressstringRequired

contract address

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Body
string[]Optional
Responses
200
Transaction id
application/json
400
Invalid request
application/json
500
Internal Server error
application/json
599
Businesss error
application/json
post
POST /v1/contracts/{address}/sponsor/whitelist HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 8

[
  "text"
]
{
  "tx_id": 1
}

Remove contract sponsored whitelist

delete

Remove contract sponsored whitelist, only work on conflux chain

Path parameters
addressstringRequired

contract address

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Body
string[]Optional
Responses
200
Transaction id
application/json
400
Invalid request
application/json
500
Internal Server error
application/json
599
Businesss error
application/json
delete
DELETE /v1/contracts/{address}/sponsor/whitelist HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 8

[
  "text"
]
{
  "tx_id": 1
}