Can someone please add code example or describe how to only bill first authorizer?
I have tried but can't get it to work.
EOS.IO Stack Exchange is a question and answer site for users and developers of distributed applications built on top of the blockchain operating system, EOS.IO. It only takes a minute to sign up.
Sign up to join this communityCan someone please add code example or describe how to only bill first authorizer?
I have tried but can't get it to work.
The ONLYBILL1ST proposal has now been approved by 15 Block producers. I have tested and OnlyBillFirstAuthorizer is working now.
I'm using eos-sharp. But it's very similar to eos-js. It's very simple. Just add the account you want to bill for the transaction first in the 'authorization'-part.
//Add the private keys
List<string> lstSignProviders = new List<string>();
lstSignProviders.Add("privateKeyForOnlyBillFirstAuthorizer"); //ONLY_BILL_FIRST_AUTHORIZER
lstSignProviders.Add("privateKeyForTheAccountExecuting");
Eos eos = new Eos(new EosConfigurator()
{
HttpEndpoint = eosHttpEndpoint,
ChainId = eosChainId,
ExpireSeconds = 20,
SignProvider = new EosSharp.Core.Providers.DefaultSignProvider(lstSignProviders)
});
var result = eos.CreateTransaction(new Transaction()
{
actions = new List<EosSharp.Core.Api.v1.Action>(){
new EosSharp.Core.Api.v1.Action()
{
account = "eosio.token",
authorization = new List<PermissionLevel>()
{
new PermissionLevel() {actor = "accountToBillForCpuNet", permission = "active" },
new PermissionLevel() {actor = fromAccount, permission = "active" }
},
name = "transfer",
data = new { from = fromAccount,
to = toAccount,
quantity = "1.0000 EOS",
memo = ""}
}
}
}).Result;`enter code here`