@railgun-community/shared-models 6.3.2 → 6.4.0
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.
|
@@ -71,16 +71,22 @@ export type SingleCommitmentProofsData = {
|
|
|
71
71
|
pois: PreTransactionPOIsPerTxidLeafPerList;
|
|
72
72
|
};
|
|
73
73
|
export type SubmitTransactProofParams = {
|
|
74
|
+
chainType: string;
|
|
75
|
+
chainID: string;
|
|
74
76
|
txidVersion: TXIDVersion;
|
|
75
77
|
listKey: string;
|
|
76
78
|
transactProofData: TransactProofData;
|
|
77
79
|
};
|
|
78
80
|
export type SubmitLegacyTransactProofParams = {
|
|
81
|
+
chainType: string;
|
|
82
|
+
chainID: string;
|
|
79
83
|
txidVersion: TXIDVersion;
|
|
80
84
|
listKeys: string[];
|
|
81
85
|
legacyTransactProofDatas: LegacyTransactProofData[];
|
|
82
86
|
};
|
|
83
87
|
export type SubmitSingleCommitmentProofsParams = {
|
|
88
|
+
chainType: string;
|
|
89
|
+
chainID: string;
|
|
84
90
|
txidVersion: TXIDVersion;
|
|
85
91
|
singleCommitmentProofsData: SingleCommitmentProofsData;
|
|
86
92
|
};
|
|
@@ -90,6 +96,8 @@ export declare enum BlindedCommitmentType {
|
|
|
90
96
|
Unshield = "Unshield"
|
|
91
97
|
}
|
|
92
98
|
export type ValidatePOIMerklerootsParams = {
|
|
99
|
+
chainType: string;
|
|
100
|
+
chainID: string;
|
|
93
101
|
txidVersion: TXIDVersion;
|
|
94
102
|
listKey: string;
|
|
95
103
|
poiMerkleroots: string[];
|
|
@@ -99,22 +107,30 @@ export type BlindedCommitmentData = {
|
|
|
99
107
|
type: BlindedCommitmentType;
|
|
100
108
|
};
|
|
101
109
|
export type GetPOIsPerListParams = {
|
|
110
|
+
chainType: string;
|
|
111
|
+
chainID: string;
|
|
102
112
|
txidVersion: TXIDVersion;
|
|
103
113
|
listKeys: string[];
|
|
104
114
|
blindedCommitmentDatas: BlindedCommitmentData[];
|
|
105
115
|
};
|
|
106
116
|
export type GetMerkleProofsParams = {
|
|
117
|
+
chainType: string;
|
|
118
|
+
chainID: string;
|
|
107
119
|
txidVersion: TXIDVersion;
|
|
108
120
|
listKey: string;
|
|
109
121
|
blindedCommitments: string[];
|
|
110
122
|
};
|
|
111
123
|
export type ValidateTxidMerklerootParams = {
|
|
124
|
+
chainType: string;
|
|
125
|
+
chainID: string;
|
|
112
126
|
txidVersion: TXIDVersion;
|
|
113
127
|
tree: number;
|
|
114
128
|
index: number;
|
|
115
129
|
merkleroot: string;
|
|
116
130
|
};
|
|
117
131
|
export type GetLatestValidatedRailgunTxidParams = {
|
|
132
|
+
chainType: string;
|
|
133
|
+
chainID: string;
|
|
118
134
|
txidVersion: TXIDVersion;
|
|
119
135
|
};
|
|
120
136
|
export declare enum POIStatus {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proof-of-innocence.js","sourceRoot":"","sources":["../../src/models/proof-of-innocence.ts"],"names":[],"mappings":";;;AAmCA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,iDAAiC,CAAA;AACnC,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;
|
|
1
|
+
{"version":3,"file":"proof-of-innocence.js","sourceRoot":"","sources":["../../src/models/proof-of-innocence.ts"],"names":[],"mappings":";;;AAmCA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,iDAAiC,CAAA;AACnC,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAkED,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,0CAAiB,CAAA;IACjB,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;AACvB,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC;AA8CD,IAAY,SASX;AATD,WAAY,SAAS;IACnB,6BAA6B;IAC7B,4BAAe,CAAA;IACf,iBAAiB;IACjB,4CAA+B,CAAA;IAC/B,2DAA2D;IAC3D,8CAAiC,CAAA;IACjC,sEAAsE;IACtE,gCAAmB,CAAA;AACrB,CAAC,EATW,SAAS,yBAAT,SAAS,QASpB;AAyCY,QAAA,sBAAsB,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS;AAC3C,QAAA,2BAA2B,GAAG,UAAU,CAAC;AACzC,QAAA,+BAA+B,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,YAAY;AACtD,QAAA,oCAAoC,GAAG,cAAc,CAAC;AAEnE,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AASY,QAAA,kBAAkB,GAAc;IAC3C;QACE,GAAG,EAAE,kEAAkE;QACvE,IAAI,EAAE,WAAW,CAAC,MAAM;QACxB,IAAI,EAAE,gCAAgC;QACtC,WAAW,EACT,2KAA2K;KAC9K;CACF,CAAC;AAEF,IAAY,gBAmBX;AAnBD,WAAY,gBAAgB;IAC1B,mDAA+B,CAAA;IAC/B,iDAA6B,CAAA;IAC7B,sEAAkD,CAAA;IAClD,2DAAuC,CAAA;IACvC,wEAAoD,CAAA;IACpD,2DAAuC,CAAA;IACvC,8DAA0C,CAAA;IAC1C,sEAAkD,CAAA;IAClD,sEAAkD,CAAA;IAClD,sEAAkD,CAAA;IAClD,qFAAiE,CAAA;IACjE,yFAAqE,CAAA;IACrE,sDAAkC,CAAA;IAClC,iFAA6D,CAAA;IAC7D,uDAAmC,CAAA;IACnC,yDAAqC,CAAA;IACrC,4EAAwD,CAAA;IACxD,4EAAwD,CAAA;AAC1D,CAAC,EAnBW,gBAAgB,gCAAhB,gBAAgB,QAmB3B","sourcesContent":["import { TXIDVersion } from './engine';\nimport { NetworkName } from './network-config';\nimport { PreTransactionPOIsPerTxidLeafPerList } from './response-types';\n\nexport type TransactProofData = {\n snarkProof: SnarkProof;\n poiMerkleroots: string[];\n txidMerkleroot: string;\n txidMerklerootIndex: number;\n blindedCommitmentsOut: string[];\n railgunTxidIfHasUnshield: 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 unknown: number;\n pending: number;\n allowed: number;\n blocked: number;\n addedPOI: number;\n latestShield: Optional<string>;\n};\n\nexport enum POIEventType {\n Shield = 'Shield',\n Transact = 'Transact',\n Unshield = 'Unshield',\n LegacyTransact = 'LegacyTransact',\n}\n\nexport type POIEventLengths = Record<POIEventType, number>;\n\nexport type POIListStatus = {\n poiEventLengths: POIEventLengths;\n listProviderPOIEventQueueLength: Optional<number>;\n pendingTransactProofs: number;\n blockedShields: number;\n historicalMerklerootsLength: number;\n latestHistoricalMerkleroot: string;\n};\n\nexport type GetTransactProofsParams = {\n txidVersion: TXIDVersion;\n bloomFilterSerialized: string;\n listKey: string;\n};\n\nexport type GetBlockedShieldsParams = {\n txidVersion: TXIDVersion;\n bloomFilterSerialized: string;\n listKey: string;\n};\n\nexport type LegacyTransactProofData = {\n txidIndex: string;\n npk: string;\n value: string;\n tokenHash: string;\n blindedCommitment: string;\n};\n\nexport type SingleCommitmentProofsData = {\n commitment: string;\n npk: string;\n utxoTreeIn: number;\n utxoTreeOut: number;\n utxoPositionOut: number;\n railgunTxid: string;\n pois: PreTransactionPOIsPerTxidLeafPerList;\n};\n\nexport type SubmitTransactProofParams = {\n chainType: string;\n chainID: string;\n txidVersion: TXIDVersion;\n listKey: string;\n transactProofData: TransactProofData;\n};\n\nexport type SubmitLegacyTransactProofParams = {\n chainType: string;\n chainID: string;\n txidVersion: TXIDVersion;\n listKeys: string[];\n legacyTransactProofDatas: LegacyTransactProofData[];\n};\n\nexport type SubmitSingleCommitmentProofsParams = {\n chainType: string;\n chainID: string;\n txidVersion: TXIDVersion;\n singleCommitmentProofsData: SingleCommitmentProofsData;\n};\n\nexport enum BlindedCommitmentType {\n Shield = 'Shield',\n Transact = 'Transact',\n Unshield = 'Unshield',\n}\n\nexport type ValidatePOIMerklerootsParams = {\n chainType: string;\n chainID: string;\n txidVersion: TXIDVersion;\n listKey: string;\n poiMerkleroots: string[];\n};\n\nexport type BlindedCommitmentData = {\n blindedCommitment: string;\n type: BlindedCommitmentType;\n};\n\nexport type GetPOIsPerListParams = {\n chainType: string;\n chainID: string;\n txidVersion: TXIDVersion;\n listKeys: string[];\n blindedCommitmentDatas: BlindedCommitmentData[];\n};\n\nexport type GetMerkleProofsParams = {\n chainType: string;\n chainID: string;\n txidVersion: TXIDVersion;\n listKey: string;\n blindedCommitments: string[];\n};\n\nexport type ValidateTxidMerklerootParams = {\n chainType: string;\n chainID: string;\n txidVersion: TXIDVersion;\n tree: number;\n index: number;\n merkleroot: string;\n};\n\nexport type GetLatestValidatedRailgunTxidParams = {\n chainType: string;\n chainID: string;\n txidVersion: TXIDVersion;\n};\n\nexport enum POIStatus {\n // POI valdated in event list\n Valid = 'Valid',\n // Shield blocked\n ShieldBlocked = 'ShieldBlocked',\n // Transact/Unshield proof submitted, but not validated yet\n ProofSubmitted = 'ProofSubmitted',\n // Missing internal/external transact/unshield proof, or ShieldPending\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 legacyTransactProofs: number;\n};\n\nexport const POI_SHIELD_PENDING_SEC = 60 * 60; // 1 hour\nexport const POI_SHIELD_PENDING_SEC_TEXT = 'One hour';\nexport const POI_SHIELD_PENDING_SEC_TEST_NET = 5 * 60; // 5 minutes\nexport const POI_SHIELD_PENDING_SEC_TEST_NET_TEXT = 'Five minutes';\n\nexport enum POIListType {\n Active = 'Active',\n Gather = 'Gather',\n}\n\nexport type POIList = {\n key: string;\n type: POIListType;\n name: string;\n description: string;\n};\n\nexport const POI_REQUIRED_LISTS: POIList[] = [\n {\n key: 'efc6ddb59c098a13fb2b618fdae94c1c3a807abc8fb1837c93620c9143ee9e88',\n type: POIListType.Active,\n name: 'Chainalysis OFAC Sanctions API',\n description:\n 'API which is used to restrict bad actors designated by the US Department of the Treasury. See: https://www.chainalysis.com/free-cryptocurrency-sanctions-screening-tools.',\n },\n];\n\nexport enum POIJSONRPCMethod {\n NodeStatus = 'ppoi_node_status',\n POIEvents = 'ppoi_poi_events',\n POIMerkletreeLeaves = 'ppoi_poi_merkletree_leaves',\n TransactProofs = 'ppoi_transact_proofs',\n LegacyTransactProofs = 'ppoi_legacy_transact_proofs',\n BlockedShields = 'ppoi_blocked_shields',\n SubmitPOIEvents = 'ppoi_submit_poi_events',\n SubmitValidatedTXID = 'ppoi_submit_validated_txid',\n RemoveTransactProof = 'ppoi_remove_transact_proof',\n SubmitTransactProof = 'ppoi_submit_transact_proof',\n SubmitLegacyTransactProofs = 'ppoi_submit_legacy_transact_proofs',\n SubmitSingleCommitmentProofs = 'ppoi_submit_single_commitment_proofs',\n POIsPerList = 'ppoi_pois_per_list',\n POIsPerBlindedCommitment = 'ppoi_pois_per_blinded_commitment',\n MerkleProofs = 'ppoi_merkle_proofs',\n ValidatedTXID = 'ppoi_validated_txid',\n ValidateTXIDMerkleroot = 'ppoi_validate_txid_merkleroot',\n ValidatePOIMerkleroots = 'ppoi_validate_poi_merkleroots',\n}\n"]}
|