Contract
The contract API provide users the entries to interact with the ERC721 contracts, including deploying the contracts, setting the sponsors and so on.
Contract Actions
Deploy Contract
The Deploy contract
API helps users to deploy a ERC721 or a ERC1155 contract.
Deploy a ERC721 or ERC1155 contract. Deploy a ERC721 or ERC1155 contract.
Bearer Open_JWT
default: true
default: true
default: true
default: true
default: 0
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"
}
Authorization
Bearer Token
Header
string
Update contract admin
The Update contract admin
API provides users the entry to update the admin of the specific contract.
Update administrator of contract, only work on conflux chain
contract address
Bearer Open_JWT
Chain string form:"chain" json:"chain" binding:"required,oneof=conflux conflux_test"
ContractAddress string form:"contract_address" json:"contract_address" binding:"required"
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
}
Authorization
Bearer Token
Header
string
Set Sponsor
The Set sponsor
API provides users to set a sponser for a specific contract according to the sponsor' address.
Set the sponsor for a contract according to the address with specified value(gas-1, storage-50)
Contract address
chain
Open auto sponsor or not, for mainnet contract keep user account have enough balance
Bearer Open_JWT
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
}
Authorization
Bearer Token
Header
string
Add Contract Sponsor Users
The Add Contract Sponsor Users
API provides users to add the address in the whitelist.
Add contract sponsored whitelist, only work on conflux chain
contract address
Bearer Open_JWT
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
}
Authorization
Bearer Token
Header
string
Remove Contract Sponsor Users
The Remove Contract Sponsor Users
API provides users to remove the address from the whitelist.
Remove contract sponsored whitelist, only work on conflux chain
contract address
Bearer Open_JWT
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
}
Authorization
Bearer Token
Header
string
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.
Get the contract list containing the contracts deployed through the specified app.
page
limit
Bearer Open_JWT
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"
}
]
}
Authorization
Bearer Token
Header
string
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.
Get Contract info
id
Bearer Open_JWT
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"
}
Authorization
Bearer Token
Header
string
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.
Get the sponsor of the specified contract according to address.
address
chain
Bearer Open_JWT
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
}
Authorization
Bearer Token
Header
string
Query contract admin
The Query contract admin
API provides users the entry to get the admin of the specific contract.
Get Contract Admin
contract address
Bearer Open_JWT
GET /v1/contracts/{address}/admin HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
text
Authorization
Bearer Token
Header
string
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.
Get contract sponsored whitelist, only work on conflux chain
contract address
Bearer Open_JWT
GET /v1/contracts/{address}/sponsor/whitelist HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
[
"text"
]
Authorization
Bearer Token
Header
string
Last updated