-
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
Add method: transfernft & show nft #304
Conversation
var (chainManager, _) = chainManagerFactory.LoadChain(Input); | ||
var password = chainManager.Chain.ResolvePassword(Sender, Password); | ||
using var txExec = txExecutorFactory.Create(chainManager, Trace, Json); | ||
await txExec.TransferNFTAsync(Contract, Encoding.UTF8.GetString(Convert.FromBase64String(TokenId)), Sender, password, Receiver, Data).ConfigureAwait(false); |
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.
TokenId Should be in hex
. This is the way it is done in production. Will be easier to understand.
internal string Data { get; init; } = string.Empty; | ||
|
||
[Option(Description = "password to use for NEP-2/NEP-6 sender")] | ||
internal string Password { get; init; } = string.Empty; |
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.
NEP-17
transfers dont require password. Seeing how there is default.neo-express
file that holds it.
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.
This is copied from TransferCommand.cs and is the same as NEP-17.
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.
yes but for password to use for NEP-2/NEP-6 sender
for legacy i believe.
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.
Also keep in mind for batch
it doesn't require password for transfers. That's what i was thinking of.
src/neoxp/neoxp.csproj
Outdated
<ItemGroup> | ||
<PackageReference Update="Neo.BlockchainToolkit.Library" Version="3.6.19" /> | ||
</ItemGroup> | ||
|
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.
3.6.19
doesn't exists anymore its 3.6.0
now. But we have updated repo with lots of changes please merge before adding this. If still needed then keep it.
"commandLineArgs": "run" | ||
} | ||
} | ||
} |
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.
Please dont merge your launchSettings.json
.
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.
Dont forget to run dotnet format
and your analyzers to fix github actions.
Edit:
https://github.com/cschuchardt88/neo-construct/blob/master/src/NeoEvents.Construct/Node/Tokens/Nep11Token.cs is good resource for adding the methods for NEP-11
, But i dont remember the proper way to invoke the VM in neo-express
.
} | ||
else | ||
{ | ||
return Encoding.UTF8.GetString(hex[2..].HexToBytes().Reverse().ToArray()); |
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.
Convert.FromHexString
or Convert.ToHexString
is good too.
You have forgotten about Divisible vs Non-Divisible NFTs |
} | ||
catch (Exception) | ||
{ | ||
throw new Exception("invalid script results"); |
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.
Can we get a better error output? Something indicating that the contract isn't an NFT or missing a method
Template for neo-devpack-dotnet only has base class for Non-divisible NFT, so, I think just supporting Non-divisible NFT is enough. BTW, does any wallet support Divisible NFT now? |
Once we add the validator for NEP-11 this won't be a problem. That is because in |
Who can review it |
Lacks unit test, all i can do is merge when you think its good to go. If you think it is good to go, i can merge it for you |
I've tested it. Merge it please. @Liaojinghui |
@chenzhitong @cschuchardt88 @Ashuaidehao Can you add unit test to this repo? I remember that @cschuchardt88 you wanted to add something that contains the unit test to this repo, right? I think we can just make things easy. |
I wanted to add @chenzhitong |
@chenzhitong can you reopen and fix? |
Try not to use Regex makes it hard to quickly understand; unless it a very lengthy task to validate. Why you use Fix
|
close #193
transfernft
show nft