@ocap/indexdb 1.13.45 → 1.13.49

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/util.js +26 -6
  2. package/package.json +4 -4
package/lib/util.js CHANGED
@@ -75,10 +75,14 @@ const createIndexedToken = (x) => ({
75
75
  decimal: x.decimal,
76
76
  icon: x.icon,
77
77
  totalSupply: x.totalSupply,
78
- erc20ContractAddress: x.erc20ContractAddress,
78
+ initialSupply: x.initialSupply,
79
+ foreignToken: x.foreignToken,
79
80
  data: x.data,
80
81
  genesisTime: x.context.genesisTime,
81
82
  renaissanceTime: x.context.renaissanceTime,
83
+
84
+ // TODO: deprecate this field
85
+ erc20ContractAddress: x.foreignToken ? x.foreignToken.contractAddress : '',
82
86
  });
83
87
 
84
88
  const createIndexedFactory = async (factory, context) => {
@@ -197,11 +201,11 @@ const createIndexedStake = async (x, ctx) => {
197
201
  };
198
202
 
199
203
  const createIndexedRollup = async (x, ctx) => {
200
- return {
204
+ const rollup = {
201
205
  ...pick(x, [
202
206
  'address',
207
+ 'paused',
203
208
  'tokenAddress',
204
- 'erc20TokenAddress',
205
209
  'contractAddress',
206
210
  'seedValidators',
207
211
  'validators',
@@ -213,13 +217,17 @@ const createIndexedRollup = async (x, ctx) => {
213
217
  'maxBlockSize',
214
218
  'minBlockInterval',
215
219
  'minBlockConfirmation',
216
- 'foreignChainType',
217
- 'foreignChainId',
218
220
  'minDepositAmount',
221
+ 'maxDepositAmount',
219
222
  'minWithdrawAmount',
223
+ 'maxWithdrawAmount',
220
224
  'depositFeeRate',
221
225
  'withdrawFeeRate',
222
226
  'proposerFeeShare',
227
+ 'minDepositFee',
228
+ 'maxDepositFee',
229
+ 'minWithdrawFee',
230
+ 'maxWithdrawFee',
223
231
  'issuer',
224
232
  'blockHeight',
225
233
  'blockHash',
@@ -227,8 +235,20 @@ const createIndexedRollup = async (x, ctx) => {
227
235
  ]),
228
236
  genesisTime: x.context.genesisTime,
229
237
  renaissanceTime: x.context.renaissanceTime,
230
- tokenInfo: formatTokenMeta({ address: x.tokenAddress, value: '0' }, ctx.tokenStates),
231
238
  };
239
+
240
+ if (ctx.tokenStates) {
241
+ const tokenState = ctx.tokenStates.find((t) => t.address === x.tokenAddress);
242
+ rollup.tokenInfo = formatTokenMeta({ address: x.tokenAddress, value: '0' }, ctx.tokenStates);
243
+ rollup.foreignToken = tokenState.foreignToken;
244
+
245
+ // TODO: deprecate following 3 fields
246
+ rollup.erc20TokenAddress = tokenState.foreignToken.contractAddress;
247
+ rollup.foreignChainType = tokenState.foreignToken.chainType;
248
+ rollup.foreignChainId = tokenState.foreignToken.chainName;
249
+ }
250
+
251
+ return rollup;
232
252
  };
233
253
 
234
254
  const createIndexedRollupBlock = async (x, ctx) => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.13.45",
6
+ "version": "1.13.49",
7
7
  "description": "Defines the basic interface for OCAP IndexDB",
8
8
  "main": "lib/main.js",
9
9
  "files": [
@@ -22,10 +22,10 @@
22
22
  "jest": "^26.6.3"
23
23
  },
24
24
  "dependencies": {
25
- "@ocap/state": "1.13.45",
26
- "@ocap/util": "1.13.45",
25
+ "@ocap/state": "1.13.49",
26
+ "@ocap/util": "1.13.49",
27
27
  "kareem": "^2.3.2",
28
28
  "lodash": "^4.17.21"
29
29
  },
30
- "gitHead": "36bd0bfdf2381ecdb4a5cc38c555428328820a99"
30
+ "gitHead": "c0af0d1ba7ead95f2224ff29aaebb635f6969a94"
31
31
  }