@arcanetech/privacy-sdk-stellar 0.5.4 → 0.6.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/dist/index.d.ts +58 -21
- package/dist/index.js +422 -81
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +24 -1
- package/dist/node.js +420 -79
- package/dist/node.js.map +1 -1
- package/dist/state/index.d.ts +31 -1
- package/dist/state/index.js +10 -2
- package/dist/state/index.js.map +1 -1
- package/dist/transact/index.d.ts +22 -1
- package/dist/transact/index.js +323 -72
- package/dist/transact/index.js.map +1 -1
- package/package.json +2 -2
package/dist/state/index.d.ts
CHANGED
|
@@ -92,6 +92,11 @@ interface StellarWalletPrivateAddressRecord {
|
|
|
92
92
|
privateAddress: string;
|
|
93
93
|
createdAt: number;
|
|
94
94
|
}
|
|
95
|
+
interface StellarLeanImtNode {
|
|
96
|
+
level: number;
|
|
97
|
+
index: number;
|
|
98
|
+
value: string;
|
|
99
|
+
}
|
|
95
100
|
interface StellarPoolMerkleState {
|
|
96
101
|
poolContract: string;
|
|
97
102
|
commitments: string[];
|
|
@@ -99,6 +104,7 @@ interface StellarPoolMerkleState {
|
|
|
99
104
|
merkleRootHex: string;
|
|
100
105
|
updatedAt: number;
|
|
101
106
|
syncedLedger?: number;
|
|
107
|
+
nodes?: StellarLeanImtNode[];
|
|
102
108
|
}
|
|
103
109
|
interface StellarLeafEphemeral {
|
|
104
110
|
poolContract: string;
|
|
@@ -384,12 +390,30 @@ declare const poolMerkleStateSchema: z.ZodObject<{
|
|
|
384
390
|
merkleRootHex: z.ZodString;
|
|
385
391
|
updatedAt: z.ZodNumber;
|
|
386
392
|
syncedLedger: z.ZodOptional<z.ZodNumber>;
|
|
393
|
+
nodes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
394
|
+
level: z.ZodNumber;
|
|
395
|
+
index: z.ZodNumber;
|
|
396
|
+
value: z.ZodString;
|
|
397
|
+
}, "strip", z.ZodTypeAny, {
|
|
398
|
+
value: string;
|
|
399
|
+
level: number;
|
|
400
|
+
index: number;
|
|
401
|
+
}, {
|
|
402
|
+
value: string;
|
|
403
|
+
level: number;
|
|
404
|
+
index: number;
|
|
405
|
+
}>, "many">>;
|
|
387
406
|
}, "strip", z.ZodTypeAny, {
|
|
388
407
|
poolContract: string;
|
|
389
408
|
updatedAt: number;
|
|
390
409
|
commitments: string[];
|
|
391
410
|
commitmentCount: number;
|
|
392
411
|
merkleRootHex: string;
|
|
412
|
+
nodes?: {
|
|
413
|
+
value: string;
|
|
414
|
+
level: number;
|
|
415
|
+
index: number;
|
|
416
|
+
}[] | undefined;
|
|
393
417
|
syncedLedger?: number | undefined;
|
|
394
418
|
}, {
|
|
395
419
|
poolContract: string;
|
|
@@ -397,6 +421,11 @@ declare const poolMerkleStateSchema: z.ZodObject<{
|
|
|
397
421
|
commitments: string[];
|
|
398
422
|
commitmentCount: number;
|
|
399
423
|
merkleRootHex: string;
|
|
424
|
+
nodes?: {
|
|
425
|
+
value: string;
|
|
426
|
+
level: number;
|
|
427
|
+
index: number;
|
|
428
|
+
}[] | undefined;
|
|
400
429
|
syncedLedger?: number | undefined;
|
|
401
430
|
}>;
|
|
402
431
|
declare const leafEphemeralSchema: z.ZodObject<{
|
|
@@ -580,6 +609,7 @@ declare function composeStellarStateService(adapter: StateBridgeAdapter): {
|
|
|
580
609
|
commitments: string[];
|
|
581
610
|
merkleRootHex: string;
|
|
582
611
|
syncedLedger?: number;
|
|
612
|
+
nodes?: StellarPoolMerkleState["nodes"];
|
|
583
613
|
}): Promise<void>;
|
|
584
614
|
getWalletPrivateAddressRecord(input: {
|
|
585
615
|
owner: StellarAddress;
|
|
@@ -635,4 +665,4 @@ type StellarStateService = ComposedStellarStateService;
|
|
|
635
665
|
declare function createStellarStateService(adapter: StateBridgeAdapter): StellarStateService;
|
|
636
666
|
declare function createStellarStorageAdapterFromState(state: StellarStateService): StellarStorageAdapter;
|
|
637
667
|
|
|
638
|
-
export { STELLAR_STATE_PATHS, type StellarAsset, type StellarAssetsCatalog, type StellarAvailablePrivateRecordsFilter, type StellarDeliverySyncState, type StellarIncomingDeliveriesFilter, type StellarIncomingDelivery, type StellarLeafEphemeral, type StellarPoolMerkleState, type StellarPrivateAssetRow, type StellarPrivateRecordStatus, type StellarPublicBalance, type StellarPublicBalanceInput, type StellarRegistryLookup, type StellarStateDefinition, type StellarStateService, type StellarTransactionStatus, assetSchema, createStellarStateService, createStellarStorageAdapterFromState, deliverySyncStateSchema, incomingDeliverySchema, leafEphemeralSchema, listWalletPrivateAddressRecordsForOwnerFromStateSnapshot, listWalletPrivateAddressScalarsForOwnerFromStateSnapshot, paginationSchema, poolMerkleStateSchema, privateRecordSchema, publicBalanceSchema, readPrivateRecordsFromStateSnapshot, readWalletDefaultPrivateAddressNonceFromStateSnapshot, readWalletPrivateAddressRecordFromStateSnapshot, readWalletPrivateAddressScalarFromStateSnapshot, registryLookupSchema, stellarStateCallTypes, stellarStateDefinitions, transactionStatusSchema };
|
|
668
|
+
export { STELLAR_STATE_PATHS, type StellarAsset, type StellarAssetsCatalog, type StellarAvailablePrivateRecordsFilter, type StellarDeliverySyncState, type StellarIncomingDeliveriesFilter, type StellarIncomingDelivery, type StellarLeafEphemeral, type StellarLeanImtNode, type StellarPoolMerkleState, type StellarPrivateAssetRow, type StellarPrivateRecordStatus, type StellarPublicBalance, type StellarPublicBalanceInput, type StellarRegistryLookup, type StellarStateDefinition, type StellarStateService, type StellarTransactionStatus, assetSchema, createStellarStateService, createStellarStorageAdapterFromState, deliverySyncStateSchema, incomingDeliverySchema, leafEphemeralSchema, listWalletPrivateAddressRecordsForOwnerFromStateSnapshot, listWalletPrivateAddressScalarsForOwnerFromStateSnapshot, paginationSchema, poolMerkleStateSchema, privateRecordSchema, publicBalanceSchema, readPrivateRecordsFromStateSnapshot, readWalletDefaultPrivateAddressNonceFromStateSnapshot, readWalletPrivateAddressRecordFromStateSnapshot, readWalletPrivateAddressScalarFromStateSnapshot, registryLookupSchema, stellarStateCallTypes, stellarStateDefinitions, transactionStatusSchema };
|
package/dist/state/index.js
CHANGED
|
@@ -93,13 +93,19 @@ var walletPrivateAddressRecordSchema = z.object({
|
|
|
93
93
|
privateAddress: z.string().min(1),
|
|
94
94
|
createdAt: z.number()
|
|
95
95
|
});
|
|
96
|
+
var leanImtNodeSchema = z.object({
|
|
97
|
+
level: z.number().int().nonnegative(),
|
|
98
|
+
index: z.number().int().nonnegative(),
|
|
99
|
+
value: z.string().min(1)
|
|
100
|
+
});
|
|
96
101
|
var poolMerkleStateSchema = z.object({
|
|
97
102
|
poolContract: z.string().min(1),
|
|
98
103
|
commitments: z.array(z.string()),
|
|
99
104
|
commitmentCount: z.number().int().nonnegative(),
|
|
100
105
|
merkleRootHex: z.string().min(1),
|
|
101
106
|
updatedAt: z.number(),
|
|
102
|
-
syncedLedger: z.number().int().optional()
|
|
107
|
+
syncedLedger: z.number().int().optional(),
|
|
108
|
+
nodes: z.array(leanImtNodeSchema).optional()
|
|
103
109
|
});
|
|
104
110
|
var leafEphemeralSchema = z.object({
|
|
105
111
|
poolContract: z.string().min(1),
|
|
@@ -1658,6 +1664,7 @@ function createPoolMerkleService(context) {
|
|
|
1658
1664
|
async appendPoolCommitments(input) {
|
|
1659
1665
|
const current = await this.getPoolMerkleState(input.poolContract);
|
|
1660
1666
|
const mergedCommitments = [...current?.commitments ?? [], ...input.commitments];
|
|
1667
|
+
const nodes = input.nodes ?? (input.commitments.length === 0 ? current?.nodes : void 0);
|
|
1661
1668
|
await this.setPoolMerkleState(
|
|
1662
1669
|
withoutUndefinedFields({
|
|
1663
1670
|
poolContract: input.poolContract,
|
|
@@ -1665,7 +1672,8 @@ function createPoolMerkleService(context) {
|
|
|
1665
1672
|
commitmentCount: mergedCommitments.length,
|
|
1666
1673
|
merkleRootHex: input.merkleRootHex,
|
|
1667
1674
|
updatedAt: Date.now(),
|
|
1668
|
-
syncedLedger: input.syncedLedger ?? current?.syncedLedger
|
|
1675
|
+
syncedLedger: input.syncedLedger ?? current?.syncedLedger,
|
|
1676
|
+
nodes
|
|
1669
1677
|
})
|
|
1670
1678
|
);
|
|
1671
1679
|
}
|