|
@@ -303,6 +303,27 @@ class BankClient {
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
const itemHashes = commaList.split(',').filter(x => x.trim() !== '');
|
|
const itemHashes = commaList.split(',').filter(x => x.trim() !== '');
|
|
|
const items = yield Promise.all(itemHashes.map(itemId => {
|
|
const items = yield Promise.all(itemHashes.map(itemId => {
|
|
|
|
|
+ const { hash, type } = this.parseItemHash(itemId);
|
|
|
|
|
+ if (type === 'CO') {
|
|
|
|
|
+ return this.getContentItemByHash(itemId);
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ return this.webClient.requestJSON({
|
|
|
|
|
+ method: 'get',
|
|
|
|
|
+ url: this.ipfsUrlBase + '/ipfs/' + hash,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }));
|
|
|
|
|
+ for (const item of items) {
|
|
|
|
|
+ item.hash = itemHashes.shift();
|
|
|
|
|
+ }
|
|
|
|
|
+ return items;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ getContentItemsForCommaList(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 => {
|
|
|
const itemHash = this.parseItemHash(itemId).hash;
|
|
const itemHash = this.parseItemHash(itemId).hash;
|
|
|
return this.webClient.requestJSON({
|
|
return this.webClient.requestJSON({
|
|
|
method: 'get',
|
|
method: 'get',
|