@eosdaq/embed
Installation
npm install @eosdaq/embed
yarn add @eosdaq/embed
Usage
- Initialize eosdaq module
const eosdaq = new Eosdaq(
'eosdaq',
{
targetUrl: 'https://eosdaq.com',
tokens: ['PTI_EOS', 'ARN_EOS'],
initialToken: 'KEOS_EOS',
theme: 'dark',
locale: 'en'
}
);
- Login and add callback function for transaction data
eosdaq.login({
identity: {
accounts: [{
authority: 'active',
name: 'xxxxxxxxxxxx12',
publickey: 'EOS7M4sXLVtqSDYT8SaGXyqyBASFYaEaqAoucZuB7RaBghv2Bd111',
}],
},
origin: 'eosdaq.com',
eos,
transactionCb: async (tx) => {
const result = await eos.transaction(tx);
return result;
},
});
or (if you use only Scatter interface)
const eos = ScatterJS.scatter.eos(network, Eos, {});
eosdaq.login({
identity: ScatterJS.identity,
origin: 'eosdaq.com',
eos,
});
In this case, transaction will be excuted in library with eos object.
- Logout
eosdaq.logout();
API
eosdaq.changeLanguage('en');