@utxopia/sdk 0.1.0-alpha.2 → 0.1.0-alpha.3
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/README.md +214 -108
- package/{packages/sdk/dist → dist}/client.d.ts +25 -1
- package/{packages/sdk/dist → dist}/client.js +36 -1
- package/{packages/sdk/dist → dist}/crypto-ed25519.d.ts +14 -0
- package/{packages/sdk/dist → dist}/crypto-ed25519.js +14 -0
- package/{packages/sdk/dist → dist}/index.d.ts +3 -3
- package/{packages/sdk/dist → dist}/index.js +3 -3
- package/{packages/sdk/dist → dist}/instructions.d.ts +28 -11
- package/{packages/sdk/dist → dist}/instructions.js +45 -15
- package/{packages/sdk/dist → dist}/stealth.d.ts +104 -9
- package/{packages/sdk/dist → dist}/stealth.js +146 -14
- package/{packages/sdk/dist → dist}/taproot.d.ts +39 -2
- package/{packages/sdk/dist → dist}/taproot.js +54 -2
- package/package.json +86 -63
- package/src/announcement-client.ts +457 -0
- package/src/auditor-ciphertext.ts +181 -0
- package/src/auditor.ts +409 -0
- package/src/bitcoin/ika.ts +103 -0
- package/src/bitcoin/index.ts +5 -0
- package/src/bound-params.ts +322 -0
- package/src/chadbuffer.ts +603 -0
- package/src/circomlibjs.d.ts +51 -0
- package/src/claim-link.ts +53 -0
- package/src/client.ts +638 -0
- package/src/commitment-tree.ts +736 -0
- package/src/config.ts +772 -0
- package/src/core/esplora.ts +332 -0
- package/src/core/mempool.ts +159 -0
- package/src/crypto-babyjub.ts +385 -0
- package/src/crypto-ed25519.ts +297 -0
- package/src/crypto.ts +199 -0
- package/src/event-client.ts +231 -0
- package/src/events.ts +384 -0
- package/src/explorer.ts +300 -0
- package/src/index.ts +902 -0
- package/src/instructions.ts +2820 -0
- package/src/keys.ts +1228 -0
- package/src/logger.ts +41 -0
- package/src/magicblock.ts +278 -0
- package/src/merkle.ts +197 -0
- package/src/note.ts +754 -0
- package/src/pda.ts +516 -0
- package/src/pool-state.ts +176 -0
- package/src/poseidon.ts +175 -0
- package/src/prover/index.ts +19 -0
- package/src/prover/mobile.ts +303 -0
- package/src/prover/web.ts +771 -0
- package/src/psbt.ts +333 -0
- package/src/selective-disclosure.ts +284 -0
- package/src/sender-memo.ts +343 -0
- package/src/snarkjs.d.ts +19 -0
- package/src/sns-resolver.ts +333 -0
- package/src/solana/connection.ts +189 -0
- package/src/solana/priority-fee.ts +201 -0
- package/src/spend-doc.ts +163 -0
- package/src/stealth.ts +1477 -0
- package/src/taproot.ts +707 -0
- package/src/token-registry.ts +207 -0
- package/src/utils/encoding.ts +33 -0
- package/src/vk-registry.ts +295 -0
- package/LICENSE +0 -21
- package/packages/btc-client/src/esplora-client.ts +0 -153
- package/packages/btc-client/src/index.ts +0 -3
- package/packages/btc-client/src/op-return.ts +0 -93
- package/packages/btc-client/src/types.ts +0 -112
- package/packages/sdk/README.md +0 -277
- /package/{packages/sdk/dist → dist}/announcement-client.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/announcement-client.js +0 -0
- /package/{packages/sdk/dist → dist}/auditor-ciphertext.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/auditor-ciphertext.js +0 -0
- /package/{packages/sdk/dist → dist}/auditor.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/auditor.js +0 -0
- /package/{packages/sdk/dist → dist}/bitcoin/ika.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/bitcoin/ika.js +0 -0
- /package/{packages/sdk/dist → dist}/bitcoin/index.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/bitcoin/index.js +0 -0
- /package/{packages/sdk/dist → dist}/bound-params.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/bound-params.js +0 -0
- /package/{packages/sdk/dist → dist}/chadbuffer.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/chadbuffer.js +0 -0
- /package/{packages/sdk/dist → dist}/claim-link.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/claim-link.js +0 -0
- /package/{packages/sdk/dist → dist}/commitment-tree.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/commitment-tree.js +0 -0
- /package/{packages/sdk/dist → dist}/config.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/config.js +0 -0
- /package/{packages/sdk/dist → dist}/core/esplora.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/core/esplora.js +0 -0
- /package/{packages/sdk/dist → dist}/core/mempool.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/core/mempool.js +0 -0
- /package/{packages/sdk/dist → dist}/crypto-babyjub.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/crypto-babyjub.js +0 -0
- /package/{packages/sdk/dist → dist}/crypto.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/crypto.js +0 -0
- /package/{packages/sdk/dist → dist}/event-client.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/event-client.js +0 -0
- /package/{packages/sdk/dist → dist}/events.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/events.js +0 -0
- /package/{packages/sdk/dist → dist}/explorer.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/explorer.js +0 -0
- /package/{packages/sdk/dist → dist}/keys.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/keys.js +0 -0
- /package/{packages/sdk/dist → dist}/logger.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/logger.js +0 -0
- /package/{packages/sdk/dist → dist}/magicblock.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/magicblock.js +0 -0
- /package/{packages/sdk/dist → dist}/merkle.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/merkle.js +0 -0
- /package/{packages/sdk/dist → dist}/note.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/note.js +0 -0
- /package/{packages/sdk/dist → dist}/pda.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/pda.js +0 -0
- /package/{packages/sdk/dist → dist}/pool-state.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/pool-state.js +0 -0
- /package/{packages/sdk/dist → dist}/poseidon.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/poseidon.js +0 -0
- /package/{packages/sdk/dist → dist}/prover/index.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/prover/index.js +0 -0
- /package/{packages/sdk/dist → dist}/prover/mobile.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/prover/mobile.js +0 -0
- /package/{packages/sdk/dist → dist}/prover/web.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/prover/web.js +0 -0
- /package/{packages/sdk/dist → dist}/psbt.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/psbt.js +0 -0
- /package/{packages/sdk/dist → dist}/selective-disclosure.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/selective-disclosure.js +0 -0
- /package/{packages/sdk/dist → dist}/sender-memo.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/sender-memo.js +0 -0
- /package/{packages/sdk/dist → dist}/sns-resolver.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/sns-resolver.js +0 -0
- /package/{packages/sdk/dist → dist}/solana/connection.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/solana/connection.js +0 -0
- /package/{packages/sdk/dist → dist}/solana/priority-fee.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/solana/priority-fee.js +0 -0
- /package/{packages/sdk/dist → dist}/spend-doc.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/spend-doc.js +0 -0
- /package/{packages/sdk/dist → dist}/token-registry.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/token-registry.js +0 -0
- /package/{packages/sdk/dist → dist}/utils/encoding.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/utils/encoding.js +0 -0
- /package/{packages/sdk/dist → dist}/vk-registry.d.ts +0 -0
- /package/{packages/sdk/dist → dist}/vk-registry.js +0 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,902 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UTXOpia SDK v3.0 (JoinSplit Architecture)
|
|
3
|
+
*
|
|
4
|
+
* Complete client library for interacting with the UTXOpia protocol.
|
|
5
|
+
* Private Bitcoin using ZK proofs.
|
|
6
|
+
*
|
|
7
|
+
* Networks: Solana deployments + Bitcoin testnet4/regtest/mainnet
|
|
8
|
+
*
|
|
9
|
+
* ## Quick Start
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { createNonInteractiveDeposit, generateJoinSplitProof, buildTransactInstruction } from '@utxopia/sdk';
|
|
12
|
+
*
|
|
13
|
+
* // 1. DEPOSIT: Generate BTC address + compact OP_RETURN payload.
|
|
14
|
+
* const deposit = await createNonInteractiveDeposit(meta, custodyInternalKey, 'testnet', undefined, opReturnContext);
|
|
15
|
+
* console.log('Send BTC to:', deposit.btcAddress);
|
|
16
|
+
*
|
|
17
|
+
* // 2. TRANSACT: JoinSplit proof for private transfer
|
|
18
|
+
* const proof = await generateJoinSplitProof(inputs);
|
|
19
|
+
*
|
|
20
|
+
* // 3. BUILD: Create Solana instruction
|
|
21
|
+
* const ix = buildTransactInstruction(options);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// ==========================================================================
|
|
26
|
+
// Cryptographic utilities
|
|
27
|
+
// ==========================================================================
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
// Byte conversion (encoding utilities)
|
|
31
|
+
bigintToBytes,
|
|
32
|
+
bytesToBigint,
|
|
33
|
+
hexToBytes,
|
|
34
|
+
bytesToHex,
|
|
35
|
+
// Hashing
|
|
36
|
+
sha256Hash,
|
|
37
|
+
x25519Ecdh,
|
|
38
|
+
ed25519GenerateKeyPair,
|
|
39
|
+
ed25519PubToX25519,
|
|
40
|
+
ed25519PrivToX25519,
|
|
41
|
+
x25519PubFromPriv,
|
|
42
|
+
x25519EcdhRaw,
|
|
43
|
+
encryptAmountEd25519,
|
|
44
|
+
decryptAmountEd25519,
|
|
45
|
+
// Low-level crypto (needed by E2E test scripts + contract deploy scripts)
|
|
46
|
+
randomFieldElement,
|
|
47
|
+
BN254_FIELD_PRIME,
|
|
48
|
+
babyJubMul,
|
|
49
|
+
BABYJUB_BASE8,
|
|
50
|
+
} from "./crypto";
|
|
51
|
+
|
|
52
|
+
// ==========================================================================
|
|
53
|
+
// Key derivation (Solana wallet -> spending/viewing keys)
|
|
54
|
+
// ==========================================================================
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
// Key derivation (high-level)
|
|
58
|
+
deriveKeysFromWallet,
|
|
59
|
+
deriveKeysFromSeed,
|
|
60
|
+
deriveKeysFromSeedCircuit,
|
|
61
|
+
deriveKeysFromAuthSignature,
|
|
62
|
+
setupKeysFromAuthSignature,
|
|
63
|
+
generateRandomAuthSignature,
|
|
64
|
+
// Key setup (combined derivation + stealth address)
|
|
65
|
+
setupKeysFromWallet,
|
|
66
|
+
setupKeysFromSeed,
|
|
67
|
+
recreateStealthAddress,
|
|
68
|
+
// EdDSA signing
|
|
69
|
+
eddsaPoseidonSign,
|
|
70
|
+
eddsaPoseidonSignWithScalar,
|
|
71
|
+
eddsaGetPrivScalar,
|
|
72
|
+
eddsaGetPubKey,
|
|
73
|
+
// Stealth meta address
|
|
74
|
+
createStealthMetaAddress,
|
|
75
|
+
serializeStealthMetaAddress,
|
|
76
|
+
deserializeStealthMetaAddress,
|
|
77
|
+
encodeStealthMetaAddress,
|
|
78
|
+
decodeStealthMetaAddress,
|
|
79
|
+
// Key lifecycle
|
|
80
|
+
clearUTXOpiaKeys,
|
|
81
|
+
// Key serialization
|
|
82
|
+
serializeKeysForStorage,
|
|
83
|
+
deserializeKeysFromStorage,
|
|
84
|
+
PASSKEY_CHAIN_SCOPE_DOMAIN,
|
|
85
|
+
deriveChainScopedPasskeySeed,
|
|
86
|
+
passkeyStorageOwner,
|
|
87
|
+
// Types
|
|
88
|
+
type UTXOpiaKeys,
|
|
89
|
+
type KeySetupResult,
|
|
90
|
+
type AuthSignatureKeyDerivationOptions,
|
|
91
|
+
type AuthSignatureKeySetupResult,
|
|
92
|
+
type ChainScopedPasskeyOptions,
|
|
93
|
+
type PasskeyChainScope,
|
|
94
|
+
type SerializedKeysForStorage,
|
|
95
|
+
type StealthMetaAddress,
|
|
96
|
+
type WalletSignerAdapter,
|
|
97
|
+
} from "./keys";
|
|
98
|
+
|
|
99
|
+
// Delegated viewing keys + auditor toolkit (Phase 1)
|
|
100
|
+
export {
|
|
101
|
+
ViewPermissions,
|
|
102
|
+
hasPermission,
|
|
103
|
+
isDelegatedKeyValid,
|
|
104
|
+
isSlotInDelegatedRange,
|
|
105
|
+
createDelegatedViewKey,
|
|
106
|
+
serializeDelegatedViewKey,
|
|
107
|
+
deserializeDelegatedViewKey,
|
|
108
|
+
makeDelegationRecord,
|
|
109
|
+
fingerprintDelegatedKey,
|
|
110
|
+
clearDelegatedViewKey,
|
|
111
|
+
// The delegation-safe alternative: unlike createDelegatedViewKey this omits nullifyingKey,
|
|
112
|
+
// which is what stops the holder from deriving every nullifier the account will ever publish.
|
|
113
|
+
// It was reachable only by deep import while the footgun sat in the barrel.
|
|
114
|
+
extractViewOnlyBundle,
|
|
115
|
+
type DelegatedViewKey,
|
|
116
|
+
type DelegationRecord,
|
|
117
|
+
} from "./keys";
|
|
118
|
+
export {
|
|
119
|
+
auditScan,
|
|
120
|
+
auditScanCiphertexts,
|
|
121
|
+
auditRecordsToCsv,
|
|
122
|
+
type AuditDirection,
|
|
123
|
+
type AuditRecord,
|
|
124
|
+
type AuditScanAnnouncement,
|
|
125
|
+
type AuditScanOptions,
|
|
126
|
+
type AuditScanSummary,
|
|
127
|
+
type OnChainSenderMemo,
|
|
128
|
+
} from "./auditor";
|
|
129
|
+
|
|
130
|
+
// Auditor ciphertext (Method-Y permissioned pool)
|
|
131
|
+
export {
|
|
132
|
+
encryptAuditorCiphertext,
|
|
133
|
+
decryptAuditorCiphertext,
|
|
134
|
+
buildAuditorCiphertextForNote,
|
|
135
|
+
resolveAuditorCiphertext,
|
|
136
|
+
AUDITOR_CIPHERTEXT_BYTES,
|
|
137
|
+
type AuditorNotePlain,
|
|
138
|
+
type AuditorCiphertextInput,
|
|
139
|
+
} from "./auditor-ciphertext";
|
|
140
|
+
export {
|
|
141
|
+
generateAuditorViewingKeypair,
|
|
142
|
+
deriveAuditorViewingKeypair,
|
|
143
|
+
} from "./keys";
|
|
144
|
+
|
|
145
|
+
// Sender memo channel (Phase 2)
|
|
146
|
+
export {
|
|
147
|
+
encryptSenderMemo,
|
|
148
|
+
decryptSenderMemo,
|
|
149
|
+
deriveOutgoingViewingKey,
|
|
150
|
+
packSenderMemo,
|
|
151
|
+
unpackSenderMemo,
|
|
152
|
+
packSenderMemoForInstruction,
|
|
153
|
+
buildSenderMemosForTransact,
|
|
154
|
+
generateSenderMemoNonce,
|
|
155
|
+
SENDER_MEMO_AMOUNT_BYTES,
|
|
156
|
+
SENDER_MEMO_CIPHERTEXT_BYTES,
|
|
157
|
+
SENDER_MEMO_COMMITMENT_BYTES,
|
|
158
|
+
SENDER_MEMO_NONCE_BYTES,
|
|
159
|
+
SENDER_MEMO_PACKED_BYTES,
|
|
160
|
+
SENDER_MEMO_TAG_BYTES,
|
|
161
|
+
SENDER_MEMO_TOKEN_BYTES,
|
|
162
|
+
type SenderMemoPlain,
|
|
163
|
+
type SenderMemoCiphertext,
|
|
164
|
+
type SenderMemoOutput,
|
|
165
|
+
} from "./sender-memo";
|
|
166
|
+
|
|
167
|
+
// Selective ZK disclosure proofs (Phase 4)
|
|
168
|
+
export {
|
|
169
|
+
generateOwnershipProof,
|
|
170
|
+
generateRangeSumProof,
|
|
171
|
+
computeRangeSumAttestation,
|
|
172
|
+
pickRangeSumVariant,
|
|
173
|
+
RANGE_SUM_N,
|
|
174
|
+
RANGE_SUM_VARIANTS,
|
|
175
|
+
RANGE_SUM_SIZES,
|
|
176
|
+
type OwnershipProofInputs,
|
|
177
|
+
type OwnershipPublicInputs,
|
|
178
|
+
type RangeSumAttestationStyle,
|
|
179
|
+
type RangeSumProofInputs,
|
|
180
|
+
type RangeSumPublicInputs,
|
|
181
|
+
} from "./selective-disclosure";
|
|
182
|
+
|
|
183
|
+
// ==========================================================================
|
|
184
|
+
// Deliberately not re-exported: isWalletAdapter, isDirectVaultDepositMode (guards the SDK
|
|
185
|
+
// branches on), updateNoteWithHashes, updateStealthNoteWithHashes (mutators for fields the
|
|
186
|
+
// SDK computes) and stealthNoteHasComputedHashes (a predicate over state no caller builds).
|
|
187
|
+
// Still exported from their own modules for internal use — they are just not public API.
|
|
188
|
+
|
|
189
|
+
// Poseidon hash utilities
|
|
190
|
+
// ==========================================================================
|
|
191
|
+
|
|
192
|
+
export {
|
|
193
|
+
initPoseidon,
|
|
194
|
+
isPoseidonReady,
|
|
195
|
+
poseidonHashSync,
|
|
196
|
+
computeUnifiedCommitmentSync,
|
|
197
|
+
computeNullifierSync,
|
|
198
|
+
hashNullifierSync,
|
|
199
|
+
// JoinSplit primitives (used by E2E scripts + pay-flow)
|
|
200
|
+
computeMPKSync,
|
|
201
|
+
computeNPKSync,
|
|
202
|
+
computeJoinSplitCommitmentSync,
|
|
203
|
+
computeJoinSplitNullifierSync,
|
|
204
|
+
// Multi-token
|
|
205
|
+
computeTokenId,
|
|
206
|
+
reduceToField,
|
|
207
|
+
} from "./poseidon";
|
|
208
|
+
|
|
209
|
+
// ==========================================================================
|
|
210
|
+
// Token Registry (multi-token support)
|
|
211
|
+
// ==========================================================================
|
|
212
|
+
|
|
213
|
+
export {
|
|
214
|
+
fetchTokenConfig,
|
|
215
|
+
getTokenId,
|
|
216
|
+
fetchSupportedTokens,
|
|
217
|
+
fetchEnabledTokens,
|
|
218
|
+
parseTokenConfig,
|
|
219
|
+
type TokenConfigData,
|
|
220
|
+
type SupportedToken,
|
|
221
|
+
} from "./token-registry";
|
|
222
|
+
|
|
223
|
+
// ==========================================================================
|
|
224
|
+
// MagicBlock ER / PER execution domains
|
|
225
|
+
// ==========================================================================
|
|
226
|
+
|
|
227
|
+
export {
|
|
228
|
+
MAGICBLOCK_DELEGATION_PROGRAM_ID,
|
|
229
|
+
MAGICBLOCK_DEVNET_ROUTER_URL,
|
|
230
|
+
MAGICBLOCK_DEVNET_ROUTER_WS_URL,
|
|
231
|
+
MAGICBLOCK_EPHEMERAL_VAULT_ID,
|
|
232
|
+
MAGICBLOCK_MAGIC_CONTEXT_ID,
|
|
233
|
+
MAGICBLOCK_MAGIC_PROGRAM_ID,
|
|
234
|
+
MAGICBLOCK_MAX_PER_MEMBERS,
|
|
235
|
+
MAGICBLOCK_PERMISSION_PROGRAM_ID,
|
|
236
|
+
MAGICBLOCK_PER_MEMBER_FLAGS,
|
|
237
|
+
MAGICBLOCK_VALIDATOR_IDENTITIES,
|
|
238
|
+
buildDefaultPrivacyDomain,
|
|
239
|
+
buildMagicBlockPerMemberFlags,
|
|
240
|
+
deriveMagicBlockCommitRecordPDA,
|
|
241
|
+
deriveMagicBlockCommitStatePDA,
|
|
242
|
+
deriveMagicBlockDelegateBufferPDA,
|
|
243
|
+
deriveMagicBlockDelegationMetadataPDA,
|
|
244
|
+
deriveMagicBlockDelegationRecordPDA,
|
|
245
|
+
deriveMagicBlockPermissionPDA,
|
|
246
|
+
deriveMagicBlockUndelegateBufferPDA,
|
|
247
|
+
requiresMagicBlockEndpoint,
|
|
248
|
+
getMagicBlockEndpoint,
|
|
249
|
+
getMagicBlockValidatorIdentity,
|
|
250
|
+
createMagicBlockRouterConnection,
|
|
251
|
+
type BuildPrivacyDomainOptions,
|
|
252
|
+
type MagicBlockEndpointConfig,
|
|
253
|
+
type MagicBlockExecutionMode,
|
|
254
|
+
type MagicBlockPolicyMode,
|
|
255
|
+
type MagicBlockPerMemberFlagName,
|
|
256
|
+
type MagicBlockValidatorRegion,
|
|
257
|
+
type PrivacyDomainConfig,
|
|
258
|
+
type PrivacyDomainKind,
|
|
259
|
+
} from "./magicblock";
|
|
260
|
+
|
|
261
|
+
// ==========================================================================
|
|
262
|
+
// Note (shielded commitment) utilities
|
|
263
|
+
// ==========================================================================
|
|
264
|
+
|
|
265
|
+
export {
|
|
266
|
+
generateNote,
|
|
267
|
+
createNoteFromSecrets,
|
|
268
|
+
serializeNote,
|
|
269
|
+
deserializeNote,
|
|
270
|
+
noteHasComputedHashes,
|
|
271
|
+
getNotePublicKeyX,
|
|
272
|
+
computeNoteCommitment,
|
|
273
|
+
computeNoteNullifier,
|
|
274
|
+
formatBtc,
|
|
275
|
+
parseBtc,
|
|
276
|
+
deriveNote,
|
|
277
|
+
deriveNotes,
|
|
278
|
+
deriveMasterKey,
|
|
279
|
+
deriveNoteFromMaster,
|
|
280
|
+
estimateSeedStrength,
|
|
281
|
+
createNote,
|
|
282
|
+
prepareWithdrawal,
|
|
283
|
+
createStealthNote,
|
|
284
|
+
serializeStealthNote,
|
|
285
|
+
deserializeStealthNote,
|
|
286
|
+
type Note,
|
|
287
|
+
type SerializedNote,
|
|
288
|
+
type NoteData,
|
|
289
|
+
type StealthNote,
|
|
290
|
+
type SerializedStealthNote,
|
|
291
|
+
// JoinSplit note types
|
|
292
|
+
createJoinSplitNote,
|
|
293
|
+
computeJoinSplitNoteNullifier,
|
|
294
|
+
serializeJoinSplitNote,
|
|
295
|
+
deserializeJoinSplitNote,
|
|
296
|
+
type JoinSplitNote,
|
|
297
|
+
type SerializedJoinSplitNote,
|
|
298
|
+
} from "./note";
|
|
299
|
+
|
|
300
|
+
// ==========================================================================
|
|
301
|
+
// Merkle tree utilities
|
|
302
|
+
// ==========================================================================
|
|
303
|
+
|
|
304
|
+
export {
|
|
305
|
+
createMerkleProof,
|
|
306
|
+
createMerkleProofFromBigints,
|
|
307
|
+
proofToCircomFormat,
|
|
308
|
+
proofToOnChainFormat,
|
|
309
|
+
createEmptyMerkleProof,
|
|
310
|
+
leafIndexToPathIndices,
|
|
311
|
+
pathIndicesToLeafIndex,
|
|
312
|
+
validateMerkleProofStructure,
|
|
313
|
+
parseMerkleProofResponse,
|
|
314
|
+
TREE_DEPTH,
|
|
315
|
+
ROOT_HISTORY_SIZE,
|
|
316
|
+
MAX_LEAVES,
|
|
317
|
+
ZERO_VALUE,
|
|
318
|
+
type MerkleProof,
|
|
319
|
+
} from "./merkle";
|
|
320
|
+
|
|
321
|
+
// ==========================================================================
|
|
322
|
+
// Taproot address utilities
|
|
323
|
+
// ==========================================================================
|
|
324
|
+
|
|
325
|
+
export {
|
|
326
|
+
deriveTaprootAddress,
|
|
327
|
+
deriveTaprootAddressWithRefund,
|
|
328
|
+
depositTweakCommitment,
|
|
329
|
+
deriveDepositAddress,
|
|
330
|
+
depositLeafScript,
|
|
331
|
+
DEPOSIT_NUMS_INTERNAL_KEY,
|
|
332
|
+
buildRefundScript,
|
|
333
|
+
computeTapLeafHash,
|
|
334
|
+
verifyTaprootAddress,
|
|
335
|
+
createP2TRScriptPubkey,
|
|
336
|
+
parseP2TRScriptPubkey,
|
|
337
|
+
isValidBitcoinAddress,
|
|
338
|
+
getInternalKey,
|
|
339
|
+
createCustomInternalKey,
|
|
340
|
+
createOpReturnScriptFromPayload,
|
|
341
|
+
buildDepositOpReturn,
|
|
342
|
+
parseDepositOpReturn,
|
|
343
|
+
encodeDepositOpReturnHeader,
|
|
344
|
+
decodeDepositOpReturnHeader,
|
|
345
|
+
validateDepositOpReturnContext,
|
|
346
|
+
computeDepositPoolTag,
|
|
347
|
+
DEPOSIT_DESTINATION_CHAIN,
|
|
348
|
+
DEPOSIT_BITCOIN_NETWORK,
|
|
349
|
+
DEPOSIT_OP_RETURN_VERSION,
|
|
350
|
+
DEPOSIT_POOL_TAG_SIZE,
|
|
351
|
+
DEPOSIT_OP_RETURN_SIZE,
|
|
352
|
+
type DepositDestinationChain,
|
|
353
|
+
type DepositBitcoinNetwork,
|
|
354
|
+
type DepositOpReturnContext,
|
|
355
|
+
type ParsedDepositOpReturn,
|
|
356
|
+
} from "./taproot";
|
|
357
|
+
|
|
358
|
+
// ==========================================================================
|
|
359
|
+
// Claim link utilities
|
|
360
|
+
// ==========================================================================
|
|
361
|
+
|
|
362
|
+
export {
|
|
363
|
+
encodeClaimLink,
|
|
364
|
+
decodeClaimLink,
|
|
365
|
+
parseClaimUrl,
|
|
366
|
+
} from "./claim-link";
|
|
367
|
+
|
|
368
|
+
// ==========================================================================
|
|
369
|
+
// WASM Prover (Browser + Node.js) — JoinSplit only
|
|
370
|
+
// ==========================================================================
|
|
371
|
+
|
|
372
|
+
// Prover types only (no runtime dependency on snarkjs)
|
|
373
|
+
// For prover runtime functions (initProver, generateJoinSplitProof, etc.), import from:
|
|
374
|
+
// - @utxopia/sdk/prover/web (browser/Node.js — uses snarkjs)
|
|
375
|
+
// - @utxopia/sdk/prover/mobile (React Native — uses mopro-ffi)
|
|
376
|
+
export type {
|
|
377
|
+
ProofData,
|
|
378
|
+
MerkleProofInput,
|
|
379
|
+
CircuitType,
|
|
380
|
+
JoinSplitProofInputs,
|
|
381
|
+
} from "./prover/web";
|
|
382
|
+
|
|
383
|
+
// ==========================================================================
|
|
384
|
+
// ChadBuffer utilities (for large proof uploads)
|
|
385
|
+
// ==========================================================================
|
|
386
|
+
|
|
387
|
+
export {
|
|
388
|
+
uploadTransactionToBuffer,
|
|
389
|
+
uploadProofToBuffer,
|
|
390
|
+
closeBuffer,
|
|
391
|
+
readBufferData,
|
|
392
|
+
fetchRawTransaction,
|
|
393
|
+
fetchMerkleProof,
|
|
394
|
+
prepareVerifyDeposit,
|
|
395
|
+
buildMerkleProof,
|
|
396
|
+
needsBuffer as bufferNeedsBuffer,
|
|
397
|
+
getProofSource,
|
|
398
|
+
calculateUploadTransactions,
|
|
399
|
+
CHADBUFFER_PROGRAM_ID,
|
|
400
|
+
AUTHORITY_SIZE,
|
|
401
|
+
MAX_DATA_PER_WRITE,
|
|
402
|
+
SOLANA_TX_SIZE_LIMIT,
|
|
403
|
+
type ProofUploadResult,
|
|
404
|
+
} from "./chadbuffer";
|
|
405
|
+
|
|
406
|
+
// ==========================================================================
|
|
407
|
+
// Bound Parameters (JoinSplit transaction binding)
|
|
408
|
+
// ==========================================================================
|
|
409
|
+
|
|
410
|
+
export {
|
|
411
|
+
computeBoundParamsHash,
|
|
412
|
+
computeSolanaDomainBoundParamsHash,
|
|
413
|
+
computeSolanaDomainSeparator,
|
|
414
|
+
computeStealthDataHash,
|
|
415
|
+
createTransferBoundParams,
|
|
416
|
+
createUnshieldBoundParams,
|
|
417
|
+
createRedeemBoundParams,
|
|
418
|
+
SOLANA_BOUND_CHAIN_ID,
|
|
419
|
+
SOLANA_DEVNET_BOUND_CHAIN_ID,
|
|
420
|
+
SOLANA_MAINNET_BOUND_CHAIN_ID,
|
|
421
|
+
DEFAULT_BOUND_PARAMS,
|
|
422
|
+
type BoundParams,
|
|
423
|
+
type BoundParamsMode,
|
|
424
|
+
type SolanaPrivacyDomainContext,
|
|
425
|
+
type SolanaPrivacyDomainKind,
|
|
426
|
+
} from "./bound-params";
|
|
427
|
+
|
|
428
|
+
export {
|
|
429
|
+
formatSpendDoc,
|
|
430
|
+
renderSpendDoc,
|
|
431
|
+
SpendDocMismatch,
|
|
432
|
+
type SpendDoc,
|
|
433
|
+
type SpendSignals,
|
|
434
|
+
} from "./spend-doc";
|
|
435
|
+
|
|
436
|
+
// ==========================================================================
|
|
437
|
+
// Configuration
|
|
438
|
+
// ==========================================================================
|
|
439
|
+
|
|
440
|
+
export {
|
|
441
|
+
getConfig,
|
|
442
|
+
setConfig,
|
|
443
|
+
createConfig,
|
|
444
|
+
initConfig,
|
|
445
|
+
DEVNET_CONFIG,
|
|
446
|
+
DEVNET_REGTEST_CONFIG,
|
|
447
|
+
MAINNET_CONFIG,
|
|
448
|
+
LOCALNET_CONFIG,
|
|
449
|
+
TOKEN_PROGRAM_ID,
|
|
450
|
+
TOKEN_2022_PROGRAM_ID,
|
|
451
|
+
ATA_PROGRAM_ID,
|
|
452
|
+
UTXOPIA_POLICY_PROGRAM_ID,
|
|
453
|
+
SDK_VERSION,
|
|
454
|
+
DEPLOYMENT_INFO,
|
|
455
|
+
JOINSPLIT_TREE_DEPTH,
|
|
456
|
+
type NetworkConfig,
|
|
457
|
+
type NetworkType,
|
|
458
|
+
} from "./config";
|
|
459
|
+
|
|
460
|
+
// ==========================================================================
|
|
461
|
+
// PoolState account layout + fee arithmetic
|
|
462
|
+
// ==========================================================================
|
|
463
|
+
|
|
464
|
+
export {
|
|
465
|
+
POOL_STATE_DISCRIMINATOR,
|
|
466
|
+
POOL_STATE_LEN,
|
|
467
|
+
POOL_STATE_OFFSETS,
|
|
468
|
+
POOL_FLAG,
|
|
469
|
+
parsePoolState,
|
|
470
|
+
parsePoolFees,
|
|
471
|
+
BPS_DENOMINATOR,
|
|
472
|
+
computeBpsFee,
|
|
473
|
+
feeShareBps,
|
|
474
|
+
} from "./pool-state";
|
|
475
|
+
export type { PoolState, PoolFees } from "./pool-state";
|
|
476
|
+
|
|
477
|
+
// ==========================================================================
|
|
478
|
+
// PDA Derivation
|
|
479
|
+
// ==========================================================================
|
|
480
|
+
|
|
481
|
+
export {
|
|
482
|
+
PDA_SEEDS,
|
|
483
|
+
// Seed builders — the single definition of every PDA. Consumers on
|
|
484
|
+
// @solana/web3.js should derive from these with findProgramAddressSync rather
|
|
485
|
+
// than restating the seeds, which is how copies drift from the program.
|
|
486
|
+
poolStateSeeds,
|
|
487
|
+
commitmentTreeSeeds,
|
|
488
|
+
tokenConfigSeeds,
|
|
489
|
+
poolConfigSeeds,
|
|
490
|
+
nullifierRecordSeeds,
|
|
491
|
+
redemptionRequestSeeds,
|
|
492
|
+
vkRegistrySeeds,
|
|
493
|
+
depositReceiptSeeds,
|
|
494
|
+
policyApprovalSeeds,
|
|
495
|
+
exitDestinationSeeds,
|
|
496
|
+
lightClientSeeds,
|
|
497
|
+
blockHeaderSeeds,
|
|
498
|
+
heightIndexSeeds,
|
|
499
|
+
verifiedTransactionSeeds,
|
|
500
|
+
derivePoolStatePDA,
|
|
501
|
+
deriveCommitmentTreePDA,
|
|
502
|
+
deriveNullifierRecordPDA,
|
|
503
|
+
derivePolicyApprovalPDA,
|
|
504
|
+
deriveExitDestinationPDA,
|
|
505
|
+
EXIT_KIND_SOLANA_OWNER,
|
|
506
|
+
EXIT_KIND_BTC_SCRIPT,
|
|
507
|
+
deriveLightClientPDA,
|
|
508
|
+
deriveBlockHeaderPDA,
|
|
509
|
+
deriveHeightIndexPDA,
|
|
510
|
+
deriveVkRegistryPDA,
|
|
511
|
+
deriveRedemptionRequestPDA,
|
|
512
|
+
deriveTokenConfigPDA,
|
|
513
|
+
derivePoolConfigPDA,
|
|
514
|
+
deriveDepositReceiptPDA,
|
|
515
|
+
commitmentToBytes,
|
|
516
|
+
} from "./pda";
|
|
517
|
+
|
|
518
|
+
// ==========================================================================
|
|
519
|
+
// Stealth address utilities
|
|
520
|
+
// ==========================================================================
|
|
521
|
+
|
|
522
|
+
export {
|
|
523
|
+
createStealthDeposit,
|
|
524
|
+
createStealthDepositWithKeys,
|
|
525
|
+
createStealthOutput,
|
|
526
|
+
createStealthOutputWithKeys,
|
|
527
|
+
createStealthOutputForCommitment,
|
|
528
|
+
packStealthOutputForCircuit,
|
|
529
|
+
scanAnnouncements,
|
|
530
|
+
scanAnnouncementsViewOnly,
|
|
531
|
+
scanAnnouncementsViewOnlyMulti,
|
|
532
|
+
exportViewOnlyKeys,
|
|
533
|
+
encodeViewOnlyKeys,
|
|
534
|
+
decodeViewOnlyKeys,
|
|
535
|
+
prepareClaimInputs,
|
|
536
|
+
scanUnifiedNotes,
|
|
537
|
+
scanUnifiedNotesMulti,
|
|
538
|
+
encryptAmount,
|
|
539
|
+
decryptAmount,
|
|
540
|
+
computeNullifierHashForNote,
|
|
541
|
+
computeNullifierBytes,
|
|
542
|
+
parseAnnouncementsFromHex,
|
|
543
|
+
createDepositFromConfig,
|
|
544
|
+
createDirectVaultDeposit,
|
|
545
|
+
createTweakDeposit,
|
|
546
|
+
depositEphemeralKeyPair,
|
|
547
|
+
depositViewingNode,
|
|
548
|
+
outgoingViewingNode,
|
|
549
|
+
outgoingEphemeralKeyPair,
|
|
550
|
+
findNextSendIndex,
|
|
551
|
+
isDepositForViewer,
|
|
552
|
+
isDepositForViewerHex,
|
|
553
|
+
ANNOUNCEMENT_TYPE_DEPOSIT,
|
|
554
|
+
ANNOUNCEMENT_TYPE_TRANSFER,
|
|
555
|
+
type StealthDeposit,
|
|
556
|
+
type StealthOutputData,
|
|
557
|
+
type StealthOutputWithKeys,
|
|
558
|
+
type CircuitStealthOutput,
|
|
559
|
+
type ScannedNote,
|
|
560
|
+
type ClaimInputs as StealthClaimInputs,
|
|
561
|
+
type OnChainStealthAnnouncement,
|
|
562
|
+
type ConnectionAdapter,
|
|
563
|
+
type ViewOnlyKeys,
|
|
564
|
+
type ViewOnlyScannedNote,
|
|
565
|
+
createNonInteractiveDeposit,
|
|
566
|
+
pickIkaCustodyKey,
|
|
567
|
+
type NonInteractiveDepositResult,
|
|
568
|
+
type TweakDepositResult,
|
|
569
|
+
type DepositRecoveryMaterial,
|
|
570
|
+
type OutgoingRecoveryMaterial,
|
|
571
|
+
type NonInteractiveDepositWithRefundResult,
|
|
572
|
+
} from "./stealth";
|
|
573
|
+
|
|
574
|
+
// ==========================================================================
|
|
575
|
+
// PSBT builder for wallet-integrated deposits
|
|
576
|
+
// ==========================================================================
|
|
577
|
+
|
|
578
|
+
export {
|
|
579
|
+
buildDepositPsbt,
|
|
580
|
+
estimateDepositFee,
|
|
581
|
+
fetchUtxos,
|
|
582
|
+
selectUtxos,
|
|
583
|
+
type BuildDepositPsbtParams,
|
|
584
|
+
type BuildDepositPsbtResult,
|
|
585
|
+
type UtxoDescriptor,
|
|
586
|
+
} from "./psbt";
|
|
587
|
+
|
|
588
|
+
// ==========================================================================
|
|
589
|
+
// Core utilities
|
|
590
|
+
// ==========================================================================
|
|
591
|
+
|
|
592
|
+
export {
|
|
593
|
+
EsploraClient,
|
|
594
|
+
esploraTestnet,
|
|
595
|
+
esploraMainnet,
|
|
596
|
+
type EsploraTransaction,
|
|
597
|
+
type EsploraVin,
|
|
598
|
+
type EsploraVout,
|
|
599
|
+
type EsploraStatus,
|
|
600
|
+
type EsploraAddressInfo,
|
|
601
|
+
type EsploraUtxo,
|
|
602
|
+
type EsploraMerkleProof,
|
|
603
|
+
type EsploraNetwork,
|
|
604
|
+
} from "./core/esplora";
|
|
605
|
+
|
|
606
|
+
// Mempool.space client with SPV support
|
|
607
|
+
export {
|
|
608
|
+
MempoolClient,
|
|
609
|
+
mempoolTestnet,
|
|
610
|
+
mempoolMainnet,
|
|
611
|
+
reverseBytes,
|
|
612
|
+
type BlockHeader,
|
|
613
|
+
type TransactionInfo,
|
|
614
|
+
type SPVProofData,
|
|
615
|
+
} from "./core/mempool";
|
|
616
|
+
|
|
617
|
+
// ==========================================================================
|
|
618
|
+
// Priority Fee Estimation
|
|
619
|
+
// ==========================================================================
|
|
620
|
+
|
|
621
|
+
export {
|
|
622
|
+
estimatePriorityFee,
|
|
623
|
+
buildPriorityFeeInstructionData,
|
|
624
|
+
encodeSetComputeUnitLimit,
|
|
625
|
+
encodeSetComputeUnitPrice,
|
|
626
|
+
getHeliusRpcUrl,
|
|
627
|
+
DEFAULT_COMPUTE_UNITS,
|
|
628
|
+
DEFAULT_PRIORITY_FEE,
|
|
629
|
+
COMPUTE_BUDGET_DISCRIMINATORS,
|
|
630
|
+
type PriorityFeeConfig,
|
|
631
|
+
type PriorityFeeEstimate,
|
|
632
|
+
type PriorityFeeInstructions,
|
|
633
|
+
} from "./solana/priority-fee";
|
|
634
|
+
|
|
635
|
+
// ==========================================================================
|
|
636
|
+
// Debug Logging
|
|
637
|
+
// ==========================================================================
|
|
638
|
+
|
|
639
|
+
export { setDebug } from "./logger";
|
|
640
|
+
|
|
641
|
+
// ==========================================================================
|
|
642
|
+
// Connection Adapter Factory
|
|
643
|
+
// ==========================================================================
|
|
644
|
+
|
|
645
|
+
export {
|
|
646
|
+
createFetchConnectionAdapter,
|
|
647
|
+
createConnectionAdapterFromWeb3,
|
|
648
|
+
createConnectionAdapterFromKit,
|
|
649
|
+
getConnectionAdapter,
|
|
650
|
+
clearConnectionAdapterCache,
|
|
651
|
+
type RpcConfig,
|
|
652
|
+
type Web3Connection,
|
|
653
|
+
type KitRpc,
|
|
654
|
+
} from "./solana/connection";
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
// ==========================================================================
|
|
658
|
+
// SNS Subdomain Resolver (*.utxopia.sol stealth addresses)
|
|
659
|
+
// ==========================================================================
|
|
660
|
+
|
|
661
|
+
export {
|
|
662
|
+
resolveSnsName,
|
|
663
|
+
resolveStealthName,
|
|
664
|
+
parseSnsStealthData,
|
|
665
|
+
isSnsStealthAddress,
|
|
666
|
+
isAuditorDisclosable,
|
|
667
|
+
SnsComplianceFlags,
|
|
668
|
+
SNS_COMPLIANCE_AUDITOR_OFFSET,
|
|
669
|
+
SNS_COMPLIANCE_AUDITOR_BYTES,
|
|
670
|
+
deriveParentDomainKey,
|
|
671
|
+
SNS_STEALTH_DATA_SIZE,
|
|
672
|
+
type SnsStealthAddress,
|
|
673
|
+
} from "./sns-resolver";
|
|
674
|
+
|
|
675
|
+
// ==========================================================================
|
|
676
|
+
// Commitment Tree
|
|
677
|
+
// ==========================================================================
|
|
678
|
+
|
|
679
|
+
export {
|
|
680
|
+
COMMITMENT_TREE_DISCRIMINATOR,
|
|
681
|
+
parseCommitmentTreeData,
|
|
682
|
+
isValidRoot,
|
|
683
|
+
fetchCommitmentTree,
|
|
684
|
+
getCommitmentIndex,
|
|
685
|
+
saveCommitmentIndex,
|
|
686
|
+
CommitmentTreeIndex,
|
|
687
|
+
// On-chain fetch functions (Helius-compatible)
|
|
688
|
+
buildCommitmentTreeFromChain,
|
|
689
|
+
fetchLeafIndexForCommitment,
|
|
690
|
+
fetchMerkleProofForCommitment,
|
|
691
|
+
getMerkleProofFromTree,
|
|
692
|
+
type CommitmentTreeState,
|
|
693
|
+
type RpcClient,
|
|
694
|
+
type OnChainMerkleProof,
|
|
695
|
+
} from "./commitment-tree";
|
|
696
|
+
|
|
697
|
+
// ==========================================================================
|
|
698
|
+
// Low-level Instruction Builders (JoinSplit only)
|
|
699
|
+
// ==========================================================================
|
|
700
|
+
|
|
701
|
+
export {
|
|
702
|
+
INSTRUCTION_DISCRIMINATORS,
|
|
703
|
+
// Shield instruction
|
|
704
|
+
buildShieldInstructionData,
|
|
705
|
+
buildShieldInstruction,
|
|
706
|
+
type ShieldInstructionOptions,
|
|
707
|
+
buildApproveRedemptionSigningInstructionData,
|
|
708
|
+
buildApproveRedemptionSigningInstruction,
|
|
709
|
+
// Cancel redemption instruction
|
|
710
|
+
buildCancelRedemptionInstructionData,
|
|
711
|
+
buildCancelRedemptionInstruction,
|
|
712
|
+
type CancelRedemptionInstructionOptions,
|
|
713
|
+
bigintTo32Bytes,
|
|
714
|
+
bytes32ToBigint,
|
|
715
|
+
// JoinSplit transact instruction
|
|
716
|
+
buildTransactInstructionData,
|
|
717
|
+
buildTransactInstruction,
|
|
718
|
+
// JoinSplit + BTC redeem instruction
|
|
719
|
+
buildRedeemInstructionData,
|
|
720
|
+
// Public unshield instruction
|
|
721
|
+
buildUnshieldInstructionData,
|
|
722
|
+
buildUnshieldInstruction,
|
|
723
|
+
// Timelocked pool update instructions
|
|
724
|
+
buildProposePoolUpdateInstructionData,
|
|
725
|
+
buildProposePoolUpdateInstruction,
|
|
726
|
+
buildExecutePoolUpdateInstructionData,
|
|
727
|
+
buildExecutePoolUpdateInstruction,
|
|
728
|
+
buildCancelPoolUpdateInstructionData,
|
|
729
|
+
buildCancelPoolUpdateInstruction,
|
|
730
|
+
// Rotate tree
|
|
731
|
+
buildRotateTreeInstructionData,
|
|
732
|
+
buildRotateTreeInstruction,
|
|
733
|
+
type RotateTreeOptions,
|
|
734
|
+
// MagicBlock lifecycle
|
|
735
|
+
buildMagicBlockDelegateInstructionData,
|
|
736
|
+
buildMagicBlockDelegateInstruction,
|
|
737
|
+
buildMagicBlockCommitInstructionData,
|
|
738
|
+
buildMagicBlockCommitInstruction,
|
|
739
|
+
buildMagicBlockPerPermissionInstructionData,
|
|
740
|
+
buildMagicBlockPerPermissionInstruction,
|
|
741
|
+
buildPolicyRequestHash,
|
|
742
|
+
buildPolicyIntentParts,
|
|
743
|
+
buildRegisterExitDestinationInstruction,
|
|
744
|
+
buildRegisterExitDestinationInstructionData,
|
|
745
|
+
MAX_POLICY_INTENT_PARTS,
|
|
746
|
+
buildInitializePolicyApprovalInstructionData,
|
|
747
|
+
buildInitializePolicyApprovalInstruction,
|
|
748
|
+
buildPolicyApprovalDecisionInstruction,
|
|
749
|
+
buildPolicyApprovalCommitInstruction,
|
|
750
|
+
buildCompleteDepositPermissionedInstructionData,
|
|
751
|
+
buildCompleteDepositPermissionedInstruction,
|
|
752
|
+
buildShieldPermissionedInstructionData,
|
|
753
|
+
buildShieldPermissionedInstruction,
|
|
754
|
+
buildRotateAuditorInstructionData,
|
|
755
|
+
buildRotateAuditorInstruction,
|
|
756
|
+
type MagicBlockDelegateTarget,
|
|
757
|
+
type MagicBlockDelegateInstructionOptions,
|
|
758
|
+
type MagicBlockCommitInstructionOptions,
|
|
759
|
+
type MagicBlockPerPermissionOperation,
|
|
760
|
+
type MagicBlockPerPermissionMember,
|
|
761
|
+
type MagicBlockPerPermissionInstructionOptions,
|
|
762
|
+
type PolicyApprovalDecision,
|
|
763
|
+
type InitializePolicyApprovalOptions,
|
|
764
|
+
type CompleteDepositPermissionedOptions,
|
|
765
|
+
type ShieldPermissionedInstructionOptions,
|
|
766
|
+
type RotateAuditorOptions,
|
|
767
|
+
// Verify instruction data builders
|
|
768
|
+
buildVerifyTransactionInstructionData,
|
|
769
|
+
buildCompleteDepositInstructionData,
|
|
770
|
+
buildVerifyDepositInstructionData,
|
|
771
|
+
buildVerifyDepositPermissionedInstructionData,
|
|
772
|
+
// Pool config (disc 2) builder + parser
|
|
773
|
+
buildSetPoolConfigInstructionData,
|
|
774
|
+
parsePoolConfig,
|
|
775
|
+
type ParsedPoolConfig,
|
|
776
|
+
POOL_CONFIG_DISCRIMINATOR,
|
|
777
|
+
POOL_CONFIG_LEN,
|
|
778
|
+
POOL_SCRIPT_MAX_LEN,
|
|
779
|
+
// Redemption PDA helper
|
|
780
|
+
type Instruction,
|
|
781
|
+
type ApproveRedemptionSigningInstructionOptions,
|
|
782
|
+
type TransactInstructionOptions,
|
|
783
|
+
type UnshieldInstructionOptions,
|
|
784
|
+
type ProposePoolUpdateOptions,
|
|
785
|
+
type ExecutePoolUpdateOptions,
|
|
786
|
+
type CancelPoolUpdateOptions,
|
|
787
|
+
} from "./instructions";
|
|
788
|
+
|
|
789
|
+
// ==========================================================================
|
|
790
|
+
// VK Registry (JoinSplit Groth16 on-chain verification keys)
|
|
791
|
+
// ==========================================================================
|
|
792
|
+
|
|
793
|
+
export {
|
|
794
|
+
VK_REGISTRY_DISCRIMINATOR,
|
|
795
|
+
VK_REGISTRY_LEN,
|
|
796
|
+
MAX_IC_POINTS,
|
|
797
|
+
MAX_SAFE_JOINSPLIT_SIZE,
|
|
798
|
+
INIT_VK_REGISTRY_DISCRIMINATOR,
|
|
799
|
+
UPDATE_VK_REGISTRY_DISCRIMINATOR,
|
|
800
|
+
joinSplitNumPublicInputs,
|
|
801
|
+
computeVkHash,
|
|
802
|
+
vkeyJsonToVkMaterial,
|
|
803
|
+
buildVkRegistryData,
|
|
804
|
+
parseVkRegistry,
|
|
805
|
+
assertVkRegistryForShape,
|
|
806
|
+
isVkRegistryReady,
|
|
807
|
+
type JoinSplitVkMaterial,
|
|
808
|
+
type SnarkjsVkeyJson,
|
|
809
|
+
type ParsedVkRegistry,
|
|
810
|
+
} from "./vk-registry";
|
|
811
|
+
|
|
812
|
+
// ==========================================================================
|
|
813
|
+
// ChadBuffer Relay
|
|
814
|
+
// ==========================================================================
|
|
815
|
+
|
|
816
|
+
// relay.ts held a second implementation of the ChadBuffer lifecycle — create / upload / close —
|
|
817
|
+
// alongside chadbuffer.ts, which already does all three. Nothing imported it but this barrel, and
|
|
818
|
+
// the two disagreed on chunk size (1020 vs 1056 bytes for the same write instruction), so one of
|
|
819
|
+
// them was wrong. Removed; chadbuffer.ts is the single implementation.
|
|
820
|
+
|
|
821
|
+
// ==========================================================================
|
|
822
|
+
// Explorer (on-chain account fetchers & parsers)
|
|
823
|
+
// ==========================================================================
|
|
824
|
+
|
|
825
|
+
export {
|
|
826
|
+
fetchExplorerDeposits,
|
|
827
|
+
fetchExplorerTransfers,
|
|
828
|
+
fetchExplorerRedemptions,
|
|
829
|
+
parseNullifierRecord,
|
|
830
|
+
parseRedemptionRequest,
|
|
831
|
+
NULLIFIER_RECORD_SIZE,
|
|
832
|
+
REDEMPTION_REQUEST_SIZE,
|
|
833
|
+
NULLIFIER_RECORD_DISCRIMINATOR,
|
|
834
|
+
REDEMPTION_REQUEST_DISCRIMINATOR,
|
|
835
|
+
OPERATION_TYPE_LABELS,
|
|
836
|
+
type ExplorerDeposit,
|
|
837
|
+
type ExplorerTransferEvent,
|
|
838
|
+
type ExplorerRedemption,
|
|
839
|
+
type IndexerLeaf,
|
|
840
|
+
} from "./explorer";
|
|
841
|
+
|
|
842
|
+
// ==========================================================================
|
|
843
|
+
// Event Parsing (sol_log_data events from on-chain program)
|
|
844
|
+
// ==========================================================================
|
|
845
|
+
|
|
846
|
+
export {
|
|
847
|
+
parseProgramEvents,
|
|
848
|
+
parseNullifierSpentEvent,
|
|
849
|
+
parseStealthAnnouncementEvent,
|
|
850
|
+
parseSenderMemoEvent,
|
|
851
|
+
parseBtcOriginAttestationEvent,
|
|
852
|
+
parseAuditorCiphertextEvent,
|
|
853
|
+
EVENT_NULLIFIER_SPENT,
|
|
854
|
+
EVENT_STEALTH_ANNOUNCEMENT,
|
|
855
|
+
EVENT_NULLIFIERS_BATCH,
|
|
856
|
+
EVENT_ANNOUNCEMENTS_BATCH,
|
|
857
|
+
EVENT_SENDER_MEMO,
|
|
858
|
+
EVENT_BTC_ORIGIN_ATTESTATION,
|
|
859
|
+
EVENT_AUDITOR_CIPHERTEXT,
|
|
860
|
+
type NullifierSpentEvent,
|
|
861
|
+
type StealthAnnouncementEvent,
|
|
862
|
+
type SenderMemoEvent,
|
|
863
|
+
type BtcOriginAttestationEvent,
|
|
864
|
+
type AuditorCiphertextEvent,
|
|
865
|
+
type ProgramEvent,
|
|
866
|
+
} from "./events";
|
|
867
|
+
|
|
868
|
+
// ==========================================================================
|
|
869
|
+
// Announcement Client (WS + REST + RPC fallback)
|
|
870
|
+
// ==========================================================================
|
|
871
|
+
|
|
872
|
+
export {
|
|
873
|
+
AnnouncementClient,
|
|
874
|
+
type AnnouncementClientConfig,
|
|
875
|
+
type AnnouncementListener,
|
|
876
|
+
} from "./announcement-client";
|
|
877
|
+
|
|
878
|
+
// ==========================================================================
|
|
879
|
+
// Event Client (unified WS + REST for all event types)
|
|
880
|
+
// ==========================================================================
|
|
881
|
+
|
|
882
|
+
export {
|
|
883
|
+
EventClient,
|
|
884
|
+
type LeafInsertedEvent as EventLeafInserted,
|
|
885
|
+
type NullifierSpentEvent as EventNullifierSpent,
|
|
886
|
+
type AnnouncementEvent as EventAnnouncement,
|
|
887
|
+
type ServerEvent as EventServerEvent,
|
|
888
|
+
type EventListener,
|
|
889
|
+
type TreeStatusResponse,
|
|
890
|
+
type NullifierPdasResponse,
|
|
891
|
+
} from "./event-client";
|
|
892
|
+
|
|
893
|
+
// ==========================================================================
|
|
894
|
+
// High-Level Client (Phase 1: init + auth + balance)
|
|
895
|
+
// ==========================================================================
|
|
896
|
+
|
|
897
|
+
export {
|
|
898
|
+
UTXOpiaClient,
|
|
899
|
+
type UTXOpiaClientConfig,
|
|
900
|
+
type TokenDefinition,
|
|
901
|
+
type InboxNote as ClientInboxNote,
|
|
902
|
+
} from "./client";
|