1-Click Transactions
1-click transactions
1. Modify your Smart Contract
token::transfer(const name &from,
const name &to,
const asset &quantity,
const string &memo)
{
require_auth({from, get_self()});
// Rest of your code below...
}#include <tonomy/tonomy.hpp>
token::transfer(const name &from,
const name &to,
const asset &quantity,
const string &memo)
{
require_auth({from, tonomysystem::tonomy::get_app_permission_by_origin("https://your-registered-app.com")});
// or
require_auth({from, tonomysystem::tonomy::get_app_permission_by_username("your-registered-app.app.demo.tonomy.id")});
// Rest of your code below...
}2. Sign the Transaction in Your App
const trx = await user.signTransaction('eosio.token', 'transfer', {
from: "me",
to: "you",
quantity: '1 SYS',
memo: 'test memo',
});Last updated