|
|
@@ -296,6 +296,21 @@ class BankClient {
|
|
|
return new content_item_1.ContentItem(hash, contentParams);
|
|
|
});
|
|
|
}
|
|
|
+ getItemsForCommaList(commaList) {
|
|
|
+ return __awaiter(this, void 0, void 0, function* () {
|
|
|
+ const itemHashes = commaList.split(',').filter(x => x.trim() !== '');
|
|
|
+ const items = yield Promise.all(itemHashes.map(itemId => {
|
|
|
+ return this.webClient.requestJSON({
|
|
|
+ method: 'get',
|
|
|
+ url: this.ipfsUrlBase + '/ipfs/' + itemId,
|
|
|
+ });
|
|
|
+ }));
|
|
|
+ for (const item of items) {
|
|
|
+ item.hash = itemHashes.shift();
|
|
|
+ }
|
|
|
+ return items;
|
|
|
+ });
|
|
|
+ }
|
|
|
connectWebsocket(peerAddr, topic, connectCallback, messageCallback) {
|
|
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
|
const nonce = yield this.getNonce();
|
|
|
@@ -336,21 +351,6 @@ class BankClient {
|
|
|
resolve();
|
|
|
}));
|
|
|
}
|
|
|
- getItemsForCommaList(commaList) {
|
|
|
- return __awaiter(this, void 0, void 0, function* () {
|
|
|
- const itemHashes = commaList.split(',').filter(x => x.trim() !== '');
|
|
|
- const items = yield Promise.all(itemHashes.map(itemId => {
|
|
|
- return this.webClient.requestJSON({
|
|
|
- method: 'get',
|
|
|
- url: this.ipfsUrlBase + '/ipfs/' + itemId,
|
|
|
- });
|
|
|
- }));
|
|
|
- for (const item of items) {
|
|
|
- item.hash = itemHashes.shift();
|
|
|
- }
|
|
|
- return items;
|
|
|
- });
|
|
|
- }
|
|
|
getPriv() {
|
|
|
if (!this.privateKey) {
|
|
|
throw new Error('missing private key');
|