@permissionless-technologies/upp-sdk 0.5.5 → 0.5.6

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 (90) hide show
  1. package/dist/{chunk-Q6BLTPWV.js → chunk-2NKFTLPD.js} +3 -3
  2. package/dist/{chunk-Q6BLTPWV.js.map → chunk-2NKFTLPD.js.map} +1 -1
  3. package/dist/{chunk-EHGH6TAW.js → chunk-37RFFZU2.js} +3 -3
  4. package/dist/{chunk-EHGH6TAW.js.map → chunk-37RFFZU2.js.map} +1 -1
  5. package/dist/{chunk-UQIM2KT3.js → chunk-4E23V3AT.js} +29 -4
  6. package/dist/chunk-4E23V3AT.js.map +1 -0
  7. package/dist/{chunk-53JACDGZ.js → chunk-A6IYQ7UF.js} +3 -3
  8. package/dist/chunk-A6IYQ7UF.js.map +1 -0
  9. package/dist/{chunk-7T4CUE6E.js → chunk-AVSR443A.js} +3 -3
  10. package/dist/{chunk-7T4CUE6E.js.map → chunk-AVSR443A.js.map} +1 -1
  11. package/dist/{chunk-UFEDJJSH.cjs → chunk-BCSMUH4L.cjs} +30 -3
  12. package/dist/chunk-BCSMUH4L.cjs.map +1 -0
  13. package/dist/{chunk-IYRCJAME.cjs → chunk-C3HXJ5A6.cjs} +9 -9
  14. package/dist/{chunk-IYRCJAME.cjs.map → chunk-C3HXJ5A6.cjs.map} +1 -1
  15. package/dist/{chunk-MEFCUBQC.js → chunk-CRUJLZV7.js} +5 -4
  16. package/dist/chunk-CRUJLZV7.js.map +1 -0
  17. package/dist/{chunk-DTEAFJG7.js → chunk-FTEXUSHR.js} +4 -4
  18. package/dist/{chunk-DTEAFJG7.js.map → chunk-FTEXUSHR.js.map} +1 -1
  19. package/dist/chunk-FW2U6TKQ.js +498 -0
  20. package/dist/chunk-FW2U6TKQ.js.map +1 -0
  21. package/dist/{chunk-6TFDBBAQ.js → chunk-H4NDMIPF.js} +3 -3
  22. package/dist/{chunk-6TFDBBAQ.js.map → chunk-H4NDMIPF.js.map} +1 -1
  23. package/dist/{chunk-DD2RTRPE.cjs → chunk-HVSP62AH.cjs} +22 -36
  24. package/dist/chunk-HVSP62AH.cjs.map +1 -0
  25. package/dist/{chunk-7BNJV2ZS.cjs → chunk-LKXC3OQT.cjs} +14 -14
  26. package/dist/{chunk-7BNJV2ZS.cjs.map → chunk-LKXC3OQT.cjs.map} +1 -1
  27. package/dist/{chunk-HB43C26P.cjs → chunk-NGXEIUQ6.cjs} +4 -4
  28. package/dist/chunk-NGXEIUQ6.cjs.map +1 -0
  29. package/dist/{chunk-KV2QFPSJ.cjs → chunk-P6E3LE7T.cjs} +5 -4
  30. package/dist/chunk-P6E3LE7T.cjs.map +1 -0
  31. package/dist/chunk-PGIV2GDM.cjs +511 -0
  32. package/dist/chunk-PGIV2GDM.cjs.map +1 -0
  33. package/dist/{chunk-M6O7HMN7.js → chunk-UHMHZQZV.js} +6 -20
  34. package/dist/chunk-UHMHZQZV.js.map +1 -0
  35. package/dist/{chunk-I5EKGD4P.cjs → chunk-XNSMPNY6.cjs} +4 -4
  36. package/dist/{chunk-I5EKGD4P.cjs.map → chunk-XNSMPNY6.cjs.map} +1 -1
  37. package/dist/{chunk-U3YFYMWF.cjs → chunk-XSJ5VVH4.cjs} +5 -5
  38. package/dist/{chunk-U3YFYMWF.cjs.map → chunk-XSJ5VVH4.cjs.map} +1 -1
  39. package/dist/{chunk-SWTNJPK5.cjs → chunk-Y6WCXYOC.cjs} +11 -11
  40. package/dist/{chunk-SWTNJPK5.cjs.map → chunk-Y6WCXYOC.cjs.map} +1 -1
  41. package/dist/core/index.cjs +63 -67
  42. package/dist/core/index.d.cts +2 -5
  43. package/dist/core/index.d.ts +2 -5
  44. package/dist/core/index.js +7 -7
  45. package/dist/crypto-FWREDAVI.js +8 -0
  46. package/dist/crypto-FWREDAVI.js.map +1 -0
  47. package/dist/crypto-IZKHHFDU.cjs +42 -0
  48. package/dist/crypto-IZKHHFDU.cjs.map +1 -0
  49. package/dist/{index-BRgBwiBM.d.ts → index-DLvLv3mg.d.ts} +11 -23
  50. package/dist/{index-D6YhhbRP.d.cts → index-DOiHUft6.d.cts} +3 -4
  51. package/dist/{index-DHW5lKcd.d.ts → index-DY0XAmFw.d.ts} +3 -4
  52. package/dist/{index-brLSTa0y.d.cts → index-KTJgQUxb.d.cts} +11 -23
  53. package/dist/index.cjs +240 -240
  54. package/dist/index.d.cts +4 -7
  55. package/dist/index.d.ts +4 -7
  56. package/dist/index.js +10 -10
  57. package/dist/indexer/index.cjs +62 -11
  58. package/dist/indexer/index.d.cts +196 -12
  59. package/dist/indexer/index.d.ts +196 -12
  60. package/dist/indexer/index.js +4 -1
  61. package/dist/keys/index.cjs +17 -17
  62. package/dist/keys/index.js +3 -3
  63. package/dist/react/index.cjs +214 -693
  64. package/dist/react/index.cjs.map +1 -1
  65. package/dist/react/index.d.cts +138 -6
  66. package/dist/react/index.d.ts +138 -6
  67. package/dist/react/index.js +193 -672
  68. package/dist/react/index.js.map +1 -1
  69. package/dist/{transfer-BVZAMEJH.js → transfer-2UYFZMIK.js} +4 -4
  70. package/dist/{transfer-BVZAMEJH.js.map → transfer-2UYFZMIK.js.map} +1 -1
  71. package/dist/{transfer-ZD76R7XF.cjs → transfer-6OW3XKVC.cjs} +10 -10
  72. package/dist/{transfer-ZD76R7XF.cjs.map → transfer-6OW3XKVC.cjs.map} +1 -1
  73. package/dist/{transfer-p-NXHdGY.d.cts → transfer-C1XU_z-6.d.cts} +46 -156
  74. package/dist/{transfer-BxiDgCvx.d.ts → transfer-DgjxZlR7.d.ts} +46 -156
  75. package/dist/utils/index.cjs +44 -44
  76. package/dist/utils/index.d.cts +186 -5
  77. package/dist/utils/index.d.ts +186 -5
  78. package/dist/utils/index.js +4 -4
  79. package/package.json +1 -1
  80. package/src/deployments/31337.json +2 -1
  81. package/dist/chunk-53JACDGZ.js.map +0 -1
  82. package/dist/chunk-DD2RTRPE.cjs.map +0 -1
  83. package/dist/chunk-HB43C26P.cjs.map +0 -1
  84. package/dist/chunk-KV2QFPSJ.cjs.map +0 -1
  85. package/dist/chunk-M6O7HMN7.js.map +0 -1
  86. package/dist/chunk-MEFCUBQC.js.map +0 -1
  87. package/dist/chunk-UFEDJJSH.cjs.map +0 -1
  88. package/dist/chunk-UQIM2KT3.js.map +0 -1
  89. package/dist/stark-BcTD1OaJ.d.cts +0 -185
  90. package/dist/stark-BcTD1OaJ.d.ts +0 -185
