EternalToken API
atom-solutions edited this page May 7, 2018
·
4 revisions
Api's server address: http://api.atom-solutions.net/, method GET.
Request
/getTokenInfo/
Response
{
address: # token address,
totalSupply: # total token supply,
name: # token name,
symbol: # token symbol,
decimals: # number of significant digits,
price: { # token price (false, if not available)
rate: # current rate
currency: # token price currency (USD)
diff: # 24 hour rate difference (in percent)
ts: # last rate update timestamp
},
owner: # token owner address,
countOps: # total count of token operations
totalIn: # total amount of incoming tokens
totalOut: # total amount of outgoing tokens
holdersCount: # total numnber of token holders
issuancesCount: # total count of token issuances
}
Examples
Request:
/getTokenInfo/
Response:
{
address: "0x054c64741dbafdc19784505494029823d89c3b13",
totalSupply: "20000000000000000",
name: "ETERNAL TOKEN",
symbol: "XET",
decimals: "8",
price: {
rate: # price,
currency: # currency symbol,
diff: # difference,
ts: # timestamp
},
owner: # owner,
countOps: # countOps
totalIn: # totalIn
totalOut: # totalOut
holdersCount: # holdersCount
issuancesCount: # issuancesCount
}
Request
/getAddressInfo/{address}
Response
{
address: # address,
ETH: { # ETH specific information
balance: # ETH balance
totalIn: # Total incoming ETH value
totalOut: # Total outgoing ETH value
},
contractInfo: { # exists if specified address is a contract
creatorAddress: # contract creator address,
transactionHash: # contract creation transaction hash,
timestamp: # contract creation timestamp
},
tokenInfo: # exists if specified address is a token contract address (same format as token info),
tokens: [ # exists if specified address has any token balances
{
tokenInfo: # token data (same format as token info),
balance: # token balance (as is, not reduced to a floating point value),
totalIn: # total incoming token value
totalOut: # total outgoing token value
},
...
],
countTxs: # Total count of incoming and outcoming transactions (including creation one),
}
Examples
Request:
/getAddressInfo/0x5eca044b580a86e7ab4b2076330978d6d125a270
Request
/getTxInfo/{transaction hash}
Response
{
hash: # transaction hash,
timestamp: # transaction block time,
blockNumber: # transaction block number,
confirmations: # number of confirmations,
success: # true if there were no errors during tx execution
from: # source address,
to: # destination address,
value: # ETH send value,
input: # transaction input data (hex),
gasLimit: # gas limit set to this transaction,
gasUsed: # gas used for this transaction,
logs: [ # event logs
{
address: # log record address
topics: # log record topics
data: # log record data
},
...
],
operations: [ # token operations list for this transaction
{
# Same format as /getTokenHistory
},
...
]
}
Examples
Request:
/getTxInfo/0xd332f74d7d7023c0487edbf884095f7d21cf5be416fa4917f64eadcc4418e3b0
Request
/getTokenHistory
Response
{
operations: [
{
timestamp: # operation timestamp
transactionHash: # transaction hash
tokenInfo: # token data (same format as token info),
type: # operation type (transfer, approve, issuance, mint, burn, etc),
address: # operation target address (if one),
from: # source address (if two addresses involved),
to: # destination address (if two addresses involved),
value: # operation value (as is, not reduced to a floating point value),
},
...
]
}
Examples
Request
/getAddressHistory/{address}
Response
{
operations: [
{
timestamp: # operation timestamp
transactionHash: # transaction hash
tokenInfo: # token data (same format as token info),
type: # operation type (transfer, approve, issuance, mint, burn, etc),
address: # operation target address (if one),
from: # source address (if two addresses involved),
to: # destination address (if two addresses involved),
value: # operation value (as is, not reduced to a floating point value),
},
...
]
}
Examples
Show last MKR token transfers for address 0x5eca044b580a86e7ab4b2076330978d6d125a270:
/getAddressHistory/0x5eca044b580a86e7ab4b2076330978d6d125a270
Returns list of address transactions.
Request
/getAddressTransactions/{address}
Response
[
{
timestamp: # operation timestamp
from: # source address (if two addresses involved),
to: # destination address (if two addresses involved),
hash: # transaction hash
value: # ETH value (as is, not reduced to a floating point value),
input: # input data
success: # true if transactions was completed, false if failed
},
]
Examples
/getAddressTransactions/0x5eca044b580a86e7ab4b2076330978d6d125a270
{
error: {
code: # error code (integer),
message: # error message
}
}