bitshares / bitshares-ui

Fully featured Graphical User Interface / Reference Wallet for the BitShares Blockchain
https://wallet.bitshares.org
MIT License
518 stars 570 forks source link

[2] Add raw json for operations and objects #2657

Open abitmore opened 5 years ago

abitmore commented 5 years ago

Is your feature request related to a problem? Please describe. image

In some cases it's not clear what the ops means. Pages that I thought of:

Describe the solution you'd like Add a link so the nerds can check the raw json (plain text, best formatted well), contains elements described in https://github.com/bitshares/bitshares-ui/issues/2657#issuecomment-519884223

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

startailcoon commented 5 years ago

Good idea, it shouldn't be difficult to view and verify the json transaction, which is just what the blockchain is all about.

OpenLedgerApp commented 5 years ago

@startailcoon Could you please clarify the following:

What info should be in the raw json? this object or trx object or smth else? image

How should it be displayed?like this? image

startailcoon commented 5 years ago

@OpenLedgerApp Exactly the spot. It's mainly to make it possible to view under the "Explorer -> View Block" section rather than when you make a new TX, which you probably know what it does.

The Raw TX should view the JSON object for the TX in question, just like when we don't have a pretty view for an operation. You can view how we do on that when we have no match for a "TX Translation".

I imagine it something like this, to make it visible but non intrusive. Much like your example above. It should open a modal to view the JSON object.

image

OpenLedgerApp commented 5 years ago

@startailcoon ok, thanks for clarifying. Can i claim this one?

startailcoon commented 5 years ago

@OpenLedgerApp it's already assigned to you, so feel free to work and push a PR on it.

abitmore commented 5 years ago

This issue is only about block explorer, but also other pages.

startailcoon commented 5 years ago

This issue is only about block explorer, but also other pages.

It could be included in other sections as well, I see your point. Do you have any specific pages in mind @abitmore ?

I could see for example the activity feed on the dashboard, but can't think of any other right now.

sschiessl-bcp commented 5 years ago

What abit means is: Please read the task outline in the first post :)

sschiessl-bcp commented 5 years ago

In account activity: Could make the operation id clickable, if necessary add the icon In proposed proposals: Either in the header, make the id clickable with icon next to it. Or the Icon and text on the right of the title

startailcoon commented 5 years ago

I should remember to read the whole thread :)

It did indeed specify the following pages for suggested addition.

When it was only added to one of these in PR

Ping @OpenLedgerApp

OpenLedgerApp commented 5 years ago

@startailcoon done. https://github.com/bitshares/bitshares-ui/pull/2996

abitmore commented 5 years ago

How about the "transaction confirmation page"? If I can have the json in the page, I can copy it to cli_wallet to sign and broadcast.

OK, just saw it in #3001.

BTW I hate Github's auto-close-issue feature.

sschiessl-bcp commented 5 years ago

How about the "transaction confirmation page"? If I can have the json in the page, I can copy it to cli_wallet to sign and broadcast.

OK, just saw it in #3001.

BTW I hate Github's auto-close-issue feature.

image

Essentially you would like a Copy button in there? image

E.g. a "Copy raw json" below "Show raw json", or as extra button on the bottom

abitmore commented 5 years ago

@sschiessl-bcp see comments in https://github.com/bitshares/bitshares-ui/pull/3001#issuecomment-517921338.

abitmore commented 5 years ago

@sschiessl-bcp by the way the modal in #2996 is NOT what I want. I need a JSON, not a tree.

abitmore commented 5 years ago

If you must have a tree in the module, please make a button to "expand all".

sschiessl-bcp commented 5 years ago

Let's do copyable text in https://github.com/bitshares/bitshares-ui/issues/3020. I consider this issue completed with the tree that allows inspection. Sorry if we misunderstood the intent of your request.

abitmore commented 5 years ago

It's clearly stated in OP, this issue is for adding "raw json". Unless you don't know what is a raw json.

