@ocap/indexdb 1.13.63 → 1.13.67

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/lib/util.js +12 -3
  2. package/package.json +4 -4
package/lib/util.js CHANGED
@@ -24,12 +24,12 @@ const createIndexedAccount = async (x, getTokenFn) => {
24
24
 
25
25
  return {
26
26
  address: x.address,
27
- balance: x.balance,
27
+ balance: x.balance || '0',
28
28
  migratedTo: x.migratedTo[0] || '',
29
29
  moniker: x.moniker,
30
30
  nonce: x.nonce,
31
- numAssets: x.numAssets,
32
- numTxs: x.numTxs,
31
+ numAssets: x.numAssets || 0,
32
+ numTxs: x.numTxs || 0,
33
33
  recentNumTxs: [],
34
34
  renaissanceTime: x.context.renaissanceTime,
35
35
  tokens: Object.keys(x.tokens || {}).map((address) =>
@@ -124,6 +124,15 @@ const createIndexedTransaction = (tx, ctx) => {
124
124
  tx.valid = tx.code === 'OK';
125
125
 
126
126
  // accounts
127
+ if (ctx.senderState) {
128
+ tx.accounts.push(ctx.senderState.address);
129
+ }
130
+ if (ctx.receiverState) {
131
+ tx.accounts.push(ctx.receiverState.address);
132
+ }
133
+ if (ctx.vaultState) {
134
+ tx.accounts.push(ctx.vaultState.address);
135
+ }
127
136
  if (ctx.updatedAccounts && Array.isArray(ctx.updatedAccounts)) {
128
137
  tx.accounts.push(...ctx.updatedAccounts.map((x) => x.address));
129
138
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.13.63",
6
+ "version": "1.13.67",
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": "^27.3.1"
23
23
  },
24
24
  "dependencies": {
25
- "@ocap/state": "1.13.63",
26
- "@ocap/util": "1.13.63",
25
+ "@ocap/state": "1.13.67",
26
+ "@ocap/util": "1.13.67",
27
27
  "kareem": "^2.3.2",
28
28
  "lodash": "^4.17.21"
29
29
  },
30
- "gitHead": "7e40f22f90f4f5ac08fde3d4d3b7194aa792c95d"
30
+ "gitHead": "866f6a0dbf4fc22425b8583d84610880472a3109"
31
31
  }