Hello, I am trying to build a website that allow user to sign in with scatter, and then user can click "hirehero" and then it will push the transaction into my eos smart contract , however I do not know how to do it properly as there are lack of example
I normally interact with the smart contract using cleos command as below
cleos push action testcontract hirehero '{"user":"useraaa", "type":1}' -p useraaa
So when putting it into the website, i have successfully sign in with scatter, my code as below
Hello, I am trying to build a website that allow user to sign in with scatter, and then user can click "hirehero" and then it will push the transaction into my eos smart contract , however I do not know how to do it properly as there are lack of example
I normally interact with the smart contract using cleos command as below cleos push action testcontract hirehero '{"user":"useraaa", "type":1}' -p useraaa
So when putting it into the website, i have successfully sign in with scatter, my code as below
function hirehero() { const account = scatter.identity.accounts.find(x => x.blockchain === 'eos'); eos.transaction( { actions: [ { account: 'testcontract', name: 'hirehero', authorization: [{ actor: account, permission: 'active' }], data: { user: account, type: 1
} , (error,result)=>{console.log(error,result)} );
}
when i run it, it keep saying TypeError: name parameter is a required string, anything i missing?