Metacoin API
MetacoinMetaWallet Deeplink APIMetascanRedscan
Metacoin API(version 2.1)
Metacoin API(version 2.1)
  • Metacoin API
  • Quick Start
  • Reference
    • REST API Reference
      • Address
      • Block and transaction
      • Token
      • MRC400(NFT)
      • MRC402(NFT)
Powered by GitBook
On this page
  1. Reference
  2. REST API Reference

Token

Token(MRC010) Create, update, mint, burn

PreviousBlock and transactionNextMRC400(NFT)

Last updated 2 years ago

Get Token info

get
Path parameters
tokenstring · int32Required

Token ID

Responses
200
successful operation
*/*
404
Token not found
get
GET /token/{token} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*
{
  "owner": "text",
  "symbol": "text",
  "createdate": 1,
  "totalsupply": "text",
  "reservedamount": "text",
  "remainamount": "text",
  "token": 1,
  "name": "text",
  "category": "text",
  "status": "text",
  "decimal": 1,
  "tier": [
    {
      "startdate": 1,
      "enddate": 1,
      "supply": "text",
      "rate": 1,
      "name": "text",
      "investormin": "text",
      "remainamount": "text"
    }
  ],
  "url": "text",
  "circulation_supply": "text"
}

Token save

post
Query parameters
ownerstring · Metacoin addressRequired

Token Creator

symbolstring · integerRequired

Token Symbol

totalsupplystring · decimalOptional

Total amount

imagestring · The "data" URL scheme(https://tools.ietf.org/html/rfc2397)Optional
  • Token image
  • Metacoin Network does not change / modify the attached IMAGE
  • If the attached image contains political, religious, or racial discrimination, or if it clearly violates international law or the laws of Hong Kong to which INBLOCK belongs, the coin may not be displayed on the Metacoin network
Example: data:image/jpeg;base64,/9j/4AAQSkZJRgABAAEAlgCWAAD//gAfTEVBR ...
reservedamountstring · decimalOptional

Reserve token amount for owner

remainamountstring · decimalOptional

Remain amount - ignore for token create.

namestringRequired

Token name

categorystringOptional

Token Category

decimalintegerOptional

Token status

urlstringOptional

Token Creator URL

TemporarykeystringRequired

Temporary key for signing - using only transfer, not recording

signaturestring · base64Required
  • ECDSA sign for data.
  • ex) ecdsa_sign(privatekey of owner address, owner +'|'+ symbol +'|'+ token +'|'+name+'|'+url +'|'+Temporarykey)
Responses
200
successful operation
*/*
Responsestring
412
token save error
post
POST /token HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*
text

Token create

post
Path parameters
tkeystringRequired

Temporary key for Sign(return value of GET /getkey/token/owner)

Query parameters
signaturestring · base64Required
  • ECDSA sign for concat token.owner, token.name, tkey
  • ex) ecdsa_sign(token owner's privatekey, token.owner + '|' + token.name + '|' + tkey)
Responses
200
successful create token.
400
token create error.
post
POST /token/{tkey} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*

No content

Token descriments

put

Decrements tokens by quantity

The amount burned will be deducted from the token owner's wallet.

Path parameters
tkeystring · int32Required

Temporary key for Sign(return value of GET /getkey/token/{tokwn owner})

Query parameters
tokenstring · integerRequired

Token ID

amountstring · integerRequired

Token burning amount

signaturestring · base64Required
  • ECDSA sign for concat Address of Token owner, token, tkey
  • ex) ecdsa_sign(token owner's privatekey, Token ID + '|' + amount + '|' + tkey)
Responses
200
successful operation
404
Token not found
put
PUT /token/burn/{tkey} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*

No content

Token increments

put

Increments tokens by quantity

The increased amount is added to the token owner's wallet.

Path parameters
tkeystring · int32Required

Temporary key for Sign(return value of GET /getkey/token/{tokwn owner})

Query parameters
tokenstring · integerRequired

Token ID

amountstring · integerRequired

Token increased amount

signaturestring · base64Required
  • ECDSA sign for concat Address of Token owner, token, tkey
  • ex) ecdsa_sign(token owner's privatekey, Token ID + '|' + amount + '|' + tkey)
Responses
200
successful operation
404
Token not found
put
PUT /token/increase/{tkey} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*

No content

Token information update

put
Path parameters
tkeystringRequired

Temporary key for Sign(return value of GET /getkey/token/{tokwn owner})

Query parameters
urlstringRequired

Token Creator URL

infostringRequired

Token Info

imagestring · https://tools.ietf.org/html/rfc2397Required

Token Image

signaturestring · base64Required
  • ECDSA sign for concat Address of Token owner, token, tkey
  • ex) ecdsa_sign(token owner's privatekey, Token ID + '|' + url + '|' + info + '|' + image + '|' + tkey)
Responses
200
successful create token.
400
token update error.
put
PUT /token/update/{tkey} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*

No content

Sell MR010(Token)

post
  • If other users purchase tokens, they will receive the specified amount of sales.
  • If platform_commission is 10, 10% of the transaction amount will be transferred to the MRC400 token holder designated in the MRC402 token, and only 90% of the fee excluding the 10% fee will be received by the MRC402 token holder.
  • If the value of platform_commission is 0, no commission is paid.
Path parameters
mrc010idstring · integerRequired
  • ID of the token you want to sell
Query parameters
addressstring · Metacoin AdderessRequired
  • The seller's metacoin address
amountstring · integerRequired
  • Quantity of tokens to be sold
min_trade_unitstring · enumOptional
  • Minimum sales quantity
  • When purchasing this dex, the purchase quantity must be a multiple of this value.
  • If not specified, it is treated as "1".
Possible values:
tokenstring · integerRequired

ID of the token to be paid for when purchasing

pricestring · integerRequired

Amount to be paid for purchase per min_trade_unit

platform_namestring · integerOptional

The name of the platform that supports this DEX transaction

Example: Mefi
platform_urlstring · urlOptional

The URL of the platform that supports this DEX transaction

Example: https://mefi.io
platform_commissionstring · float · max: 10Optional
  • Percentage of fees taken from the platform when a transaction is concluded
  • If the value of platform_address is not specified, no fee is paid.
Example: 5.75
platform_addressstring · Metacoin addressOptional
  • Metacoin address to receive commission if the value of platform_commission is greater than 0
tkeystringRequired

Temporary key for Sign(return value of GET /getkey/transfer)

signaturestringRequired
  • ECDSA sign for concat seller address, amount, mrc010id, price, token, platform_name, platform_url, platform_address, platform_commission, tkey
  • ex) ecdsa_sign(privatekey of seller address, address +'|'+ amount +'|'+ mrc010id +'|'+ price +'|'+ token +'|'+ platform_name +'|'+ platform_url +'|'+ platform_address +'|'+ platform_commission +'|'+ tkey)
Responses
200
successful operation
*/*
404
MRC400 not found
post
POST /token/sell/{mrc010id} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*
{
  "transaction_id": "text"
}
  • GETGet Token info
  • POSTToken save
  • POSTToken create
  • PUTToken descriments
  • PUTToken increments
  • PUTToken information update
  • POSTSell MR010(Token)