bitshares-ui icon indicating copy to clipboard operation
bitshares-ui copied to clipboard

[2] Add raw json for operations and objects

Open abitmore opened this issue 6 years ago • 31 comments

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:

  • [ ] block explorer
  • [ ] account activities
  • [ ] proposed proposals
  • [ ] transaction confirmation page

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.

abitmore avatar May 04 '19 11:05 abitmore

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

  • "Click to view Raw TX" type of text
  • Should view the raw json in a new modal window.
  • On all TX and Blockchain OPs viewed in app

startailcoon avatar May 06 '19 18:05 startailcoon

@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

OpenLedgerApp avatar May 29 '19 12:05 OpenLedgerApp

@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

startailcoon avatar May 31 '19 06:05 startailcoon

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

OpenLedgerApp avatar May 31 '19 12:05 OpenLedgerApp

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

startailcoon avatar Jun 03 '19 04:06 startailcoon

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

abitmore avatar Jul 28 '19 07:07 abitmore

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.

startailcoon avatar Jul 29 '19 20:07 startailcoon

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

sschiessl-bcp avatar Jul 29 '19 20:07 sschiessl-bcp

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

sschiessl-bcp avatar Jul 29 '19 20:07 sschiessl-bcp

I should remember to read the whole thread :)

It did indeed specify the following pages for suggested addition.

  • [x] block explorer
  • [ ] account activities
  • [ ] proposed proposals
  • [x] transaction confirmation page

When it was only added to one of these in PR

Ping @OpenLedgerApp

startailcoon avatar Jul 29 '19 20:07 startailcoon

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

OpenLedgerApp avatar Jul 30 '19 13:07 OpenLedgerApp

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.

abitmore avatar Jul 31 '19 18:07 abitmore

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

sschiessl-bcp avatar Aug 09 '19 08:08 sschiessl-bcp

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

abitmore avatar Aug 09 '19 10:08 abitmore

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

abitmore avatar Aug 09 '19 10:08 abitmore

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

abitmore avatar Aug 09 '19 10:08 abitmore

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.

sschiessl-bcp avatar Aug 09 '19 10:08 sschiessl-bcp

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

abitmore avatar Aug 09 '19 11:08 abitmore

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

abitmore avatar Aug 09 '19 11:08 abitmore

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

sschiessl-bcp avatar Aug 09 '19 11:08 sschiessl-bcp

Please redo this issue. Current implementation is not acceptable.

  • the tree in account activities doesn't include important data
    • [ ] id of the history
    • [ ] block_num
    • [ ] trx_in_block
    • [ ] op_in_trx
    • [ ] virtual_op
  • the trees in block explorer, I just don't want to use it.
    • [ ] I need a raw json of the whole block
    • btw, the "?" icon added near the fee in that page just doesn't make sense
  • proposed transactions
    • [ ] I need the json about the proposal, but not one of the operations in the proposal
      • [ ] id of the proposal
      • [ ] proposer
      • [ ] required approvals
      • [ ] added approvals
      • [ ] when will it expire
      • [ ] review period
  • confirmation page, I guess you've got what I want, see #3020. But I still think it's better to redo it in this issue. Let that issue be for beet only, which is more complicated, and could take forever to complete.
    • [ ] as mentioned in https://github.com/bitshares/bitshares-ui/pull/3001#issuecomment-517921338, I need json of the whole transaction, but not operations in the transaction
      • [ ] expiration time of the transaction
      • [ ] TaPoS data (ref_block_num, ref_block_prefix)
      • [ ] optionally, the hash of the transaction (aka txid)

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.

abitmore avatar Aug 09 '19 11:08 abitmore

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.

sschiessl-bcp avatar Nov 08 '19 14:11 sschiessl-bcp

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)

abitmore avatar Feb 15 '22 14:02 abitmore

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?

sschiessl-bcp avatar Feb 16 '22 19:02 sschiessl-bcp

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.

abitmore avatar Feb 17 '22 00:02 abitmore

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.

xiangxn avatar Feb 18 '22 11:02 xiangxn

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:

  • https://stackoverflow.com/questions/12764334/qr-code-max-char-length#12764370
  • https://en.wikipedia.org/wiki/QR_code#Storage
  • the specification https://www.iso.org/standard/62021.html

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.

abitmore avatar Feb 18 '22 14:02 abitmore

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

xiangxn avatar Feb 19 '22 16:02 xiangxn

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

abitmore avatar Feb 19 '22 21:02 abitmore

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

xiangxn avatar Feb 20 '22 01:02 xiangxn