@@ -1,13 +1,145 @@
1
- import { aI as NoteCreationResult, r as ProofWorkerManager, j as DownloadProgress, aJ as PlonkProofStruct, aK as ShieldedNote, a0 as TransferStage, P as PlonkProvingStage, X as SwapOrderEvent, a2 as UPPCircuitType, f as CircuitCacheStatus } from '../transfer-p-NXHdGY.cjs';
2
- export { A as ASPProof, aR as ASP_TREE_DEPTH, C as CIRCUIT_CDN_BASE, c as CIRCUIT_VERSION, d as CircuitArtifactCache, aP as IndexerConfig, aO as ProofSystemType, aQ as SignTypedDataFn, aN as UPPAccountContextType, aM as UPPAccountProvider, a6 as buildASPTree, ac as computeMultiOriginASPRoot, af as computeSingleOriginASPRoot, ao as generateASPProof, aq as generateMultiOriginASPProof, as as generateSingleOriginASPProof, av as generateUPPProofAsync, aL as useUPPAccount } from '../transfer-p-NXHdGY.cjs';
3
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
2
  import * as react from 'react';
5
- import { CSSProperties } from 'react';
3
+ import { ReactNode, CSSProperties } from 'react';
4
+ import { Hex, Address, PublicClient } from 'viem';
5
+ import { M as MasterKeys, b as StarkMasterKeys } from '../types-CJSbxv4q.cjs';
6
+ import { H as ShieldedNote, aL as NoteCreationResult, s as ProofSystem, t as ProofWorkerManager, j as DownloadProgress, aM as PlonkProofStruct, a3 as TransferStage, P as PlonkProvingStage, _ as SwapOrderEvent, a5 as UPPCircuitType, f as CircuitCacheStatus } from '../transfer-C1XU_z-6.cjs';
7
+ export { A as ASPProof, aN as ASP_TREE_DEPTH, C as CIRCUIT_CDN_BASE, c as CIRCUIT_VERSION, d as CircuitArtifactCache, a9 as buildASPTree, af as computeMultiOriginASPRoot, ai as computeSingleOriginASPRoot, ar as generateASPProof, at as generateMultiOriginASPProof, av as generateSingleOriginASPProof, ay as generateUPPProofAsync } from '../transfer-C1XU_z-6.cjs';
6
8
  import { P as Point } from '../merkle-mteVOlDf.cjs';
