@arcanetech/privacy-sdk-stellar 0.3.0 → 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/README.md +6 -6
- package/dist/index.d.ts +306 -159
- package/dist/index.js +2367 -1769
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +49 -118
- package/dist/node.js +1381 -1582
- 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 +362 -61
- package/dist/transact/index.js +2474 -937
- package/dist/transact/index.js.map +1 -1
- package/generated/contract/README.md +4 -4
- package/generated/contract/dist/index.d.ts +231 -256
- package/generated/contract/dist/index.js +71 -57
- package/generated/contract/package.json +1 -1
- package/generated/contract/src/index.ts +211 -242
- 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 +2 -2
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,39 +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;
|
|
232
199
|
/**
|
|
233
200
|
* Nonce (persistent storage key) of the pool's `ZkConfig` entry this
|
|
234
|
-
* environment's proofs/circuit shape target. Defaults to `
|
|
235
|
-
*
|
|
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.
|
|
236
204
|
*/
|
|
237
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;
|
|
238
217
|
auditPublicKey?: AuditPublicKey;
|
|
239
218
|
kyt: StellarKytEnvironment;
|
|
240
219
|
signTransaction?: StellarSignTransaction;
|
|
@@ -250,7 +229,6 @@ interface StellarTransactEnvironment {
|
|
|
250
229
|
recipientStellarAddress: string;
|
|
251
230
|
walletPublicKey: string;
|
|
252
231
|
}) => Promise<TransferRecipientExecutionContext>;
|
|
253
|
-
buildTransferOnboardingAtExecute?: (input: BuildTransferOnboardingAtExecuteInput) => Promise<OnboardingPayload>;
|
|
254
232
|
resolveWalletPublicKey?: () => Promise<string>;
|
|
255
233
|
poolMerkleState?: PoolMerkleStatePort;
|
|
256
234
|
leafEphemeral?: LeafEphemeralStatePort;
|
|
@@ -277,16 +255,25 @@ interface StellarSubmissionPayload {
|
|
|
277
255
|
interface StellarTransactArtifacts {
|
|
278
256
|
proofHex?: string;
|
|
279
257
|
publicHex?: string;
|
|
258
|
+
ciphertextHex?: string;
|
|
259
|
+
outputNoteEphemeralScalars?: string[];
|
|
280
260
|
applicationIdsPlaintext?: KytApplicationIdHints;
|
|
281
261
|
tokenAddress?: string;
|
|
282
262
|
depositScalarHex?: string;
|
|
283
263
|
precommitementHex?: string;
|
|
284
264
|
commitmentHex?: string;
|
|
285
265
|
walletPublicKey?: string;
|
|
286
|
-
|
|
266
|
+
escrowRecipient?: string;
|
|
267
|
+
escrowAuthorization?: string;
|
|
268
|
+
escrowSend?: boolean;
|
|
269
|
+
escrowSpendScalarHex?: string;
|
|
270
|
+
escrowClaimantLimbs?: {
|
|
271
|
+
recipientHi: string;
|
|
272
|
+
recipientLo: string;
|
|
273
|
+
nonceDecimal?: string;
|
|
274
|
+
};
|
|
287
275
|
executeFinalizeRequired?: boolean;
|
|
288
|
-
|
|
289
|
-
spendSource?: 'privateAddress' | 'pendingClaim';
|
|
276
|
+
spendSource?: 'privateAddress' | 'escrow';
|
|
290
277
|
}
|
|
291
278
|
interface StellarOperationReceipt {
|
|
292
279
|
operationId: string;
|
|
@@ -302,8 +289,6 @@ interface StellarNetworkConfig {
|
|
|
302
289
|
}
|
|
303
290
|
interface StellarBrowserAssets {
|
|
304
291
|
sdkWasm: ArrayBuffer;
|
|
305
|
-
circuitWasm: ArrayBuffer;
|
|
306
|
-
provingKey: ArrayBuffer;
|
|
307
292
|
}
|
|
308
293
|
interface StellarWalletAdapter {
|
|
309
294
|
getAddress(): Promise<StellarAddress>;
|
|
@@ -392,22 +377,6 @@ declare function composeStellarStateService(adapter: StateBridgeAdapter): {
|
|
|
392
377
|
getIncomingDeliveries: (filter: StellarIncomingDeliveriesFilter) => Promise<StellarIncomingDelivery[]>;
|
|
393
378
|
upsertIncomingDeliveries: (deliveries: StellarIncomingDelivery[]) => Promise<void>;
|
|
394
379
|
markDeliveryProcessed(id: number): Promise<void>;
|
|
395
|
-
getPendingClaims: (filter?: StellarPendingClaimsFilter) => Promise<StellarPendingClaimsState>;
|
|
396
|
-
getPendingClaimsCount(owner: StellarAddress): Promise<number | undefined>;
|
|
397
|
-
appendPendingClaims: (claims: StellarPendingClaim[], paginationInfo: StellarPendingClaimsPagination) => Promise<void>;
|
|
398
|
-
replacePendingClaimsPage: (input: {
|
|
399
|
-
owner: StellarAddress;
|
|
400
|
-
claims: StellarPendingClaim[];
|
|
401
|
-
paginationInfo: StellarPendingClaimsPagination;
|
|
402
|
-
count?: number;
|
|
403
|
-
}) => Promise<void>;
|
|
404
|
-
upsertPendingClaims: (claims: StellarPendingClaim[]) => Promise<void>;
|
|
405
|
-
removePendingClaims: (ids: string[]) => Promise<void>;
|
|
406
|
-
clearPendingClaims: (input?: {
|
|
407
|
-
owner?: StellarAddress;
|
|
408
|
-
asset?: StellarAssetId;
|
|
409
|
-
}) => Promise<void>;
|
|
410
|
-
setPendingClaimsCount: (owner: StellarAddress, count: number) => Promise<void>;
|
|
411
380
|
getLeafEphemeral(input: {
|
|
412
381
|
poolContract: string;
|
|
413
382
|
leafIndex: number;
|
|
@@ -504,22 +473,6 @@ declare function composeStellarPrivacyClient(config: ResolvedStellarPrivacyClien
|
|
|
504
473
|
getIncomingDeliveries: (filter: StellarIncomingDeliveriesFilter) => Promise<StellarIncomingDelivery[]>;
|
|
505
474
|
upsertIncomingDeliveries: (deliveries: StellarIncomingDelivery[]) => Promise<void>;
|
|
506
475
|
markDeliveryProcessed(id: number): Promise<void>;
|
|
507
|
-
getPendingClaims: (filter?: StellarPendingClaimsFilter) => Promise<StellarPendingClaimsState>;
|
|
508
|
-
getPendingClaimsCount(owner: StellarAddress): Promise<number | undefined>;
|
|
509
|
-
appendPendingClaims: (claims: StellarPendingClaim[], paginationInfo: StellarPendingClaimsPagination) => Promise<void>;
|
|
510
|
-
replacePendingClaimsPage: (input: {
|
|
511
|
-
owner: StellarAddress;
|
|
512
|
-
claims: StellarPendingClaim[];
|
|
513
|
-
paginationInfo: StellarPendingClaimsPagination;
|
|
514
|
-
count?: number;
|
|
515
|
-
}) => Promise<void>;
|
|
516
|
-
upsertPendingClaims: (claims: StellarPendingClaim[]) => Promise<void>;
|
|
517
|
-
removePendingClaims: (ids: string[]) => Promise<void>;
|
|
518
|
-
clearPendingClaims: (input?: {
|
|
519
|
-
owner?: StellarAddress;
|
|
520
|
-
asset?: StellarAssetId;
|
|
521
|
-
}) => Promise<void>;
|
|
522
|
-
setPendingClaimsCount: (owner: StellarAddress, count: number) => Promise<void>;
|
|
523
476
|
getLeafEphemeral(input: {
|
|
524
477
|
poolContract: string;
|
|
525
478
|
leafIndex: number;
|
|
@@ -591,6 +544,7 @@ declare function composeStellarPrivacyClient(config: ResolvedStellarPrivacyClien
|
|
|
591
544
|
poolContractId?: string;
|
|
592
545
|
nullifier: string;
|
|
593
546
|
walletPublicKey: string;
|
|
547
|
+
privKeyScalarHex: string;
|
|
594
548
|
}) => Promise<{
|
|
595
549
|
spent: boolean;
|
|
596
550
|
nullifierHashHex: string;
|
|
@@ -636,18 +590,6 @@ declare function composeStellarPrivacyClient(config: ResolvedStellarPrivacyClien
|
|
|
636
590
|
};
|
|
637
591
|
type ComposedStellarPrivacyClient = ReturnType<typeof composeStellarPrivacyClient>;
|
|
638
592
|
|
|
639
|
-
interface LoadPendingClaimsFromBackendInput {
|
|
640
|
-
backendBaseUrl: string;
|
|
641
|
-
ownerAddress: StellarAddress;
|
|
642
|
-
asset?: StellarAssetId;
|
|
643
|
-
page?: number;
|
|
644
|
-
pageSize?: number;
|
|
645
|
-
}
|
|
646
|
-
interface LoadPendingClaimsCountFromBackendInput {
|
|
647
|
-
backendBaseUrl: string;
|
|
648
|
-
ownerAddress: StellarAddress;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
593
|
declare function createStateDelegates(state: StellarStateService): {
|
|
652
594
|
getPrivateRecords: () => Promise<StellarPrivateRecord[]>;
|
|
653
595
|
getAvailablePrivateRecords: (filter: Parameters<StellarStateService["getAvailablePrivateRecords"]>[0]) => Promise<StellarPrivateRecord[]>;
|
|
@@ -664,16 +606,6 @@ declare function createStateDelegates(state: StellarStateService): {
|
|
|
664
606
|
markDeliveryProcessed: (id: Parameters<StellarStateService["markDeliveryProcessed"]>[0]) => Promise<void>;
|
|
665
607
|
getDeliverySyncState: (input: Parameters<StellarStateService["getDeliverySyncState"]>[0]) => Promise<StellarDeliverySyncState | undefined>;
|
|
666
608
|
setDeliverySyncState: (syncState: Parameters<StellarStateService["setDeliverySyncState"]>[0]) => Promise<void>;
|
|
667
|
-
appendPendingClaims: (claims: Parameters<StellarStateService["appendPendingClaims"]>[0], paginationInfo: Parameters<StellarStateService["appendPendingClaims"]>[1]) => Promise<void>;
|
|
668
|
-
loadPendingClaimsFromBackend: (input: LoadPendingClaimsFromBackendInput) => Promise<void>;
|
|
669
|
-
loadPendingClaimsCountFromBackend: (input: LoadPendingClaimsCountFromBackendInput) => Promise<void>;
|
|
670
|
-
replacePendingClaimsPage: (input: Parameters<StellarStateService["replacePendingClaimsPage"]>[0]) => Promise<void>;
|
|
671
|
-
upsertPendingClaims: (claims: Parameters<StellarStateService["upsertPendingClaims"]>[0]) => Promise<void>;
|
|
672
|
-
removePendingClaims: (ids: Parameters<StellarStateService["removePendingClaims"]>[0]) => Promise<void>;
|
|
673
|
-
clearPendingClaims: (input?: Parameters<StellarStateService["clearPendingClaims"]>[0]) => Promise<void>;
|
|
674
|
-
getPendingClaims: (filter?: Parameters<StellarStateService["getPendingClaims"]>[0]) => Promise<StellarPendingClaimsState>;
|
|
675
|
-
getPendingClaimsCount: (owner: Parameters<StellarStateService["getPendingClaimsCount"]>[0]) => Promise<number | undefined>;
|
|
676
|
-
setPendingClaimsCount: (owner: Parameters<StellarStateService["setPendingClaimsCount"]>[0], count: Parameters<StellarStateService["setPendingClaimsCount"]>[1]) => Promise<void>;
|
|
677
609
|
getPoolMerkleState: (poolContract: Parameters<StellarStateService["getPoolMerkleState"]>[0]) => Promise<StellarPoolMerkleState | undefined>;
|
|
678
610
|
setPoolMerkleState: (poolState: Parameters<StellarStateService["setPoolMerkleState"]>[0]) => Promise<void>;
|
|
679
611
|
appendPoolCommitments: (input: Parameters<StellarStateService["appendPoolCommitments"]>[0]) => Promise<void>;
|
|
@@ -729,11 +661,10 @@ declare function createStellarPrivacyClientFromResolvedConfig(config: ResolvedSt
|
|
|
729
661
|
|
|
730
662
|
interface StellarNodeAssets {
|
|
731
663
|
sdkWasmPath: string;
|
|
732
|
-
circuitWasmPath: string;
|
|
733
|
-
provingKeyPath: string;
|
|
734
664
|
}
|
|
735
665
|
interface StellarNodePrivacyClientConfig extends StellarPrivacyClientConfigBase {
|
|
736
666
|
assets: StellarNodeAssets;
|
|
667
|
+
transactEnvironment?: StellarTransactEnvironment;
|
|
737
668
|
}
|
|
738
669
|
|
|
739
670
|
type CreateStellarPrivacyClientResult = StellarPrivacyClient | ReturnType<typeof createRejectedOperation>;
|