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

Token

Token(MRC010) Create, update, mint, burn

PreviousBlock and transactionNextMRC400(NFT)

Last updated 1 year 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

Get information of MRC010 DEX

get
Path parameters
mrc010dexidstringRequired

MRC010 DEX ID

Responses
200
successful operation
*/*
404
MRC010 DEX not found
get
GET /token/dex/{mrc010dexid} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*
{
  "dexid": "text",
  "mrc010": "text",
  "seller": "text",
  "buyer": "text",
  "amount": "text",
  "remain_amount": "text",
  "min_trade_unit": "text",
  "platform_name": "Mefi",
  "platform_url": "https://mefi.io",
  "platform_commission": 5.75,
  "platform_address": "text",
  "regdate": 1,
  "sell_date": 1,
  "cancel_date": 1,
  "sell_price": "text",
  "selll_token": "text",
  "buy_price": "text",
  "buy_token": "text",
  "buy_price_total": "text"
}

Sell MR010(Token)

post
  • If other users purchase tokens, they will receive the specified amount of sales.
  • If 'platform_commission' is 10, the seller receives only 90% of the commission excluding the 10% commission.
  • If the value of platform_commission is 0, no commission is paid.
  • You can sell Metacoin or MRC010 token as Metacoin or MRC010 token.
  • Tokens or coins being sold are traded in a decentralized manner.
  • This is the true meaning of DEX.
  • You can designate a platform that takes a certain percentage of the transaction price when trading.
  • The transaction amount is the minimum amount per transaction unit.
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
*/*
400
metacoin node response error
*/*
412
operation error
*/*
post
POST /token/sell/{mrc010id} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*
{
  "mrc010dexid": "text",
  "txid": "text"
}

MRC010 Token Sale Cancellation

post
Path parameters
mrc010dexidstring · MRC010 DEX IDRequired

MRC010 DEX ID

Query parameters
amountstring · integerRequired

buy amount

tkeystringRequired

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

signaturestring · base64Required
  • ECDSA sign for concat seller, itemdata, tkey
  • ex) ecdsa_sign(privatekey of mrc010dexid creator address, mrc010dexid +'|'+ tkey)
Responses
200
successful operation
*/*
400
metacoin node response error
*/*
412
operation error
*/*
post
POST /token/buy/{mrc010dexid} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*
{
  "txid": "text"
}

MRC010 Token Sale Cancellation

post
Path parameters
mrc010dexidstring · MRC010 DEX IDRequired

MRC010 DEX ID

Query parameters
tkeystringRequired

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

signaturestring · base64Required
  • ECDSA sign for concat seller, itemdata, tkey
  • ex) ecdsa_sign(privatekey of mrc010dexid creator address, mrc010dexid +'|'+ tkey)
Responses
200
successful operation
*/*
400
metacoin node response error
*/*
412
operation error
*/*
post
POST /token/unsell/{mrc010dexid} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*
{
  "txid": "text"
}

Request sell MR010(Token)

post
  • Register DEX to purchase token ID mrc010 by paying the price per min_trade_unit for token ID token.
  • If 'platform_commission' is 10, you must pay an additional 10% of the purchase amount, and 10% of the transaction amount is sent to the platform_address when making a transaction.
  • If the 'platform_commission' value is 0, no commission is paid.
  • You can sell Metacoin or MRC010 tokens as Metacoin or MRC010 tokens.
  • The tokens or coins sold are traded in a decentralized way.
Path parameters
mrc010idstring · integerRequired
  • ID of the token you want to buy
Query parameters
addressstring · Metacoin AdderessRequired
  • The seller's metacoin address
amountstring · integerRequired
  • Quantity of tokens to be buy
min_trade_unitstring · enumOptional
  • Minimum purchase quantity
  • When accepting this purchase requisition, the 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 to the seller

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
*/*
400
metacoin node response error
*/*
412
operation error
*/*
post
POST /token/reqsell/{mrc010id} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*
{
  "mrc010dexid": "text",
  "txid": "text"
}

Accepting a sales request

post
Path parameters
mrc010dexidstring · MRC010 DEX IDRequired

MRC010 DEX ID

Query parameters
amountstring · integerRequired

buy amount

tkeystringRequired

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

signaturestring · base64Required
  • ECDSA sign for concat seller, itemdata, tkey
  • ex) ecdsa_sign(privatekey of mrc010dexid creator address, mrc010dexid +'|'+ tkey)
Responses
200
successful operation
*/*
400
metacoin node response error
*/*
412
operation error
*/*
post
POST /token/acceptreqsell/{mrc010dexid} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*
{
  "txid": "text"
}

Cancel Sales Requisition

post
Path parameters
mrc010dexidstring · MRC010 DEX IDRequired

MRC010 DEX ID

Query parameters
tkeystringRequired

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

signaturestring · base64Required
  • ECDSA sign for concat seller, itemdata, tkey
  • ex) ecdsa_sign(privatekey of mrc010dexid creator address, mrc010dexid +'|'+ tkey)
Responses
200
successful operation
*/*
400
metacoin node response error
*/*
412
operation error
*/*
post
POST /token/unreqsell/{mrc010dexid} HTTP/1.1
Host: rest.metacoin.network:20923
Accept: */*
{
  "txid": "text"
}
  • GETGet Token info
  • POSTToken save
  • POSTToken create
  • PUTToken descriments
  • PUTToken increments
  • PUTToken information update
  • GETGet information of MRC010 DEX
  • POSTSell MR010(Token)
  • POSTMRC010 Token Sale Cancellation
  • POSTMRC010 Token Sale Cancellation
  • POSTRequest sell MR010(Token)
  • POSTAccepting a sales request
  • POSTCancel Sales Requisition