Giter Club home page Giter Club logo

blockatlas's People

Contributors

arein avatar artemgoryunov avatar coolcottontail avatar criesofcarrots avatar cryptokat avatar dependabot-preview[bot] avatar dpereskokov avatar dustinxie avatar eddywm avatar emmanuelm41 avatar enorage avatar fionera avatar hewigovens avatar jeyldii avatar kolya182 avatar krboktv avatar lorenzozanotto avatar madcake avatar maxuo avatar miiu96 avatar optout21 avatar pantani avatar prazd avatar ququzone avatar riptl avatar tolsi avatar vcoolish avatar vikmeup avatar vmtrue avatar yun-yeo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blockatlas's Issues

Cannot unmarshal

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"

Return consistent result for the transactions

/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

Return transactions list in the wrapper

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

Set GitHub description and tags

The repository description is empty right now, and I don't have permissions to modify it.

image

How about Clean and lightweight cross-chain transaction API. Backend of TrustWallet.?

Tags: crypto, blockchain, api, binance, trustwallet

Lint

Run project through lint

Response Standards

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:

  • Update README file with finalized requirements
  • Implement requirements for each endpoint

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.",
  }
}

Docker Hub image

  • Dockerfile
  • trustwallet/blockatlas
  • Continuous Deployment
  • Gravatar image for TrustWallet Docker organization

[Ripple] returned wrong value

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

Add go-import page

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>

Transactions format

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
}

Platform Unit Tests

  • Add unit tests per platform
  • Cover each possible transaction type
  • Check if data was deserialized correctly from RPC/API
  • assert(parse(api_response) == expected_model)

Why?

Integration Tests only test connections and the actual requests, but don't verify the response content

Progress

  • Binance DEX
  • Nimiq
  • Ripple
  • Stellar
  • Tezos
  • Ethereum
  • Aion

Request Standards to BlockAtlas

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:

  • Make appropriate changes to the code
  • Update README file with finalized requirements

Each HTTP request to BlockAtlas (BA) and response from BA must contain next headers
Accept: application/json
Accept-Encoding: gzip

Binance Integration Test: No transactions

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

Wrong fee on nimiq network

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

Add DEX support

  • Add support for Binance
  • Add support for Stellar
  • Add support for WAVES

Related #21

GoDoc

Document entire project with GoDoc

Tron support

/tron

@kolya182 can you provide endpoints from the official docs? and trongrid endpoint? it's ok if it's not working yet

Azure Pipelines CI

Pipeline stages

  • Compile project
  • Run Unit tests
  • Start server with default config
  • Run integration test (go run test/main.go) on temp server

Ethereum Fee

Ethereum shows wrong gas value
Correct: Fee = gasUsed * gasPrice

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.