@veilo/sdk-core 0.3.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +289 -1262
- package/dist/cjs/accounts/admin.d.ts +84 -0
- package/dist/cjs/accounts/admin.js +208 -0
- package/dist/cjs/accounts/errors.d.ts +6 -0
- package/dist/cjs/accounts/errors.js +98 -0
- package/dist/cjs/accounts/index.d.ts +4 -0
- package/dist/cjs/accounts/index.js +20 -0
- package/dist/cjs/accounts/pdas.d.ts +23 -0
- package/dist/cjs/accounts/pdas.js +44 -0
- package/dist/cjs/accounts/queries.d.ts +41 -0
- package/dist/cjs/accounts/queries.js +95 -0
- package/dist/cjs/client.d.ts +2 -407
- package/dist/cjs/client.js +17 -912
- package/dist/cjs/cloak/client.d.ts +28 -0
- package/dist/cjs/cloak/client.js +68 -0
- package/dist/cjs/cloak/errors.d.ts +13 -0
- package/dist/cjs/cloak/errors.js +25 -0
- package/dist/cjs/cloak/helpers.d.ts +6 -0
- package/dist/cjs/cloak/helpers.js +35 -0
- package/dist/cjs/cloak/index.d.ts +6 -0
- package/dist/cjs/cloak/index.js +24 -0
- package/dist/cjs/cloak/polling.d.ts +7 -0
- package/dist/cjs/cloak/polling.js +66 -0
- package/dist/cjs/cloak/transport.d.ts +15 -0
- package/dist/cjs/cloak/transport.js +119 -0
- package/dist/cjs/cloak/types.d.ts +188 -0
- package/dist/cjs/cloak/types.js +5 -0
- package/dist/cjs/cloak.d.ts +1 -0
- package/dist/cjs/cloak.js +18 -0
- package/dist/cjs/compactNote.d.ts +128 -0
- package/dist/cjs/compactNote.js +191 -0
- package/dist/cjs/events.d.ts +1 -1
- package/dist/cjs/events.js +2 -2
- package/dist/cjs/idl/privacy_pool.d.ts +5 -0
- package/dist/cjs/idl/privacy_pool.js +15218 -0
- package/dist/cjs/index.d.ts +17 -13
- package/dist/cjs/index.js +43 -30
- package/dist/cjs/merkle.d.ts +13 -0
- package/dist/cjs/merkle.js +31 -8
- package/dist/cjs/notes/encryption.d.ts +41 -0
- package/dist/cjs/notes/encryption.js +75 -0
- package/dist/cjs/notes/index.d.ts +5 -0
- package/dist/cjs/notes/index.js +21 -0
- package/dist/cjs/notes/mailbox.d.ts +70 -0
- package/dist/cjs/notes/mailbox.js +164 -0
- package/dist/cjs/notes/model.d.ts +91 -0
- package/dist/cjs/notes/model.js +109 -0
- package/dist/cjs/notes/nullifier.d.ts +27 -0
- package/dist/cjs/notes/nullifier.js +45 -0
- package/dist/cjs/notes/recovery.d.ts +10 -0
- package/dist/cjs/notes/recovery.js +31 -0
- package/dist/cjs/program.d.ts +11 -0
- package/dist/cjs/program.js +26 -3
- package/dist/cjs/proof.d.ts +1 -183
- package/dist/cjs/proof.js +16 -290
- package/dist/cjs/proofs/encoding.d.ts +17 -0
- package/dist/cjs/proofs/encoding.js +72 -0
- package/dist/cjs/proofs/formatting.d.ts +6 -0
- package/dist/cjs/proofs/formatting.js +34 -0
- package/dist/cjs/proofs/index.d.ts +5 -0
- package/dist/cjs/proofs/index.js +21 -0
- package/dist/cjs/proofs/swap.d.ts +87 -0
- package/dist/cjs/proofs/swap.js +144 -0
- package/dist/cjs/proofs/transaction.d.ts +28 -0
- package/dist/cjs/proofs/transaction.js +110 -0
- package/dist/cjs/proofs/types.d.ts +70 -0
- package/dist/cjs/proofs/types.js +2 -0
- package/dist/cjs/prover.d.ts +4 -1
- package/dist/cjs/prover.js +12 -2
- package/dist/cjs/random.d.ts +16 -0
- package/dist/cjs/random.js +28 -0
- package/dist/cjs/relayer/client.d.ts +61 -0
- package/dist/cjs/relayer/client.js +151 -0
- package/dist/cjs/relayer/crypto.d.ts +5 -0
- package/dist/cjs/relayer/crypto.js +26 -0
- package/dist/cjs/relayer/encoding.d.ts +2 -0
- package/dist/cjs/relayer/encoding.js +23 -0
- package/dist/cjs/relayer/errors.d.ts +7 -0
- package/dist/cjs/relayer/errors.js +17 -0
- package/dist/cjs/relayer/index.d.ts +3 -0
- package/dist/cjs/relayer/index.js +19 -0
- package/dist/cjs/relayer/transport.d.ts +17 -0
- package/dist/cjs/relayer/transport.js +63 -0
- package/dist/cjs/relayer/types.d.ts +276 -0
- package/dist/cjs/relayer/types.js +5 -0
- package/dist/cjs/relayer.d.ts +1 -295
- package/dist/cjs/relayer.js +15 -243
- package/dist/cjs/shield/alt.d.ts +87 -0
- package/dist/cjs/shield/alt.js +194 -0
- package/dist/cjs/shield/computeBudget.d.ts +61 -0
- package/dist/cjs/shield/computeBudget.js +64 -0
- package/dist/cjs/shield/errors.d.ts +58 -0
- package/dist/cjs/shield/errors.js +121 -0
- package/dist/cjs/shield/finalize.d.ts +45 -0
- package/dist/cjs/shield/finalize.js +119 -0
- package/dist/cjs/shield/index.d.ts +35 -0
- package/dist/cjs/shield/index.js +68 -0
- package/dist/cjs/shield/ix.d.ts +54 -0
- package/dist/cjs/shield/ix.js +119 -0
- package/dist/cjs/shield/owner.d.ts +36 -0
- package/dist/cjs/shield/owner.js +127 -0
- package/dist/cjs/shield/ports.d.ts +43 -0
- package/dist/cjs/shield/ports.js +153 -0
- package/dist/cjs/shield/preflight.d.ts +30 -0
- package/dist/cjs/shield/preflight.js +154 -0
- package/dist/cjs/shield/shield.d.ts +68 -0
- package/dist/cjs/shield/shield.js +500 -0
- package/dist/cjs/shield/types.d.ts +202 -0
- package/dist/cjs/shield/types.js +2 -0
- package/dist/cjs/transactions/deposit.d.ts +94 -0
- package/dist/cjs/transactions/deposit.js +234 -0
- package/dist/cjs/transactions/index.d.ts +7 -0
- package/dist/cjs/transactions/index.js +26 -0
- package/dist/cjs/transactions/swap.d.ts +71 -0
- package/dist/cjs/transactions/swap.js +184 -0
- package/dist/cjs/transactions/transact.d.ts +34 -0
- package/dist/cjs/transactions/transact.js +146 -0
- package/dist/cjs/transactions/transfer.d.ts +51 -0
- package/dist/cjs/transactions/transfer.js +106 -0
- package/dist/cjs/transactions/withdraw.d.ts +52 -0
- package/dist/cjs/transactions/withdraw.js +104 -0
- package/dist/cjs/utxo.d.ts +1 -215
- package/dist/cjs/utxo.js +15 -391
- package/dist/esm/accounts/admin.d.ts +84 -0
- package/dist/esm/accounts/admin.js +165 -0
- package/dist/esm/accounts/errors.d.ts +6 -0
- package/dist/esm/accounts/errors.js +95 -0
- package/dist/esm/accounts/index.d.ts +4 -0
- package/dist/esm/accounts/index.js +4 -0
- package/dist/esm/accounts/pdas.d.ts +23 -0
- package/dist/esm/accounts/pdas.js +38 -0
- package/dist/esm/accounts/queries.d.ts +41 -0
- package/dist/esm/accounts/queries.js +88 -0
- package/dist/esm/client.d.ts +2 -0
- package/dist/esm/client.js +3 -887
- package/dist/esm/cloak/client.d.ts +28 -0
- package/dist/esm/cloak/client.js +64 -0
- package/dist/esm/cloak/errors.d.ts +13 -0
- package/dist/esm/cloak/errors.js +21 -0
- package/dist/esm/cloak/helpers.d.ts +6 -0
- package/dist/esm/cloak/helpers.js +31 -0
- package/dist/esm/cloak/index.d.ts +6 -0
- package/dist/esm/cloak/index.js +6 -0
- package/dist/esm/cloak/polling.d.ts +7 -0
- package/dist/esm/cloak/polling.js +63 -0
- package/dist/esm/cloak/transport.d.ts +15 -0
- package/dist/esm/cloak/transport.js +115 -0
- package/dist/esm/cloak/types.d.ts +188 -0
- package/dist/esm/cloak/types.js +4 -0
- package/dist/esm/cloak.d.ts +1 -0
- package/dist/esm/cloak.js +2 -0
- package/dist/esm/compactNote.d.ts +128 -0
- package/dist/esm/compactNote.js +179 -0
- package/dist/esm/config.d.ts +82 -0
- package/dist/esm/events.d.ts +77 -0
- package/dist/esm/events.js +1 -1
- package/dist/esm/idl/privacy_pool.d.ts +5 -0
- package/dist/esm/idl/privacy_pool.js +15216 -0
- package/dist/esm/index.d.ts +17 -0
- package/dist/esm/index.js +20 -11
- package/dist/esm/merkle.d.ts +77 -0
- package/dist/esm/merkle.js +23 -1
- package/dist/esm/notes/encryption.d.ts +41 -0
- package/dist/esm/notes/encryption.js +67 -0
- package/dist/esm/notes/index.d.ts +5 -0
- package/dist/esm/notes/index.js +5 -0
- package/dist/esm/notes/mailbox.d.ts +70 -0
- package/dist/esm/notes/mailbox.js +154 -0
- package/dist/esm/notes/model.d.ts +91 -0
- package/dist/esm/notes/model.js +99 -0
- package/dist/esm/notes/nullifier.d.ts +27 -0
- package/dist/esm/notes/nullifier.js +40 -0
- package/dist/esm/notes/recovery.d.ts +10 -0
- package/dist/esm/notes/recovery.js +28 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/poseidon.d.ts +29 -0
- package/dist/esm/program.d.ts +37 -0
- package/dist/esm/program.js +23 -1
- package/dist/esm/proof.d.ts +1 -0
- package/dist/esm/proof.js +2 -281
- package/dist/esm/proofs/encoding.d.ts +17 -0
- package/dist/esm/proofs/encoding.js +68 -0
- package/dist/esm/proofs/formatting.d.ts +6 -0
- package/dist/esm/proofs/formatting.js +31 -0
- package/dist/esm/proofs/index.d.ts +5 -0
- package/dist/esm/proofs/index.js +5 -0
- package/dist/esm/proofs/swap.d.ts +87 -0
- package/dist/esm/proofs/swap.js +138 -0
- package/dist/esm/proofs/transaction.d.ts +28 -0
- package/dist/esm/proofs/transaction.js +105 -0
- package/dist/esm/proofs/types.d.ts +70 -0
- package/dist/esm/proofs/types.js +1 -0
- package/dist/esm/prover.d.ts +57 -0
- package/dist/esm/prover.js +10 -1
- package/dist/esm/random.d.ts +16 -0
- package/dist/esm/random.js +21 -0
- package/dist/esm/relayer/client.d.ts +61 -0
- package/dist/esm/relayer/client.js +144 -0
- package/dist/esm/relayer/crypto.d.ts +5 -0
- package/dist/esm/relayer/crypto.js +20 -0
- package/dist/esm/relayer/encoding.d.ts +2 -0
- package/dist/esm/relayer/encoding.js +19 -0
- package/dist/esm/relayer/errors.d.ts +7 -0
- package/dist/esm/relayer/errors.js +13 -0
- package/dist/esm/relayer/index.d.ts +3 -0
- package/dist/esm/relayer/index.js +3 -0
- package/dist/esm/relayer/transport.d.ts +17 -0
- package/dist/esm/relayer/transport.js +59 -0
- package/dist/esm/relayer/types.d.ts +276 -0
- package/dist/esm/relayer/types.js +4 -0
- package/dist/esm/relayer.d.ts +1 -0
- package/dist/esm/relayer.js +2 -238
- package/dist/esm/retry.d.ts +32 -0
- package/dist/esm/shield/alt.d.ts +87 -0
- package/dist/esm/shield/alt.js +186 -0
- package/dist/esm/shield/computeBudget.d.ts +61 -0
- package/dist/esm/shield/computeBudget.js +61 -0
- package/dist/esm/shield/errors.d.ts +58 -0
- package/dist/esm/shield/errors.js +115 -0
- package/dist/esm/shield/finalize.d.ts +45 -0
- package/dist/esm/shield/finalize.js +83 -0
- package/dist/esm/shield/index.d.ts +35 -0
- package/dist/esm/shield/index.js +32 -0
- package/dist/esm/shield/ix.d.ts +54 -0
- package/dist/esm/shield/ix.js +82 -0
- package/dist/esm/shield/owner.d.ts +36 -0
- package/dist/esm/shield/owner.js +123 -0
- package/dist/esm/shield/ports.d.ts +43 -0
- package/dist/esm/shield/ports.js +147 -0
- package/dist/esm/shield/preflight.d.ts +30 -0
- package/dist/esm/shield/preflight.js +151 -0
- package/dist/esm/shield/shield.d.ts +68 -0
- package/dist/esm/shield/shield.js +493 -0
- package/dist/esm/shield/types.d.ts +202 -0
- package/dist/esm/shield/types.js +1 -0
- package/dist/esm/transactions/deposit.d.ts +94 -0
- package/dist/esm/transactions/deposit.js +198 -0
- package/dist/esm/transactions/index.d.ts +7 -0
- package/dist/esm/transactions/index.js +7 -0
- package/dist/esm/transactions/swap.d.ts +71 -0
- package/dist/esm/transactions/swap.js +144 -0
- package/dist/esm/transactions/transact.d.ts +34 -0
- package/dist/esm/transactions/transact.js +110 -0
- package/dist/esm/transactions/transfer.d.ts +51 -0
- package/dist/esm/transactions/transfer.js +103 -0
- package/dist/esm/transactions/withdraw.d.ts +52 -0
- package/dist/esm/transactions/withdraw.js +101 -0
- package/dist/esm/utxo.d.ts +1 -0
- package/dist/esm/utxo.js +2 -372
- package/package.json +111 -15
package/dist/cjs/relayer.d.ts
CHANGED
|
@@ -1,295 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
/** Base URL of the relayer (e.g. "https://relayer.veilo.io") */
|
|
3
|
-
relayerUrl: string;
|
|
4
|
-
/** API key sent as x-api-key header */
|
|
5
|
-
apiKey: string;
|
|
6
|
-
/** Relayer's NaCl box public key (base64-encoded, 32 bytes) */
|
|
7
|
-
relayerPublicKey: string;
|
|
8
|
-
/** Optional JWT auth token for authenticated endpoints */
|
|
9
|
-
authToken?: string;
|
|
10
|
-
}
|
|
11
|
-
/** Structured error thrown by VeiloRelayerClient on API failures. */
|
|
12
|
-
export declare class VeiloApiError extends Error {
|
|
13
|
-
code: string;
|
|
14
|
-
status: number;
|
|
15
|
-
constructor(code: string, message: string, status: number);
|
|
16
|
-
}
|
|
17
|
-
/** Retry configuration for the relayer HTTP client. */
|
|
18
|
-
export interface RetryPolicy {
|
|
19
|
-
/** Max number of retry attempts (default: 3) */
|
|
20
|
-
maxRetries: number;
|
|
21
|
-
/** Base delay in ms for exponential backoff (default: 1000) */
|
|
22
|
-
baseDelayMs: number;
|
|
23
|
-
/** HTTP status codes that trigger a retry (default: [429, 502, 503, 504]) */
|
|
24
|
-
retryableStatuses: number[];
|
|
25
|
-
}
|
|
26
|
-
export interface RelayerEncryptedNote {
|
|
27
|
-
noteId: string;
|
|
28
|
-
commitment: string;
|
|
29
|
-
ephemeralPublicKey: string;
|
|
30
|
-
encryptedBlob: string;
|
|
31
|
-
timestamp: number;
|
|
32
|
-
blockHeight?: number;
|
|
33
|
-
txSignature?: string;
|
|
34
|
-
spent?: boolean;
|
|
35
|
-
onchainId?: string;
|
|
36
|
-
spentTx?: string;
|
|
37
|
-
spentAt?: number;
|
|
38
|
-
}
|
|
39
|
-
export interface QueryNotesRequest {
|
|
40
|
-
lastCheckedTimestamp?: number;
|
|
41
|
-
limit?: number;
|
|
42
|
-
offset?: number;
|
|
43
|
-
walletPublicKey?: string;
|
|
44
|
-
}
|
|
45
|
-
export interface QueryNotesResponse {
|
|
46
|
-
success: boolean;
|
|
47
|
-
notes: RelayerEncryptedNote[];
|
|
48
|
-
total: number;
|
|
49
|
-
limit: number;
|
|
50
|
-
offset: number;
|
|
51
|
-
}
|
|
52
|
-
export interface SaveEncryptedNoteRequest {
|
|
53
|
-
commitment: string;
|
|
54
|
-
ephemeralPublicKey: string;
|
|
55
|
-
encryptedBlob: string;
|
|
56
|
-
timestamp: number;
|
|
57
|
-
blockHeight?: number;
|
|
58
|
-
txSignature?: string;
|
|
59
|
-
recipientWalletPublicKey?: string;
|
|
60
|
-
}
|
|
61
|
-
export interface SaveEncryptedNoteResponse {
|
|
62
|
-
success: boolean;
|
|
63
|
-
noteId?: string;
|
|
64
|
-
message?: string;
|
|
65
|
-
error?: string;
|
|
66
|
-
}
|
|
67
|
-
export interface MerkleRootResponse {
|
|
68
|
-
success: boolean;
|
|
69
|
-
data: {
|
|
70
|
-
root: string;
|
|
71
|
-
nextIndex: number;
|
|
72
|
-
treeId: number;
|
|
73
|
-
onChainTreeId: number;
|
|
74
|
-
mintAddress: string;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export interface MerkleTreeResponse {
|
|
78
|
-
success: boolean;
|
|
79
|
-
data: {
|
|
80
|
-
treeId: number;
|
|
81
|
-
onChainTreeId: number;
|
|
82
|
-
mintAddress: string;
|
|
83
|
-
height: number;
|
|
84
|
-
nextIndex: number;
|
|
85
|
-
root: string;
|
|
86
|
-
totalCommitments: number;
|
|
87
|
-
leaves: Array<{
|
|
88
|
-
commitment: string;
|
|
89
|
-
index: number;
|
|
90
|
-
txSignature: string;
|
|
91
|
-
slot: number;
|
|
92
|
-
timestamp: string;
|
|
93
|
-
}>;
|
|
94
|
-
reconstructionInfo: {
|
|
95
|
-
instructions: string;
|
|
96
|
-
treeHeight: number;
|
|
97
|
-
hashFunction?: string;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
export interface TransactNote {
|
|
102
|
-
commitment: string;
|
|
103
|
-
privateKey: string;
|
|
104
|
-
publicKey: string;
|
|
105
|
-
blinding: string;
|
|
106
|
-
amount: string;
|
|
107
|
-
nullifier: string;
|
|
108
|
-
leafIndex?: number;
|
|
109
|
-
noteId?: string;
|
|
110
|
-
}
|
|
111
|
-
export interface WithdrawRequest {
|
|
112
|
-
notes: TransactNote[];
|
|
113
|
-
recipient: string;
|
|
114
|
-
amount: string;
|
|
115
|
-
userPublicKey: string;
|
|
116
|
-
mintAddress: string;
|
|
117
|
-
}
|
|
118
|
-
export interface WithdrawResponse {
|
|
119
|
-
success: boolean;
|
|
120
|
-
message: string;
|
|
121
|
-
data?: {
|
|
122
|
-
withdrawRecipient: string;
|
|
123
|
-
withdrawAmount: number;
|
|
124
|
-
changeAmount: number;
|
|
125
|
-
changeNote: {
|
|
126
|
-
commitment: string;
|
|
127
|
-
privateKey: string;
|
|
128
|
-
publicKey: string;
|
|
129
|
-
blinding: string;
|
|
130
|
-
amount: string;
|
|
131
|
-
nullifier: string;
|
|
132
|
-
};
|
|
133
|
-
spentNoteIds?: string[];
|
|
134
|
-
txSignature?: string;
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
export interface PrivateTransferRequest {
|
|
138
|
-
notes: TransactNote[];
|
|
139
|
-
amount: string;
|
|
140
|
-
recipientUsername: string;
|
|
141
|
-
userPublicKey?: string;
|
|
142
|
-
mintAddress?: string;
|
|
143
|
-
}
|
|
144
|
-
export interface PrivateTransferResponse {
|
|
145
|
-
success: boolean;
|
|
146
|
-
message: string;
|
|
147
|
-
data?: {
|
|
148
|
-
recipient: string;
|
|
149
|
-
transferAmount: number;
|
|
150
|
-
senderChangeAmount: number;
|
|
151
|
-
txSignature: string;
|
|
152
|
-
recipientNote: {
|
|
153
|
-
commitment: string;
|
|
154
|
-
amount: string;
|
|
155
|
-
leafIndex: number;
|
|
156
|
-
savedNoteId: string;
|
|
157
|
-
};
|
|
158
|
-
senderChangeNote: {
|
|
159
|
-
commitment: string;
|
|
160
|
-
privateKey: string;
|
|
161
|
-
publicKey: string;
|
|
162
|
-
blinding: string;
|
|
163
|
-
amount: string;
|
|
164
|
-
leafIndex: number;
|
|
165
|
-
savedNoteId: string;
|
|
166
|
-
} | null;
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
export interface PrivateSwapRequest {
|
|
170
|
-
notes: TransactNote[];
|
|
171
|
-
sourceMintAddress: string;
|
|
172
|
-
destMintAddress: string;
|
|
173
|
-
sourceJupiterMint?: string;
|
|
174
|
-
destJupiterMint?: string;
|
|
175
|
-
swapAmountRaw: string;
|
|
176
|
-
minAmountOut: string;
|
|
177
|
-
slippageBps: number;
|
|
178
|
-
userPublicKey: string;
|
|
179
|
-
veiloPublicKey: string;
|
|
180
|
-
}
|
|
181
|
-
export interface PrivateSwapResponse {
|
|
182
|
-
success: boolean;
|
|
183
|
-
message: string;
|
|
184
|
-
data?: {
|
|
185
|
-
txSignature: string;
|
|
186
|
-
swapAmountRaw: string;
|
|
187
|
-
outputAmount: string;
|
|
188
|
-
minAmountOut: string;
|
|
189
|
-
changeAmount: string;
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
export interface ChallengeResponse {
|
|
193
|
-
success: boolean;
|
|
194
|
-
challenge: string;
|
|
195
|
-
expiresAt: number;
|
|
196
|
-
}
|
|
197
|
-
export interface RegisterRequest {
|
|
198
|
-
username: string;
|
|
199
|
-
walletPublicKey: string;
|
|
200
|
-
signature: string;
|
|
201
|
-
challenge: string;
|
|
202
|
-
veiloPublicKey: string;
|
|
203
|
-
}
|
|
204
|
-
export interface RegisterResponse {
|
|
205
|
-
success: boolean;
|
|
206
|
-
token: string;
|
|
207
|
-
message?: string;
|
|
208
|
-
}
|
|
209
|
-
export interface RestoreRequest {
|
|
210
|
-
walletPublicKey: string;
|
|
211
|
-
signature: string;
|
|
212
|
-
challenge: string;
|
|
213
|
-
}
|
|
214
|
-
export interface RestoreResponse {
|
|
215
|
-
success: boolean;
|
|
216
|
-
token: string;
|
|
217
|
-
username: string;
|
|
218
|
-
veiloPublicKey: string;
|
|
219
|
-
}
|
|
220
|
-
export interface CheckUsernameResponse {
|
|
221
|
-
success: boolean;
|
|
222
|
-
available: boolean;
|
|
223
|
-
}
|
|
224
|
-
export interface VeiloPublicKeyResponse {
|
|
225
|
-
success: boolean;
|
|
226
|
-
username: string;
|
|
227
|
-
pubK: string;
|
|
228
|
-
veiloPublicKey: string;
|
|
229
|
-
}
|
|
230
|
-
export interface DeleteUserDataResponse {
|
|
231
|
-
success: boolean;
|
|
232
|
-
message: string;
|
|
233
|
-
deletedCount?: number;
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* HTTP client for the Veilo relayer API.
|
|
237
|
-
*
|
|
238
|
-
* Handles auth, notes, merkle, and encrypted transact endpoints with
|
|
239
|
-
* automatic retry on transient failures and NaCl box payload encryption.
|
|
240
|
-
*
|
|
241
|
-
* @example
|
|
242
|
-
* ```ts
|
|
243
|
-
* const client = new VeiloRelayerClient({
|
|
244
|
-
* relayerUrl: "https://relayer.veilo.io",
|
|
245
|
-
* apiKey: "your-api-key",
|
|
246
|
-
* relayerPublicKey: "<base64 NaCl public key>",
|
|
247
|
-
* });
|
|
248
|
-
* const root = await client.getMerkleRoot("So111...");
|
|
249
|
-
* ```
|
|
250
|
-
*/
|
|
251
|
-
export declare class VeiloRelayerClient {
|
|
252
|
-
private readonly baseUrl;
|
|
253
|
-
private readonly apiKey;
|
|
254
|
-
private readonly relayerPubKey;
|
|
255
|
-
private authToken;
|
|
256
|
-
private readonly retry;
|
|
257
|
-
constructor(config: VeiloRelayerConfig, retry?: Partial<RetryPolicy>);
|
|
258
|
-
/** Update the auth token (e.g. after register/restore). */
|
|
259
|
-
setAuthToken(token: string): void;
|
|
260
|
-
private headers;
|
|
261
|
-
private request;
|
|
262
|
-
private encrypt;
|
|
263
|
-
/** Request a signature challenge for wallet authentication. */
|
|
264
|
-
getChallenge(walletPublicKey: string): Promise<ChallengeResponse>;
|
|
265
|
-
/** Register a new account with a signed challenge. Returns a JWT auth token. */
|
|
266
|
-
register(data: RegisterRequest): Promise<RegisterResponse>;
|
|
267
|
-
/** Restore an existing account using a signed challenge. Returns a JWT auth token. */
|
|
268
|
-
restore(data: RestoreRequest): Promise<RestoreResponse>;
|
|
269
|
-
/** Check whether a username is available for registration. */
|
|
270
|
-
checkUsername(username: string): Promise<CheckUsernameResponse>;
|
|
271
|
-
/** Look up a user's Veilo public key by username or wallet public key. */
|
|
272
|
-
getVeiloPublicKey(params: {
|
|
273
|
-
username: string;
|
|
274
|
-
publicKey?: never;
|
|
275
|
-
} | {
|
|
276
|
-
publicKey: string;
|
|
277
|
-
username?: never;
|
|
278
|
-
}): Promise<VeiloPublicKeyResponse>;
|
|
279
|
-
/** Save an encrypted note to the relayer's database. */
|
|
280
|
-
saveEncryptedNote(data: SaveEncryptedNoteRequest): Promise<SaveEncryptedNoteResponse>;
|
|
281
|
-
/** Query encrypted notes for the authenticated user. Requires auth token. */
|
|
282
|
-
queryEncryptedNotes(params?: QueryNotesRequest): Promise<QueryNotesResponse>;
|
|
283
|
-
/** Delete all stored data for the authenticated user. Requires auth token. */
|
|
284
|
-
deleteUserData(): Promise<DeleteUserDataResponse>;
|
|
285
|
-
/** Fetch the current Merkle root for a pool, optionally filtered by mint and tree ID. */
|
|
286
|
-
getMerkleRoot(mintAddress?: string, treeId?: number): Promise<MerkleRootResponse>;
|
|
287
|
-
/** Fetch the full Merkle tree (all leaves) for a pool. */
|
|
288
|
-
getMerkleTree(mintAddress?: string, treeId?: number): Promise<MerkleTreeResponse>;
|
|
289
|
-
/** Submit an encrypted withdrawal request to the relayer. Not retried on failure. */
|
|
290
|
-
submitWithdraw(data: WithdrawRequest): Promise<WithdrawResponse>;
|
|
291
|
-
/** Submit an encrypted private transfer request. Not retried on failure. */
|
|
292
|
-
submitPrivateTransfer(data: PrivateTransferRequest): Promise<PrivateTransferResponse>;
|
|
293
|
-
/** Submit an encrypted private swap request. Not retried on failure. */
|
|
294
|
-
submitPrivateSwap(data: PrivateSwapRequest): Promise<PrivateSwapResponse>;
|
|
295
|
-
}
|
|
1
|
+
export * from "./relayer/index.js";
|
package/dist/cjs/relayer.js
CHANGED
|
@@ -1,246 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// =============================================================================
|
|
9
|
-
// Structured Error
|
|
10
|
-
// =============================================================================
|
|
11
|
-
/** Structured error thrown by VeiloRelayerClient on API failures. */
|
|
12
|
-
class VeiloApiError extends Error {
|
|
13
|
-
constructor(code, message, status) {
|
|
14
|
-
super(message);
|
|
15
|
-
this.name = "VeiloApiError";
|
|
16
|
-
this.code = code;
|
|
17
|
-
this.status = status;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.VeiloApiError = VeiloApiError;
|
|
21
|
-
const DEFAULT_RETRY = {
|
|
22
|
-
maxRetries: 3,
|
|
23
|
-
baseDelayMs: 1000,
|
|
24
|
-
retryableStatuses: [429, 502, 503, 504],
|
|
25
|
-
};
|
|
26
|
-
// =============================================================================
|
|
27
|
-
// Base64 helpers (no dependency on tweetnacl-util)
|
|
28
|
-
// =============================================================================
|
|
29
|
-
function toBase64(bytes) {
|
|
30
|
-
if (typeof Buffer !== "undefined") {
|
|
31
|
-
return Buffer.from(bytes).toString("base64");
|
|
32
|
-
}
|
|
33
|
-
return btoa(String.fromCharCode(...bytes));
|
|
34
|
-
}
|
|
35
|
-
function fromBase64(str) {
|
|
36
|
-
if (typeof Buffer !== "undefined") {
|
|
37
|
-
return new Uint8Array(Buffer.from(str, "base64"));
|
|
38
|
-
}
|
|
39
|
-
const binary = atob(str);
|
|
40
|
-
const bytes = new Uint8Array(binary.length);
|
|
41
|
-
for (let i = 0; i < binary.length; i++)
|
|
42
|
-
bytes[i] = binary.charCodeAt(i);
|
|
43
|
-
return bytes;
|
|
44
|
-
}
|
|
45
|
-
// =============================================================================
|
|
46
|
-
// Encryption
|
|
47
|
-
// =============================================================================
|
|
48
|
-
/**
|
|
49
|
-
* Encrypt a JSON-serializable payload for the relayer using NaCl box.
|
|
50
|
-
* Layout: [ephemeralPubKey (32)] [nonce (24)] [ciphertext (...)]
|
|
51
|
-
*/
|
|
52
|
-
function encryptForRelayer(data, relayerPublicKey) {
|
|
53
|
-
const ephemeral = tweetnacl_1.default.box.keyPair();
|
|
54
|
-
const message = new TextEncoder().encode(JSON.stringify(data));
|
|
55
|
-
const nonce = tweetnacl_1.default.randomBytes(tweetnacl_1.default.box.nonceLength);
|
|
56
|
-
const ciphertext = tweetnacl_1.default.box(message, nonce, relayerPublicKey, ephemeral.secretKey);
|
|
57
|
-
const payload = new Uint8Array(ephemeral.publicKey.length + nonce.length + ciphertext.length);
|
|
58
|
-
payload.set(ephemeral.publicKey, 0);
|
|
59
|
-
payload.set(nonce, ephemeral.publicKey.length);
|
|
60
|
-
payload.set(ciphertext, ephemeral.publicKey.length + nonce.length);
|
|
61
|
-
return toBase64(payload);
|
|
62
|
-
}
|
|
63
|
-
// =============================================================================
|
|
64
|
-
// Relayer Client
|
|
65
|
-
// =============================================================================
|
|
66
|
-
/**
|
|
67
|
-
* HTTP client for the Veilo relayer API.
|
|
68
|
-
*
|
|
69
|
-
* Handles auth, notes, merkle, and encrypted transact endpoints with
|
|
70
|
-
* automatic retry on transient failures and NaCl box payload encryption.
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```ts
|
|
74
|
-
* const client = new VeiloRelayerClient({
|
|
75
|
-
* relayerUrl: "https://relayer.veilo.io",
|
|
76
|
-
* apiKey: "your-api-key",
|
|
77
|
-
* relayerPublicKey: "<base64 NaCl public key>",
|
|
78
|
-
* });
|
|
79
|
-
* const root = await client.getMerkleRoot("So111...");
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
class VeiloRelayerClient {
|
|
83
|
-
constructor(config, retry) {
|
|
84
|
-
this.baseUrl = config.relayerUrl.replace(/\/+$/, "");
|
|
85
|
-
this.apiKey = config.apiKey;
|
|
86
|
-
this.relayerPubKey = fromBase64(config.relayerPublicKey);
|
|
87
|
-
this.authToken = config.authToken;
|
|
88
|
-
this.retry = { ...DEFAULT_RETRY, ...retry };
|
|
89
|
-
}
|
|
90
|
-
/** Update the auth token (e.g. after register/restore). */
|
|
91
|
-
setAuthToken(token) {
|
|
92
|
-
this.authToken = token;
|
|
93
|
-
}
|
|
94
|
-
// ---------------------------------------------------------------------------
|
|
95
|
-
// Internal helpers
|
|
96
|
-
// ---------------------------------------------------------------------------
|
|
97
|
-
headers(authenticated) {
|
|
98
|
-
const h = {
|
|
99
|
-
"Content-Type": "application/json",
|
|
100
|
-
"x-api-key": this.apiKey,
|
|
101
|
-
};
|
|
102
|
-
if (authenticated && this.authToken) {
|
|
103
|
-
h["Authorization"] = `Bearer ${this.authToken}`;
|
|
104
|
-
}
|
|
105
|
-
return h;
|
|
106
|
-
}
|
|
107
|
-
async request(method, path, opts = {}) {
|
|
108
|
-
const url = `${this.baseUrl}/api${path}`;
|
|
109
|
-
const { body, authenticated = false, retryable = true } = opts;
|
|
110
|
-
const maxAttempts = retryable ? this.retry.maxRetries + 1 : 1;
|
|
111
|
-
let lastError;
|
|
112
|
-
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
113
|
-
if (attempt > 0) {
|
|
114
|
-
const delay = this.retry.baseDelayMs * Math.pow(2, attempt - 1) +
|
|
115
|
-
Math.random() * 200;
|
|
116
|
-
await new Promise((r) => setTimeout(r, delay));
|
|
117
|
-
}
|
|
118
|
-
let res;
|
|
119
|
-
try {
|
|
120
|
-
res = await fetch(url, {
|
|
121
|
-
method,
|
|
122
|
-
headers: this.headers(authenticated),
|
|
123
|
-
body: body != null ? JSON.stringify(body) : undefined,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
catch (err) {
|
|
127
|
-
lastError = new VeiloApiError("NETWORK_ERROR", err.message || "Network request failed", 0);
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
const data = await res.json().catch(() => ({}));
|
|
131
|
-
if (res.ok && data.success !== false) {
|
|
132
|
-
return data;
|
|
133
|
-
}
|
|
134
|
-
lastError = new VeiloApiError(data.error || "UNKNOWN", data.message || data.error || `Request failed: ${res.status}`, res.status);
|
|
135
|
-
// Only retry on transient statuses
|
|
136
|
-
if (!this.retry.retryableStatuses.includes(res.status)) {
|
|
137
|
-
throw lastError;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
throw lastError;
|
|
141
|
-
}
|
|
142
|
-
encrypt(data) {
|
|
143
|
-
return encryptForRelayer({
|
|
144
|
-
...data,
|
|
145
|
-
timestamp: Date.now(),
|
|
146
|
-
nonce: toBase64(tweetnacl_1.default.randomBytes(32)),
|
|
147
|
-
}, this.relayerPubKey);
|
|
148
|
-
}
|
|
149
|
-
// ---------------------------------------------------------------------------
|
|
150
|
-
// Auth
|
|
151
|
-
// ---------------------------------------------------------------------------
|
|
152
|
-
/** Request a signature challenge for wallet authentication. */
|
|
153
|
-
async getChallenge(walletPublicKey) {
|
|
154
|
-
return this.request("POST", "/auth/challenge", {
|
|
155
|
-
body: { walletPublicKey },
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
/** Register a new account with a signed challenge. Returns a JWT auth token. */
|
|
159
|
-
async register(data) {
|
|
160
|
-
return this.request("POST", "/auth/register", { body: data });
|
|
161
|
-
}
|
|
162
|
-
/** Restore an existing account using a signed challenge. Returns a JWT auth token. */
|
|
163
|
-
async restore(data) {
|
|
164
|
-
return this.request("POST", "/auth/restore", { body: data });
|
|
165
|
-
}
|
|
166
|
-
/** Check whether a username is available for registration. */
|
|
167
|
-
async checkUsername(username) {
|
|
168
|
-
return this.request("GET", `/auth/checkUsername?username=${encodeURIComponent(username)}`);
|
|
169
|
-
}
|
|
170
|
-
/** Look up a user's Veilo public key by username or wallet public key. */
|
|
171
|
-
async getVeiloPublicKey(params) {
|
|
172
|
-
const query = "username" in params && params.username
|
|
173
|
-
? `username=${encodeURIComponent(params.username)}`
|
|
174
|
-
: `publicKey=${encodeURIComponent(params.publicKey)}`;
|
|
175
|
-
return this.request("GET", `/auth/veiloPublicKey?${query}`);
|
|
176
|
-
}
|
|
177
|
-
// ---------------------------------------------------------------------------
|
|
178
|
-
// Notes
|
|
179
|
-
// ---------------------------------------------------------------------------
|
|
180
|
-
/** Save an encrypted note to the relayer's database. */
|
|
181
|
-
async saveEncryptedNote(data) {
|
|
182
|
-
return this.request("POST", "/notes/save", { body: data });
|
|
183
|
-
}
|
|
184
|
-
/** Query encrypted notes for the authenticated user. Requires auth token. */
|
|
185
|
-
async queryEncryptedNotes(params = {}) {
|
|
186
|
-
return this.request("POST", "/notes/query", {
|
|
187
|
-
body: params,
|
|
188
|
-
authenticated: true,
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
/** Delete all stored data for the authenticated user. Requires auth token. */
|
|
192
|
-
async deleteUserData() {
|
|
193
|
-
return this.request("POST", "/notes/delete", { authenticated: true });
|
|
194
|
-
}
|
|
195
|
-
// ---------------------------------------------------------------------------
|
|
196
|
-
// Merkle
|
|
197
|
-
// ---------------------------------------------------------------------------
|
|
198
|
-
/** Fetch the current Merkle root for a pool, optionally filtered by mint and tree ID. */
|
|
199
|
-
async getMerkleRoot(mintAddress, treeId) {
|
|
200
|
-
const params = new URLSearchParams();
|
|
201
|
-
if (mintAddress)
|
|
202
|
-
params.append("mintAddress", mintAddress);
|
|
203
|
-
if (treeId !== undefined)
|
|
204
|
-
params.append("treeId", treeId.toString());
|
|
205
|
-
const qs = params.toString();
|
|
206
|
-
return this.request("GET", `/merkle/root${qs ? `?${qs}` : ""}`);
|
|
207
|
-
}
|
|
208
|
-
/** Fetch the full Merkle tree (all leaves) for a pool. */
|
|
209
|
-
async getMerkleTree(mintAddress, treeId) {
|
|
210
|
-
const params = new URLSearchParams();
|
|
211
|
-
if (mintAddress)
|
|
212
|
-
params.append("mintAddress", mintAddress);
|
|
213
|
-
if (treeId !== undefined)
|
|
214
|
-
params.append("treeId", treeId.toString());
|
|
215
|
-
const qs = params.toString();
|
|
216
|
-
return this.request("GET", `/merkle/tree${qs ? `?${qs}` : ""}`);
|
|
217
|
-
}
|
|
218
|
-
// ---------------------------------------------------------------------------
|
|
219
|
-
// Transact (encrypted payloads)
|
|
220
|
-
// ---------------------------------------------------------------------------
|
|
221
|
-
/** Submit an encrypted withdrawal request to the relayer. Not retried on failure. */
|
|
222
|
-
async submitWithdraw(data) {
|
|
223
|
-
const encryptedPayload = this.encrypt(data);
|
|
224
|
-
return this.request("POST", "/transact/withdra", {
|
|
225
|
-
body: { encryptedPayload },
|
|
226
|
-
retryable: false,
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
/** Submit an encrypted private transfer request. Not retried on failure. */
|
|
230
|
-
async submitPrivateTransfer(data) {
|
|
231
|
-
const encryptedPayload = this.encrypt(data);
|
|
232
|
-
return this.request("POST", "/transact/private-transfer", {
|
|
233
|
-
body: { encryptedPayload },
|
|
234
|
-
retryable: false,
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
/** Submit an encrypted private swap request. Not retried on failure. */
|
|
238
|
-
async submitPrivateSwap(data) {
|
|
239
|
-
const encryptedPayload = this.encrypt(data);
|
|
240
|
-
return this.request("POST", "/transact/private-swap", {
|
|
241
|
-
body: { encryptedPayload },
|
|
242
|
-
retryable: false,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
exports.VeiloRelayerClient = VeiloRelayerClient;
|
|
17
|
+
// Backward-compatible entry point. Relayer responsibilities live in src/relayer.
|
|
18
|
+
__exportStar(require("./relayer/index.js"), exports);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { AddressLookupTableAccount, Connection, PublicKey } from "@solana/web3.js";
|
|
2
|
+
import type { AltSource, ShieldCachePort } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Address lookup table handling for the shield path.
|
|
5
|
+
*
|
|
6
|
+
* The ALT is not an optimisation here — it is load-bearing. A `transact` carries
|
|
7
|
+
* 847 bytes of instruction data across 16 accounts, which is ~1500 bytes as a
|
|
8
|
+
* legacy transaction and therefore unlandable. Compressing the constant pool
|
|
9
|
+
* accounts to 1-byte indices is what brings it to ~1163 and leaves room for
|
|
10
|
+
* Phantom's Lighthouse guard instructions.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The shared, team-owned deposit table.
|
|
14
|
+
*
|
|
15
|
+
* Deliberately shared rather than per-wallet: creating a per-wallet table costs
|
|
16
|
+
* the signer an extra signature and unrecoverable rent, which is unacceptable to
|
|
17
|
+
* ask of an external wallet shielding once, and impossible to ask of a
|
|
18
|
+
* third-party platform's managed wallet.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SHARED_DEPOSIT_ALT: PublicKey;
|
|
21
|
+
/** Mints the shared table is provisioned for. */
|
|
22
|
+
export declare const SHARED_ALT_MINTS: {
|
|
23
|
+
symbol: string;
|
|
24
|
+
mint: PublicKey;
|
|
25
|
+
}[];
|
|
26
|
+
/**
|
|
27
|
+
* Load the shared table, and verify it actually covers this shield.
|
|
28
|
+
*
|
|
29
|
+
* The verification is the important part. Coverage is an *operational* property,
|
|
30
|
+
* not a code property: the table is populated by a script, and if a mint or a
|
|
31
|
+
* tree is missing, every one of its accounts falls back to a 32-byte static key
|
|
32
|
+
* and the transaction silently grows past 1232. Failing here with a list of the
|
|
33
|
+
* missing addresses is far better than failing at `signTransaction` with
|
|
34
|
+
* "transaction too large" and no indication why.
|
|
35
|
+
*/
|
|
36
|
+
export declare function sharedDepositAlt(address?: PublicKey, opts?: {
|
|
37
|
+
cache?: ShieldCachePort;
|
|
38
|
+
verifyCoverage?: boolean;
|
|
39
|
+
}): AltSource;
|
|
40
|
+
/** Use a table the caller already loaded. Skips both the RPC call and the coverage check. */
|
|
41
|
+
export declare function explicitAlt(account: AddressLookupTableAccount): AltSource;
|
|
42
|
+
type NamedKey = {
|
|
43
|
+
label: string;
|
|
44
|
+
address: PublicKey;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Accounts that must be in the table for a shield of `mint` into `outputTreeId`
|
|
48
|
+
* to fit.
|
|
49
|
+
*
|
|
50
|
+
* The signer, the two nullifier markers, and the user's token account are
|
|
51
|
+
* deliberately excluded: markers are unique per transaction and the others are
|
|
52
|
+
* per-user, so none can live in a shared table. They are the static keys the
|
|
53
|
+
* size budget accounts for.
|
|
54
|
+
*/
|
|
55
|
+
export declare function requiredAltKeys(params: {
|
|
56
|
+
mint: PublicKey;
|
|
57
|
+
outputTreeId: number;
|
|
58
|
+
programId?: PublicKey;
|
|
59
|
+
}): NamedKey[];
|
|
60
|
+
/**
|
|
61
|
+
* Everything the shared table should contain across every supported mint and
|
|
62
|
+
* every tree up to `maxTreeId`.
|
|
63
|
+
*
|
|
64
|
+
* Exported so this can be asserted in CI. The table currently only covers tree 0
|
|
65
|
+
* per mint, which means the size budget quietly loses 32 bytes of headroom the
|
|
66
|
+
* day tree 0 fills and `getBestTreeForDeposit` starts returning tree 1. That is
|
|
67
|
+
* a scheduled failure, and this function is how it gets caught before a user
|
|
68
|
+
* finds it.
|
|
69
|
+
*/
|
|
70
|
+
export declare function expectedDepositAltKeys(params: {
|
|
71
|
+
mints?: PublicKey[];
|
|
72
|
+
maxTreeId?: number;
|
|
73
|
+
programId?: PublicKey;
|
|
74
|
+
}): Promise<NamedKey[]>;
|
|
75
|
+
/** Diff the on-chain table against {@link expectedDepositAltKeys}. */
|
|
76
|
+
export declare function auditDepositAlt(connection: Connection, params?: {
|
|
77
|
+
address?: PublicKey;
|
|
78
|
+
mints?: PublicKey[];
|
|
79
|
+
maxTreeId?: number;
|
|
80
|
+
programId?: PublicKey;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
ok: boolean;
|
|
83
|
+
present: number;
|
|
84
|
+
missing: NamedKey[];
|
|
85
|
+
extra: string[];
|
|
86
|
+
}>;
|
|
87
|
+
export {};
|