dotbit-sdk-allin
Version:
A complete .bit SDK and utilities in TypeScript
46 lines • 1.45 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.BitIndexer = void 0;
const JSON_RPC_1 = require("../tools/JSON-RPC");
class BitIndexer {
constructor({ uri }) {
this.rpc = new JSON_RPC_1.JSONRPC(uri);
}
request(method, params) {
return this.rpc.request(method, params).then(result => result.data);
}
serverInfo() {
return this.request('das_serverInfo');
}
accountInfo(account) {
return this.request('das_accountInfo', [{
account,
}]);
}
accountInfoById(accountId) {
return this.request('das_accountInfo', [{
account_id: accountId,
}]);
}
accountRecords(account) {
return this.request('das_accountRecords', [{
account,
}]).then(result => result.records);
}
reverseRecord(keyInfo) {
return this.request('das_reverseRecord', [{
type: 'blockchain',
key_info: keyInfo,
}]);
}
accountList(keyInfo, role = 'owner') {
return this.request('das_accountList', [{
type: 'blockchain',
key_info: keyInfo,
role,
}])
.then(result => result.account_list.map(item => item.account));
}
}
exports.BitIndexer = BitIndexer;
//# sourceMappingURL=BitIndexer.js.map
;