UNPKG

@dioxide-js/silas

Version:

RPC utility for Silas

32 lines (29 loc) 927 B
import { __awaiter } from '../node_modules/tslib/tslib.es6.mjs'; import Fetcher from './request.mjs'; class TransactionService extends Fetcher { compose(composed) { return this.postToBC('tx.compose', composed); } sendTransaction(signedText) { return this.post('tx.send', signedText); } getTransactionByHash(hash) { return __awaiter(this, void 0, void 0, function* () { const resp = yield this.post('chain.txn_detail', { hash, }); return resp; }); } sign(privateKey, txdata) { return this.postToBC('tx.sign', { sk: [privateKey], txdata, }); } sendTxWithPrivateKey(privateKey, params) { return this.post('tx.send', Object.assign({ privatekey: privateKey }, params)); } } export { TransactionService as default }; //# sourceMappingURL=transactions.mjs.map