@ocap/indexdb-elasticsearch 1.13.71 → 1.13.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/db.js +10 -3
- package/package.json +5 -4
package/lib/db.js
CHANGED
|
@@ -5,6 +5,7 @@ const { formatPagination } = require('@ocap/indexdb/lib/util');
|
|
|
5
5
|
const { parseDateTime } = require('@ocap/indexdb/lib/util');
|
|
6
6
|
const { formatTxAfterRead } = require('@ocap/indexdb/lib/util');
|
|
7
7
|
const { DEFAULT_TOKEN_DECIMAL } = require('@ocap/util/lib/constant');
|
|
8
|
+
const { toChecksumAddress } = require('@arcblock/did/lib/type');
|
|
8
9
|
|
|
9
10
|
const debug = require('debug')(require('../package.json').name);
|
|
10
11
|
|
|
@@ -439,7 +440,7 @@ class ESIndexDB extends BaseIndexDB {
|
|
|
439
440
|
return { stakes: items.map((item) => Stake.formatAfterRead(item)), paging: nextPaging };
|
|
440
441
|
}
|
|
441
442
|
|
|
442
|
-
async listRollups({ paging, tokenAddress = '', erc20TokenAddress = '' } = {}) {
|
|
443
|
+
async listRollups({ paging, tokenAddress = '', erc20TokenAddress = '', foreignTokenAddress = '' } = {}) {
|
|
443
444
|
const pagination = formatPagination({
|
|
444
445
|
paging,
|
|
445
446
|
defaultSortField: 'renaissanceTime',
|
|
@@ -450,8 +451,14 @@ class ESIndexDB extends BaseIndexDB {
|
|
|
450
451
|
if (tokenAddress) {
|
|
451
452
|
conditions.push({ term: { tokenAddress } });
|
|
452
453
|
}
|
|
453
|
-
|
|
454
|
-
|
|
454
|
+
const foreignTokenAddr = foreignTokenAddress || erc20TokenAddress;
|
|
455
|
+
if (foreignTokenAddr) {
|
|
456
|
+
conditions.push({
|
|
457
|
+
nested: {
|
|
458
|
+
path: 'foreignToken',
|
|
459
|
+
query: { bool: { must: { term: { 'foreignToken.contractAddress': toChecksumAddress(foreignTokenAddr) } } } },
|
|
460
|
+
},
|
|
461
|
+
});
|
|
455
462
|
}
|
|
456
463
|
|
|
457
464
|
debug('listRollups', { paging, pagination, conditions });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocap/indexdb-elasticsearch",
|
|
3
3
|
"description": "OCAP indexdb adapter that uses elasticsearch as backend",
|
|
4
|
-
"version": "1.13.
|
|
4
|
+
"version": "1.13.75",
|
|
5
5
|
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/ArcBlock/asset-chain/issues",
|
|
@@ -38,11 +38,12 @@
|
|
|
38
38
|
"test": "jest --forceExit --detectOpenHandles",
|
|
39
39
|
"coverage": "npm run test -- --coverage"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "27937d11e59a00125c2d01e4343da768bcf677d8",
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"@arcblock/did": "1.13.75",
|
|
43
44
|
"@elastic/elasticsearch": "7.13.0",
|
|
44
|
-
"@ocap/indexdb": "1.13.
|
|
45
|
-
"@ocap/util": "1.13.
|
|
45
|
+
"@ocap/indexdb": "1.13.75",
|
|
46
|
+
"@ocap/util": "1.13.75",
|
|
46
47
|
"axios": "^0.21.4",
|
|
47
48
|
"bn.js": "^5.2.0",
|
|
48
49
|
"debug": "^4.3.2",
|