abitmore commented 5 years ago

A well formatted JSON is much better than the appearance currently showing in UI.

sschiessl-bcp commented 5 years ago

"raw json"

For the times I used this popup the "tree json" was sufficient for me and I didn't think more about it. You want plaintext. I put a question for you in the follow up issue.

abitmore commented 5 years ago

Please redo this issue. Current implementation is not acceptable.

Last but not least, I don't think it's a good practice to auto-close issues without the issue-creators' confirmation. I'm able to reopen issues that closed by developers because I'm an admin, but other normal users can not, it's super annoying, because nobody pays attention to closed issues, if they reply in the issue their messages would easily get lost, in in that case they have to create new issues.

sschiessl-bcp commented 5 years ago

I'm able to reopen issues that closed by developers because I'm an admin, but other normal users can not, it's super annoying, because nobody pays attention to closed issues

I can agree to that when the issue creator is a known to be active.

abitmore commented 2 years ago

add a link on the transaction confirmation page to preview the transaction in JSON format

@syalon recommended that we can add a QR code for the JSON so that it can be signed and broadcast via a mobile app. @sschiessl-bcp @xiangxn what do you think? (Also see https://github.com/bitshares/bitshares-ui/issues/3020)

sschiessl-bcp commented 2 years ago

add a link on the transaction confirmation page to preview the transaction in JSON format

@syalon recommended that we can add a QR code for the JSON so that it can be signed and broadcast via a mobile app. @sschiessl-bcp @xiangxn what do you think? (Also see #3020)

Idea is to be able to click to the "confirm transaction" popup without unlocking and then be able to switch to a QR code?

abitmore commented 2 years ago

add a link on the transaction confirmation page to preview the transaction in JSON format

@syalon recommended that we can add a QR code for the JSON so that it can be signed and broadcast via a mobile app. @sschiessl-bcp @xiangxn what do you think? (Also see #3020)

Idea is to be able to click to the "confirm transaction" popup without unlocking and then be able to switch to a QR code?

I'm not sure if I got what your said. Probably the most wanted behavior is to be able to construct transactions (be able to "claim" or "act as" an account) without login in the first place at all, but this looks like a big change (see also: https://github.com/bitshares/bitshares-ui/issues/1285). The first and (I guess) easier step is to add a link/button to show a QR code (and as mentioned in #3020, a JSON string) on the existing transaction confirmation popup.

xiangxn commented 2 years ago

I'm guessing this is to create a transaction in the browser and sign it with the app and broadcast it. Simple transfer transactions are feasible with QR codes, but some transaction data is very large and may not be suitable for QR codes.

abitmore commented 2 years ago

I'm guessing this is to create a transaction in the browser and sign it with the app and broadcast it. Simple transfer transactions are feasible with QR codes, but some transaction data is very large and may not be suitable for QR codes.

Yes it is a valid argument. I think a simple solution is to show an error if the data is too big to fit in a QR code.

Input mode Max. characters Bits/char. Possible characters, default encoding
Numeric only 7,089 31⁄3 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Alphanumeric 4,296 51⁄2 0–9, A–Z (upper-case only), space, $, %, *, +, -, ., /, :
Binary/byte 2,953 8 ISO 8859-1
Kanji/kana 1,817 13 Shift JIS X 0208

References:

In addition, I think we need to encode the data in UTF-8? E.G. an asset_create_operation or an asset_update_operation. In this case, the maximum supported length is probably even smaller.

xiangxn commented 2 years ago

If it can't support all transactions, then this feature is not very meaningful.

abitmore commented 2 years ago

Most of common transactions can be done with this, so I think it is worth doing.

xiangxn commented 2 years ago

So, is the QR code for the entire transaction required here, or just the OP's QR code?

abitmore commented 2 years ago

So, is the QR code for the entire transaction required here, or just the OP's QR code?

The transaction.