@permissionless-technologies/upp-sdk 0.5.5 → 0.5.7
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/dist/{chunk-Q6BLTPWV.js → chunk-2NKFTLPD.js} +3 -3
- package/dist/{chunk-Q6BLTPWV.js.map → chunk-2NKFTLPD.js.map} +1 -1
- package/dist/{chunk-EHGH6TAW.js → chunk-37RFFZU2.js} +3 -3
- package/dist/{chunk-EHGH6TAW.js.map → chunk-37RFFZU2.js.map} +1 -1
- package/dist/{chunk-UQIM2KT3.js → chunk-4E23V3AT.js} +29 -4
- package/dist/chunk-4E23V3AT.js.map +1 -0
- package/dist/{chunk-53JACDGZ.js → chunk-A6IYQ7UF.js} +3 -3
- package/dist/chunk-A6IYQ7UF.js.map +1 -0
- package/dist/{chunk-7T4CUE6E.js → chunk-AVSR443A.js} +3 -3
- package/dist/{chunk-7T4CUE6E.js.map → chunk-AVSR443A.js.map} +1 -1
- package/dist/{chunk-UFEDJJSH.cjs → chunk-BCSMUH4L.cjs} +30 -3
- package/dist/chunk-BCSMUH4L.cjs.map +1 -0
- package/dist/{chunk-IYRCJAME.cjs → chunk-C3HXJ5A6.cjs} +9 -9
- package/dist/{chunk-IYRCJAME.cjs.map → chunk-C3HXJ5A6.cjs.map} +1 -1
- package/dist/{chunk-DTEAFJG7.js → chunk-FTEXUSHR.js} +4 -4
- package/dist/{chunk-DTEAFJG7.js.map → chunk-FTEXUSHR.js.map} +1 -1
- package/dist/chunk-FW2U6TKQ.js +498 -0
- package/dist/chunk-FW2U6TKQ.js.map +1 -0
- package/dist/{chunk-6TFDBBAQ.js → chunk-H4NDMIPF.js} +3 -3
- package/dist/{chunk-6TFDBBAQ.js.map → chunk-H4NDMIPF.js.map} +1 -1
- package/dist/{chunk-7BNJV2ZS.cjs → chunk-LKXC3OQT.cjs} +14 -14
- package/dist/{chunk-7BNJV2ZS.cjs.map → chunk-LKXC3OQT.cjs.map} +1 -1
- package/dist/{chunk-MEFCUBQC.js → chunk-N2VHE47N.js} +73 -7
- package/dist/chunk-N2VHE47N.js.map +1 -0
- package/dist/{chunk-HB43C26P.cjs → chunk-NGXEIUQ6.cjs} +4 -4
- package/dist/chunk-NGXEIUQ6.cjs.map +1 -0
- package/dist/{chunk-M6O7HMN7.js → chunk-OG6TNEAT.js} +6 -20
- package/dist/chunk-OG6TNEAT.js.map +1 -0
- package/dist/chunk-PGIV2GDM.cjs +511 -0
- package/dist/chunk-PGIV2GDM.cjs.map +1 -0
- package/dist/{chunk-DD2RTRPE.cjs → chunk-TKUOY2PQ.cjs} +22 -36
- package/dist/chunk-TKUOY2PQ.cjs.map +1 -0
- package/dist/{chunk-I5EKGD4P.cjs → chunk-XNSMPNY6.cjs} +4 -4
- package/dist/{chunk-I5EKGD4P.cjs.map → chunk-XNSMPNY6.cjs.map} +1 -1
- package/dist/{chunk-U3YFYMWF.cjs → chunk-XSJ5VVH4.cjs} +5 -5
- package/dist/{chunk-U3YFYMWF.cjs.map → chunk-XSJ5VVH4.cjs.map} +1 -1
- package/dist/{chunk-KV2QFPSJ.cjs → chunk-Y3VL3LOE.cjs} +73 -4
- package/dist/chunk-Y3VL3LOE.cjs.map +1 -0
- package/dist/{chunk-SWTNJPK5.cjs → chunk-Y6WCXYOC.cjs} +11 -11
- package/dist/{chunk-SWTNJPK5.cjs.map → chunk-Y6WCXYOC.cjs.map} +1 -1
- package/dist/core/index.cjs +117 -121
- package/dist/core/index.d.cts +2 -5
- package/dist/core/index.d.ts +2 -5
- package/dist/core/index.js +7 -7
- package/dist/crypto-FWREDAVI.js +8 -0
- package/dist/crypto-FWREDAVI.js.map +1 -0
- package/dist/crypto-IZKHHFDU.cjs +42 -0
- package/dist/crypto-IZKHHFDU.cjs.map +1 -0
- package/dist/{index-BRgBwiBM.d.ts → index-2eL8ZLD0.d.ts} +11 -23
- package/dist/{index-DHW5lKcd.d.ts → index-B31tBTbC.d.ts} +3 -4
- package/dist/{index-D6YhhbRP.d.cts → index-CzmvOht6.d.cts} +3 -4
- package/dist/{index-brLSTa0y.d.cts → index-a_f935pS.d.cts} +11 -23
- package/dist/index.cjs +285 -285
- package/dist/index.d.cts +4 -7
- package/dist/index.d.ts +4 -7
- package/dist/index.js +10 -10
- package/dist/indexer/index.cjs +62 -11
- package/dist/indexer/index.d.cts +196 -12
- package/dist/indexer/index.d.ts +196 -12
- package/dist/indexer/index.js +4 -1
- package/dist/keys/index.cjs +17 -17
- package/dist/keys/index.js +3 -3
- package/dist/react/index.cjs +237 -754
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +142 -6
- package/dist/react/index.d.ts +142 -6
- package/dist/react/index.js +215 -732
- package/dist/react/index.js.map +1 -1
- package/dist/transfer-27GZNGCI.js +9 -0
- package/dist/{transfer-BVZAMEJH.js.map → transfer-27GZNGCI.js.map} +1 -1
- package/dist/{transfer-ZD76R7XF.cjs → transfer-TJNDCZF2.cjs} +14 -10
- package/dist/{transfer-ZD76R7XF.cjs.map → transfer-TJNDCZF2.cjs.map} +1 -1
- package/dist/{transfer-p-NXHdGY.d.cts → transfer-_qaZXsv7.d.cts} +47 -156
- package/dist/{transfer-BxiDgCvx.d.ts → transfer-x7UChjh7.d.ts} +47 -156
- package/dist/utils/index.cjs +63 -63
- package/dist/utils/index.d.cts +186 -5
- package/dist/utils/index.d.ts +186 -5
- package/dist/utils/index.js +4 -4
- package/package.json +1 -1
- package/src/deployments/31337.json +2 -1
- package/dist/chunk-53JACDGZ.js.map +0 -1
- package/dist/chunk-DD2RTRPE.cjs.map +0 -1
- package/dist/chunk-HB43C26P.cjs.map +0 -1
- package/dist/chunk-KV2QFPSJ.cjs.map +0 -1
- package/dist/chunk-M6O7HMN7.js.map +0 -1
- package/dist/chunk-MEFCUBQC.js.map +0 -1
- package/dist/chunk-UFEDJJSH.cjs.map +0 -1
- package/dist/chunk-UQIM2KT3.js.map +0 -1
- package/dist/stark-BcTD1OaJ.d.cts +0 -185
- package/dist/stark-BcTD1OaJ.d.ts +0 -185
- package/dist/transfer-BVZAMEJH.js +0 -9
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
export { A as ADDRESS_VERSION,
|
|
2
|
-
export { A as ASPProof, a as ASPRoot, b as ASP_TREE_DEPTH, C as CIRCUIT_CDN_BASE, c as CIRCUIT_VERSION, d as CircuitArtifactCache, e as CircuitArtifacts, f as CircuitCacheStatus, g as CircuitType, h as Commitment, D as DEMO_ASP_ID, i as DEMO_ASP_NAME, j as DownloadProgress, E as EncryptedNote, M as MergeParams, k as MergeRecord, l as MerkleProofWithNote, N as NOTE_VERSION, m as Note, n as
|
|
1
|
+
export { A as ADDRESS_VERSION, a as ASPMembershipProof, D as DeploymentConfig, b as DirectAccountAdapter, c as IASPProvider, d as IAccountAdapter, e as INoteStore, f as IndexedNote, I as Indexer, N as NoteStore, R as RpcIndexerConfig, S as STARK_ADDRESS_VERSION, g as STARK_STEALTH_ADDRESS_PREFIX, h as STEALTH_ADDRESS_PREFIX, i as StorableAccountAdapter, j as StorageAdapter, k as SyncResult, U as UPPClient, l as UPPClientConfig, V as VerificationCheck, m as VerificationResult, n as VerifierAddresses, o as checkImplementation, p as computeNoteEncryptionKey, q as createNote, r as createOneTimeKeys, s as createUPPClient, t as decodeStarkStealthAddress, u as decodeStealthAddress, v as decryptNote, w as detectAddressType, x as encodeStarkStealthAddress, y as encodeStealthAddress, z as encryptNote, B as generateStarkStealthAddress, C as generateStealthAddress, E as getDeployment, F as getDeploymentOrThrow, G as getSupportedChainIds, H as getTokenAddress, J as hasDeployment, K as isValidStarkStealthAddress, L as isValidStealthAddress, M as registerDeployment, O as verifyDeployment, P as verifyOwnership } from './index-a_f935pS.cjs';
|
|
2
|
+
export { A as ASPProof, a as ASPRoot, b as ASP_TREE_DEPTH, C as CIRCUIT_CDN_BASE, c as CIRCUIT_VERSION, d as CircuitArtifactCache, e as CircuitArtifacts, f as CircuitCacheStatus, g as CircuitType, h as Commitment, D as DEMO_ASP_ID, i as DEMO_ASP_NAME, j as DownloadProgress, E as EncryptedNote, M as MergeParams, k as MergeRecord, l as MerkleProofWithNote, N as NOTE_VERSION, m as Note, n as NoteStatus, o as NoteWithAmount, p as Nullifier, P as PlonkProvingStage, q as Proof, r as ProofResult, s as ProofSystem, t as ProofWorkerManager, u as ProofWorkerRequest, v as ProofWorkerResponse, R as RATE_PRECISION, w as ResolvedCircuitArtifacts, S as STATE_TREE_DEPTH, x as SWAP_EVENTS_ABI, y as SWAP_ORDER_CANCELLED_EVENT, z as SWAP_ORDER_CLAIMED_EVENT, B as SWAP_ORDER_FILLED_EVENT, F as SWAP_ORDER_PLACED_EVENT, G as ShieldParams, H as ShieldedNote, I as SpendableNote, J as StarkNote, K as StarkProof, L as StarkStealthMetaAddress, O as Stealth1x2CircuitInputs, Q as Stealth2x2CircuitInputs, T as StealthAddress, U as StealthCircuitInputs, V as StealthCircuitType, W as StealthMetaAddress, X as SwapFillEvent, Y as SwapFillParams, Z as SwapOrder, _ as SwapOrderEvent, $ as SwapOrderParams, a0 as TransferBuildResult, a1 as TransferContext, a2 as TransferParams, a3 as TransferStage, a4 as UPPCircuitInputs, a5 as UPPCircuitType, a6 as UPPTransferCircuitInputs, a7 as UPPWithdrawCircuitInputs, a8 as WithdrawParams, a9 as buildASPTree, aa as buildTransfer, ab as buildUPPTransferCircuitInputs, ac as computeCancelKeyHash, ad as computeFillPercentage, ae as computeGiveAmount, af as computeMultiOriginASPRoot, ag as computeNullifier, ah as computeRate, ai as computeSingleOriginASPRoot, aj as computeTakeAmount, ak as computeTotalBuyAmount, al as createDemoASPRoot, am as filterOrdersByASP, an as filterOrdersByTokenPair, ao as formatOutputForContract, ap as formatProofForContract, aq as formatRate, ar as generateASPProof, as as generateCancelSecret, at as generateMultiOriginASPProof, au as generateProof, av as generateSingleOriginASPProof, aw as generateStealthProof, ax as generateUPPProof, ay as generateUPPProofAsync, az as getCancelSecret, aA as getMerkleProofsForNotes, aB as getOwnOrderIds, aC as getStealthCircuitArtifacts, aD as getUPPCircuitArtifacts, aE as isFillerASPAccepted, aF as isOrderActive, aG as removeCancelSecret, aH as storeCancelSecret, aI as syncMerkleTree, aJ as verifyASPProof, aK as verifyProof } from './transfer-_qaZXsv7.cjs';
|
|
3
3
|
export { A as AuditKeyExport, D as DEFAULT_KEY_DERIVATION_CONFIG, a as DualMasterKeys, K as KeyDerivationConfig, M as MasterKeys, O as OneTimeKeys, P as ProvingSystem, S as SerializedKeys, b as StarkMasterKeys, c as StealthAddressComponents, T as TransactionViewingKey } from './types-CJSbxv4q.cjs';
|
|
4
4
|
export { NoteReference, deriveDualKeysFromSignature, deriveKeysFromSignature, deriveNullifierKey, derivePerNoteKey, derivePerNoteKeyFromKeys, deriveStarkKeysFromSignature, deriveStarkPerNoteKey, deriveStarkPerNoteKeyFromKeys, exportViewingKeysForAudit, getKeyDerivationMessage, getViewingKeyFromExport, validateAuditKeyExport, verifyKeysMatchSignature } from './keys/index.cjs';
|
|
5
|
-
export { BABYJUBJUB_SUBORDER, FIELD_PRIME, addressToField, bigintToBytes, bytesToBigint, bytesToHex, fieldToAddress, hexToBytes, isValidFieldElement, poseidon, poseidonHash, poseidonScalar, randomBytes, randomFieldElement, toFieldElement } from './utils/index.cjs';
|
|
5
|
+
export { BABYJUBJUB_SUBORDER, FIELD_PRIME, STARK_AMOUNT_SCALE, STARK_ASP_TREE_DEPTH, STARK_STATE_TREE_DEPTH, StarkTransferWitness, StarkWithdrawWitness, addressToField, addressToM31, bigintToBytes, buildStarkTransferWitness, buildStarkWithdrawWitness, bytesToBigint, bytesToHex, computeTransferPublicInputsSeed, computeWithdrawPublicInputsSeed, fieldToAddress, hexToBytes, isStarkAligned, isValidFieldElement, packM31Digest, poseidon, poseidonHash, poseidonScalar, randomBytes, randomFieldElement, scaleAmountForStark, splitSecretToM31Limbs, toFieldElement, truncateToM31 } from './utils/index.cjs';
|
|
6
6
|
export { M as MAX_TREE_DEPTH, a as MerkleProof, b as MerkleTree, P as Point, c as addPoints, d as buildMerkleTree, e as computeSharedSecret, f as deriveDecryptionViewingKey, g as deriveEncryptionViewingKey, h as getBasePoint, i as getMerkleProof, j as getSubOrder, k as isOnCurve, m as mulPointScalar, p as packPoint, l as pointToTuple, n as privateToPublic, t as tupleToPoint, v as verifyMerkleProof } from './merkle-mteVOlDf.cjs';
|
|
7
|
-
export { S as STARK_AMOUNT_SCALE, a as STARK_ASP_TREE_DEPTH, b as STARK_STATE_TREE_DEPTH, c as StarkTransferWitness, d as StarkWithdrawWitness, e as addressToM31, f as buildStarkTransferWitness, g as buildStarkWithdrawWitness, h as computeTransferPublicInputsSeed, i as computeWithdrawPublicInputsSeed, j as isStarkAligned, p as packM31Digest, s as scaleAmountForStark, k as splitSecretToM31Limbs, t as truncateToM31 } from './stark-BcTD1OaJ.cjs';
|
|
8
7
|
export { D as DIGEST_SIZE, a as M31Digest, M as M31Secret, b as M31_P, S as SECRET_LIMBS, c as computeStarkCommitment, d as computeStarkNullifier, e as computeStarkOwnerHash, k as keccakHashTwo, f as keccakM31, s as splitToM31Limbs } from './keccak-m31-B_AqBbRF.cjs';
|
|
9
|
-
export { A as ASP_REGISTRY_HUB_ABI, b as TEST_STABLE_TOKEN_2_ABI, T as TEST_STABLE_TOKEN_ABI, U as UNIVERSAL_PRIVATE_POOL_ABI, a as UPP_SWAP_MODULE_ABI, m as makeRpcIndexer } from './index-
|
|
8
|
+
export { A as ASP_REGISTRY_HUB_ABI, b as TEST_STABLE_TOKEN_2_ABI, T as TEST_STABLE_TOKEN_ABI, U as UNIVERSAL_PRIVATE_POOL_ABI, a as UPP_SWAP_MODULE_ABI, m as makeRpcIndexer } from './index-CzmvOht6.cjs';
|
|
10
9
|
import 'viem';
|
|
11
10
|
import '@permissionless-technologies/upc-sdk';
|
|
12
|
-
import 'react/jsx-runtime';
|
|
13
|
-
import 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
export { A as ADDRESS_VERSION,
|
|
2
|
-
export { A as ASPProof, a as ASPRoot, b as ASP_TREE_DEPTH, C as CIRCUIT_CDN_BASE, c as CIRCUIT_VERSION, d as CircuitArtifactCache, e as CircuitArtifacts, f as CircuitCacheStatus, g as CircuitType, h as Commitment, D as DEMO_ASP_ID, i as DEMO_ASP_NAME, j as DownloadProgress, E as EncryptedNote, M as MergeParams, k as MergeRecord, l as MerkleProofWithNote, N as NOTE_VERSION, m as Note, n as
|
|
1
|
+
export { A as ADDRESS_VERSION, a as ASPMembershipProof, D as DeploymentConfig, b as DirectAccountAdapter, c as IASPProvider, d as IAccountAdapter, e as INoteStore, f as IndexedNote, I as Indexer, N as NoteStore, R as RpcIndexerConfig, S as STARK_ADDRESS_VERSION, g as STARK_STEALTH_ADDRESS_PREFIX, h as STEALTH_ADDRESS_PREFIX, i as StorableAccountAdapter, j as StorageAdapter, k as SyncResult, U as UPPClient, l as UPPClientConfig, V as VerificationCheck, m as VerificationResult, n as VerifierAddresses, o as checkImplementation, p as computeNoteEncryptionKey, q as createNote, r as createOneTimeKeys, s as createUPPClient, t as decodeStarkStealthAddress, u as decodeStealthAddress, v as decryptNote, w as detectAddressType, x as encodeStarkStealthAddress, y as encodeStealthAddress, z as encryptNote, B as generateStarkStealthAddress, C as generateStealthAddress, E as getDeployment, F as getDeploymentOrThrow, G as getSupportedChainIds, H as getTokenAddress, J as hasDeployment, K as isValidStarkStealthAddress, L as isValidStealthAddress, M as registerDeployment, O as verifyDeployment, P as verifyOwnership } from './index-2eL8ZLD0.js';
|
|
2
|
+
export { A as ASPProof, a as ASPRoot, b as ASP_TREE_DEPTH, C as CIRCUIT_CDN_BASE, c as CIRCUIT_VERSION, d as CircuitArtifactCache, e as CircuitArtifacts, f as CircuitCacheStatus, g as CircuitType, h as Commitment, D as DEMO_ASP_ID, i as DEMO_ASP_NAME, j as DownloadProgress, E as EncryptedNote, M as MergeParams, k as MergeRecord, l as MerkleProofWithNote, N as NOTE_VERSION, m as Note, n as NoteStatus, o as NoteWithAmount, p as Nullifier, P as PlonkProvingStage, q as Proof, r as ProofResult, s as ProofSystem, t as ProofWorkerManager, u as ProofWorkerRequest, v as ProofWorkerResponse, R as RATE_PRECISION, w as ResolvedCircuitArtifacts, S as STATE_TREE_DEPTH, x as SWAP_EVENTS_ABI, y as SWAP_ORDER_CANCELLED_EVENT, z as SWAP_ORDER_CLAIMED_EVENT, B as SWAP_ORDER_FILLED_EVENT, F as SWAP_ORDER_PLACED_EVENT, G as ShieldParams, H as ShieldedNote, I as SpendableNote, J as StarkNote, K as StarkProof, L as StarkStealthMetaAddress, O as Stealth1x2CircuitInputs, Q as Stealth2x2CircuitInputs, T as StealthAddress, U as StealthCircuitInputs, V as StealthCircuitType, W as StealthMetaAddress, X as SwapFillEvent, Y as SwapFillParams, Z as SwapOrder, _ as SwapOrderEvent, $ as SwapOrderParams, a0 as TransferBuildResult, a1 as TransferContext, a2 as TransferParams, a3 as TransferStage, a4 as UPPCircuitInputs, a5 as UPPCircuitType, a6 as UPPTransferCircuitInputs, a7 as UPPWithdrawCircuitInputs, a8 as WithdrawParams, a9 as buildASPTree, aa as buildTransfer, ab as buildUPPTransferCircuitInputs, ac as computeCancelKeyHash, ad as computeFillPercentage, ae as computeGiveAmount, af as computeMultiOriginASPRoot, ag as computeNullifier, ah as computeRate, ai as computeSingleOriginASPRoot, aj as computeTakeAmount, ak as computeTotalBuyAmount, al as createDemoASPRoot, am as filterOrdersByASP, an as filterOrdersByTokenPair, ao as formatOutputForContract, ap as formatProofForContract, aq as formatRate, ar as generateASPProof, as as generateCancelSecret, at as generateMultiOriginASPProof, au as generateProof, av as generateSingleOriginASPProof, aw as generateStealthProof, ax as generateUPPProof, ay as generateUPPProofAsync, az as getCancelSecret, aA as getMerkleProofsForNotes, aB as getOwnOrderIds, aC as getStealthCircuitArtifacts, aD as getUPPCircuitArtifacts, aE as isFillerASPAccepted, aF as isOrderActive, aG as removeCancelSecret, aH as storeCancelSecret, aI as syncMerkleTree, aJ as verifyASPProof, aK as verifyProof } from './transfer-x7UChjh7.js';
|
|
3
3
|
export { A as AuditKeyExport, D as DEFAULT_KEY_DERIVATION_CONFIG, a as DualMasterKeys, K as KeyDerivationConfig, M as MasterKeys, O as OneTimeKeys, P as ProvingSystem, S as SerializedKeys, b as StarkMasterKeys, c as StealthAddressComponents, T as TransactionViewingKey } from './types-mLybMxNR.js';
|
|
4
4
|
export { NoteReference, deriveDualKeysFromSignature, deriveKeysFromSignature, deriveNullifierKey, derivePerNoteKey, derivePerNoteKeyFromKeys, deriveStarkKeysFromSignature, deriveStarkPerNoteKey, deriveStarkPerNoteKeyFromKeys, exportViewingKeysForAudit, getKeyDerivationMessage, getViewingKeyFromExport, validateAuditKeyExport, verifyKeysMatchSignature } from './keys/index.js';
|
|
5
|
-
export { BABYJUBJUB_SUBORDER, FIELD_PRIME, addressToField, bigintToBytes, bytesToBigint, bytesToHex, fieldToAddress, hexToBytes, isValidFieldElement, poseidon, poseidonHash, poseidonScalar, randomBytes, randomFieldElement, toFieldElement } from './utils/index.js';
|
|
5
|
+
export { BABYJUBJUB_SUBORDER, FIELD_PRIME, STARK_AMOUNT_SCALE, STARK_ASP_TREE_DEPTH, STARK_STATE_TREE_DEPTH, StarkTransferWitness, StarkWithdrawWitness, addressToField, addressToM31, bigintToBytes, buildStarkTransferWitness, buildStarkWithdrawWitness, bytesToBigint, bytesToHex, computeTransferPublicInputsSeed, computeWithdrawPublicInputsSeed, fieldToAddress, hexToBytes, isStarkAligned, isValidFieldElement, packM31Digest, poseidon, poseidonHash, poseidonScalar, randomBytes, randomFieldElement, scaleAmountForStark, splitSecretToM31Limbs, toFieldElement, truncateToM31 } from './utils/index.js';
|
|
6
6
|
export { M as MAX_TREE_DEPTH, a as MerkleProof, b as MerkleTree, P as Point, c as addPoints, d as buildMerkleTree, e as computeSharedSecret, f as deriveDecryptionViewingKey, g as deriveEncryptionViewingKey, h as getBasePoint, i as getMerkleProof, j as getSubOrder, k as isOnCurve, m as mulPointScalar, p as packPoint, l as pointToTuple, n as privateToPublic, t as tupleToPoint, v as verifyMerkleProof } from './merkle-mteVOlDf.js';
|
|
7
|
-
export { S as STARK_AMOUNT_SCALE, a as STARK_ASP_TREE_DEPTH, b as STARK_STATE_TREE_DEPTH, c as StarkTransferWitness, d as StarkWithdrawWitness, e as addressToM31, f as buildStarkTransferWitness, g as buildStarkWithdrawWitness, h as computeTransferPublicInputsSeed, i as computeWithdrawPublicInputsSeed, j as isStarkAligned, p as packM31Digest, s as scaleAmountForStark, k as splitSecretToM31Limbs, t as truncateToM31 } from './stark-BcTD1OaJ.js';
|
|
8
7
|
export { D as DIGEST_SIZE, a as M31Digest, M as M31Secret, b as M31_P, S as SECRET_LIMBS, c as computeStarkCommitment, d as computeStarkNullifier, e as computeStarkOwnerHash, k as keccakHashTwo, f as keccakM31, s as splitToM31Limbs } from './keccak-m31-B_AqBbRF.js';
|
|
9
|
-
export { A as ASP_REGISTRY_HUB_ABI, b as TEST_STABLE_TOKEN_2_ABI, T as TEST_STABLE_TOKEN_ABI, U as UNIVERSAL_PRIVATE_POOL_ABI, a as UPP_SWAP_MODULE_ABI, m as makeRpcIndexer } from './index-
|
|
8
|
+
export { A as ASP_REGISTRY_HUB_ABI, b as TEST_STABLE_TOKEN_2_ABI, T as TEST_STABLE_TOKEN_ABI, U as UNIVERSAL_PRIVATE_POOL_ABI, a as UPP_SWAP_MODULE_ABI, m as makeRpcIndexer } from './index-B31tBTbC.js';
|
|
10
9
|
import 'viem';
|
|
11
10
|
import '@permissionless-technologies/upc-sdk';
|
|
12
|
-
import 'react/jsx-runtime';
|
|
13
|
-
import 'react';
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { NOTE_VERSION, checkImplementation, createNote, createUPPClient, decryptNote, encryptNote, verifyDeployment } from './chunk-
|
|
2
|
-
export {
|
|
1
|
+
export { NOTE_VERSION, checkImplementation, createNote, createUPPClient, decryptNote, encryptNote, verifyDeployment } from './chunk-A6IYQ7UF.js';
|
|
2
|
+
export { DEFAULT_KEY_DERIVATION_CONFIG, deriveDualKeysFromSignature, deriveKeysFromSignature, deriveNullifierKey, derivePerNoteKey, derivePerNoteKeyFromKeys, deriveStarkKeysFromSignature, deriveStarkPerNoteKey, deriveStarkPerNoteKeyFromKeys, exportViewingKeysForAudit, getKeyDerivationMessage, getViewingKeyFromExport, validateAuditKeyExport, verifyKeysMatchSignature } from './chunk-FTEXUSHR.js';
|
|
3
|
+
export { ADDRESS_VERSION, DirectAccountAdapter, NoteStore, ProofWorkerManager, RATE_PRECISION, STARK_ADDRESS_VERSION, STARK_STEALTH_ADDRESS_PREFIX, STEALTH_ADDRESS_PREFIX, SWAP_EVENTS_ABI, SWAP_ORDER_CANCELLED_EVENT, SWAP_ORDER_CLAIMED_EVENT, SWAP_ORDER_FILLED_EVENT, SWAP_ORDER_PLACED_EVENT, StorableAccountAdapter, computeCancelKeyHash, computeFillPercentage, computeGiveAmount, computeNoteEncryptionKey, computeRate, computeTakeAmount, computeTotalBuyAmount, createOneTimeKeys, decodeStarkStealthAddress, decodeStealthAddress, detectAddressType, encodeStarkStealthAddress, encodeStealthAddress, filterOrdersByASP, filterOrdersByTokenPair, formatRate, generateCancelSecret, generateStarkStealthAddress, generateStealthAddress, generateUPPProofAsync, getCancelSecret, getOwnOrderIds, isFillerASPAccepted, isOrderActive, isValidStarkStealthAddress, isValidStealthAddress, removeCancelSecret, storeCancelSecret, verifyOwnership } from './chunk-2NKFTLPD.js';
|
|
4
|
+
export { buildTransfer, buildUPPTransferCircuitInputs, computeNullifier, formatOutputForContract, getDeployment, getDeploymentOrThrow, getMerkleProofsForNotes, getSupportedChainIds, getTokenAddress, hasDeployment, registerDeployment, syncMerkleTree } from './chunk-N2VHE47N.js';
|
|
3
5
|
export { ASP_TREE_DEPTH, STATE_TREE_DEPTH, formatProofForContract, generateProof, generateStealthProof, generateUPPProof, getStealthCircuitArtifacts, getUPPCircuitArtifacts, verifyProof } from './chunk-KR4GB6VC.js';
|
|
4
|
-
export { makeRpcIndexer } from './chunk-M6O7HMN7.js';
|
|
5
|
-
export { DEFAULT_KEY_DERIVATION_CONFIG, deriveDualKeysFromSignature, deriveKeysFromSignature, deriveNullifierKey, derivePerNoteKey, derivePerNoteKeyFromKeys, deriveStarkKeysFromSignature, deriveStarkPerNoteKey, deriveStarkPerNoteKeyFromKeys, exportViewingKeysForAudit, getKeyDerivationMessage, getViewingKeyFromExport, validateAuditKeyExport, verifyKeysMatchSignature } from './chunk-DTEAFJG7.js';
|
|
6
|
-
export { addPoints, computeSharedSecret, deriveDecryptionViewingKey, deriveEncryptionViewingKey, getBasePoint, getSubOrder, isOnCurve, mulPointScalar, packPoint, pointToTuple, privateToPublic, tupleToPoint } from './chunk-EHGH6TAW.js';
|
|
7
|
-
export { STARK_AMOUNT_SCALE, STARK_ASP_TREE_DEPTH, STARK_STATE_TREE_DEPTH, addressToM31, buildStarkTransferWitness, buildStarkWithdrawWitness, computeTransferPublicInputsSeed, computeWithdrawPublicInputsSeed, isStarkAligned, packM31Digest, scaleAmountForStark, splitSecretToM31Limbs, truncateToM31 } from './chunk-7T4CUE6E.js';
|
|
8
|
-
export { MAX_TREE_DEPTH, MerkleTree, buildMerkleTree, getMerkleProof, verifyMerkleProof } from './chunk-GPF72JFR.js';
|
|
9
|
-
export { DIGEST_SIZE, M31_P, SECRET_LIMBS, computeStarkCommitment, computeStarkNullifier, computeStarkOwnerHash, keccakHashTwo, keccakM31, splitToM31Limbs } from './chunk-6TFDBBAQ.js';
|
|
10
|
-
export { ADDRESS_VERSION, DirectAccountAdapter, NoteStore, ProofWorkerManager, RATE_PRECISION, STARK_ADDRESS_VERSION, STARK_STEALTH_ADDRESS_PREFIX, STEALTH_ADDRESS_PREFIX, SWAP_EVENTS_ABI, SWAP_ORDER_CANCELLED_EVENT, SWAP_ORDER_CLAIMED_EVENT, SWAP_ORDER_FILLED_EVENT, SWAP_ORDER_PLACED_EVENT, StorableAccountAdapter, computeCancelKeyHash, computeFillPercentage, computeGiveAmount, computeNoteEncryptionKey, computeRate, computeTakeAmount, computeTotalBuyAmount, createOneTimeKeys, decodeStarkStealthAddress, decodeStealthAddress, detectAddressType, encodeStarkStealthAddress, encodeStealthAddress, filterOrdersByASP, filterOrdersByTokenPair, formatRate, generateCancelSecret, generateStarkStealthAddress, generateStealthAddress, generateUPPProofAsync, getCancelSecret, getOwnOrderIds, isFillerASPAccepted, isOrderActive, isValidStarkStealthAddress, isValidStealthAddress, removeCancelSecret, storeCancelSecret, verifyOwnership } from './chunk-Q6BLTPWV.js';
|
|
11
6
|
export { DEMO_ASP_ID, DEMO_ASP_NAME, buildASPTree, computeMultiOriginASPRoot, computeSingleOriginASPRoot, createDemoASPRoot, generateASPProof, generateMultiOriginASPProof, generateSingleOriginASPProof, verifyASPProof } from './chunk-6IEYWJVS.js';
|
|
12
7
|
export { CIRCUIT_CDN_BASE, CIRCUIT_VERSION, CircuitArtifactCache } from './chunk-2BSIUEPO.js';
|
|
8
|
+
export { addPoints, computeSharedSecret, deriveDecryptionViewingKey, deriveEncryptionViewingKey, getBasePoint, getSubOrder, isOnCurve, mulPointScalar, packPoint, pointToTuple, privateToPublic, tupleToPoint } from './chunk-37RFFZU2.js';
|
|
9
|
+
export { STARK_AMOUNT_SCALE, STARK_ASP_TREE_DEPTH, STARK_STATE_TREE_DEPTH, addressToM31, buildStarkTransferWitness, buildStarkWithdrawWitness, computeTransferPublicInputsSeed, computeWithdrawPublicInputsSeed, isStarkAligned, packM31Digest, scaleAmountForStark, splitSecretToM31Limbs, truncateToM31 } from './chunk-AVSR443A.js';
|
|
10
|
+
export { DIGEST_SIZE, M31_P, SECRET_LIMBS, computeStarkCommitment, computeStarkNullifier, computeStarkOwnerHash, keccakHashTwo, keccakM31, splitToM31Limbs } from './chunk-H4NDMIPF.js';
|
|
11
|
+
export { MAX_TREE_DEPTH, MerkleTree, buildMerkleTree, getMerkleProof, verifyMerkleProof } from './chunk-GPF72JFR.js';
|
|
12
|
+
export { makeRpcIndexer } from './chunk-OG6TNEAT.js';
|
|
13
13
|
import './chunk-ABVALIIG.js';
|
|
14
|
-
export { bigintToBytes, bytesToBigint, bytesToHex, hexToBytes, randomBytes, randomFieldElement } from './chunk-
|
|
14
|
+
export { bigintToBytes, bytesToBigint, bytesToHex, hexToBytes, randomBytes, randomFieldElement } from './chunk-4E23V3AT.js';
|
|
15
15
|
export { BABYJUBJUB_SUBORDER, FIELD_PRIME, addressToField, fieldToAddress, isValidFieldElement, poseidon, poseidonHash, poseidonScalar, toFieldElement } from './chunk-5QSSX3KR.js';
|
|
16
16
|
import './chunk-Z6ZWNWWR.js';
|
|
17
17
|
|
package/dist/indexer/index.cjs
CHANGED
|
@@ -1,50 +1,101 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTKUOY2PQ_cjs = require('../chunk-TKUOY2PQ.cjs');
|
|
4
|
+
var chunkPGIV2GDM_cjs = require('../chunk-PGIV2GDM.cjs');
|
|
4
5
|
var chunkARH2SJM3_cjs = require('../chunk-ARH2SJM3.cjs');
|
|
6
|
+
require('../chunk-BCSMUH4L.cjs');
|
|
7
|
+
require('../chunk-HEHXSV47.cjs');
|
|
5
8
|
require('../chunk-G7VZBCD6.cjs');
|
|
6
9
|
|
|
7
10
|
|
|
8
11
|
|
|
9
12
|
Object.defineProperty(exports, "computeSearchTag", {
|
|
10
13
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkTKUOY2PQ_cjs.computeSearchTag; }
|
|
12
15
|
});
|
|
13
16
|
Object.defineProperty(exports, "createAutoAdapter", {
|
|
14
17
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkTKUOY2PQ_cjs.createAutoAdapter; }
|
|
16
19
|
});
|
|
17
20
|
Object.defineProperty(exports, "createLocalStorageAdapter", {
|
|
18
21
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkTKUOY2PQ_cjs.createLocalStorageAdapter; }
|
|
20
23
|
});
|
|
21
24
|
Object.defineProperty(exports, "createMemoryAdapter", {
|
|
22
25
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkTKUOY2PQ_cjs.createMemoryAdapter; }
|
|
24
27
|
});
|
|
25
28
|
Object.defineProperty(exports, "localStorageAdapter", {
|
|
26
29
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkTKUOY2PQ_cjs.localStorageAdapter; }
|
|
28
31
|
});
|
|
29
32
|
Object.defineProperty(exports, "makeRpcIndexer", {
|
|
30
33
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkTKUOY2PQ_cjs.makeRpcIndexer; }
|
|
32
35
|
});
|
|
33
36
|
Object.defineProperty(exports, "matchesSearchTag", {
|
|
34
37
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkTKUOY2PQ_cjs.matchesSearchTag; }
|
|
36
39
|
});
|
|
37
40
|
Object.defineProperty(exports, "memoryAdapter", {
|
|
38
41
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkTKUOY2PQ_cjs.memoryAdapter; }
|
|
40
43
|
});
|
|
41
44
|
Object.defineProperty(exports, "tryDecryptNote", {
|
|
42
45
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkTKUOY2PQ_cjs.tryDecryptNote; }
|
|
44
47
|
});
|
|
45
48
|
Object.defineProperty(exports, "unpackNoteData", {
|
|
46
49
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkTKUOY2PQ_cjs.unpackNoteData; }
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, "COMMITMENT_INSERTED_EVENT", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () { return chunkPGIV2GDM_cjs.COMMITMENT_INSERTED_EVENT; }
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "NULLIFIER_USED_ABI", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () { return chunkPGIV2GDM_cjs.NULLIFIER_USED_ABI; }
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "SHIELDED_EVENT", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () { return chunkPGIV2GDM_cjs.SHIELDED_EVENT; }
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "SWAP_ORDER_CANCELLED_EVENT", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () { return chunkPGIV2GDM_cjs.SWAP_ORDER_CANCELLED_EVENT; }
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "SWAP_ORDER_CLAIMED_EVENT", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () { return chunkPGIV2GDM_cjs.SWAP_ORDER_CLAIMED_EVENT; }
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "SWAP_ORDER_FILLED_EVENT", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () { return chunkPGIV2GDM_cjs.SWAP_ORDER_FILLED_EVENT; }
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(exports, "TRANSFERRED_EVENT", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () { return chunkPGIV2GDM_cjs.TRANSFERRED_EVENT; }
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, "createSyncEngine", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function () { return chunkPGIV2GDM_cjs.createSyncEngine; }
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "decryptCandidates", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () { return chunkPGIV2GDM_cjs.decryptCandidates; }
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(exports, "deriveDecryptionKey", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function () { return chunkPGIV2GDM_cjs.deriveDecryptionKey; }
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(exports, "tryDecryptHashBased", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function () { return chunkPGIV2GDM_cjs.tryDecryptHashBased; }
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "verifyNullifiers", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () { return chunkPGIV2GDM_cjs.verifyNullifiers; }
|
|
48
99
|
});
|
|
49
100
|
Object.defineProperty(exports, "createIndexedDBAdapter", {
|
|
50
101
|
enumerable: true,
|
package/dist/indexer/index.d.cts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { _ as ___index_js } from '../index-
|
|
4
|
-
export { m as makeRpcIndexer } from '../index-
|
|
5
|
-
import { Hex } from 'viem';
|
|
1
|
+
import { e as INoteStore, j as StorageAdapter } from '../index-a_f935pS.cjs';
|
|
2
|
+
export { a0 as CommitmentInsertedArgs, f as IndexedNote, I as Indexer, Z as IndexerState, Y as LiveSyncConfig, T as NoteFilters, Q as NoteStatus, a2 as NullifiedArgs, R as RpcIndexerConfig, $ as SerializedNote, a1 as StealthTransactArgs, X as SyncConfig, W as SyncProgress, k as SyncResult, _ as SyncState } from '../index-a_f935pS.cjs';
|
|
3
|
+
import { _ as ___index_js } from '../index-CzmvOht6.cjs';
|
|
4
|
+
export { m as makeRpcIndexer } from '../index-CzmvOht6.cjs';
|
|
5
|
+
import { Hex, Address } from 'viem';
|
|
6
6
|
import { P as Point } from '../merkle-mteVOlDf.cjs';
|
|
7
|
-
import '../transfer-
|
|
8
|
-
import '../keccak-m31-B_AqBbRF.cjs';
|
|
9
|
-
import '@permissionless-technologies/upc-sdk';
|
|
10
|
-
import 'react/jsx-runtime';
|
|
11
|
-
import 'react';
|
|
7
|
+
import { H as ShieldedNote } from '../transfer-_qaZXsv7.cjs';
|
|
12
8
|
import '../types-CJSbxv4q.cjs';
|
|
13
|
-
import '../
|
|
9
|
+
import '../keccak-m31-B_AqBbRF.cjs';
|
|
14
10
|
import '../keys/index.cjs';
|
|
15
11
|
import '../utils/index.cjs';
|
|
12
|
+
import '@permissionless-technologies/upc-sdk';
|
|
16
13
|
|
|
17
14
|
interface DecryptedNote {
|
|
18
15
|
amount: bigint;
|
|
@@ -94,6 +91,193 @@ declare function tryDecryptNote(sdk: SDK, keys: DecryptionKeys, ephemeralPubkey:
|
|
|
94
91
|
*/
|
|
95
92
|
declare function unpackNoteData(packed: Hex, debug?: boolean): UnpackedNoteData | null;
|
|
96
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Unified Sync Engine — framework-agnostic note discovery
|
|
96
|
+
*
|
|
97
|
+
* Scans blockchain events, decrypts notes, reconciles nullifiers,
|
|
98
|
+
* and writes directly to NoteStore. No React dependency.
|
|
99
|
+
*
|
|
100
|
+
* Replaces the ~530-line inline syncNotes callback from use-upp-account.tsx
|
|
101
|
+
* with a testable, reusable engine.
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
interface SyncEngineConfig {
|
|
105
|
+
/** viem PublicClient (or compatible) */
|
|
106
|
+
client: any;
|
|
107
|
+
/** Pool contract address */
|
|
108
|
+
contractAddress: Address;
|
|
109
|
+
/** Optional swap module address (swap events come from here) */
|
|
110
|
+
swapModuleAddress?: Address;
|
|
111
|
+
/** Owner hash for note ownership check */
|
|
112
|
+
ownerHash: bigint;
|
|
113
|
+
/** Spending secret for commitment verification */
|
|
114
|
+
spendingSecret: bigint;
|
|
115
|
+
/** Viewing secret for AES-GCM decryption */
|
|
116
|
+
viewingSecret: bigint;
|
|
117
|
+
/** NoteStore to write discovered notes into */
|
|
118
|
+
noteStore: INoteStore;
|
|
119
|
+
/** Block to start scanning from (default: 0) */
|
|
120
|
+
fromBlock?: number;
|
|
121
|
+
/** Poseidon hash function */
|
|
122
|
+
poseidonFn: (inputs: bigint[]) => Promise<bigint>;
|
|
123
|
+
}
|
|
124
|
+
interface SyncResult {
|
|
125
|
+
/** Number of newly discovered notes */
|
|
126
|
+
discovered: number;
|
|
127
|
+
/** Number of notes with corrected leafIndex or status */
|
|
128
|
+
repaired: number;
|
|
129
|
+
/** Total candidates scanned */
|
|
130
|
+
candidatesScanned: number;
|
|
131
|
+
}
|
|
132
|
+
interface LiveSyncConfig {
|
|
133
|
+
/** Polling interval in ms (default: 60000) */
|
|
134
|
+
intervalMs?: number;
|
|
135
|
+
}
|
|
136
|
+
interface SyncEngine {
|
|
137
|
+
/** Run a full sync cycle */
|
|
138
|
+
sync(): Promise<SyncResult>;
|
|
139
|
+
/** Start live sync (poll + optional WebSocket watch) */
|
|
140
|
+
startLiveSync(config?: LiveSyncConfig): void;
|
|
141
|
+
/** Stop live sync */
|
|
142
|
+
stopLiveSync(): void;
|
|
143
|
+
/** Whether live sync is currently active */
|
|
144
|
+
isLiveSyncing(): boolean;
|
|
145
|
+
}
|
|
146
|
+
declare function createSyncEngine(config: SyncEngineConfig): SyncEngine;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Hash-based note decryption for UPP
|
|
150
|
+
*
|
|
151
|
+
* Decrypts notes encrypted with the hash-based ownership scheme:
|
|
152
|
+
* 1. Fast ownerHash match (skip notes not belonging to us)
|
|
153
|
+
* 2. AES-GCM decryption with keccak256(viewingSecret) as key
|
|
154
|
+
* 3. Commitment verification: Poseidon(amount, ownerHash, blinding, origin, token)
|
|
155
|
+
*
|
|
156
|
+
* This is the correct decryption path for the current protocol (no ECDH).
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
/** A candidate note to attempt decryption on */
|
|
160
|
+
interface NoteCandidate {
|
|
161
|
+
commitment: string;
|
|
162
|
+
leafIndex: number;
|
|
163
|
+
packedData: string;
|
|
164
|
+
txHash?: string;
|
|
165
|
+
}
|
|
166
|
+
/** Configuration for the decryption engine */
|
|
167
|
+
interface HashDecryptionConfig {
|
|
168
|
+
ownerHash: bigint;
|
|
169
|
+
spendingSecret: bigint;
|
|
170
|
+
viewingSecret: bigint;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Derive an AES-GCM CryptoKey from the viewing secret.
|
|
174
|
+
* Reuse this key across all decryption attempts in a sync cycle.
|
|
175
|
+
*/
|
|
176
|
+
declare function deriveDecryptionKey(viewingSecret: bigint): Promise<CryptoKey>;
|
|
177
|
+
/**
|
|
178
|
+
* Try to decrypt a single packed note using hash-based ownership.
|
|
179
|
+
*
|
|
180
|
+
* Packed format: searchTag (8 bytes) + ownerHash (32 bytes) + AES-GCM encrypted payload
|
|
181
|
+
* Returns a ShieldedNote if decryption and verification succeed, null otherwise.
|
|
182
|
+
*/
|
|
183
|
+
declare function tryDecryptHashBased(candidate: NoteCandidate, config: HashDecryptionConfig, cryptoKey: CryptoKey, poseidonFn: (inputs: bigint[]) => Promise<bigint>): Promise<ShieldedNote | null>;
|
|
184
|
+
/**
|
|
185
|
+
* Batch decrypt candidates. Returns discovered notes.
|
|
186
|
+
*/
|
|
187
|
+
declare function decryptCandidates(candidates: NoteCandidate[], config: HashDecryptionConfig, poseidonFn: (inputs: bigint[]) => Promise<bigint>): Promise<ShieldedNote[]>;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* On-chain nullifier verification
|
|
191
|
+
*
|
|
192
|
+
* Reconciles local note state against on-chain nullifier status:
|
|
193
|
+
* - Forward check: unspent notes whose nullifier IS on-chain → mark spent
|
|
194
|
+
* - Reverse check: spent notes whose nullifier NOT on-chain → unmark spent
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
interface NullifierVerificationResult {
|
|
198
|
+
/** Number of notes whose status was corrected */
|
|
199
|
+
repaired: number;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Verify note spent/unspent status against on-chain nullifiers.
|
|
203
|
+
*
|
|
204
|
+
* Only checks SNARK notes (STARK nullifiers use a different scheme).
|
|
205
|
+
*/
|
|
206
|
+
declare function verifyNullifiers(noteStore: INoteStore, commitmentLeafMap: Map<string, number>, contractAddress: Address, client: any, poseidonFn: (inputs: bigint[]) => Promise<bigint>): Promise<NullifierVerificationResult>;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Centralized event ABI definitions for UPP contracts
|
|
210
|
+
*
|
|
211
|
+
* Single source of truth for all on-chain event schemas used by the sync engine.
|
|
212
|
+
*/
|
|
213
|
+
declare const SHIELDED_EVENT: {
|
|
214
|
+
type: "event";
|
|
215
|
+
name: string;
|
|
216
|
+
inputs: {
|
|
217
|
+
name: string;
|
|
218
|
+
type: string;
|
|
219
|
+
indexed: boolean;
|
|
220
|
+
}[];
|
|
221
|
+
};
|
|
222
|
+
declare const COMMITMENT_INSERTED_EVENT: {
|
|
223
|
+
type: "event";
|
|
224
|
+
name: string;
|
|
225
|
+
inputs: {
|
|
226
|
+
name: string;
|
|
227
|
+
type: string;
|
|
228
|
+
indexed: boolean;
|
|
229
|
+
}[];
|
|
230
|
+
};
|
|
231
|
+
declare const TRANSFERRED_EVENT: {
|
|
232
|
+
type: "event";
|
|
233
|
+
name: string;
|
|
234
|
+
inputs: {
|
|
235
|
+
name: string;
|
|
236
|
+
type: string;
|
|
237
|
+
indexed: boolean;
|
|
238
|
+
}[];
|
|
239
|
+
};
|
|
240
|
+
declare const SWAP_ORDER_FILLED_EVENT: {
|
|
241
|
+
type: "event";
|
|
242
|
+
name: string;
|
|
243
|
+
inputs: {
|
|
244
|
+
name: string;
|
|
245
|
+
type: string;
|
|
246
|
+
indexed: boolean;
|
|
247
|
+
}[];
|
|
248
|
+
};
|
|
249
|
+
declare const SWAP_ORDER_CLAIMED_EVENT: {
|
|
250
|
+
type: "event";
|
|
251
|
+
name: string;
|
|
252
|
+
inputs: {
|
|
253
|
+
name: string;
|
|
254
|
+
type: string;
|
|
255
|
+
indexed: boolean;
|
|
256
|
+
}[];
|
|
257
|
+
};
|
|
258
|
+
declare const SWAP_ORDER_CANCELLED_EVENT: {
|
|
259
|
+
type: "event";
|
|
260
|
+
name: string;
|
|
261
|
+
inputs: {
|
|
262
|
+
name: string;
|
|
263
|
+
type: string;
|
|
264
|
+
indexed: boolean;
|
|
265
|
+
}[];
|
|
266
|
+
};
|
|
267
|
+
declare const NULLIFIER_USED_ABI: {
|
|
268
|
+
type: "function";
|
|
269
|
+
name: string;
|
|
270
|
+
inputs: {
|
|
271
|
+
name: string;
|
|
272
|
+
type: string;
|
|
273
|
+
}[];
|
|
274
|
+
outputs: {
|
|
275
|
+
name: string;
|
|
276
|
+
type: string;
|
|
277
|
+
}[];
|
|
278
|
+
stateMutability: "view";
|
|
279
|
+
}[];
|
|
280
|
+
|
|
97
281
|
/**
|
|
98
282
|
* IndexedDB Storage Adapter
|
|
99
283
|
*
|
|
@@ -210,4 +394,4 @@ declare const memoryAdapter: StorageAdapter & {
|
|
|
210
394
|
*/
|
|
211
395
|
declare function createAutoAdapter(prefix?: string): StorageAdapter;
|
|
212
396
|
|
|
213
|
-
export { type DecryptedNote, type DecryptionKeys, StorageAdapter, type UnpackedNoteData, computeSearchTag, createAutoAdapter, createIndexedDBAdapter, createLocalStorageAdapter, createMemoryAdapter, indexedDBAdapter, localStorageAdapter, matchesSearchTag, memoryAdapter, tryDecryptNote, unpackNoteData };
|
|
397
|
+
export { COMMITMENT_INSERTED_EVENT, type DecryptedNote, type DecryptionKeys, type HashDecryptionConfig, NULLIFIER_USED_ABI, type NoteCandidate, type NullifierVerificationResult, SHIELDED_EVENT, SWAP_ORDER_CANCELLED_EVENT, SWAP_ORDER_CLAIMED_EVENT, SWAP_ORDER_FILLED_EVENT, StorageAdapter, type SyncEngine, type SyncEngineConfig, type LiveSyncConfig as SyncEngineLiveSyncConfig, type SyncResult as SyncEngineSyncResult, TRANSFERRED_EVENT, type UnpackedNoteData, computeSearchTag, createAutoAdapter, createIndexedDBAdapter, createLocalStorageAdapter, createMemoryAdapter, createSyncEngine, decryptCandidates, deriveDecryptionKey, indexedDBAdapter, localStorageAdapter, matchesSearchTag, memoryAdapter, tryDecryptHashBased, tryDecryptNote, unpackNoteData, verifyNullifiers };
|