trustwallet / blockatlas Goto Github PK
View Code? Open in Web Editor NEWClean and lightweight cross-chain transaction API
License: MIT License
Clean and lightweight cross-chain transaction API
License: MIT License
level=error msg="Tron: Failed to decode API response" error="json: cannot unmarshal object into Go struct field Page.error of type string"
2019-04-22T09:41:03.031492+00:00 app[web.1]: time="2019-04-22T09:41:03Z" level=error msg="Tron: Failed to get transactions for TKLnCNY5EsLNCvCXQTCn1dtqvc6vHhJUyJ" error="connection to servers failed"
/v1/ethereum/0x89e0cdf0a548ecb432d00a22dfd188f45641478d?contract=0x4b4787aace23eb70da046bcc0ccfe28d4e4fb899
/v1/ethereum/0x89e0cdf0a548ecb432d00a22dfd188f45641478d
@terorie I think it would be better to return a consistent result for the transactions endpoint. Ignore previous discussion to have different format if contract
or token
is passed
Check coin
field in integration tests
http://blockatlas-trust.herokuapp.com/v1/tezos/tz1WDujRWCYjLBDfZieXW6insg5EUbg1rCRK
metadata: {
value: ""
}
value is empty
@kolya182 can you provide details for the indexer endpoint
Instead of returning transactions as list, can we do, in which docs
will contain transactions list and this should be used across blockatlas.
{
"docs": [{
}],
"status": true
}
in this case we can extend to support pagination and error handling easier
/tron
, /icon
, cosmos
, theta
, vechain
make empty response until implemented:
{
total: 0,
docs: [ ],
status: "success"
}
Placeholder for 1.0 release and code/API review
Documentation on how to deploy in README
Run project through lint
Test that runs the app and calls every platform endpoint
This PR intend to establish minimum requirements to HTTP response
. Please feel free to add a comment or suggestion. Once we finalize requirements requirements two PR must be made:
Endpoint Response Payload Format
All endpoints return data
in JSON format with the results of your query under data if the call is successful. Type of data
can be array or hash-map, thses two only used in current implementation. If we will have endpoint returning single bit of information we need to consider type for data
as number(integer)
or string
, example: {"data": "Coin status is active"}, price for some token {"data": 135.4}
A Status
object is always included for both successful calls and failures when possible.
Any details about errors encountered can be found under the error_message
and response code status under response_code
.
200 Successful
{
"total": Number,
"data": [] || {},
"status": {
"response_code": 200,
"error_message": "",
}
}
400 Bad Request
{
"status": {
"response_code": 400,
"error_message": "The server could not process the request, likely due to an invalid argument.",
}
}
401 Unauthorized
{
"status": {
"response_code": 401,
"error_message": "Your API Key was not supplied or is invalid",
}
}
429 Too Many Requests
{
"status": {
"response_code": 429,
"error_message": "You have exceeded your API rate limit, please provide API key to keep going",
}
}
500 Internal Server Error
{
"status": {
"response_code": 500,
"error_message": "An unexpected server issue was encountered.",
}
}
trustwallet/blockatlas
Create list of blockchains with config options + how to enable them
http://blockatlas.trustwalletapp.com/v1/ripple/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh
{
id: "E89CFA4C75F02A456880CC98BCF8762E69AB285452A27B8F143EEF70E73D9626",
coin: 144,
from: "rP9GDNw8je4xez1vsmVtrYohHGscfMCT3P",
to: "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh",
fee: "7646000000",
date: 1509614141,
type: "transfer",
block: 33933674,
metadata: {
value: "100000000000000"
}
}
https://xrpscan.com/tx/E89CFA4C75F02A456880CC98BCF8762E69AB285452A27B8F143EEF70E73D9626
I beelive value and fee contains extra zeros
/v1/binance/tbnb1xwalxpaes9r0z0fqdy70j3kz6aayetegjkcrgw?contract=NC1-279
Transfer asset example: https://testnet-explorer.binance.org/tx/39278E2E87D24932796A14D8CBD9C0C82A6391B8380911A813059DA8075FD07A
Implement generic ERC-20 swap and transfer support
let's call it sequence: Int64
asset
property from BasicTxOnly newest tx are important
coin: 60
- ethereum example
@vikmeup Can you provide a test address for ThunderCore?
Related: #14 (Generic DEX model)
Describe trades on the Binance DEX chain
I'm using the custom import path trustwallet.com/blockatlas
.
Please deploy the following HTML page so that go get
works.
It will tell Go where to find the documentation and source code.
Regular browsers will get redirected to GitHub when visiting.
URLs:
https://trustwallet.com/blockatlas?go-get=1
https://trustwallet.com/blockatlas
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="go-import" content="trustwallet.com/blockatlas git https://github.com/trustwallet/blockatlas">
<meta name="go-source" content="trustwallet.com/blockatlas https://github.com/trustwallet/blockatlas https://github.com/trustwallet/blockatlas/tree/master{/dir} https://github.com/trustwallet/blockatlas/blob/master{/dir}/{file}#L{line}">
<meta http-equiv="refresh" content="0; url=https://github.com/trustwallet/blockatlas">
</head>
<body>
Checkout the <a href="https://github.com/trustwallet/blockatlas">GitHub repo</a>!
</body>
Base
{
"id": "12345678"
"from": "123",
"to": "123",
"fee": "1234"
"coin": 60,
"block": 1
}
Transfer:
{
"type": "transfer",
"metadata: [
"name": "Viktor Coin",
"symbol": "VIK",
"decimals": 18,
"value": "12312312"
]
}
Token Transfer
{
"type": "token_transfer",
"metadata: [
"name": "Viktor Coin",
"symbol": "VIK",
"token_id" : "0x123",
"decimals": 18,
"value": "12312312",
"from": "123",
"to": "123",
]
}
Token Transfer
{
"type": "contract_token_transfer",
"metadata: [
"token": {
"type": "token_transfer",
"metadata: [
"name": "Viktor Coin",
"symbol": "VIK",
"token_id" : "0x123",
"decimals": 18,
"value": "12312312",
"from": "123",
"to": "123",
]
},
"coin": {
"type": "contract_call",
"metadata": []
}
]
}
Tron Token Transfer
{
"type": "token_transfer",
"metadata: [
"name": "Bittorent",
"symbol": "BTT",
"token_id" : "1002000",
"decimals": 8,
"value": "12312312"
]
}
Collectible Transfer
{
"type": "collectible_transfer",
"metadata: [
"name": "Viktor Kittie",
"contract" : "0x123",
"image_url": "https://google.com/img.png"
]
}
Token Swap
{
"type": "token_swap"
"metadata: [
"input" : [
"token_id": "0x123" - this property is optional
"symbol": "BNB",
"value": "123",
"decimals": 8
],
"output": [
"token_id": "0x123" - this property is optional
"symbol": "BTT",
"value": "123",
"decimals": 8
]
]
}
Contract Call
{
"type": "contract_call",
"metadata": [
]
}
Any Action
{
"type": "any_action",
"metadata": [
"coin": 60,
"title": "Place Order",
"key": "place_order",
"token_id": "0x123" - this property is optional
"name": "Viktor Coin",
"symbol": "VIK",
"decimals": 18,
"value": "12312312"
]
}
Keys
place_order
- Placer Order
cancel_order
- Cancel order
issue_token
- Issue Token
burn_token
- Burn Token
mint_token
- Mint Token
will continue... Keys mostly used to provide localized version on the clients by key
types: transfer
, token_transfer
, collectible_transfer
, token_swap
, contract_call
and many more
Status
enum Status {
completed
pending
errror
}
assert(parse(api_response) == expected_model)
Why?
Integration Tests only test connections and the actual requests, but don't verify the response content
Progress
This PR intend to establish minimum requirements to HTTP request. Please feel free to add a comment or suggestion. Once we finalize requirements requirements two PR must be made:
Each HTTP request to BlockAtlas (BA) and response from BA must contain next headers
Accept: application/json
Accept-Encoding: gzip
time="2019-03-23T13:03:13+01:00" level=info msg="Testing endpoint" @platform=binance
time="2019-03-23T13:03:14+01:00" level=warning msg="No transactions" @platform=binance
time="2019-03-23T13:03:14+01:00" level=info msg="Endpoint works" @platform=binance
time="2019-03-23T13:03:14+01:00" level=info msg="Endpoint tested" @platform=binance fields.time=592.104107ms
v1/nimiq/NQ86%202H8F%20YGU5%20RM77%20QSN9%20LYLH%20C56A%20CYYR%200MLA
id: "e1a911583a1678a2338922efadbdf6710136f0c558f9f2d4a8b1e87aa05c05db",
coin: 242,
from: "NQ95 QLQF E5T9 0VR8 GGAQ D1TK 4CG1 C77K NVR2",
to: "NQ86 2H8F YGU5 RM77 QSN9 LYLH C56A CYYR 0MLA",
fee: "0",
date: 1554573613,
type: "transfer",
block: 512316,
status: "completed",
sequence: 0,
metadata: {
value: "4284350514"
}
fee
should not be zero
Related #21
Document entire project with GoDoc
Placeholder issue for the future
/tron
@kolya182 can you provide endpoints from the official docs? and trongrid endpoint? it's ok if it's not working yet
Pipeline stages
go run test/main.go
) on temp serverEthereum shows wrong gas value
Correct: Fee = gasUsed
* gasPrice
status: "completed"
by defaultplatform/x/source
packagesTx
vs Transaction
)A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.