@arcanetech/privacy-sdk-stellar 0.2.3 → 0.4.1
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 +6 -6
- package/dist/index.d.ts +310 -157
- package/dist/index.js +2505 -1817
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +53 -116
- package/dist/node.js +1506 -1622
- package/dist/node.js.map +1 -1
- package/dist/state/index.d.ts +7 -122
- package/dist/state/index.js +96 -490
- package/dist/state/index.js.map +1 -1
- package/dist/testing/index.d.ts +14 -32
- package/dist/transact/index.d.ts +366 -59
- package/dist/transact/index.js +2484 -924
- package/dist/transact/index.js.map +1 -1
- package/generated/contract/README.md +4 -4
- package/generated/contract/dist/index.d.ts +270 -197
- package/generated/contract/dist/index.js +94 -52
- package/generated/contract/package.json +1 -1
- package/generated/contract/src/index.ts +239 -183
- package/generated/registry/README.md +4 -4
- package/generated/registry/dist/index.d.ts +56 -123
- package/generated/registry/dist/index.js +39 -37
- package/generated/registry/package.json +1 -1
- package/generated/registry/src/index.ts +56 -132
- package/package.json +8 -8
package/dist/node.d.ts
CHANGED
|
@@ -3,8 +3,7 @@ import { OperationKind, DepositIntent, TransferIntent, WithdrawIntent, createRej
|
|
|
3
3
|
export { isPreparedOperation } from '@arcanetech/privacy-sdk-core';
|
|
4
4
|
import * as _arcanetech_privacy_sdk_core_state from '@arcanetech/privacy-sdk-core/state';
|
|
5
5
|
import { StateBridgeAdapter } from '@arcanetech/privacy-sdk-core/state';
|
|
6
|
-
import {
|
|
7
|
-
import { AuditPublicKey } from '@auditable/privacy-pool-zk-sdk';
|
|
6
|
+
import { ZkCircuitLayoutFields, BundledZkCircuit, AuditPublicKey } from '@arcanetech/stellar-privacy-pool-zk-sdk';
|
|
8
7
|
|
|
9
8
|
type StellarPrivateRecordStatus = 'pending' | 'finalized' | 'spent';
|
|
10
9
|
interface StellarPrivateCoinNote {
|
|
@@ -78,35 +77,6 @@ interface StellarLeafEphemeral {
|
|
|
78
77
|
yHex: string;
|
|
79
78
|
cachedAt?: string;
|
|
80
79
|
}
|
|
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
80
|
interface StellarIncomingDelivery {
|
|
111
81
|
id: number;
|
|
112
82
|
privateAddress: string;
|
|
@@ -161,26 +131,15 @@ interface StellarAvailablePrivateRecordsFilter {
|
|
|
161
131
|
privateAddress?: string;
|
|
162
132
|
asset?: StellarAssetId;
|
|
163
133
|
}
|
|
164
|
-
interface StellarPendingClaimsFilter {
|
|
165
|
-
owner?: StellarAddress;
|
|
166
|
-
asset?: StellarAssetId;
|
|
167
|
-
}
|
|
168
134
|
interface StellarIncomingDeliveriesFilter {
|
|
169
135
|
privateAddress: string;
|
|
170
136
|
asset?: StellarAssetId;
|
|
171
137
|
includeProcessed?: boolean;
|
|
172
138
|
}
|
|
173
139
|
|
|
174
|
-
type KytApplicationIdHints = [
|
|
140
|
+
type KytApplicationIdHints = string[];
|
|
175
141
|
|
|
176
|
-
type
|
|
177
|
-
kind: 'pendingClaim';
|
|
178
|
-
claimId: string;
|
|
179
|
-
} | {
|
|
180
|
-
kind: 'pendingClaim';
|
|
181
|
-
claim: StellarPendingClaim;
|
|
182
|
-
};
|
|
183
|
-
type StellarTransferFromAddress = StellarAddress | StellarPendingClaimSource;
|
|
142
|
+
type StellarTransferFromAddress = StellarAddress;
|
|
184
143
|
|
|
185
144
|
interface PoolMerkleStatePort {
|
|
186
145
|
get(poolContract: string): Promise<StellarPoolMerkleState | undefined>;
|
|
@@ -202,33 +161,59 @@ type StellarSignTransaction = (input: {
|
|
|
202
161
|
signedTxXdr: string;
|
|
203
162
|
}>;
|
|
204
163
|
|
|
164
|
+
type StellarBundledZkCircuitDefinition = ZkCircuitLayoutFields & {
|
|
165
|
+
circuit: BundledZkCircuit;
|
|
166
|
+
};
|
|
167
|
+
type StellarCustomZkCircuitDefinition = ZkCircuitLayoutFields & {
|
|
168
|
+
zkeyUrl: string;
|
|
169
|
+
circuitGraphUrl: string;
|
|
170
|
+
r1csUrl: string;
|
|
171
|
+
provingKeyUrl: string;
|
|
172
|
+
};
|
|
173
|
+
type StellarZkCircuitDefinition = StellarBundledZkCircuitDefinition | StellarCustomZkCircuitDefinition;
|
|
174
|
+
|
|
205
175
|
interface TransferTemporaryRecipientKey {
|
|
206
176
|
temporaryScalarHex: string;
|
|
207
177
|
temporaryPrivateAddressStpl1: string;
|
|
208
178
|
}
|
|
209
|
-
interface
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
179
|
+
interface TransferEscrowSend {
|
|
180
|
+
nonceDecimal: string;
|
|
181
|
+
recipientHi: string;
|
|
182
|
+
recipientLo: string;
|
|
183
|
+
recipientStellarAddress: string;
|
|
214
184
|
}
|
|
215
185
|
interface TransferRecipientExecutionContext {
|
|
216
186
|
recipientPrivateAddressStpl1: string;
|
|
217
187
|
recipientStellarAddress?: string;
|
|
188
|
+
escrowSend?: TransferEscrowSend;
|
|
218
189
|
temporaryRecipientKey?: TransferTemporaryRecipientKey;
|
|
219
190
|
}
|
|
220
|
-
interface BuildTransferOnboardingAtExecuteInput {
|
|
221
|
-
ownerStellarAddress: string;
|
|
222
|
-
temporaryRecipientKey: TransferTemporaryRecipientKey;
|
|
223
|
-
recipientNote: TransferOnboardingRecipientNoteInput;
|
|
224
|
-
}
|
|
225
191
|
interface StellarKytEnvironment {
|
|
226
192
|
apiBaseUrl: string;
|
|
227
193
|
kytPassageRegistryContract: string;
|
|
228
194
|
registerPassageOnChain?: boolean;
|
|
195
|
+
inspectAuthorization?: string;
|
|
229
196
|
}
|
|
230
197
|
interface StellarTransactEnvironment {
|
|
231
198
|
network: StellarNetworkConfig;
|
|
199
|
+
/**
|
|
200
|
+
* Nonce (persistent storage key) of the pool's `ZkConfig` entry this
|
|
201
|
+
* environment's proofs/circuit shape target. Defaults to `2n` (Commitment
|
|
202
|
+
* V2, 95 public signals) when omitted. Nonce `0` is the retired 93-signal
|
|
203
|
+
* layout and must be passed explicitly.
|
|
204
|
+
*/
|
|
205
|
+
zkConfigNonce?: bigint;
|
|
206
|
+
/**
|
|
207
|
+
* Optional nonce-keyed circuit map. Defaults to the SDK bundled 2×2 (nonce 2)
|
|
208
|
+
* and 6×6 (nonce 6) schemes. URL fields are only for a custom/dev circuit.
|
|
209
|
+
*/
|
|
210
|
+
zkCircuits?: Record<string, StellarZkCircuitDefinition>;
|
|
211
|
+
/**
|
|
212
|
+
* Directory or HTTP prefix for graph / r1cs / proving-key files.
|
|
213
|
+
* Defaults to the GitHub release for `@arcanetech/stellar-privacy-pool-zk-sdk`.
|
|
214
|
+
* Staging and local stands override this to serve files from disk.
|
|
215
|
+
*/
|
|
216
|
+
zkArtifactBaseUrl?: string;
|
|
232
217
|
auditPublicKey?: AuditPublicKey;
|
|
233
218
|
kyt: StellarKytEnvironment;
|
|
234
219
|
signTransaction?: StellarSignTransaction;
|
|
@@ -244,7 +229,6 @@ interface StellarTransactEnvironment {
|
|
|
244
229
|
recipientStellarAddress: string;
|
|
245
230
|
walletPublicKey: string;
|
|
246
231
|
}) => Promise<TransferRecipientExecutionContext>;
|
|
247
|
-
buildTransferOnboardingAtExecute?: (input: BuildTransferOnboardingAtExecuteInput) => Promise<OnboardingPayload>;
|
|
248
232
|
resolveWalletPublicKey?: () => Promise<string>;
|
|
249
233
|
poolMerkleState?: PoolMerkleStatePort;
|
|
250
234
|
leafEphemeral?: LeafEphemeralStatePort;
|
|
@@ -271,16 +255,25 @@ interface StellarSubmissionPayload {
|
|
|
271
255
|
interface StellarTransactArtifacts {
|
|
272
256
|
proofHex?: string;
|
|
273
257
|
publicHex?: string;
|
|
258
|
+
ciphertextHex?: string;
|
|
259
|
+
outputNoteEphemeralScalars?: string[];
|
|
274
260
|
applicationIdsPlaintext?: KytApplicationIdHints;
|
|
275
261
|
tokenAddress?: string;
|
|
276
262
|
depositScalarHex?: string;
|
|
277
263
|
precommitementHex?: string;
|
|
278
264
|
commitmentHex?: string;
|
|
279
265
|
walletPublicKey?: string;
|
|
280
|
-
|
|
266
|
+
escrowRecipient?: string;
|
|
267
|
+
escrowAuthorization?: string;
|
|
268
|
+
escrowSend?: boolean;
|
|
269
|
+
escrowSpendScalarHex?: string;
|
|
270
|
+
escrowClaimantLimbs?: {
|
|
271
|
+
recipientHi: string;
|
|
272
|
+
recipientLo: string;
|
|
273
|
+
nonceDecimal?: string;
|
|
274
|
+
};
|
|
281
275
|
executeFinalizeRequired?: boolean;
|
|
282
|
-
|
|
283
|
-
spendSource?: 'privateAddress' | 'pendingClaim';
|
|
276
|
+
spendSource?: 'privateAddress' | 'escrow';
|
|
284
277
|
}
|
|
285
278
|
interface StellarOperationReceipt {
|
|
286
279
|
operationId: string;
|
|
@@ -296,8 +289,6 @@ interface StellarNetworkConfig {
|
|
|
296
289
|
}
|
|
297
290
|
interface StellarBrowserAssets {
|
|
298
291
|
sdkWasm: ArrayBuffer;
|
|
299
|
-
circuitWasm: ArrayBuffer;
|
|
300
|
-
provingKey: ArrayBuffer;
|
|
301
292
|
}
|
|
302
293
|
interface StellarWalletAdapter {
|
|
303
294
|
getAddress(): Promise<StellarAddress>;
|
|
@@ -386,22 +377,6 @@ declare function composeStellarStateService(adapter: StateBridgeAdapter): {
|
|
|
386
377
|
getIncomingDeliveries: (filter: StellarIncomingDeliveriesFilter) => Promise<StellarIncomingDelivery[]>;
|
|
387
378
|
upsertIncomingDeliveries: (deliveries: StellarIncomingDelivery[]) => Promise<void>;
|
|
388
379
|
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
380
|
getLeafEphemeral(input: {
|
|
406
381
|
poolContract: string;
|
|
407
382
|
leafIndex: number;
|
|
@@ -498,22 +473,6 @@ declare function composeStellarPrivacyClient(config: ResolvedStellarPrivacyClien
|
|
|
498
473
|
getIncomingDeliveries: (filter: StellarIncomingDeliveriesFilter) => Promise<StellarIncomingDelivery[]>;
|
|
499
474
|
upsertIncomingDeliveries: (deliveries: StellarIncomingDelivery[]) => Promise<void>;
|
|
500
475
|
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
476
|
getLeafEphemeral(input: {
|
|
518
477
|
poolContract: string;
|
|
519
478
|
leafIndex: number;
|
|
@@ -585,6 +544,7 @@ declare function composeStellarPrivacyClient(config: ResolvedStellarPrivacyClien
|
|
|
585
544
|
poolContractId?: string;
|
|
586
545
|
nullifier: string;
|
|
587
546
|
walletPublicKey: string;
|
|
547
|
+
privKeyScalarHex: string;
|
|
588
548
|
}) => Promise<{
|
|
589
549
|
spent: boolean;
|
|
590
550
|
nullifierHashHex: string;
|
|
@@ -630,18 +590,6 @@ declare function composeStellarPrivacyClient(config: ResolvedStellarPrivacyClien
|
|
|
630
590
|
};
|
|
631
591
|
type ComposedStellarPrivacyClient = ReturnType<typeof composeStellarPrivacyClient>;
|
|
632
592
|
|
|
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
593
|
declare function createStateDelegates(state: StellarStateService): {
|
|
646
594
|
getPrivateRecords: () => Promise<StellarPrivateRecord[]>;
|
|
647
595
|
getAvailablePrivateRecords: (filter: Parameters<StellarStateService["getAvailablePrivateRecords"]>[0]) => Promise<StellarPrivateRecord[]>;
|
|
@@ -658,16 +606,6 @@ declare function createStateDelegates(state: StellarStateService): {
|
|
|
658
606
|
markDeliveryProcessed: (id: Parameters<StellarStateService["markDeliveryProcessed"]>[0]) => Promise<void>;
|
|
659
607
|
getDeliverySyncState: (input: Parameters<StellarStateService["getDeliverySyncState"]>[0]) => Promise<StellarDeliverySyncState | undefined>;
|
|
660
608
|
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
609
|
getPoolMerkleState: (poolContract: Parameters<StellarStateService["getPoolMerkleState"]>[0]) => Promise<StellarPoolMerkleState | undefined>;
|
|
672
610
|
setPoolMerkleState: (poolState: Parameters<StellarStateService["setPoolMerkleState"]>[0]) => Promise<void>;
|
|
673
611
|
appendPoolCommitments: (input: Parameters<StellarStateService["appendPoolCommitments"]>[0]) => Promise<void>;
|
|
@@ -723,11 +661,10 @@ declare function createStellarPrivacyClientFromResolvedConfig(config: ResolvedSt
|
|
|
723
661
|
|
|
724
662
|
interface StellarNodeAssets {
|
|
725
663
|
sdkWasmPath: string;
|
|
726
|
-
circuitWasmPath: string;
|
|
727
|
-
provingKeyPath: string;
|
|
728
664
|
}
|
|
729
665
|
interface StellarNodePrivacyClientConfig extends StellarPrivacyClientConfigBase {
|
|
730
666
|
assets: StellarNodeAssets;
|
|
667
|
+
transactEnvironment?: StellarTransactEnvironment;
|
|
731
668
|
}
|
|
732
669
|
|
|
733
670
|
type CreateStellarPrivacyClientResult = StellarPrivacyClient | ReturnType<typeof createRejectedOperation>;
|