@ocap/resolver 1.13.61 → 1.13.65

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.
Files changed (2) hide show
  1. package/lib/index.js +17 -2
  2. package/package.json +11 -11
package/lib/index.js CHANGED
@@ -901,7 +901,14 @@ module.exports = class OCAPResolver {
901
901
  return [];
902
902
  }
903
903
 
904
- const rollupTxs = ['DepositTokenV2Tx', 'WithdrawTokenV2Tx', 'JoinRollupTx', 'LeaveRollupTx', 'CreateRollupBlockTx'];
904
+ const rollupTxs = [
905
+ 'DepositTokenV2Tx',
906
+ 'WithdrawTokenV2Tx',
907
+ 'JoinRollupTx',
908
+ 'LeaveRollupTx',
909
+ 'CreateRollupBlockTx',
910
+ 'ClaimBlockRewardTx',
911
+ ];
905
912
  const typeUrl = formatTxType(tx.tx.itxJson._type);
906
913
  const tokens = [];
907
914
 
@@ -924,13 +931,21 @@ module.exports = class OCAPResolver {
924
931
  'address'
925
932
  ).filter((x) => x.address)
926
933
  );
927
- } else if (['RevokeStakeTx'].includes(typeUrl)) {
934
+ } else if (typeUrl === 'RevokeStakeTx') {
928
935
  tokens.push(
929
936
  ...uniqBy(
930
937
  tx.tx.itxJson.outputs.reduce((acc, x) => acc.concat(x.tokens), []),
931
938
  'address'
932
939
  ).filter((x) => x.address)
933
940
  );
941
+ } else if (typeUrl === 'ClaimStakeTx') {
942
+ const revokeTx = await this.indexdb.tx.get(tx.tx.itxJson.evidence.hash);
943
+ tokens.push(
944
+ ...uniqBy(
945
+ revokeTx.tx.itxJson.outputs.reduce((acc, x) => acc.concat(x.tokens), []),
946
+ 'address'
947
+ ).filter((x) => x.address)
948
+ );
934
949
  } else if (rollupTxs.includes(typeUrl)) {
935
950
  const rollup = await this.indexdb.rollup.get(tx.tx.itxJson.rollup);
936
951
  tokens.push({ address: rollup.tokenAddress, value: '0' });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.13.61",
6
+ "version": "1.13.65",
7
7
  "description": "GraphQL resolver built upon ocap statedb and GQL layer",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -22,17 +22,17 @@
22
22
  "jest": "^27.3.1"
23
23
  },
24
24
  "dependencies": {
25
- "@arcblock/did": "1.13.61",
26
- "@arcblock/did-util": "1.13.61",
27
- "@ocap/config": "1.13.61",
28
- "@ocap/indexdb": "1.13.61",
29
- "@ocap/mcrypto": "1.13.61",
30
- "@ocap/message": "1.13.61",
31
- "@ocap/state": "1.13.61",
32
- "@ocap/tx-protocols": "1.13.61",
33
- "@ocap/util": "1.13.61",
25
+ "@arcblock/did": "1.13.65",
26
+ "@arcblock/did-util": "1.13.65",
27
+ "@ocap/config": "1.13.65",
28
+ "@ocap/indexdb": "1.13.65",
29
+ "@ocap/mcrypto": "1.13.65",
30
+ "@ocap/message": "1.13.65",
31
+ "@ocap/state": "1.13.65",
32
+ "@ocap/tx-protocols": "1.13.65",
33
+ "@ocap/util": "1.13.65",
34
34
  "debug": "^4.3.2",
35
35
  "lodash": "^4.17.21"
36
36
  },
37
- "gitHead": "79d07bbde4df1d0d37afe76aaa1eaa2f30cc55a7"
37
+ "gitHead": "4011996e1800845142aa5c889b58726129a99ec3"
38
38
  }