fluidex / rollup-state-manager

5 stars 6 forks source link

refactor `TokenBalanceQuery` API #150

Closed 0xmountaintop closed 2 years ago

0xmountaintop commented 3 years ago

TokenBalanceQuery requires token_id currently. But we may not provide token_id

doc: proto/third_party/googleapis/google/api/http.proto

0xmountaintop commented 3 years ago
  rpc TokenBalanceQuery(TokenBalanceQueryRequest)
      returns (TokenBalanceQueryResponse) {
    option (google.api.http) = {
      get : "/api/explorer/token_balance/{account_id}"
    };
  }

Method: GET

if having token_id, query by token_id, otherwise if having token_address, query by token_address, // unimplemented()! otherwise if having token_name, query by token_name,

0xmountaintop commented 3 years ago

also add a rest_get_token_balance.ts test