@arcanetech/privacy-sdk-stellar 0.2.0 → 0.2.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/dist/index.d.ts +1051 -0
- package/dist/index.js +29 -16
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +739 -0
- package/dist/node.js +29 -16
- package/dist/node.js.map +1 -1
- package/dist/state/index.d.ts +753 -0
- package/dist/testing/index.d.ts +107 -0
- package/dist/testing/index.js +54 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/transact/index.d.ts +399 -0
- package/package.json +9 -4
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,739 @@
|
|
|
1
|
+
import * as _arcanetech_privacy_sdk_core from '@arcanetech/privacy-sdk-core';
|
|
2
|
+
import { OperationKind, DepositIntent, TransferIntent, WithdrawIntent, createRejectedOperation } from '@arcanetech/privacy-sdk-core';
|
|
3
|
+
export { isPreparedOperation } from '@arcanetech/privacy-sdk-core';
|
|
4
|
+
import * as _arcanetech_privacy_sdk_core_state from '@arcanetech/privacy-sdk-core/state';
|
|
5
|
+
import { StateBridgeAdapter } from '@arcanetech/privacy-sdk-core/state';
|
|
6
|
+
import { OnboardingPayload } from 'contract';
|
|
7
|
+
import { AuditPublicKey } from '@auditable/privacy-pool-zk-sdk';
|
|
8
|
+
|
|
9
|
+
type StellarPrivateRecordStatus = 'pending' | 'finalized' | 'spent';
|
|
10
|
+
interface StellarPrivateCoinNote {
|
|
11
|
+
value: string;
|
|
12
|
+
nullifier: string;
|
|
13
|
+
secret: string;
|
|
14
|
+
commitment: string;
|
|
15
|
+
asset_hi: string;
|
|
16
|
+
asset_lo: string;
|
|
17
|
+
application_id?: string;
|
|
18
|
+
}
|
|
19
|
+
type StellarRegistryStatus = 'registered' | 'unregistered';
|
|
20
|
+
type StellarTrustlineStatus = 'active' | 'inactive' | 'none';
|
|
21
|
+
type StellarTransactionConfirmationStatus = 'pending' | 'success' | 'failed';
|
|
22
|
+
interface StellarAsset {
|
|
23
|
+
id: number;
|
|
24
|
+
assetId: StellarAssetId;
|
|
25
|
+
name: string;
|
|
26
|
+
logoUrl: string | null;
|
|
27
|
+
issuerAddress: string | null;
|
|
28
|
+
clientContract: string | null;
|
|
29
|
+
poolContracts: string[];
|
|
30
|
+
poolContract: string;
|
|
31
|
+
mintable: boolean;
|
|
32
|
+
mintAmount: string | null;
|
|
33
|
+
decimals?: number | null;
|
|
34
|
+
}
|
|
35
|
+
interface StellarAssetsCatalog {
|
|
36
|
+
byId: Record<StellarAssetId, StellarAsset>;
|
|
37
|
+
listOrder: StellarAssetId[];
|
|
38
|
+
}
|
|
39
|
+
interface StellarPublicBalance {
|
|
40
|
+
owner: StellarAddress;
|
|
41
|
+
asset: StellarAssetId;
|
|
42
|
+
balance: string;
|
|
43
|
+
trustlineStatus: StellarTrustlineStatus;
|
|
44
|
+
}
|
|
45
|
+
interface StellarRegistryLookup {
|
|
46
|
+
owner: StellarAddress;
|
|
47
|
+
status: StellarRegistryStatus;
|
|
48
|
+
privateAddressStpl1?: string;
|
|
49
|
+
publicKeyXHex?: string;
|
|
50
|
+
publicKeyYHex?: string;
|
|
51
|
+
updatedAtLedger?: number;
|
|
52
|
+
cachedAt?: string;
|
|
53
|
+
}
|
|
54
|
+
interface StellarWalletPrivateAddressScalar {
|
|
55
|
+
owner: StellarAddress;
|
|
56
|
+
nonce: string;
|
|
57
|
+
scalarHex: string;
|
|
58
|
+
updatedAt?: string;
|
|
59
|
+
}
|
|
60
|
+
interface StellarWalletPrivateAddressRecord {
|
|
61
|
+
owner: StellarAddress;
|
|
62
|
+
nonce: string;
|
|
63
|
+
privateAddress: string;
|
|
64
|
+
createdAt: number;
|
|
65
|
+
}
|
|
66
|
+
interface StellarPoolMerkleState {
|
|
67
|
+
poolContract: string;
|
|
68
|
+
commitments: string[];
|
|
69
|
+
commitmentCount: number;
|
|
70
|
+
merkleRootHex: string;
|
|
71
|
+
updatedAt: number;
|
|
72
|
+
syncedLedger?: number;
|
|
73
|
+
}
|
|
74
|
+
interface StellarLeafEphemeral {
|
|
75
|
+
poolContract: string;
|
|
76
|
+
leafIndex: number;
|
|
77
|
+
xHex: string;
|
|
78
|
+
yHex: string;
|
|
79
|
+
cachedAt?: string;
|
|
80
|
+
}
|
|
81
|
+
interface StellarPendingClaim {
|
|
82
|
+
id: string;
|
|
83
|
+
owner: StellarAddress;
|
|
84
|
+
asset: StellarAssetId;
|
|
85
|
+
amount: bigint;
|
|
86
|
+
createdAt: string;
|
|
87
|
+
poolTxId?: string;
|
|
88
|
+
commitmentHex?: string;
|
|
89
|
+
nullifierHex?: string;
|
|
90
|
+
futureNullifierHashHex?: string;
|
|
91
|
+
assetHiHex?: string;
|
|
92
|
+
assetLoHex?: string;
|
|
93
|
+
nullifierFieldHex?: string;
|
|
94
|
+
secretHex?: string;
|
|
95
|
+
tempPublicKeyXHex?: string;
|
|
96
|
+
tempPublicKeyYHex?: string;
|
|
97
|
+
encryptedRecoveryBase64?: string;
|
|
98
|
+
createdAtLedger?: number;
|
|
99
|
+
}
|
|
100
|
+
interface StellarPendingClaimsPagination {
|
|
101
|
+
total: number;
|
|
102
|
+
page: number;
|
|
103
|
+
pageSize: number;
|
|
104
|
+
hasMore: boolean;
|
|
105
|
+
}
|
|
106
|
+
interface StellarPendingClaimsState {
|
|
107
|
+
items: StellarPendingClaim[];
|
|
108
|
+
pagination?: StellarPendingClaimsPagination;
|
|
109
|
+
}
|
|
110
|
+
interface StellarIncomingDelivery {
|
|
111
|
+
id: number;
|
|
112
|
+
privateAddress: string;
|
|
113
|
+
asset: StellarAssetId;
|
|
114
|
+
ciphertextBase64: string;
|
|
115
|
+
ephemeralKey: string;
|
|
116
|
+
tagBase64: string;
|
|
117
|
+
createdAt: string;
|
|
118
|
+
processed?: boolean;
|
|
119
|
+
}
|
|
120
|
+
interface StellarDeliverySyncState {
|
|
121
|
+
privateAddress: string;
|
|
122
|
+
asset: StellarAssetId;
|
|
123
|
+
bloomM: number;
|
|
124
|
+
bloomK: number;
|
|
125
|
+
bloomBitsBase64?: string;
|
|
126
|
+
lastPage?: number;
|
|
127
|
+
lastPolledAt?: string;
|
|
128
|
+
}
|
|
129
|
+
interface StellarPrivateRecord {
|
|
130
|
+
id: string;
|
|
131
|
+
owner: StellarAddress;
|
|
132
|
+
asset: StellarAssetId;
|
|
133
|
+
amount: bigint;
|
|
134
|
+
consumed: boolean;
|
|
135
|
+
status?: StellarPrivateRecordStatus;
|
|
136
|
+
poolContract?: string;
|
|
137
|
+
commitmentHex?: string;
|
|
138
|
+
nullifierHex?: string;
|
|
139
|
+
amountDisplay?: number;
|
|
140
|
+
deliveryId?: number;
|
|
141
|
+
privateAddress?: string;
|
|
142
|
+
txHash?: string;
|
|
143
|
+
coinNote?: StellarPrivateCoinNote;
|
|
144
|
+
depositScalarHex?: string;
|
|
145
|
+
precommitementHex?: string;
|
|
146
|
+
}
|
|
147
|
+
interface StellarPrivateAssetRow {
|
|
148
|
+
assetId: StellarAssetId;
|
|
149
|
+
poolContract: string;
|
|
150
|
+
totalAmount: bigint;
|
|
151
|
+
totalAmountDisplay: number;
|
|
152
|
+
}
|
|
153
|
+
interface StellarTransactionStatus {
|
|
154
|
+
txHash: string;
|
|
155
|
+
status: StellarTransactionConfirmationStatus;
|
|
156
|
+
ledger?: number;
|
|
157
|
+
createdAt?: string;
|
|
158
|
+
}
|
|
159
|
+
interface StellarAvailablePrivateRecordsFilter {
|
|
160
|
+
owner?: StellarAddress;
|
|
161
|
+
privateAddress?: string;
|
|
162
|
+
asset?: StellarAssetId;
|
|
163
|
+
}
|
|
164
|
+
interface StellarPendingClaimsFilter {
|
|
165
|
+
owner?: StellarAddress;
|
|
166
|
+
asset?: StellarAssetId;
|
|
167
|
+
}
|
|
168
|
+
interface StellarIncomingDeliveriesFilter {
|
|
169
|
+
privateAddress: string;
|
|
170
|
+
asset?: StellarAssetId;
|
|
171
|
+
includeProcessed?: boolean;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
type KytApplicationIdHints = [string, string, string, string];
|
|
175
|
+
|
|
176
|
+
type StellarPendingClaimSource = {
|
|
177
|
+
kind: 'pendingClaim';
|
|
178
|
+
claimId: string;
|
|
179
|
+
} | {
|
|
180
|
+
kind: 'pendingClaim';
|
|
181
|
+
claim: StellarPendingClaim;
|
|
182
|
+
};
|
|
183
|
+
type StellarTransferFromAddress = StellarAddress | StellarPendingClaimSource;
|
|
184
|
+
|
|
185
|
+
interface PoolMerkleStatePort {
|
|
186
|
+
get(poolContract: string): Promise<StellarPoolMerkleState | undefined>;
|
|
187
|
+
set(state: StellarPoolMerkleState): Promise<void>;
|
|
188
|
+
}
|
|
189
|
+
interface LeafEphemeralStatePort {
|
|
190
|
+
get(input: {
|
|
191
|
+
poolContract: string;
|
|
192
|
+
leafIndex: number;
|
|
193
|
+
}): Promise<StellarLeafEphemeral | undefined>;
|
|
194
|
+
set(ephemeral: StellarLeafEphemeral): Promise<void>;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
type StellarSignTransaction = (input: {
|
|
198
|
+
xdr: string;
|
|
199
|
+
networkPassphrase: string;
|
|
200
|
+
address: string;
|
|
201
|
+
}) => Promise<{
|
|
202
|
+
signedTxXdr: string;
|
|
203
|
+
}>;
|
|
204
|
+
|
|
205
|
+
interface TransferTemporaryRecipientKey {
|
|
206
|
+
temporaryScalarHex: string;
|
|
207
|
+
temporaryPrivateAddressStpl1: string;
|
|
208
|
+
}
|
|
209
|
+
interface TransferOnboardingRecipientNoteInput {
|
|
210
|
+
tokenAddress: string;
|
|
211
|
+
nullifier: string;
|
|
212
|
+
secret: string;
|
|
213
|
+
value: string;
|
|
214
|
+
}
|
|
215
|
+
interface TransferRecipientExecutionContext {
|
|
216
|
+
recipientPrivateAddressStpl1: string;
|
|
217
|
+
recipientStellarAddress?: string;
|
|
218
|
+
temporaryRecipientKey?: TransferTemporaryRecipientKey;
|
|
219
|
+
}
|
|
220
|
+
interface BuildTransferOnboardingAtExecuteInput {
|
|
221
|
+
ownerStellarAddress: string;
|
|
222
|
+
temporaryRecipientKey: TransferTemporaryRecipientKey;
|
|
223
|
+
recipientNote: TransferOnboardingRecipientNoteInput;
|
|
224
|
+
}
|
|
225
|
+
interface StellarKytEnvironment {
|
|
226
|
+
apiBaseUrl: string;
|
|
227
|
+
kytPassageRegistryContract: string;
|
|
228
|
+
registerPassageOnChain?: boolean;
|
|
229
|
+
}
|
|
230
|
+
interface StellarTransactEnvironment {
|
|
231
|
+
network: StellarNetworkConfig;
|
|
232
|
+
auditPublicKey?: AuditPublicKey;
|
|
233
|
+
kyt: StellarKytEnvironment;
|
|
234
|
+
signTransaction?: StellarSignTransaction;
|
|
235
|
+
resolveTokenContractId?: (assetId: StellarAssetId) => string | Promise<string>;
|
|
236
|
+
resolveSenderPrivKeyScalarHex?: (privateAddressStpl1: string) => Promise<string>;
|
|
237
|
+
readSenderPrivKeyScalarHex?: (privateAddressStpl1: string) => Promise<string | undefined>;
|
|
238
|
+
ensureSenderPrivKeyScalarHex?: (privateAddressStpl1: string) => Promise<string>;
|
|
239
|
+
resolveSenderPrivKeyScalarFromState?: (input: {
|
|
240
|
+
owner: string;
|
|
241
|
+
privateAddressStpl1: string;
|
|
242
|
+
}) => Promise<string | undefined>;
|
|
243
|
+
resolveTransferRecipientAtExecute?: (input: {
|
|
244
|
+
recipientStellarAddress: string;
|
|
245
|
+
walletPublicKey: string;
|
|
246
|
+
}) => Promise<TransferRecipientExecutionContext>;
|
|
247
|
+
buildTransferOnboardingAtExecute?: (input: BuildTransferOnboardingAtExecuteInput) => Promise<OnboardingPayload>;
|
|
248
|
+
resolveWalletPublicKey?: () => Promise<string>;
|
|
249
|
+
poolMerkleState?: PoolMerkleStatePort;
|
|
250
|
+
leafEphemeral?: LeafEphemeralStatePort;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
type StellarAddress = string;
|
|
254
|
+
type StellarAssetId = string;
|
|
255
|
+
|
|
256
|
+
type StellarTransferIntent = TransferIntent<StellarTransferFromAddress, StellarAssetId, bigint, StellarAddress>;
|
|
257
|
+
|
|
258
|
+
interface StellarPreparedOperation {
|
|
259
|
+
kind: OperationKind;
|
|
260
|
+
intent: DepositIntent<StellarAddress, StellarAssetId, bigint> | StellarTransferIntent | WithdrawIntent<StellarAddress, StellarAssetId, bigint>;
|
|
261
|
+
consumedRecords: StellarPrivateRecord[];
|
|
262
|
+
outputRecords: StellarPrivateRecord[];
|
|
263
|
+
submissionPayload: StellarSubmissionPayload;
|
|
264
|
+
transactArtifacts?: StellarTransactArtifacts;
|
|
265
|
+
}
|
|
266
|
+
interface StellarSubmissionPayload {
|
|
267
|
+
operationId: string;
|
|
268
|
+
signed: boolean;
|
|
269
|
+
txHash?: string;
|
|
270
|
+
}
|
|
271
|
+
interface StellarTransactArtifacts {
|
|
272
|
+
proofHex?: string;
|
|
273
|
+
publicHex?: string;
|
|
274
|
+
applicationIdsPlaintext?: KytApplicationIdHints;
|
|
275
|
+
tokenAddress?: string;
|
|
276
|
+
depositScalarHex?: string;
|
|
277
|
+
precommitementHex?: string;
|
|
278
|
+
commitmentHex?: string;
|
|
279
|
+
walletPublicKey?: string;
|
|
280
|
+
onboarding?: OnboardingPayload;
|
|
281
|
+
executeFinalizeRequired?: boolean;
|
|
282
|
+
pendingClaim?: StellarPendingClaim;
|
|
283
|
+
spendSource?: 'privateAddress' | 'pendingClaim';
|
|
284
|
+
}
|
|
285
|
+
interface StellarOperationReceipt {
|
|
286
|
+
operationId: string;
|
|
287
|
+
confirmed: boolean;
|
|
288
|
+
}
|
|
289
|
+
interface StellarNetworkConfig {
|
|
290
|
+
id: string;
|
|
291
|
+
rpcUrl: string;
|
|
292
|
+
networkPassphrase: string;
|
|
293
|
+
poolContract: string;
|
|
294
|
+
registryContract: string;
|
|
295
|
+
applicationId: string;
|
|
296
|
+
}
|
|
297
|
+
interface StellarBrowserAssets {
|
|
298
|
+
sdkWasm: ArrayBuffer;
|
|
299
|
+
circuitWasm: ArrayBuffer;
|
|
300
|
+
provingKey: ArrayBuffer;
|
|
301
|
+
}
|
|
302
|
+
interface StellarWalletAdapter {
|
|
303
|
+
getAddress(): Promise<StellarAddress>;
|
|
304
|
+
authorizeMessage(message: Uint8Array | string): Promise<Uint8Array>;
|
|
305
|
+
signTransactionPayload(payload: StellarSubmissionPayload): Promise<StellarSubmissionPayload>;
|
|
306
|
+
}
|
|
307
|
+
/** @internal Bridge-backed storage adapter; consumers pass {@link StateBridgeAdapter} instead. */
|
|
308
|
+
type StellarStateAdapter = StateBridgeAdapter;
|
|
309
|
+
interface StellarPolicyAdapter {
|
|
310
|
+
inspectOperation(kind: OperationKind, intent: DepositIntent<StellarAddress, StellarAssetId, bigint> | StellarTransferIntent | WithdrawIntent<StellarAddress, StellarAssetId, bigint>): Promise<void>;
|
|
311
|
+
}
|
|
312
|
+
interface StellarTransactEngine {
|
|
313
|
+
prepare(prepared: StellarPreparedOperation): Promise<StellarPreparedOperation>;
|
|
314
|
+
submit(prepared: StellarPreparedOperation, signedPayload: StellarSubmissionPayload): Promise<StellarOperationReceipt>;
|
|
315
|
+
}
|
|
316
|
+
interface StellarPrivacyClientConfigBase {
|
|
317
|
+
network: StellarNetworkConfig;
|
|
318
|
+
wallet: StellarWalletAdapter;
|
|
319
|
+
state: StellarStateAdapter;
|
|
320
|
+
auditPublicKeyHex?: string;
|
|
321
|
+
policy?: StellarPolicyAdapter;
|
|
322
|
+
transactEngine?: StellarTransactEngine;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
interface StellarBrowserPrivacyClientConfig extends StellarPrivacyClientConfigBase {
|
|
326
|
+
assets: StellarBrowserAssets;
|
|
327
|
+
transactEnvironment?: StellarTransactEnvironment;
|
|
328
|
+
}
|
|
329
|
+
/** Browser entrypoint config alias. */
|
|
330
|
+
type StellarPrivacyClientConfig = StellarBrowserPrivacyClientConfig;
|
|
331
|
+
interface ResolvedStellarPrivacyClientConfig extends Omit<StellarPrivacyClientConfigBase, 'transactEngine'> {
|
|
332
|
+
transactEngine: StellarTransactEngine;
|
|
333
|
+
transactEnvironment?: StellarTransactEnvironment;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
interface FetchContractMerkleResult {
|
|
337
|
+
commitmentCount: number;
|
|
338
|
+
commitments: string[];
|
|
339
|
+
merkleRootHex: string;
|
|
340
|
+
updatedAt: number;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
type StellarTransactionDetails = {
|
|
344
|
+
txHash: string;
|
|
345
|
+
status: StellarTransactionConfirmationStatus;
|
|
346
|
+
ledger?: number;
|
|
347
|
+
createdAt?: string;
|
|
348
|
+
invokedPoolContractId?: string;
|
|
349
|
+
transferAmountRaw?: string;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
interface StellarPublicBalanceInput {
|
|
353
|
+
owner: StellarAddress;
|
|
354
|
+
asset: StellarAssetId;
|
|
355
|
+
balance: string;
|
|
356
|
+
trustlineStatus: 'active' | 'inactive' | 'none';
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
declare function composeStellarStateService(adapter: StateBridgeAdapter): {
|
|
360
|
+
getTransactionStatus(txHash: string): Promise<StellarTransactionStatus | undefined>;
|
|
361
|
+
setTransactionStatus(status: StellarTransactionStatus): Promise<void>;
|
|
362
|
+
clearTransactionStatus(txHash: string): Promise<void>;
|
|
363
|
+
pruneConsumedPrivateRecords: () => Promise<void>;
|
|
364
|
+
getPrivateRecords: () => Promise<StellarPrivateRecord[]>;
|
|
365
|
+
getAvailablePrivateRecords: (filter: StellarAvailablePrivateRecordsFilter) => Promise<StellarPrivateRecord[]>;
|
|
366
|
+
listPrivateRecords: (filter: {
|
|
367
|
+
owner?: StellarAddress;
|
|
368
|
+
privateAddress?: string;
|
|
369
|
+
asset?: StellarAssetId;
|
|
370
|
+
amount?: bigint;
|
|
371
|
+
}) => Promise<StellarPrivateRecord[]>;
|
|
372
|
+
savePrivateRecords: (records: StellarPrivateRecord[]) => Promise<void>;
|
|
373
|
+
upsertPrivateRecords: (records: StellarPrivateRecord[]) => Promise<void>;
|
|
374
|
+
markPrivateRecordsUsed: (records: StellarPrivateRecord[]) => Promise<void>;
|
|
375
|
+
markPrivateRecordsStatus: (records: StellarPrivateRecord[], status: StellarPrivateRecordStatus) => Promise<void>;
|
|
376
|
+
getPrivateBalance: (input: {
|
|
377
|
+
owner: StellarAddress;
|
|
378
|
+
asset: StellarAssetId;
|
|
379
|
+
}) => Promise<bigint>;
|
|
380
|
+
getPrivateAssetRows: (owner: StellarAddress) => Promise<StellarPrivateAssetRow[]>;
|
|
381
|
+
getDeliverySyncState(input: {
|
|
382
|
+
privateAddress: string;
|
|
383
|
+
asset: StellarAssetId;
|
|
384
|
+
}): Promise<StellarDeliverySyncState | undefined>;
|
|
385
|
+
setDeliverySyncState(syncState: StellarDeliverySyncState): Promise<void>;
|
|
386
|
+
getIncomingDeliveries: (filter: StellarIncomingDeliveriesFilter) => Promise<StellarIncomingDelivery[]>;
|
|
387
|
+
upsertIncomingDeliveries: (deliveries: StellarIncomingDelivery[]) => Promise<void>;
|
|
388
|
+
markDeliveryProcessed(id: number): Promise<void>;
|
|
389
|
+
getPendingClaims: (filter?: StellarPendingClaimsFilter) => Promise<StellarPendingClaimsState>;
|
|
390
|
+
getPendingClaimsCount(owner: StellarAddress): Promise<number | undefined>;
|
|
391
|
+
appendPendingClaims: (claims: StellarPendingClaim[], paginationInfo: StellarPendingClaimsPagination) => Promise<void>;
|
|
392
|
+
replacePendingClaimsPage: (input: {
|
|
393
|
+
owner: StellarAddress;
|
|
394
|
+
claims: StellarPendingClaim[];
|
|
395
|
+
paginationInfo: StellarPendingClaimsPagination;
|
|
396
|
+
count?: number;
|
|
397
|
+
}) => Promise<void>;
|
|
398
|
+
upsertPendingClaims: (claims: StellarPendingClaim[]) => Promise<void>;
|
|
399
|
+
removePendingClaims: (ids: string[]) => Promise<void>;
|
|
400
|
+
clearPendingClaims: (input?: {
|
|
401
|
+
owner?: StellarAddress;
|
|
402
|
+
asset?: StellarAssetId;
|
|
403
|
+
}) => Promise<void>;
|
|
404
|
+
setPendingClaimsCount: (owner: StellarAddress, count: number) => Promise<void>;
|
|
405
|
+
getLeafEphemeral(input: {
|
|
406
|
+
poolContract: string;
|
|
407
|
+
leafIndex: number;
|
|
408
|
+
}): Promise<StellarLeafEphemeral | undefined>;
|
|
409
|
+
setLeafEphemeral(ephemeral: StellarLeafEphemeral): Promise<void>;
|
|
410
|
+
getPoolMerkleState(poolContract: string): Promise<StellarPoolMerkleState | undefined>;
|
|
411
|
+
setPoolMerkleState(state: StellarPoolMerkleState): Promise<void>;
|
|
412
|
+
appendPoolCommitments(input: {
|
|
413
|
+
poolContract: string;
|
|
414
|
+
commitments: string[];
|
|
415
|
+
merkleRootHex: string;
|
|
416
|
+
syncedLedger?: number;
|
|
417
|
+
}): Promise<void>;
|
|
418
|
+
getWalletPrivateAddressRecord(input: {
|
|
419
|
+
owner: StellarAddress;
|
|
420
|
+
nonce: string;
|
|
421
|
+
}): Promise<StellarWalletPrivateAddressRecord | undefined>;
|
|
422
|
+
saveWalletPrivateAddressRecord(record: StellarWalletPrivateAddressRecord): Promise<void>;
|
|
423
|
+
getWalletDefaultPrivateAddressNonce(owner: StellarAddress): Promise<string | undefined>;
|
|
424
|
+
setWalletDefaultPrivateAddressNonce(input: {
|
|
425
|
+
owner: StellarAddress;
|
|
426
|
+
nonce: string;
|
|
427
|
+
}): Promise<void>;
|
|
428
|
+
getWalletPrivateAddressScalar(input: {
|
|
429
|
+
owner: StellarAddress;
|
|
430
|
+
nonce: string;
|
|
431
|
+
}): Promise<StellarWalletPrivateAddressScalar | undefined>;
|
|
432
|
+
saveWalletPrivateAddressScalar(scalar: StellarWalletPrivateAddressScalar): Promise<void>;
|
|
433
|
+
deleteWalletPrivateAddressScalar(input: {
|
|
434
|
+
owner: StellarAddress;
|
|
435
|
+
nonce: string;
|
|
436
|
+
}): Promise<void>;
|
|
437
|
+
saveRegistryLookup(lookup: StellarRegistryLookup): Promise<void>;
|
|
438
|
+
saveRegisteredPrivateAddress(input: {
|
|
439
|
+
address: StellarAddress;
|
|
440
|
+
privateAddress: string;
|
|
441
|
+
registered: boolean;
|
|
442
|
+
}): Promise<void>;
|
|
443
|
+
invalidateRegistryLookup: (address: StellarAddress) => Promise<void>;
|
|
444
|
+
invalidateRegisteredAddress(address: StellarAddress): Promise<void>;
|
|
445
|
+
getRegistryLookup: (address: StellarAddress) => Promise<StellarRegistryLookup | undefined>;
|
|
446
|
+
isStellarAddressRegistered(address: StellarAddress): Promise<boolean | undefined>;
|
|
447
|
+
getCachedPrivateAddress: (address: StellarAddress) => Promise<string | undefined>;
|
|
448
|
+
getPublicBalance(input: {
|
|
449
|
+
owner: StellarAddress;
|
|
450
|
+
asset: StellarAssetId;
|
|
451
|
+
}): Promise<StellarPublicBalance | undefined>;
|
|
452
|
+
getPublicBalances(owner: StellarAddress): Promise<StellarPublicBalance[]>;
|
|
453
|
+
setPublicBalance(balance: StellarPublicBalanceInput): Promise<void>;
|
|
454
|
+
setPublicBalances(input: {
|
|
455
|
+
owner: StellarAddress;
|
|
456
|
+
balances: StellarPublicBalanceInput[];
|
|
457
|
+
}): Promise<void>;
|
|
458
|
+
upsertAssets(assets: StellarAsset[]): Promise<void>;
|
|
459
|
+
getAssetsCatalog: () => Promise<StellarAssetsCatalog>;
|
|
460
|
+
getAsset(assetId: StellarAssetId): Promise<StellarAsset | undefined>;
|
|
461
|
+
getAssets(): Promise<StellarAsset[]>;
|
|
462
|
+
getAssetsForPool(poolContract: string): Promise<StellarAsset[]>;
|
|
463
|
+
replaceAssets: (assets: StellarAsset[]) => Promise<void>;
|
|
464
|
+
bridge: _arcanetech_privacy_sdk_core_state.StateBridge;
|
|
465
|
+
};
|
|
466
|
+
type ComposedStellarStateService = ReturnType<typeof composeStellarStateService>;
|
|
467
|
+
|
|
468
|
+
type StellarStateService = ComposedStellarStateService;
|
|
469
|
+
|
|
470
|
+
declare function composeStellarPrivacyClient(config: ResolvedStellarPrivacyClientConfig): {
|
|
471
|
+
state: {
|
|
472
|
+
getTransactionStatus(txHash: string): Promise<StellarTransactionStatus | undefined>;
|
|
473
|
+
setTransactionStatus(status: StellarTransactionStatus): Promise<void>;
|
|
474
|
+
clearTransactionStatus(txHash: string): Promise<void>;
|
|
475
|
+
pruneConsumedPrivateRecords: () => Promise<void>;
|
|
476
|
+
getPrivateRecords: () => Promise<StellarPrivateRecord[]>;
|
|
477
|
+
getAvailablePrivateRecords: (filter: StellarAvailablePrivateRecordsFilter) => Promise<StellarPrivateRecord[]>;
|
|
478
|
+
listPrivateRecords: (filter: {
|
|
479
|
+
owner?: StellarAddress;
|
|
480
|
+
privateAddress?: string;
|
|
481
|
+
asset?: StellarAssetId;
|
|
482
|
+
amount?: bigint;
|
|
483
|
+
}) => Promise<StellarPrivateRecord[]>;
|
|
484
|
+
savePrivateRecords: (records: StellarPrivateRecord[]) => Promise<void>;
|
|
485
|
+
upsertPrivateRecords: (records: StellarPrivateRecord[]) => Promise<void>;
|
|
486
|
+
markPrivateRecordsUsed: (records: StellarPrivateRecord[]) => Promise<void>;
|
|
487
|
+
markPrivateRecordsStatus: (records: StellarPrivateRecord[], status: StellarPrivateRecordStatus) => Promise<void>;
|
|
488
|
+
getPrivateBalance: (input: {
|
|
489
|
+
owner: StellarAddress;
|
|
490
|
+
asset: StellarAssetId;
|
|
491
|
+
}) => Promise<bigint>;
|
|
492
|
+
getPrivateAssetRows: (owner: StellarAddress) => Promise<StellarPrivateAssetRow[]>;
|
|
493
|
+
getDeliverySyncState(input: {
|
|
494
|
+
privateAddress: string;
|
|
495
|
+
asset: StellarAssetId;
|
|
496
|
+
}): Promise<StellarDeliverySyncState | undefined>;
|
|
497
|
+
setDeliverySyncState(syncState: StellarDeliverySyncState): Promise<void>;
|
|
498
|
+
getIncomingDeliveries: (filter: StellarIncomingDeliveriesFilter) => Promise<StellarIncomingDelivery[]>;
|
|
499
|
+
upsertIncomingDeliveries: (deliveries: StellarIncomingDelivery[]) => Promise<void>;
|
|
500
|
+
markDeliveryProcessed(id: number): Promise<void>;
|
|
501
|
+
getPendingClaims: (filter?: StellarPendingClaimsFilter) => Promise<StellarPendingClaimsState>;
|
|
502
|
+
getPendingClaimsCount(owner: StellarAddress): Promise<number | undefined>;
|
|
503
|
+
appendPendingClaims: (claims: StellarPendingClaim[], paginationInfo: StellarPendingClaimsPagination) => Promise<void>;
|
|
504
|
+
replacePendingClaimsPage: (input: {
|
|
505
|
+
owner: StellarAddress;
|
|
506
|
+
claims: StellarPendingClaim[];
|
|
507
|
+
paginationInfo: StellarPendingClaimsPagination;
|
|
508
|
+
count?: number;
|
|
509
|
+
}) => Promise<void>;
|
|
510
|
+
upsertPendingClaims: (claims: StellarPendingClaim[]) => Promise<void>;
|
|
511
|
+
removePendingClaims: (ids: string[]) => Promise<void>;
|
|
512
|
+
clearPendingClaims: (input?: {
|
|
513
|
+
owner?: StellarAddress;
|
|
514
|
+
asset?: StellarAssetId;
|
|
515
|
+
}) => Promise<void>;
|
|
516
|
+
setPendingClaimsCount: (owner: StellarAddress, count: number) => Promise<void>;
|
|
517
|
+
getLeafEphemeral(input: {
|
|
518
|
+
poolContract: string;
|
|
519
|
+
leafIndex: number;
|
|
520
|
+
}): Promise<StellarLeafEphemeral | undefined>;
|
|
521
|
+
setLeafEphemeral(ephemeral: StellarLeafEphemeral): Promise<void>;
|
|
522
|
+
getPoolMerkleState(poolContract: string): Promise<StellarPoolMerkleState | undefined>;
|
|
523
|
+
setPoolMerkleState(state: StellarPoolMerkleState): Promise<void>;
|
|
524
|
+
appendPoolCommitments(input: {
|
|
525
|
+
poolContract: string;
|
|
526
|
+
commitments: string[];
|
|
527
|
+
merkleRootHex: string;
|
|
528
|
+
syncedLedger?: number;
|
|
529
|
+
}): Promise<void>;
|
|
530
|
+
getWalletPrivateAddressRecord(input: {
|
|
531
|
+
owner: StellarAddress;
|
|
532
|
+
nonce: string;
|
|
533
|
+
}): Promise<StellarWalletPrivateAddressRecord | undefined>;
|
|
534
|
+
saveWalletPrivateAddressRecord(record: StellarWalletPrivateAddressRecord): Promise<void>;
|
|
535
|
+
getWalletDefaultPrivateAddressNonce(owner: StellarAddress): Promise<string | undefined>;
|
|
536
|
+
setWalletDefaultPrivateAddressNonce(input: {
|
|
537
|
+
owner: StellarAddress;
|
|
538
|
+
nonce: string;
|
|
539
|
+
}): Promise<void>;
|
|
540
|
+
getWalletPrivateAddressScalar(input: {
|
|
541
|
+
owner: StellarAddress;
|
|
542
|
+
nonce: string;
|
|
543
|
+
}): Promise<StellarWalletPrivateAddressScalar | undefined>;
|
|
544
|
+
saveWalletPrivateAddressScalar(scalar: StellarWalletPrivateAddressScalar): Promise<void>;
|
|
545
|
+
deleteWalletPrivateAddressScalar(input: {
|
|
546
|
+
owner: StellarAddress;
|
|
547
|
+
nonce: string;
|
|
548
|
+
}): Promise<void>;
|
|
549
|
+
saveRegistryLookup(lookup: StellarRegistryLookup): Promise<void>;
|
|
550
|
+
saveRegisteredPrivateAddress(input: {
|
|
551
|
+
address: StellarAddress;
|
|
552
|
+
privateAddress: string;
|
|
553
|
+
registered: boolean;
|
|
554
|
+
}): Promise<void>;
|
|
555
|
+
invalidateRegistryLookup: (address: StellarAddress) => Promise<void>;
|
|
556
|
+
invalidateRegisteredAddress(address: StellarAddress): Promise<void>;
|
|
557
|
+
getRegistryLookup: (address: StellarAddress) => Promise<StellarRegistryLookup | undefined>;
|
|
558
|
+
isStellarAddressRegistered(address: StellarAddress): Promise<boolean | undefined>;
|
|
559
|
+
getCachedPrivateAddress: (address: StellarAddress) => Promise<string | undefined>;
|
|
560
|
+
getPublicBalance(input: {
|
|
561
|
+
owner: StellarAddress;
|
|
562
|
+
asset: StellarAssetId;
|
|
563
|
+
}): Promise<StellarPublicBalance | undefined>;
|
|
564
|
+
getPublicBalances(owner: StellarAddress): Promise<StellarPublicBalance[]>;
|
|
565
|
+
setPublicBalance(balance: StellarPublicBalanceInput): Promise<void>;
|
|
566
|
+
setPublicBalances(input: {
|
|
567
|
+
owner: StellarAddress;
|
|
568
|
+
balances: StellarPublicBalanceInput[];
|
|
569
|
+
}): Promise<void>;
|
|
570
|
+
upsertAssets(assets: StellarAsset[]): Promise<void>;
|
|
571
|
+
getAssetsCatalog: () => Promise<StellarAssetsCatalog>;
|
|
572
|
+
getAsset(assetId: StellarAssetId): Promise<StellarAsset | undefined>;
|
|
573
|
+
getAssets(): Promise<StellarAsset[]>;
|
|
574
|
+
getAssetsForPool(poolContract: string): Promise<StellarAsset[]>;
|
|
575
|
+
replaceAssets: (assets: StellarAsset[]) => Promise<void>;
|
|
576
|
+
bridge: _arcanetech_privacy_sdk_core_state.StateBridge;
|
|
577
|
+
};
|
|
578
|
+
operations: {
|
|
579
|
+
deposit: (intent: _arcanetech_privacy_sdk_core.DepositIntent<string, string, bigint>) => Promise<_arcanetech_privacy_sdk_core.OperationResult<"deposit", string, string, bigint, StellarPreparedOperation, StellarOperationReceipt>>;
|
|
580
|
+
withdraw: (intent: _arcanetech_privacy_sdk_core.WithdrawIntent<string, string, bigint>) => Promise<_arcanetech_privacy_sdk_core.OperationResult<"withdraw", string, string, bigint, StellarPreparedOperation, StellarOperationReceipt>>;
|
|
581
|
+
transfer: (intent: StellarTransferIntent) => Promise<_arcanetech_privacy_sdk_core.OperationResult<"transfer", string, string, bigint, StellarPreparedOperation, StellarOperationReceipt>>;
|
|
582
|
+
};
|
|
583
|
+
network: {
|
|
584
|
+
checkPrivateRecordSpendStatus: (spendInput: {
|
|
585
|
+
poolContractId?: string;
|
|
586
|
+
nullifier: string;
|
|
587
|
+
walletPublicKey: string;
|
|
588
|
+
}) => Promise<{
|
|
589
|
+
spent: boolean;
|
|
590
|
+
nullifierHashHex: string;
|
|
591
|
+
}>;
|
|
592
|
+
waitForTransactionConfirmation: (confirmationInput: {
|
|
593
|
+
txHash: string;
|
|
594
|
+
pollIntervalMs?: number;
|
|
595
|
+
timeoutMs?: number;
|
|
596
|
+
}) => Promise<StellarTransactionStatus>;
|
|
597
|
+
fetchTransactionConfirmationStatus: (txHash: string) => Promise<StellarTransactionStatus>;
|
|
598
|
+
getTransactionDetails: (txHash: string) => Promise<StellarTransactionDetails>;
|
|
599
|
+
checkRegistrationStatus: (registrationInput: {
|
|
600
|
+
address: StellarAddress;
|
|
601
|
+
walletPublicKey: string;
|
|
602
|
+
}) => Promise<StellarRegistryLookup>;
|
|
603
|
+
registerPrivateAddress: (registrationInput: {
|
|
604
|
+
owner: StellarAddress;
|
|
605
|
+
walletPublicKey: string;
|
|
606
|
+
privateAddressStpl1: string;
|
|
607
|
+
}) => Promise<StellarTransactionStatus>;
|
|
608
|
+
resolveTransferRecipient: (recipientInput: {
|
|
609
|
+
recipientStellarAddress: StellarAddress;
|
|
610
|
+
walletPublicKey: StellarAddress;
|
|
611
|
+
}) => Promise<TransferRecipientExecutionContext>;
|
|
612
|
+
syncPoolMerkleState: (poolInput: {
|
|
613
|
+
poolContractId: string;
|
|
614
|
+
walletPublicKey: string;
|
|
615
|
+
}) => Promise<FetchContractMerkleResult>;
|
|
616
|
+
syncPoolMerkleStates: (poolInput: {
|
|
617
|
+
poolContractIds: string[];
|
|
618
|
+
walletPublicKey: string;
|
|
619
|
+
}) => Promise<void>;
|
|
620
|
+
readPoolLeafEphemeralHex: (poolInput: {
|
|
621
|
+
poolContractId: string;
|
|
622
|
+
walletPublicKey: string;
|
|
623
|
+
leafIndex: number;
|
|
624
|
+
}) => Promise<{
|
|
625
|
+
xHex: string;
|
|
626
|
+
yHex: string;
|
|
627
|
+
}>;
|
|
628
|
+
};
|
|
629
|
+
transactEnvironment: StellarTransactEnvironment | undefined;
|
|
630
|
+
};
|
|
631
|
+
type ComposedStellarPrivacyClient = ReturnType<typeof composeStellarPrivacyClient>;
|
|
632
|
+
|
|
633
|
+
interface LoadPendingClaimsFromBackendInput {
|
|
634
|
+
backendBaseUrl: string;
|
|
635
|
+
ownerAddress: StellarAddress;
|
|
636
|
+
asset?: StellarAssetId;
|
|
637
|
+
page?: number;
|
|
638
|
+
pageSize?: number;
|
|
639
|
+
}
|
|
640
|
+
interface LoadPendingClaimsCountFromBackendInput {
|
|
641
|
+
backendBaseUrl: string;
|
|
642
|
+
ownerAddress: StellarAddress;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
declare function createStateDelegates(state: StellarStateService): {
|
|
646
|
+
getPrivateRecords: () => Promise<StellarPrivateRecord[]>;
|
|
647
|
+
getAvailablePrivateRecords: (filter: Parameters<StellarStateService["getAvailablePrivateRecords"]>[0]) => Promise<StellarPrivateRecord[]>;
|
|
648
|
+
getPrivateBalance: (input: Parameters<StellarStateService["getPrivateBalance"]>[0]) => Promise<bigint>;
|
|
649
|
+
getPrivateAssetRows: (owner: Parameters<StellarStateService["getPrivateAssetRows"]>[0]) => Promise<StellarPrivateAssetRow[]>;
|
|
650
|
+
upsertPrivateRecords: (records: Parameters<StellarStateService["upsertPrivateRecords"]>[0]) => Promise<void>;
|
|
651
|
+
markPrivateRecordsStatus: (records: Parameters<StellarStateService["markPrivateRecordsStatus"]>[0], status: Parameters<StellarStateService["markPrivateRecordsStatus"]>[1]) => Promise<void>;
|
|
652
|
+
pruneConsumedPrivateRecords: () => Promise<void>;
|
|
653
|
+
getTransactionStatus: (txHash: Parameters<StellarStateService["getTransactionStatus"]>[0]) => Promise<StellarTransactionStatus | undefined>;
|
|
654
|
+
setTransactionStatus: (status: Parameters<StellarStateService["setTransactionStatus"]>[0]) => Promise<void>;
|
|
655
|
+
clearTransactionStatus: (txHash: Parameters<StellarStateService["clearTransactionStatus"]>[0]) => Promise<void>;
|
|
656
|
+
getIncomingDeliveries: (filter: Parameters<StellarStateService["getIncomingDeliveries"]>[0]) => Promise<StellarIncomingDelivery[]>;
|
|
657
|
+
upsertIncomingDeliveries: (deliveries: Parameters<StellarStateService["upsertIncomingDeliveries"]>[0]) => Promise<void>;
|
|
658
|
+
markDeliveryProcessed: (id: Parameters<StellarStateService["markDeliveryProcessed"]>[0]) => Promise<void>;
|
|
659
|
+
getDeliverySyncState: (input: Parameters<StellarStateService["getDeliverySyncState"]>[0]) => Promise<StellarDeliverySyncState | undefined>;
|
|
660
|
+
setDeliverySyncState: (syncState: Parameters<StellarStateService["setDeliverySyncState"]>[0]) => Promise<void>;
|
|
661
|
+
appendPendingClaims: (claims: Parameters<StellarStateService["appendPendingClaims"]>[0], paginationInfo: Parameters<StellarStateService["appendPendingClaims"]>[1]) => Promise<void>;
|
|
662
|
+
loadPendingClaimsFromBackend: (input: LoadPendingClaimsFromBackendInput) => Promise<void>;
|
|
663
|
+
loadPendingClaimsCountFromBackend: (input: LoadPendingClaimsCountFromBackendInput) => Promise<void>;
|
|
664
|
+
replacePendingClaimsPage: (input: Parameters<StellarStateService["replacePendingClaimsPage"]>[0]) => Promise<void>;
|
|
665
|
+
upsertPendingClaims: (claims: Parameters<StellarStateService["upsertPendingClaims"]>[0]) => Promise<void>;
|
|
666
|
+
removePendingClaims: (ids: Parameters<StellarStateService["removePendingClaims"]>[0]) => Promise<void>;
|
|
667
|
+
clearPendingClaims: (input?: Parameters<StellarStateService["clearPendingClaims"]>[0]) => Promise<void>;
|
|
668
|
+
getPendingClaims: (filter?: Parameters<StellarStateService["getPendingClaims"]>[0]) => Promise<StellarPendingClaimsState>;
|
|
669
|
+
getPendingClaimsCount: (owner: Parameters<StellarStateService["getPendingClaimsCount"]>[0]) => Promise<number | undefined>;
|
|
670
|
+
setPendingClaimsCount: (owner: Parameters<StellarStateService["setPendingClaimsCount"]>[0], count: Parameters<StellarStateService["setPendingClaimsCount"]>[1]) => Promise<void>;
|
|
671
|
+
getPoolMerkleState: (poolContract: Parameters<StellarStateService["getPoolMerkleState"]>[0]) => Promise<StellarPoolMerkleState | undefined>;
|
|
672
|
+
setPoolMerkleState: (poolState: Parameters<StellarStateService["setPoolMerkleState"]>[0]) => Promise<void>;
|
|
673
|
+
appendPoolCommitments: (input: Parameters<StellarStateService["appendPoolCommitments"]>[0]) => Promise<void>;
|
|
674
|
+
getLeafEphemeral: (input: Parameters<StellarStateService["getLeafEphemeral"]>[0]) => Promise<StellarLeafEphemeral | undefined>;
|
|
675
|
+
setLeafEphemeral: (ephemeral: Parameters<StellarStateService["setLeafEphemeral"]>[0]) => Promise<void>;
|
|
676
|
+
getRegistryLookup: (address: Parameters<StellarStateService["getRegistryLookup"]>[0]) => Promise<StellarRegistryLookup | undefined>;
|
|
677
|
+
isStellarAddressRegistered: (address: Parameters<StellarStateService["isStellarAddressRegistered"]>[0]) => Promise<boolean | undefined>;
|
|
678
|
+
getCachedPrivateAddress: (address: Parameters<StellarStateService["getCachedPrivateAddress"]>[0]) => Promise<string | undefined>;
|
|
679
|
+
saveRegistryLookup: (lookup: Parameters<StellarStateService["saveRegistryLookup"]>[0]) => Promise<void>;
|
|
680
|
+
getWalletPrivateAddressScalar: (input: Parameters<StellarStateService["getWalletPrivateAddressScalar"]>[0]) => Promise<StellarWalletPrivateAddressScalar | undefined>;
|
|
681
|
+
saveWalletPrivateAddressScalar: (scalar: Parameters<StellarStateService["saveWalletPrivateAddressScalar"]>[0]) => Promise<void>;
|
|
682
|
+
getWalletPrivateAddressRecord: (input: Parameters<StellarStateService["getWalletPrivateAddressRecord"]>[0]) => Promise<StellarWalletPrivateAddressRecord | undefined>;
|
|
683
|
+
saveWalletPrivateAddressRecord: (record: Parameters<StellarStateService["saveWalletPrivateAddressRecord"]>[0]) => Promise<void>;
|
|
684
|
+
getWalletDefaultPrivateAddressNonce: (owner: Parameters<StellarStateService["getWalletDefaultPrivateAddressNonce"]>[0]) => Promise<string | undefined>;
|
|
685
|
+
setWalletDefaultPrivateAddressNonce: (input: Parameters<StellarStateService["setWalletDefaultPrivateAddressNonce"]>[0]) => Promise<void>;
|
|
686
|
+
deleteWalletPrivateAddressScalar: (input: Parameters<StellarStateService["deleteWalletPrivateAddressScalar"]>[0]) => Promise<void>;
|
|
687
|
+
saveRegisteredPrivateAddress: (input: Parameters<StellarStateService["saveRegisteredPrivateAddress"]>[0]) => Promise<void>;
|
|
688
|
+
invalidateRegistryLookup: (address: Parameters<StellarStateService["invalidateRegistryLookup"]>[0]) => Promise<void>;
|
|
689
|
+
invalidateRegisteredAddress: (address: Parameters<StellarStateService["invalidateRegisteredAddress"]>[0]) => Promise<void>;
|
|
690
|
+
getAssets: () => Promise<StellarAsset[]>;
|
|
691
|
+
getAssetsCatalog: () => Promise<StellarAssetsCatalog>;
|
|
692
|
+
getAsset: (assetId: Parameters<StellarStateService["getAsset"]>[0]) => Promise<StellarAsset | undefined>;
|
|
693
|
+
getAssetsForPool: (poolContract: string) => Promise<StellarAsset[]>;
|
|
694
|
+
replaceAssets: (assets: Parameters<StellarStateService["replaceAssets"]>[0]) => Promise<void>;
|
|
695
|
+
upsertAssets: (assets: Parameters<StellarStateService["upsertAssets"]>[0]) => Promise<void>;
|
|
696
|
+
getPublicBalance: (input: Parameters<StellarStateService["getPublicBalance"]>[0]) => Promise<StellarPublicBalance | undefined>;
|
|
697
|
+
getPublicBalances: (owner: Parameters<StellarStateService["getPublicBalances"]>[0]) => Promise<StellarPublicBalance[]>;
|
|
698
|
+
setPublicBalance: (balance: Parameters<StellarStateService["setPublicBalance"]>[0]) => Promise<void>;
|
|
699
|
+
setPublicBalances: (input: Parameters<StellarStateService["setPublicBalances"]>[0]) => Promise<void>;
|
|
700
|
+
};
|
|
701
|
+
type StellarPrivacyClientStateDelegates = ReturnType<typeof createStateDelegates>;
|
|
702
|
+
|
|
703
|
+
type StellarPrivacyClientNetwork = ComposedStellarPrivacyClient['network'];
|
|
704
|
+
type StellarPrivacyClientOperations = ComposedStellarPrivacyClient['operations'];
|
|
705
|
+
type StellarPrivacyClient = {
|
|
706
|
+
readonly state: ComposedStellarPrivacyClient['state'];
|
|
707
|
+
deposit: StellarPrivacyClientOperations['deposit'];
|
|
708
|
+
transfer: (intent: StellarTransferIntent) => ReturnType<StellarPrivacyClientOperations['transfer']>;
|
|
709
|
+
withdraw: StellarPrivacyClientOperations['withdraw'];
|
|
710
|
+
syncPoolMerkleState: StellarPrivacyClientNetwork['syncPoolMerkleState'];
|
|
711
|
+
syncPoolMerkleStates: StellarPrivacyClientNetwork['syncPoolMerkleStates'];
|
|
712
|
+
readPoolLeafEphemeralHex: StellarPrivacyClientNetwork['readPoolLeafEphemeralHex'];
|
|
713
|
+
checkRegistrationStatus: StellarPrivacyClientNetwork['checkRegistrationStatus'];
|
|
714
|
+
registerPrivateAddress: StellarPrivacyClientNetwork['registerPrivateAddress'];
|
|
715
|
+
resolveTransferRecipient: StellarPrivacyClientNetwork['resolveTransferRecipient'];
|
|
716
|
+
checkPrivateRecordSpendStatus: StellarPrivacyClientNetwork['checkPrivateRecordSpendStatus'];
|
|
717
|
+
waitForTransactionConfirmation: StellarPrivacyClientNetwork['waitForTransactionConfirmation'];
|
|
718
|
+
fetchTransactionConfirmationStatus: StellarPrivacyClientNetwork['fetchTransactionConfirmationStatus'];
|
|
719
|
+
getTransactionDetails: StellarPrivacyClientNetwork['getTransactionDetails'];
|
|
720
|
+
} & StellarPrivacyClientStateDelegates;
|
|
721
|
+
|
|
722
|
+
declare function createStellarPrivacyClientFromResolvedConfig(config: ResolvedStellarPrivacyClientConfig): StellarPrivacyClient;
|
|
723
|
+
|
|
724
|
+
interface StellarNodeAssets {
|
|
725
|
+
sdkWasmPath: string;
|
|
726
|
+
circuitWasmPath: string;
|
|
727
|
+
provingKeyPath: string;
|
|
728
|
+
}
|
|
729
|
+
interface StellarNodePrivacyClientConfig extends StellarPrivacyClientConfigBase {
|
|
730
|
+
assets: StellarNodeAssets;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
type CreateStellarPrivacyClientResult = StellarPrivacyClient | ReturnType<typeof createRejectedOperation>;
|
|
734
|
+
declare function isStellarPrivacyClient(result: CreateStellarPrivacyClientResult): result is StellarPrivacyClient;
|
|
735
|
+
declare function createStellarPrivacyClient(config: StellarBrowserPrivacyClientConfig): Promise<CreateStellarPrivacyClientResult>;
|
|
736
|
+
|
|
737
|
+
declare function createStellarPrivacyClientFromNodeConfig(config: StellarNodePrivacyClientConfig): Promise<ReturnType<typeof createStellarPrivacyClientFromResolvedConfig> | ReturnType<typeof createRejectedOperation>>;
|
|
738
|
+
|
|
739
|
+
export { type CreateStellarPrivacyClientResult, type StellarBrowserPrivacyClientConfig, type StellarNodeAssets, type StellarNodePrivacyClientConfig, type StellarPrivacyClientConfig, createStellarPrivacyClient, createStellarPrivacyClientFromNodeConfig, isStellarPrivacyClient };
|