Skip to content
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

How to call action from eos-sharp? #46

Closed
varshadqz opened this issue May 27, 2020 · 1 comment
Closed

How to call action from eos-sharp? #46

varshadqz opened this issue May 27, 2020 · 1 comment

Comments

@varshadqz
Copy link

Using cleos I am using command to call action and it works:

cleos push action groupsample erase '["user2"]' -p groupsample@active

groupsample is the account used for deploying a smart contract and authorization also.

I want to do this in .Net using eos-sharp. I am trying this:

public async Task pushaction()
        {
            try
            {
                var result = await eos.CreateTransaction(new EosSharp.Core.Api.v1.Transaction()
                {
                    actions = new List<EosSharp.Core.Api.v1.Action>()
    {
                    new EosSharp.Core.Api.v1.Action()
                    {
                        account = "groupsample",
                        authorization = new List<PermissionLevel>()
                        {
                            new PermissionLevel() {actor = "groupsample", permission = "active" }
                        },
                        name = "erase",
                        data = new Dictionary<string, string>()
                        {
                            { "key", "user2" }  
                        }
                    }
    }
                });
            }
            catch(Exception ex)
            {
                
            }
        }

But this is throwing an exception:

Exception of type 'EosSharp.Core.Exceptions.ApiErrorException' was thrown.

@varshadqz
Copy link
Author

Sorry, it's my bad, wrong primary key was provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant