eos Transact Without Broadcast
https://github.com/EOSIO/eosjs/blob/849c03992e6ce3cb4b6a11bf18ab17b62136e5c9/src/tests/web.html#L144
const transactWithoutBroadcast = async () => await api.transact({
actions: [{
account: 'eosio.token',
name: 'transfer',
authorization: [{
actor: 'bob',
permission: 'active',
}],
data: {
from: 'bob',
to: 'alice',
quantity: '0.0001 SYS',
memo: '',
},
}]
}, {
broadcast: false,
blocksBehind: 3,
expireSeconds: 30,
});
const testTransactWithoutBroadcast = async (e) => {
resultsLabel = e.target;
resultsLabel.innerText = EXECUTING;
try {
transactionSignatures = await transactWithoutBroadcast();
} catch (error) {
resultsLabel.className = 'failed';
resultsLabel.innerText = FAILED;
console.error('Transact without Broadcast Test Failure: ', error.message);
return false;
}
if(transactionSignatures.signatures && transactionSignatures.serializedTransaction) {
resultsLabel.className = "success";
resultsLabel.innerText = SUCCESS;
return true;
}
resultsLabel.className = 'failed';
resultsLabel.innerText = FAILED;
return false;
};
当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »