UNPKG

@dioxide-js/silas

Version:

RPC utility for Silas

30 lines (27 loc) 912 B
import { __awaiter } from '../node_modules/tslib/tslib.es6.mjs'; import AddressService from '../api/address.mjs'; import Fetcher from '../api/request.mjs'; class Account extends Fetcher { constructor(opts) { super(opts); this.address = new AddressService(opts); } generate() { return __awaiter(this, arguments, void 0, function* (alg = 'sm2', privatekey) { return this.address.generate(alg, privatekey); }); } register(options) { return __awaiter(this, void 0, void 0, function* () { return this.post('user.register', options); }); } getState(options) { return __awaiter(this, void 0, void 0, function* () { const { id, address } = options; return this.post('user.state', { id, address }); }); } } export { Account as default }; //# sourceMappingURL=account.mjs.map