7
- import { Address, Hex, PublicClient } from 'viem';
8
9
  import '../keccak-m31-B_AqBbRF.cjs';
9
10
  import '@permissionless-technologies/upc-sdk';
10
- import '../types-CJSbxv4q.cjs';
11
+
12
+ /**
13
+ * EIP-712 Constants for UPP wallet signing
14
+ *
15
+ * Used by UPPAccountProvider to derive private keys from wallet signatures.
16
+ */
17
+
18
+ /**
19
+ * Function signature for EIP-712 typed data signing.
20
+ * Compatible with wagmi's signTypedDataAsync.
21
+ */
22
+ type SignTypedDataFn = (args: {
23
+ domain: {
24
+ name: string;
25
+ version: string;
26
+ chainId: number;
27
+ };
28
+ types: Record<string, Array<{
29
+ name: string;
30
+ type: string;
31
+ }>>;
32
+ primaryType: string;
33
+ message: Record<string, unknown>;
34
+ }) => Promise<Hex>;
35
+
36
+ /** @deprecated Use ProofSystem from core/types.ts */
37
+ type ProofSystemType = ProofSystem;
38
+ /**
39
+ * Indexer configuration for advanced usage
40
+ */
41
+ interface IndexerConfig {
42
+ /** Enable IndexedDB storage (default: true if available) */
43
+ useIndexedDB?: boolean;
44
+ /** Custom storage prefix for multi-account support */
45
+ storagePrefix?: string;
46
+ /** Batch size for RPC scanning (default: 200, adapts on rate limits) */
47
+ batchSize?: number;
48
+ /** Sync interval for live sync in ms (default: 30000) */
49
+ liveSyncIntervalMs?: number;
50
+ /** Starting block for new accounts (skips blocks before account creation) */
51
+ fromBlock?: number;
52
+ /** Pool contract address (required for indexer) */
53
+ contractAddress?: Address;
54
+ /** UPPSwapModule proxy address (swap events come from this contract, not the pool) */
55
+ swapModuleAddress?: Address;
56
+ }
57
+ /**
58
+ * Context type for UPP Account
59
+ */
60
+ interface UPPAccountContextType {
61
+ /** SNARK master keys (null if not setup) */
62
+ masterKeys: MasterKeys | null;
63
+ /** STARK master keys (null if not setup) */
64
+ starkMasterKeys: StarkMasterKeys | null;
65
+ /** Connected wallet address */
66
+ ethAddress: string | null;
67
+ /** Owner hash (public identifier, hex) — SNARK */
68
+ ownerHash: string | null;
69
+ /** Stealth address (bech32m encoded, 0zk prefix) — SNARK */
70
+ stealthAddress: string | null;
71
+ /** STARK stealth address (bech32m encoded, 0zs prefix) */
72
+ starkStealthAddress: string | null;
73
+ /** All notes */
74
+ notes: ShieldedNote[];
75
+ /** Unspent notes */
76
+ unspentNotes: ShieldedNote[];
77
+ /** Total balance of unspent notes */
78
+ balance: bigint;
79
+ /** Whether account is set up */
80
+ isSetup: boolean;
81
+ /** Whether SDK is loading/initializing */
82
+ isLoading: boolean;
83
+ /** Whether crypto is ready */
84
+ cryptoReady: boolean;
85
+ /** Whether sync is in progress */
86
+ isSyncing: boolean;
87
+ /** Last synced block number */
88
+ lastSyncedBlock: number;
89
+ /** Set up a new account from wallet signature (low-level) */
90
+ setupAccount: (signature: Hex) => Promise<void>;
91
+ /** Connect private account via EIP-712 wallet signature (requires wagmi signTypedData) */
92
+ connect: (password?: string) => Promise<void>;
93
+ /** Whether a connect operation is in progress */
94
+ isConnecting: boolean;
95
+ /** Clear account and logout */
96
+ logout: () => void;
97
+ /** Alias for logout */
98
+ disconnect: () => void;
99
+ /** Add a note to the account */
100
+ addNote: (note: ShieldedNote) => void;
101
+ /** Mark a note as spent */
102
+ markNoteSpent: (commitment: string) => void;
103
+ /** Create note for self (e.g., shield or change output) */
104
+ createNoteForSelf: (amount: bigint, origin: bigint, token: bigint) => Promise<NoteCreationResult>;
105
+ /** Get owner hash */
106
+ getOwnerHash: () => bigint | null;
107
+ /** Select optimal circuit for a given amount */
108
+ selectOptimalCircuit: (requiredAmount: bigint, tokenAddress?: string) => {
109
+ circuit: '1x2' | '2x2' | null;
110
+ selectedNotes: ShieldedNote[];
111
+ error?: string;
112
+ };
113
+ /** Sync notes from blockchain (requires client to be passed in) */
114
+ syncNotes: (contractAddress: Address, client: any) => Promise<number>;
115
+ /** Start live sync (polls for new notes at interval) */
116
+ startLiveSync: (contractAddress: Address, client: any) => void;
117
+ /** Stop live sync */
118
+ stopLiveSync: () => void;
119
+ /** Whether live sync is active */
120
+ isLiveSyncing: boolean;
121
+ }
122
+
123
+ interface UPPAccountProviderProps {
124
+ children: ReactNode;
125
+ /** Ethereum address of connected wallet */
126
+ ethAddress?: string;
127
+ /** Chain ID */
128
+ chainId?: number;
129
+ /** Indexer configuration */
130
+ indexerConfig?: IndexerConfig;
131
+ /** EIP-712 signing function (from wagmi's useSignTypedData().signTypedDataAsync) */
132
+ signTypedData?: SignTypedDataFn;
133
+ /** Public client for chain fingerprint validation (e.g. from wagmi usePublicClient) */
134
+ publicClient?: any;
135
+ /** Active proof system — filters unspentNotes and balance to only show spendable notes */
136
+ activeProofSystem?: ProofSystem;
137
+ }
138
+ declare function UPPAccountProvider({ children, ethAddress, chainId, indexerConfig, signTypedData, publicClient: publicClientProp, activeProofSystem, }: UPPAccountProviderProps): react_jsx_runtime.JSX.Element;
139
+ /**
140
+ * Hook to access UPP Account context
141
+ */
142
+ declare function useUPPAccount(): UPPAccountContextType;
11
143
 
