The second and third arguments of the functions in the Contract
are gas and attached deposit:
await nearvar.contract.buy_tokens({}, GAS_AMOUNT, ATTACHED_DEPOSIT);
Or you can use the Account
API (see details here) to do that:
let account = await connection.account(senderAccountId);
account.functionCall(contractId, 'buy_tokens', {}, GAS_AMOUNT, ATTACHED_DEPOSIT);
where GAS_AMOUNT can be 100000000000000
for 100Tgas (can also pass null instead for default 30Tgas).
ATTACHED_DEPOSIT for example for 1N: 10000000000000000000000000
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…