planetarium / libplanet-explorer-frontend

Libplanet Explorer Frontend
https://explorer.libplanet.io/
MIT License
16 stars 27 forks source link

Account page #9

Closed dahlia closed 4 years ago

dahlia commented 5 years ago

A page that lists transactions related to an account.

MaxStalker commented 4 years ago

I can help you with this one If you have some outline how you want this to work :) I guess, we can do something simillar to Etherscan, when you have a list of transactions in the block, then you click on a transaction, which will have details "from" or "to", which can be then used to display all related transactions on separate route.

MaxStalker commented 4 years ago

Also, if possible, can you "create" several transactions, cause atm all blocks are empty :\

limebell commented 4 years ago

We are expecting to inspect these things in account page:

It will be great if account page has table UI like main page, but if it is picky, just listing texts such as block page will do the work :)

limebell commented 4 years ago

@MaxStalker We uploaded new explorer which is not online mode (you cannot test your amazing PR #43 :( ) but contains numerous transactions :)

MaxStalker commented 4 years ago

I'm using the following query to fetch transactions specific to certain account:

query TransactionsByAccount($involvedAddress: Address) {
  transactions(involvedAddress: $involvedAddress) {
    ...TransactionCommon
  }
}

When I try to fetch it with generated Apollo component it returns an error:

extensions: {code: "INVALID_CAST"}
code: "INVALID_CAST"
message: "Unable to cast object of type 'System.String' to type 'System.Nullable`1[Libplanet.Address]'."

Works in Insomnia without any problems: image

Any hints how to fix that?

MaxStalker commented 4 years ago

Can someone check and tell me if it's something wrong on front-end or API side? :)

longfin commented 4 years ago

Can someone check and tell me if it's something wrong on front-end or API side? :)

@MaxStalker I've found related bug. I'll fix and update the backend API server in a minute.

longfin commented 4 years ago

@MaxStalker I updated the backend API as a fixed version. please check as below.

curl 'http://52.231.74.24:31235/graphql/' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: http://52.231.74.24:31235' --data-binary '{"query":"query TransactionsByAccount($account: Address) {\n  transactions(involvedAddress: $account) {\n    id\n  }\n}","variables":{"account":"6510f821819937d70f6f8930BAC1BF7b39331aB1"}}' --compressed
MaxStalker commented 4 years ago

Thanks @longfin! Works like a charm :)

MaxStalker commented 4 years ago
  • Transactions that corresponding address created. (stored in Transaction<T>.Signer)
  • Transactions that corresponding address related. (stored in Transaction<T>.UpdatedAddress)

Is there a way to query those separetly? 🤔 I suppose it's not a problem at this very moment, but when user will have hundreds of transactions it can slow down the page considerably. Would be cool to get pagination from the start, I suppose :)

MaxStalker commented 4 years ago

@longfin this one should be closed, right?

longfin commented 4 years ago

@longfin this one should be closed, right?

Yes, thanks for reminding me.