12
144
  interface UPPPrivateButtonProps {
13
145
  /** Additional inline styles for the outer button */
@@ -903,4 +1035,4 @@ interface UsePrivateBalanceReturn {
903
1035
  }
904
1036
  declare function usePrivateBalance(config: PrivateBalanceConfig): UsePrivateBalanceReturn;
905
1037
 
906
- export { type AvatarData, type AvatarShape, type CancelOrderBuildData, type CancelOrderParams, CircuitCacheStatus, type ClaimOrderBuildData, type ClaimOrderParams, DownloadProgress, type FillOrderBuildData, type FillOrderParams, NoteCreationResult, type PersonalASPConfig, type PersonalASPInfo, type PlaceOrderBuildData, type PlaceOrderParams, PlonkProvingStage, type PoolTransferBuildData, type PoolTransferConfig, type PoolTransferParams, type PrivateBalanceConfig, ProofWorkerManager, type ShieldBuildData, type ShieldConfig, type ShieldParams, ShieldedNote, type SplitNoteBuildData, type SplitNoteParams, type SwapConfig, type SwapOrderBookConfig, type SwapStage, type TokenBalanceEntry, type TokenListItem, TransferStage, UPPAvatar, type UPPAvatarProps, UPPModal, type UPPModalProps, UPPPrivateButton, type UPPPrivateButtonProps, type UseCircuitCacheReturn, type UsePersonalASPReturn, type UsePoolTransferReturn, type UsePrivateBalanceReturn, type UseShieldReturn, type UseSwapOrderBookReturn, type UseSwapReturn, type UseWithdrawReturn, type WithdrawBuildData, type WithdrawConfig, type WithdrawParams, generateAvatarData, renderAvatarSVG, storePersonalASPId, useCircuitCache, usePersonalASP, usePoolTransfer, usePrivateBalance, useProofWorker, useShield, useSwap, useSwapOrderBook, useUPPCrypto, useWithdraw };
1038
+ export { type AvatarData, type AvatarShape, type CancelOrderBuildData, type CancelOrderParams, CircuitCacheStatus, type ClaimOrderBuildData, type ClaimOrderParams, DownloadProgress, type FillOrderBuildData, type FillOrderParams, type IndexerConfig, NoteCreationResult, type PersonalASPConfig, type PersonalASPInfo, type PlaceOrderBuildData, type PlaceOrderParams, PlonkProvingStage, type PoolTransferBuildData, type PoolTransferConfig, type PoolTransferParams, type PrivateBalanceConfig, ProofSystem, type ProofSystemType, ProofWorkerManager, type ShieldBuildData, type ShieldConfig, type ShieldParams, ShieldedNote, type SignTypedDataFn, type SplitNoteBuildData, type SplitNoteParams, type SwapConfig, type SwapOrderBookConfig, type SwapStage, type TokenBalanceEntry, type TokenListItem, TransferStage, type UPPAccountContextType, UPPAccountProvider, UPPAvatar, type UPPAvatarProps, UPPModal, type UPPModalProps, UPPPrivateButton, type UPPPrivateButtonProps, type UseCircuitCacheReturn, type UsePersonalASPReturn, type UsePoolTransferReturn, type UsePrivateBalanceReturn, type UseShieldReturn, type UseSwapOrderBookReturn, type UseSwapReturn, type UseWithdrawReturn, type WithdrawBuildData, type WithdrawConfig, type WithdrawParams, generateAvatarData, renderAvatarSVG, storePersonalASPId, useCircuitCache, usePersonalASP, usePoolTransfer, usePrivateBalance, useProofWorker, useShield, useSwap, useSwapOrderBook, useUPPAccount, useUPPCrypto, useWithdraw };
@@ -1,13 +1,145 @@
1
- import { aI as NoteCreationResult, r as ProofWorkerManager, j as DownloadProgress, aJ as PlonkProofStruct, aK as ShieldedNote, a0 as TransferStage, P as PlonkProvingStage, X as SwapOrderEvent, a2 as UPPCircuitType, f as CircuitCacheStatus } from '../transfer-BxiDgCvx.js';
2
- export { A as ASPProof, aR as ASP_TREE_DEPTH, C as CIRCUIT_CDN_BASE, c as CIRCUIT_VERSION, d as CircuitArtifactCache, aP as IndexerConfig, aO as ProofSystemType, aQ as SignTypedDataFn, aN as UPPAccountContextType, aM as UPPAccountProvider, a6 as buildASPTree, ac as computeMultiOriginASPRoot, af as computeSingleOriginASPRoot, ao as generateASPProof, aq as generateMultiOriginASPProof, as as generateSingleOriginASPProof, av as generateUPPProofAsync, aL as useUPPAccount } from '../transfer-BxiDgCvx.js';
3
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
2
  import * as react from 'react';
5
- import { CSSProperties } from 'react';
3
+ import { ReactNode, CSSProperties } from 'react';
4
+ import { Hex, Address, PublicClient } from 'viem';
5
+ import { M as MasterKeys, b as StarkMasterKeys } from '../types-mLybMxNR.js';
6
+ import { H as ShieldedNote, aL as NoteCreationResult, s as ProofSystem, t as ProofWorkerManager, j as DownloadProgress, aM as PlonkProofStruct, a3 as TransferStage, P as PlonkProvingStage, _ as SwapOrderEvent, a5 as UPPCircuitType, f as CircuitCacheStatus } from '../transfer-DgjxZlR7.js';
7
+ export { A as ASPProof, aN as ASP_TREE_DEPTH, C as CIRCUIT_CDN_BASE, c as CIRCUIT_VERSION, d as CircuitArtifactCache, a9 as buildASPTree, af as computeMultiOriginASPRoot, ai as computeSingleOriginASPRoot, ar as generateASPProof, at as generateMultiOriginASPProof, av as generateSingleOriginASPProof, ay as generateUPPProofAsync } from '../transfer-DgjxZlR7.js';
6
8
  import { P as Point } from '../merkle-mteVOlDf.js';
7
- import { Address, Hex, PublicClient } from 'viem';
8
9
  import '../keccak-m31-B_AqBbRF.js';
9
10
  import '@permissionless-technologies/upc-sdk';
10
- import '../types-mLybMxNR.js';
11
+
12
+ /**
13
+ * EIP-712 Constants for UPP wallet signing
14
+ *
15
+ * Used by UPPAccountProvider to derive private keys from wallet signatures.
16
+ */
17
+
18
+ /**
19
+ * Function signature for EIP-712 typed data signing.
20
+ * Compatible with wagmi's signTypedDataAsync.
21
+ */
22
+ type SignTypedDataFn = (args: {
23
+ domain: {
24
+ name: string;
25
+ version: string;
26
+ chainId: number;
27
+ };
28
+ types: Record<string, Array<{
29
+ name: string;
30
+ type: string;
31
+ }>>;
32
+ primaryType: string;
33
+ message: Record<string, unknown>;
34
+ }) => Promise<Hex>;
35
+
36
+ /** @deprecated Use ProofSystem from core/types.ts */
37
+ type ProofSystemType = ProofSystem;
38
+ /**
39
+ * Indexer configuration for advanced usage
40
+ */
41
+ interface IndexerConfig {
42
+ /** Enable IndexedDB storage (default: true if available) */
43
+ useIndexedDB?: boolean;
44
+ /** Custom storage prefix for multi-account support */
45
+ storagePrefix?: string;
46
+ /** Batch size for RPC scanning (default: 200, adapts on rate limits) */
47
+ batchSize?: number;
48
+ /** Sync interval for live sync in ms (default: 30000) */
49
+ liveSyncIntervalMs?: number;
50
+ /** Starting block for new accounts (skips blocks before account creation) */
51
+ fromBlock?: number;
52
+ /** Pool contract address (required for indexer) */
53
+ contractAddress?: Address;
54
+ /** UPPSwapModule proxy address (swap events come from this contract, not the pool) */
55
+ swapModuleAddress?: Address;
56
+ }
57
+ /**
58
+ * Context type for UPP Account
59
+ */
60
+ interface UPPAccountContextType {
61
+ /** SNARK master keys (null if not setup) */
62
+ masterKeys: MasterKeys | null;
63
+ /** STARK master keys (null if not setup) */
64
+ starkMasterKeys: StarkMasterKeys | null;
65
+ /** Connected wallet address */
66
+ ethAddress: string | null;
67
+ /** Owner hash (public identifier, hex) — SNARK */
68
+ ownerHash: string | null;
69
+ /** Stealth address (bech32m encoded, 0zk prefix) — SNARK */
70
+ stealthAddress: string | null;
71
+ /** STARK stealth address (bech32m encoded, 0zs prefix) */
72
+ starkStealthAddress: string | null;
73
+ /** All notes */
74
+ notes: ShieldedNote[];
75
+ /** Unspent notes */
76
+ unspentNotes: ShieldedNote[];
77
+ /** Total balance of unspent notes */
78
+ balance: bigint;
79
+ /** Whether account is set up */
80
+ isSetup: boolean;
81
+ /** Whether SDK is loading/initializing */
82
+ isLoading: boolean;
83
+ /** Whether crypto is ready */
84
+ cryptoReady: boolean;
85
+ /** Whether sync is in progress */
86
+ isSyncing: boolean;
87
+ /** Last synced block number */
88
+ lastSyncedBlock: number;
89
+ /** Set up a new account from wallet signature (low-level) */
90
+ setupAccount: (signature: Hex) => Promise<void>;
91
+ /** Connect private account via EIP-712 wallet signature (requires wagmi signTypedData) */
92
+ connect: (password?: string) => Promise<void>;
93
+ /** Whether a connect operation is in progress */
94
+ isConnecting: boolean;
95
+ /** Clear account and logout */
96
+ logout: () => void;
97
+ /** Alias for logout */
98
+ disconnect: () => void;
99
+ /** Add a note to the account */
100
+ addNote: (note: ShieldedNote) => void;
101
+ /** Mark a note as spent */
102
+ markNoteSpent: (commitment: string) => void;
103
+ /** Create note for self (e.g., shield or change output) */
104
+ createNoteForSelf: (amount: bigint, origin: bigint, token: bigint) => Promise<NoteCreationResult>;
105
+ /** Get owner hash */
106
+ getOwnerHash: () => bigint | null;
107
+ /** Select optimal circuit for a given amount */
108
+ selectOptimalCircuit: (requiredAmount: bigint, tokenAddress?: string) => {
109
+ circuit: '1x2' | '2x2' | null;
110
+ selectedNotes: ShieldedNote[];
111
+ error?: string;
112
+ };
113
+ /** Sync notes from blockchain (requires client to be passed in) */
114
+ syncNotes: (contractAddress: Address, client: any) => Promise<number>;
115
+ /** Start live sync (polls for new notes at interval) */
116
+ startLiveSync: (contractAddress: Address, client: any) => void;
117
+ /** Stop live sync */
118
+ stopLiveSync: () => void;
119
+ /** Whether live sync is active */
120
+ isLiveSyncing: boolean;
121
+ }
122
+
123
+ interface UPPAccountProviderProps {
124
+ children: ReactNode;
125
+ /** Ethereum address of connected wallet */
126
+ ethAddress?: string;
127
+ /** Chain ID */
128
+ chainId?: number;
129
+ /** Indexer configuration */
130
+ indexerConfig?: IndexerConfig;
131
+ /** EIP-712 signing function (from wagmi's useSignTypedData().signTypedDataAsync) */
132
+ signTypedData?: SignTypedDataFn;
133
+ /** Public client for chain fingerprint validation (e.g. from wagmi usePublicClient) */
134
+ publicClient?: any;
135
+ /** Active proof system — filters unspentNotes and balance to only show spendable notes */
136
+ activeProofSystem?: ProofSystem;
137
+ }
138
+ declare function UPPAccountProvider({ children, ethAddress, chainId, indexerConfig, signTypedData, publicClient: publicClientProp, activeProofSystem, }: UPPAccountProviderProps): react_jsx_runtime.JSX.Element;
139
+ /**
140
+ * Hook to access UPP Account context
141
+ */
142
+ declare function useUPPAccount(): UPPAccountContextType;
11
143
 
12
144
  interface UPPPrivateButtonProps {
13
145
  /** Additional inline styles for the outer button */
@@ -903,4 +1035,4 @@ interface UsePrivateBalanceReturn {
903
1035
  }
904
1036
  declare function usePrivateBalance(config: PrivateBalanceConfig): UsePrivateBalanceReturn;
905
1037
 
906
- export { type AvatarData, type AvatarShape, type CancelOrderBuildData, type CancelOrderParams, CircuitCacheStatus, type ClaimOrderBuildData, type ClaimOrderParams, DownloadProgress, type FillOrderBuildData, type FillOrderParams, NoteCreationResult, type PersonalASPConfig, type PersonalASPInfo, type PlaceOrderBuildData, type PlaceOrderParams, PlonkProvingStage, type PoolTransferBuildData, type PoolTransferConfig, type PoolTransferParams, type PrivateBalanceConfig, ProofWorkerManager, type ShieldBuildData, type ShieldConfig, type ShieldParams, ShieldedNote, type SplitNoteBuildData, type SplitNoteParams, type SwapConfig, type SwapOrderBookConfig, type SwapStage, type TokenBalanceEntry, type TokenListItem, TransferStage, UPPAvatar, type UPPAvatarProps, UPPModal, type UPPModalProps, UPPPrivateButton, type UPPPrivateButtonProps, type UseCircuitCacheReturn, type UsePersonalASPReturn, type UsePoolTransferReturn, type UsePrivateBalanceReturn, type UseShieldReturn, type UseSwapOrderBookReturn, type UseSwapReturn, type UseWithdrawReturn, type WithdrawBuildData, type WithdrawConfig, type WithdrawParams, generateAvatarData, renderAvatarSVG, storePersonalASPId, useCircuitCache, usePersonalASP, usePoolTransfer, usePrivateBalance, useProofWorker, useShield, useSwap, useSwapOrderBook, useUPPCrypto, useWithdraw };
1038
+ export { type AvatarData, type AvatarShape, type CancelOrderBuildData, type CancelOrderParams, CircuitCacheStatus, type ClaimOrderBuildData, type ClaimOrderParams, DownloadProgress, type FillOrderBuildData, type FillOrderParams, type IndexerConfig, NoteCreationResult, type PersonalASPConfig, type PersonalASPInfo, type PlaceOrderBuildData, type PlaceOrderParams, PlonkProvingStage, type PoolTransferBuildData, type PoolTransferConfig, type PoolTransferParams, type PrivateBalanceConfig, ProofSystem, type ProofSystemType, ProofWorkerManager, type ShieldBuildData, type ShieldConfig, type ShieldParams, ShieldedNote, type SignTypedDataFn, type SplitNoteBuildData, type SplitNoteParams, type SwapConfig, type SwapOrderBookConfig, type SwapStage, type TokenBalanceEntry, type TokenListItem, TransferStage, type UPPAccountContextType, UPPAccountProvider, UPPAvatar, type UPPAvatarProps, UPPModal, type UPPModalProps, UPPPrivateButton, type UPPPrivateButtonProps, type UseCircuitCacheReturn, type UsePersonalASPReturn, type UsePoolTransferReturn, type UsePrivateBalanceReturn, type UseShieldReturn, type UseSwapOrderBookReturn, type UseSwapReturn, type UseWithdrawReturn, type WithdrawBuildData, type WithdrawConfig, type WithdrawParams, generateAvatarData, renderAvatarSVG, storePersonalASPId, useCircuitCache, usePersonalASP, usePoolTransfer, usePrivateBalance, useProofWorker, useShield, useSwap, useSwapOrderBook, useUPPAccount, useUPPCrypto, useWithdraw };