0.5.8 • Published 5 years ago
@eosdaq/embed v0.5.8
@eosdaq/embed
Installation
npm install @eosdaq/embed
yarn add @eosdaq/embed
Usage
- Initialize eosdaq module
const eosdaq = new Eosdaq(
'eosdaq', // id of div for iframe to be rendered.
{
targetUrl: 'https://eosdaq.com', // Target url to load eosdaq embedding page
tokens: ['PTI_EOS', 'ARN_EOS'], // Token list that will be traded. An Empty array will show all tokens.
initialToken: 'KEOS_EOS', // Default selected token.
theme: 'dark', // Optional. Only 'light' and 'dark' are available.
locale: 'en' // Optional. 'en', 'cn', 'hk' and 'ko' are available.
}
);
- Login and add callback function for transaction data
eosdaq.login({
identity: {
accounts: [{
authority: 'active', // eg. 'active', 'owner'
name: 'xxxxxxxxxxxx12', // Account name
publickey: 'EOS7M4sXLVtqSDYT8SaGXyqyBASFYaEaqAoucZuB7RaBghv2Bd111', // Account`s public key
}],
},
origin: 'eosdaq.com', // Optional. Your origin to add on memo
eos, // Optional.
transactionCb: async (tx) => {
// Call your transaction function here
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
- changeLanguage(language)
eosdaq.changeLanguage('en'); // 'en', 'cn', 'hk', 'ko'
0.5.8
5 years ago
0.5.6
5 years ago
0.5.5
5 years ago
0.5.4
5 years ago
0.5.3
5 years ago
0.5.2
5 years ago
0.5.1
5 years ago
0.5.0
5 years ago
0.4.1
5 years ago
0.4.0
5 years ago
0.3.3
5 years ago
0.3.2
5 years ago
0.3.1
5 years ago
0.3.0
5 years ago
0.2.0
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago