@railgun-community/shared-models 5.5.2 → 5.5.4

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.
@@ -22,8 +22,17 @@ export type MerkleProof = {
22
22
  indices: string;
23
23
  root: string;
24
24
  };
25
- export type POIEventListStatus = {
26
- length: number;
25
+ export type ShieldQueueStatus = {
26
+ pending: number;
27
+ allowed: number;
28
+ blocked: number;
29
+ addedPOI: number;
30
+ latestPendingShield: Optional<string>;
31
+ };
32
+ export type POIListStatus = {
33
+ poiEvents: number;
34
+ pendingTransactProofs: number;
35
+ blockedShields: number;
27
36
  };
28
37
  export type GetTransactProofsParams = {
29
38
  bloomFilterSerialized: string;
@@ -63,8 +72,11 @@ export declare enum POIStatus {
63
72
  TransactProofSubmitted = "TransactProofSubmitted",
64
73
  Missing = "Missing"
65
74
  }
66
- export type POIStatusListMap = {
67
- [listKey: string]: POIStatus[];
75
+ export type POIsPerList = {
76
+ [listKey: string]: POIStatus;
77
+ };
78
+ export type POIsPerListMap = {
79
+ [blindedCommitment: string]: POIsPerList;
68
80
  };
69
81
  export type TxidMerkletreeSyncStatus = {
70
82
  currentTxidIndex: number;
@@ -88,5 +100,6 @@ export type NodeStatusAllNetworks = {
88
100
  };
89
101
  export type NodeStatusForNetwork = {
90
102
  txidStatus: RailgunTxidStatus;
91
- eventListStatuses: Record<string, POIEventListStatus>;
103
+ shieldQueueStatus: ShieldQueueStatus;
104
+ listStatuses: Record<string, POIListStatus>;
92
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"proof-of-innocence.js","sourceRoot":"","sources":["../../src/models/proof-of-innocence.ts"],"names":[],"mappings":";;;AAEA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,qCAAiB,CAAA;AACnB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAwCD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,0CAAiB,CAAA;IACjB,8CAAqB,CAAA;AACvB,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC;AAuBD,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,6BAA6B;IAC7B,4BAAe,CAAA;IACf,iDAAiD;IACjD,4CAA+B,CAAA;IAC/B,iBAAiB;IACjB,4CAA+B,CAAA;IAC/B,kDAAkD;IAClD,8DAAiD,CAAA;IACjD,WAAW;IACX,gCAAmB,CAAA;AACrB,CAAC,EAXW,SAAS,yBAAT,SAAS,QAWpB","sourcesContent":["import { NetworkName } from './network-config';\n\nexport enum POINetworkStatus {\n Screen = 'Screen',\n Gather = 'Gather',\n}\n\nexport type TransactProofData = {\n snarkProof: SnarkProof;\n poiMerkleroots: string[];\n txidMerkleroot: string;\n txidMerklerootIndex: number;\n blindedCommitmentOutputs: string[];\n};\n\nexport type SnarkProof = {\n pi_a: [string, string];\n pi_b: [[string, string], [string, string]];\n pi_c: [string, string];\n};\n\nexport type MerkleProof = {\n leaf: string; // hash of commitment\n elements: string[];\n indices: string;\n root: string;\n};\n\nexport type POIEventListStatus = {\n length: number;\n};\n\nexport type GetTransactProofsParams = {\n bloomFilterSerialized: string;\n};\n\nexport type GetBlockedShieldsParams = {\n bloomFilterSerialized: string;\n};\n\nexport type SubmitTransactProofParams = {\n listKey: string;\n transactProofData: TransactProofData;\n};\n\nexport enum BlindedCommitmentType {\n Shield = 'Shield',\n Transact = 'Transact',\n}\n\nexport type BlindedCommitmentData = {\n blindedCommitment: string;\n type: BlindedCommitmentType;\n};\n\nexport type GetPOIsPerListParams = {\n listKeys: string[];\n blindedCommitmentDatas: BlindedCommitmentData[];\n};\n\nexport type GetMerkleProofsParams = {\n listKey: string;\n blindedCommitments: string[];\n};\n\nexport type ValidateTxidMerklerootParams = {\n tree: number;\n index: number;\n merkleroot: string;\n};\n\nexport enum POIStatus {\n // POI valdated in event list\n Valid = 'Valid',\n // Shield indexed, but not allowed or blocked yet\n ShieldPending = 'ShieldPending',\n // Shield blocked\n ShieldBlocked = 'ShieldBlocked',\n // Transact proof submitted, but not validated yet\n TransactProofSubmitted = 'TransactProofSubmitted',\n // No proof\n Missing = 'Missing',\n}\n\nexport type POIStatusListMap = {\n [listKey: string]: POIStatus[];\n};\n\nexport type TxidMerkletreeSyncStatus = {\n currentTxidIndex: number;\n currentMerkleroot: string;\n validatedTxidIndex: number;\n validatedMerkleroot: string;\n};\n\nexport type RailgunTxidStatus = {\n currentTxidIndex: Optional<number>;\n currentMerkleroot: Optional<string>;\n validatedTxidIndex: Optional<number>;\n validatedMerkleroot: Optional<string>;\n};\n\nexport type ValidatedRailgunTxidStatus = {\n validatedTxidIndex: Optional<number>;\n validatedMerkleroot: Optional<string>;\n};\n\nexport type NodeStatusAllNetworks = {\n listKeys: string[];\n forNetwork: Partial<Record<NetworkName, NodeStatusForNetwork>>;\n};\n\nexport type NodeStatusForNetwork = {\n txidStatus: RailgunTxidStatus;\n eventListStatuses: Record<string, POIEventListStatus>;\n};\n"]}
1
+ {"version":3,"file":"proof-of-innocence.js","sourceRoot":"","sources":["../../src/models/proof-of-innocence.ts"],"names":[],"mappings":";;;AAEA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,qCAAiB,CAAA;AACnB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAkDD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,0CAAiB,CAAA;IACjB,8CAAqB,CAAA;AACvB,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC;AAuBD,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,6BAA6B;IAC7B,4BAAe,CAAA;IACf,iDAAiD;IACjD,4CAA+B,CAAA;IAC/B,iBAAiB;IACjB,4CAA+B,CAAA;IAC/B,kDAAkD;IAClD,8DAAiD,CAAA;IACjD,WAAW;IACX,gCAAmB,CAAA;AACrB,CAAC,EAXW,SAAS,yBAAT,SAAS,QAWpB","sourcesContent":["import { NetworkName } from './network-config';\n\nexport enum POINetworkStatus {\n Screen = 'Screen',\n Gather = 'Gather',\n}\n\nexport type TransactProofData = {\n snarkProof: SnarkProof;\n poiMerkleroots: string[];\n txidMerkleroot: string;\n txidMerklerootIndex: number;\n blindedCommitmentOutputs: string[];\n};\n\nexport type SnarkProof = {\n pi_a: [string, string];\n pi_b: [[string, string], [string, string]];\n pi_c: [string, string];\n};\n\nexport type MerkleProof = {\n leaf: string; // hash of commitment\n elements: string[];\n indices: string;\n root: string;\n};\n\nexport type ShieldQueueStatus = {\n pending: number;\n allowed: number;\n blocked: number;\n addedPOI: number;\n latestPendingShield: Optional<string>;\n};\n\nexport type POIListStatus = {\n poiEvents: number;\n pendingTransactProofs: number;\n blockedShields: number;\n};\n\nexport type GetTransactProofsParams = {\n bloomFilterSerialized: string;\n};\n\nexport type GetBlockedShieldsParams = {\n bloomFilterSerialized: string;\n};\n\nexport type SubmitTransactProofParams = {\n listKey: string;\n transactProofData: TransactProofData;\n};\n\nexport enum BlindedCommitmentType {\n Shield = 'Shield',\n Transact = 'Transact',\n}\n\nexport type BlindedCommitmentData = {\n blindedCommitment: string;\n type: BlindedCommitmentType;\n};\n\nexport type GetPOIsPerListParams = {\n listKeys: string[];\n blindedCommitmentDatas: BlindedCommitmentData[];\n};\n\nexport type GetMerkleProofsParams = {\n listKey: string;\n blindedCommitments: string[];\n};\n\nexport type ValidateTxidMerklerootParams = {\n tree: number;\n index: number;\n merkleroot: string;\n};\n\nexport enum POIStatus {\n // POI valdated in event list\n Valid = 'Valid',\n // Shield indexed, but not allowed or blocked yet\n ShieldPending = 'ShieldPending',\n // Shield blocked\n ShieldBlocked = 'ShieldBlocked',\n // Transact proof submitted, but not validated yet\n TransactProofSubmitted = 'TransactProofSubmitted',\n // No proof\n Missing = 'Missing',\n}\n\nexport type POIsPerList = {\n [listKey: string]: POIStatus;\n};\n\nexport type POIsPerListMap = {\n [blindedCommitment: string]: POIsPerList;\n};\n\nexport type TxidMerkletreeSyncStatus = {\n currentTxidIndex: number;\n currentMerkleroot: string;\n validatedTxidIndex: number;\n validatedMerkleroot: string;\n};\n\nexport type RailgunTxidStatus = {\n currentTxidIndex: Optional<number>;\n currentMerkleroot: Optional<string>;\n validatedTxidIndex: Optional<number>;\n validatedMerkleroot: Optional<string>;\n};\n\nexport type ValidatedRailgunTxidStatus = {\n validatedTxidIndex: Optional<number>;\n validatedMerkleroot: Optional<string>;\n};\n\nexport type NodeStatusAllNetworks = {\n listKeys: string[];\n forNetwork: Partial<Record<NetworkName, NodeStatusForNetwork>>;\n};\n\nexport type NodeStatusForNetwork = {\n txidStatus: RailgunTxidStatus;\n shieldQueueStatus: ShieldQueueStatus;\n listStatuses: Record<string, POIListStatus>;\n};\n"]}
@@ -7,11 +7,11 @@ const isDefined = (a) => {
7
7
  exports.isDefined = isDefined;
8
8
  const removeUndefineds = (a) => {
9
9
  const newArray = [];
10
- for (const item of a) {
10
+ a.forEach(item => {
11
11
  if ((0, exports.isDefined)(item)) {
12
12
  newArray.push(item);
13
13
  }
14
- }
14
+ });
15
15
  return newArray;
16
16
  };
17
17
  exports.removeUndefineds = removeUndefineds;
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/utils/util.ts"],"names":[],"mappings":";;;AAAO,MAAM,SAAS,GAAG,CAAI,CAAuB,EAAU,EAAE;IAC9D,OAAO,OAAO,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,IAAI,CAAC;AAChD,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,gBAAgB,GAAG,CAAI,CAAgB,EAAO,EAAE;IAC3D,MAAM,QAAQ,GAAQ,EAAE,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,CAAC,EAAE;QACpB,IAAI,IAAA,iBAAS,EAAC,IAAI,CAAC,EAAE;YACnB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACrB;KACF;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AARW,QAAA,gBAAgB,oBAQ3B","sourcesContent":["export const isDefined = <T>(a: T | undefined | null): a is T => {\n return typeof a !== 'undefined' && a !== null;\n};\n\nexport const removeUndefineds = <T>(a: Optional<T>[]): T[] => {\n const newArray: T[] = [];\n for (const item of a) {\n if (isDefined(item)) {\n newArray.push(item);\n }\n }\n return newArray;\n};\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/utils/util.ts"],"names":[],"mappings":";;;AAAO,MAAM,SAAS,GAAG,CAAI,CAAuB,EAAU,EAAE;IAC9D,OAAO,OAAO,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,IAAI,CAAC;AAChD,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,gBAAgB,GAAG,CAAI,CAAgB,EAAO,EAAE;IAC3D,MAAM,QAAQ,GAAQ,EAAE,CAAC;IACzB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACf,IAAI,IAAA,iBAAS,EAAC,IAAI,CAAC,EAAE;YACnB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACrB;IACH,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AARW,QAAA,gBAAgB,oBAQ3B","sourcesContent":["export const isDefined = <T>(a: T | undefined | null): a is T => {\n return typeof a !== 'undefined' && a !== null;\n};\n\nexport const removeUndefineds = <T>(a: Optional<T>[]): T[] => {\n const newArray: T[] = [];\n a.forEach(item => {\n if (isDefined(item)) {\n newArray.push(item);\n }\n });\n return newArray;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railgun-community/shared-models",
3
- "version": "5.5.2",
3
+ "version": "5.5.4",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "files": [