@ocap/indexdb-elasticsearch 1.13.69 → 1.13.73

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 CHANGED
@@ -439,7 +439,7 @@ class ESIndexDB extends BaseIndexDB {
439
439
  return { stakes: items.map((item) => Stake.formatAfterRead(item)), paging: nextPaging };
440
440
  }
441
441
 
442
- async listRollups({ paging, tokenAddress = '', erc20TokenAddress = '' } = {}) {
442
+ async listRollups({ paging, tokenAddress = '', erc20TokenAddress = '', foreignTokenAddress = '' } = {}) {
443
443
  const pagination = formatPagination({
444
444
  paging,
445
445
  defaultSortField: 'renaissanceTime',
@@ -450,8 +450,14 @@ class ESIndexDB extends BaseIndexDB {
450
450
  if (tokenAddress) {
451
451
  conditions.push({ term: { tokenAddress } });
452
452
  }
453
- if (erc20TokenAddress) {
454
- conditions.push({ match: { erc20TokenAddress } });
453
+ const foreignTokenAddr = foreignTokenAddress || erc20TokenAddress;
454
+ if (foreignTokenAddr) {
455
+ conditions.push({
456
+ nested: {
457
+ path: 'foreignToken',
458
+ query: { bool: { must: { term: { 'foreignToken.contractAddress': foreignTokenAddr } } } },
459
+ },
460
+ });
455
461
  }
456
462
 
457
463
  debug('listRollups', { paging, pagination, conditions });
@@ -72,6 +72,8 @@ module.exports = () => ({
72
72
  totalDepositAmount: { type: 'text' },
73
73
  totalWithdrawAmount: { type: 'text' },
74
74
 
75
+ migrateHistory: { type: 'keyword' },
76
+
75
77
  data: { type: 'object', enabled: false },
76
78
  },
77
79
  },
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.69",
4
+ "version": "1.13.73",
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,11 @@
38
38
  "test": "jest --forceExit --detectOpenHandles",
39
39
  "coverage": "npm run test -- --coverage"
40
40
  },
41
- "gitHead": "7520d994d592dc4fe50612a665c94d7fa4d5b143",
41
+ "gitHead": "ffce10eaa7c72fe6d6fdc534f7e15cbdb3e6a917",
42
42
  "dependencies": {
43
43
  "@elastic/elasticsearch": "7.13.0",
44
- "@ocap/indexdb": "1.13.69",
45
- "@ocap/util": "1.13.69",
44
+ "@ocap/indexdb": "1.13.73",
45
+ "@ocap/util": "1.13.73",
46
46
  "axios": "^0.21.4",
47
47
  "bn.js": "^5.2.0",
48
48
  "debug": "^4.3.2",