@ocap/resolver 1.13.59 → 1.13.63
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/index.js +17 -12
- package/package.json +11 -11
package/lib/index.js
CHANGED
|
@@ -311,11 +311,6 @@ module.exports = class OCAPResolver {
|
|
|
311
311
|
const tokens = await this.formatTokenMap({ [state.tokenAddress]: '0' });
|
|
312
312
|
state.tokenInfo = tokens.find((x) => x.address === state.tokenAddress);
|
|
313
313
|
state.foreignToken = state.tokenInfo.foreignToken;
|
|
314
|
-
|
|
315
|
-
// TODO: deprecate following 3 fields
|
|
316
|
-
state.erc20TokenAddress = state.foreignToken.contractAddress;
|
|
317
|
-
state.foreignChainType = state.foreignToken.chainType;
|
|
318
|
-
state.foreignChainId = state.foreignToken.chainName;
|
|
319
314
|
}
|
|
320
315
|
|
|
321
316
|
return state;
|
|
@@ -396,11 +391,6 @@ module.exports = class OCAPResolver {
|
|
|
396
391
|
if (typeof state.decimal === 'undefined') {
|
|
397
392
|
state.decimal = DEFAULT_TOKEN_DECIMAL;
|
|
398
393
|
}
|
|
399
|
-
|
|
400
|
-
// TODO: deprecate this
|
|
401
|
-
if (state.foreignToken) {
|
|
402
|
-
state.erc20ContractAddress = state.foreignToken.contractAddress;
|
|
403
|
-
}
|
|
404
394
|
}
|
|
405
395
|
|
|
406
396
|
return state;
|
|
@@ -911,7 +901,14 @@ module.exports = class OCAPResolver {
|
|
|
911
901
|
return [];
|
|
912
902
|
}
|
|
913
903
|
|
|
914
|
-
const rollupTxs = [
|
|
904
|
+
const rollupTxs = [
|
|
905
|
+
'DepositTokenV2Tx',
|
|
906
|
+
'WithdrawTokenV2Tx',
|
|
907
|
+
'JoinRollupTx',
|
|
908
|
+
'LeaveRollupTx',
|
|
909
|
+
'CreateRollupBlockTx',
|
|
910
|
+
'ClaimBlockRewardTx',
|
|
911
|
+
];
|
|
915
912
|
const typeUrl = formatTxType(tx.tx.itxJson._type);
|
|
916
913
|
const tokens = [];
|
|
917
914
|
|
|
@@ -934,13 +931,21 @@ module.exports = class OCAPResolver {
|
|
|
934
931
|
'address'
|
|
935
932
|
).filter((x) => x.address)
|
|
936
933
|
);
|
|
937
|
-
} else if (
|
|
934
|
+
} else if (typeUrl === 'RevokeStakeTx') {
|
|
938
935
|
tokens.push(
|
|
939
936
|
...uniqBy(
|
|
940
937
|
tx.tx.itxJson.outputs.reduce((acc, x) => acc.concat(x.tokens), []),
|
|
941
938
|
'address'
|
|
942
939
|
).filter((x) => x.address)
|
|
943
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
|
+
);
|
|
944
949
|
} else if (rollupTxs.includes(typeUrl)) {
|
|
945
950
|
const rollup = await this.indexdb.rollup.get(tx.tx.itxJson.rollup);
|
|
946
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.
|
|
6
|
+
"version": "1.13.63",
|
|
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.
|
|
26
|
-
"@arcblock/did-util": "1.13.
|
|
27
|
-
"@ocap/config": "1.13.
|
|
28
|
-
"@ocap/indexdb": "1.13.
|
|
29
|
-
"@ocap/mcrypto": "1.13.
|
|
30
|
-
"@ocap/message": "1.13.
|
|
31
|
-
"@ocap/state": "1.13.
|
|
32
|
-
"@ocap/tx-protocols": "1.13.
|
|
33
|
-
"@ocap/util": "1.13.
|
|
25
|
+
"@arcblock/did": "1.13.63",
|
|
26
|
+
"@arcblock/did-util": "1.13.63",
|
|
27
|
+
"@ocap/config": "1.13.63",
|
|
28
|
+
"@ocap/indexdb": "1.13.63",
|
|
29
|
+
"@ocap/mcrypto": "1.13.63",
|
|
30
|
+
"@ocap/message": "1.13.63",
|
|
31
|
+
"@ocap/state": "1.13.63",
|
|
32
|
+
"@ocap/tx-protocols": "1.13.63",
|
|
33
|
+
"@ocap/util": "1.13.63",
|
|
34
34
|
"debug": "^4.3.2",
|
|
35
35
|
"lodash": "^4.17.21"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "7e40f22f90f4f5ac08fde3d4d3b7194aa792c95d"
|
|
38
38
|
}
|