encoderlee / eos_demo

These examples show how to use eosjs and eospy to interact with the eos/wax network, especially include the use of ONLY_BILL_FIRST_AUTHORIZER feature

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Call contract via wax.api.transact include eos signatures

nht1610 opened this issue · comments

anyway to create transact use wax.js, i get the eos signatures but do not know how to add this signatures

const wax = new waxjs.WaxJS({
rpcEndpoint: "https://wax.greymass.com",
userAccount: user,
pubKeys: data.pubKeys,
tryAutoLogin: false,
});

const result = await wax.api.transact(
{
actions: [
{
account: "eosio.token",
name: "transfer",
authorization: [
{
actor: payer_name,
permission: "active",
},
{
actor: user,
permission: "active",
},
],
data: {
from: fromUser,
to: toUser,
quantity: "0.00010000 WAX",
memo: "this is a memo",
},
},
],
},
{
blocksBehind: 3,
expireSeconds: 1200,
}
);

i use your code, everything ok, i want to merge my code use waxjs (which disappear popup) call contract via wax.api.transact with signature, there is anyway to include eos signature in await wax.api.transact.
If use transcation_args = await wax.api.signatureProvider.sign(sign_args); , approve popup will apear, i do not want that popup apear

image
if you use wax cloud wallet account and waxjs, the popup window will be apeared at least once, you can check the checkbox

Always sign those transactions on ....

then, the popup window will no longer appear.

if you don't want to see the popup window under any circumstances
you can look at what's going on inside the function 'wax.api.signatureProvider.sign'
It actually sends a POST request to 'https://public-wax-on.wax.io/wam/sign'
you can write code to send a POST request directly to 'https://public-wax-on.wax.io/wam/sign',
then you will get signatures without any popup window,
You don't even need a browser to run your javascript code,
You can even implement it using Python or NodeJS

how to send a POST request directly to 'https://public-wax-on.wax.io/wam/sign',
you can refer to my other code https://github.com/encoderlee/OpenAlien/blob/main/alien.py
see function 'wax_sign', but this is Python code

it work done !, thank you so much sir!