-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements and fixes of nep11 command #391
Conversation
chenzhitong
commented
Nov 27, 2023
•
edited
Loading
edited
- Add TokenIds as base64 as well
- Fix error output to show inter error
- Make wording say [Argument(1, Description = "TokenId of NFT (Format: HEX, BASE64)")]
- Make wording say [Argument(0, Description = "NFT Contract (Symbol or Script Hash)")]
- Add transfernft command to batch commands
- Fix show nft
- Remove regular expressions
- Remove support for little-endian on TokenId
- Allow contract names
test:
|
Just a reminder for the future. We need to add |
[Required] | ||
internal string Contract { get; init; } = string.Empty; | ||
|
||
[Argument(1, Description = "Account to show asset balance for")] | ||
[Argument(1, Description = "TokenId of NFT (Format: Script Hash, Address, Wallet name)")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this should read as Account
?
I have added TransferNFT to BatchCommand, please check if I have added it right |
You have to add here as well. neo-express/src/neoxp/Commands/BatchCommand.cs Lines 110 to 284 in 4c1c513
|
Also here too (as subcommand)
|
@cschuchardt88 It's added. |
{ | ||
return Encoding.UTF8.GetString(hex.HexToBytes()); | ||
return input.StartsWith("0x") ? Encoding.UTF8.GetString(input[2..].HexToBytes().Reverse().ToArray()) : Encoding.UTF8.GetString(Convert.FromBase64String(input)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure reverse
is appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure, it starting with 0x is big-endian hex string, need to remove 0x and revert to byte array. Same deal here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same in the neo project too. https://github.com/neo-project/neo/blob/683af79b0d639cef0a8b1e91208395ca289d1664/src/Neo/UInt160.cs#L118
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but that is only for UInt160
. Normally with just hexstring
it isnt reversed. I know people complained about this. But we can leave for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a note in the documentation would be nice, like this
NOTE
In Neo, hexadecimal strings are processed in big-endian order if they are preceded by 0x, or little-endian order if they are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the results in reverse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.