@ocash/sdk 0.1.4-rc.0 → 0.1.4-rc.2

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.
@@ -1,5 +1,5 @@
1
- import { S as StorageAdapter, M as MerkleNodeRecord, a as MerkleTreeState, E as EntryMemoRecord, L as ListEntryMemosQuery, b as EntryNullifierRecord, c as ListEntryNullifiersQuery, H as Hex, d as SyncCursor, U as UtxoRecord, e as ListUtxosQuery, O as OperationType, f as StoredOperation, g as OperationDetailFor, h as OperationStatus, i as ListOperationsQuery } from './index-CI7UllxU.cjs';
2
- export { A as App_ABI, j as AssetOverrideEntry, k as AssetsOverride, B as BABYJUBJUB_SCALAR_FIELD, l as BASE_DEV, m as BASE_MAINNET, n as BSC_DEV, o as BSC_MAINNET, p as BSC_TESTNET, q as BSC_TESTNET_DEV, C as ChainConfigInput, r as CommitmentData, s as CryptoToolkit, D as DepositOperation, t as DepositOperationDetail, u as DummyFactory, v as ETH_DEV, w as ETH_MAINNET, K as KeyManager, x as KeyValueClient, y as KeyValueStore, z as KeyValueStoreOptions, F as LedgerInfo, G as MemoKit, I as MemoryStore, J as MerkleLeafRecord, N as OCashSdk, P as OCashSdkConfig, Q as OperationCreateInput, R as OpsApi, T as PlannerEstimateTransferResult, V as PlannerEstimateWithdrawResult, W as ProofResult, X as RedisStore, Y as RedisStoreOptions, Z as RelayerRequest, _ as SEPOLIA_DEV, $ as SEPOLIA_TESTNET, a0 as SdkEvent, a1 as SyncChainStatus, a2 as TokenMetadata, a3 as TransactionReceipt, a4 as TransferOperation, a5 as TransferOperationDetail, a6 as TransferWitnessInput, a7 as Utils, a8 as WalletSessionInput, a9 as WithdrawOperation, aa as WithdrawOperationDetail, ab as WithdrawWitnessInput, ac as WitnessBuildResult, ad as WitnessContext, ae as assertChainConfigInput, af as assertTokenList, ag as assertTokenMetadata, ah as calcTransferProofBinding, ai as calcWithdrawProofBinding, aj as createSdk, ak as default, al as defaultAssetsOverrideMainnet, am as defaultAssetsOverrideTestnet, an as fetchPoolTokensFromContract, ao as normalizeTokenMetadata } from './index-CI7UllxU.cjs';
1
+ import { S as StorageAdapter, C as ChairmanMerkleNodeRecord, a as ChairmanMerkleVersionRecord, E as EntryMemoRecord, L as ListEntryMemosQuery, b as EntryNullifierRecord, c as ListEntryNullifiersQuery, H as Hex, d as SyncCursor, U as UtxoRecord, e as ListUtxosQuery, O as OperationType, f as StoredOperation, g as OperationDetailFor, h as OperationStatus, i as ListOperationsQuery } from './index-Dvl0HZkw.cjs';
2
+ export { A as App_ABI, j as AssetOverrideEntry, k as AssetsOverride, B as BABYJUBJUB_SCALAR_FIELD, l as BASE_DEV, m as BASE_MAINNET, n as BSC_DEV, o as BSC_MAINNET, p as BSC_TESTNET, q as BSC_TESTNET_DEV, r as ChainConfigInput, s as CommitmentData, t as CryptoToolkit, D as DepositOperation, u as DepositOperationDetail, v as DummyFactory, w as ETH_DEV, x as ETH_MAINNET, K as KeyManager, y as KeyValueClient, z as KeyValueStore, F as KeyValueStoreOptions, G as LedgerInfo, M as MemoKit, I as MemoryStore, J as MerkleLeafRecord, N as OCashSdk, P as OCashSdkConfig, Q as OperationCreateInput, R as OpsApi, T as PlannerEstimateTransferResult, V as PlannerEstimateWithdrawResult, W as ProofResult, X as RedisStore, Y as RedisStoreOptions, Z as RelayerRequest, _ as SEPOLIA_DEV, $ as SEPOLIA_TESTNET, a0 as SdkEvent, a1 as SyncChainStatus, a2 as TokenMetadata, a3 as TransactionReceipt, a4 as TransferOperation, a5 as TransferOperationDetail, a6 as TransferWitnessInput, a7 as Utils, a8 as WalletSessionInput, a9 as WithdrawOperation, aa as WithdrawOperationDetail, ab as WithdrawWitnessInput, ac as WitnessBuildResult, ad as WitnessContext, ae as assertChainConfigInput, af as assertTokenList, ag as assertTokenMetadata, ah as calcTransferProofBinding, ai as calcWithdrawProofBinding, aj as createSdk, ak as default, al as defaultAssetsOverrideMainnet, am as defaultAssetsOverrideTestnet, an as fetchPoolTokensFromContract, ao as normalizeTokenMetadata } from './index-Dvl0HZkw.cjs';
3
3
  import 'viem';
4
4
 
5
5
  type IndexedDbStoreOptions = {
@@ -17,7 +17,7 @@ declare class IndexedDbStore implements StorageAdapter {
17
17
  private walletId;
18
18
  private readonly cursors;
19
19
  private operations;
20
- private merkleTrees;
20
+ private chairmanMerkleLatestVersions;
21
21
  private db;
22
22
  private readonly maxOperations;
23
23
  /**
@@ -54,29 +54,31 @@ declare class IndexedDbStore implements StorageAdapter {
54
54
  */
55
55
  private load;
56
56
  /**
57
- * Get a merkle node by id.
57
+ * Get a chairmanMerkle node by id.
58
58
  */
59
- getMerkleNode(chainId: number, id: string): Promise<MerkleNodeRecord | undefined>;
59
+ getChairmanMerkleNode(chainId: number, id: string): Promise<ChairmanMerkleNodeRecord | undefined>;
60
60
  /**
61
- * Upsert merkle nodes and persist.
61
+ * Put chairmanMerkle nodes and persist.
62
62
  */
63
- upsertMerkleNodes(chainId: number, nodes: MerkleNodeRecord[]): Promise<void>;
63
+ putChairmanMerkleNodes(chainId: number, nodes: ChairmanMerkleNodeRecord[]): Promise<void>;
64
64
  /**
65
- * Clear merkle nodes for a chain.
65
+ * Get a chairmanMerkle version record by chainId and version.
66
66
  */
67
- clearMerkleNodes(chainId: number): Promise<void>;
67
+ getChairmanMerkleVersion(chainId: number, version: number): Promise<ChairmanMerkleVersionRecord | undefined>;
68
68
  /**
69
- * Get persisted merkle tree metadata for a chain.
69
+ * Get the latest chairmanMerkle version for a chain from in-memory cache,
70
+ * falling back to loading from the store if not cached.
70
71
  */
71
- getMerkleTree(chainId: number): Promise<MerkleTreeState | undefined>;
72
+ getLatestChairmanMerkleVersion(chainId: number): Promise<ChairmanMerkleVersionRecord | undefined>;
72
73
  /**
73
- * Persist merkle tree metadata for a chain.
74
+ * Persist a chairmanMerkle version record and update the in-memory cache
75
+ * if this is the latest version for the chain.
74
76
  */
75
- setMerkleTree(chainId: number, tree: MerkleTreeState): Promise<void>;
77
+ putChairmanMerkleVersion(chainId: number, record: ChairmanMerkleVersionRecord): Promise<void>;
76
78
  /**
77
- * Clear merkle tree metadata for a chain.
79
+ * Clear both chairmanMerkle nodes and versions for a chain and reset the cache.
78
80
  */
79
- clearMerkleTree(chainId: number): Promise<void>;
81
+ clearChairmanMerkleTree(chainId: number): Promise<void>;
80
82
  /**
81
83
  * Upsert entry memos and persist.
82
84
  */
@@ -201,4 +203,4 @@ declare class IndexedDbStore implements StorageAdapter {
201
203
  listOperations(input?: number | ListOperationsQuery): StoredOperation[];
202
204
  }
203
205
 
204
- export { EntryMemoRecord, EntryNullifierRecord, Hex, IndexedDbStore, type IndexedDbStoreOptions, ListEntryMemosQuery, ListEntryNullifiersQuery, ListOperationsQuery, ListUtxosQuery, MerkleNodeRecord, MerkleTreeState, OperationStatus, OperationType, StorageAdapter, StoredOperation, SyncCursor, UtxoRecord };
206
+ export { ChairmanMerkleNodeRecord, ChairmanMerkleVersionRecord, EntryMemoRecord, EntryNullifierRecord, Hex, IndexedDbStore, type IndexedDbStoreOptions, ListEntryMemosQuery, ListEntryNullifiersQuery, ListOperationsQuery, ListUtxosQuery, OperationStatus, OperationType, StorageAdapter, StoredOperation, SyncCursor, UtxoRecord };
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as StorageAdapter, M as MerkleNodeRecord, a as MerkleTreeState, E as EntryMemoRecord, L as ListEntryMemosQuery, b as EntryNullifierRecord, c as ListEntryNullifiersQuery, H as Hex, d as SyncCursor, U as UtxoRecord, e as ListUtxosQuery, O as OperationType, f as StoredOperation, g as OperationDetailFor, h as OperationStatus, i as ListOperationsQuery } from './index-CI7UllxU.js';
2
- export { A as App_ABI, j as AssetOverrideEntry, k as AssetsOverride, B as BABYJUBJUB_SCALAR_FIELD, l as BASE_DEV, m as BASE_MAINNET, n as BSC_DEV, o as BSC_MAINNET, p as BSC_TESTNET, q as BSC_TESTNET_DEV, C as ChainConfigInput, r as CommitmentData, s as CryptoToolkit, D as DepositOperation, t as DepositOperationDetail, u as DummyFactory, v as ETH_DEV, w as ETH_MAINNET, K as KeyManager, x as KeyValueClient, y as KeyValueStore, z as KeyValueStoreOptions, F as LedgerInfo, G as MemoKit, I as MemoryStore, J as MerkleLeafRecord, N as OCashSdk, P as OCashSdkConfig, Q as OperationCreateInput, R as OpsApi, T as PlannerEstimateTransferResult, V as PlannerEstimateWithdrawResult, W as ProofResult, X as RedisStore, Y as RedisStoreOptions, Z as RelayerRequest, _ as SEPOLIA_DEV, $ as SEPOLIA_TESTNET, a0 as SdkEvent, a1 as SyncChainStatus, a2 as TokenMetadata, a3 as TransactionReceipt, a4 as TransferOperation, a5 as TransferOperationDetail, a6 as TransferWitnessInput, a7 as Utils, a8 as WalletSessionInput, a9 as WithdrawOperation, aa as WithdrawOperationDetail, ab as WithdrawWitnessInput, ac as WitnessBuildResult, ad as WitnessContext, ae as assertChainConfigInput, af as assertTokenList, ag as assertTokenMetadata, ah as calcTransferProofBinding, ai as calcWithdrawProofBinding, aj as createSdk, ak as default, al as defaultAssetsOverrideMainnet, am as defaultAssetsOverrideTestnet, an as fetchPoolTokensFromContract, ao as normalizeTokenMetadata } from './index-CI7UllxU.js';
1
+ import { S as StorageAdapter, C as ChairmanMerkleNodeRecord, a as ChairmanMerkleVersionRecord, E as EntryMemoRecord, L as ListEntryMemosQuery, b as EntryNullifierRecord, c as ListEntryNullifiersQuery, H as Hex, d as SyncCursor, U as UtxoRecord, e as ListUtxosQuery, O as OperationType, f as StoredOperation, g as OperationDetailFor, h as OperationStatus, i as ListOperationsQuery } from './index-Dvl0HZkw.js';
2
+ export { A as App_ABI, j as AssetOverrideEntry, k as AssetsOverride, B as BABYJUBJUB_SCALAR_FIELD, l as BASE_DEV, m as BASE_MAINNET, n as BSC_DEV, o as BSC_MAINNET, p as BSC_TESTNET, q as BSC_TESTNET_DEV, r as ChainConfigInput, s as CommitmentData, t as CryptoToolkit, D as DepositOperation, u as DepositOperationDetail, v as DummyFactory, w as ETH_DEV, x as ETH_MAINNET, K as KeyManager, y as KeyValueClient, z as KeyValueStore, F as KeyValueStoreOptions, G as LedgerInfo, M as MemoKit, I as MemoryStore, J as MerkleLeafRecord, N as OCashSdk, P as OCashSdkConfig, Q as OperationCreateInput, R as OpsApi, T as PlannerEstimateTransferResult, V as PlannerEstimateWithdrawResult, W as ProofResult, X as RedisStore, Y as RedisStoreOptions, Z as RelayerRequest, _ as SEPOLIA_DEV, $ as SEPOLIA_TESTNET, a0 as SdkEvent, a1 as SyncChainStatus, a2 as TokenMetadata, a3 as TransactionReceipt, a4 as TransferOperation, a5 as TransferOperationDetail, a6 as TransferWitnessInput, a7 as Utils, a8 as WalletSessionInput, a9 as WithdrawOperation, aa as WithdrawOperationDetail, ab as WithdrawWitnessInput, ac as WitnessBuildResult, ad as WitnessContext, ae as assertChainConfigInput, af as assertTokenList, ag as assertTokenMetadata, ah as calcTransferProofBinding, ai as calcWithdrawProofBinding, aj as createSdk, ak as default, al as defaultAssetsOverrideMainnet, am as defaultAssetsOverrideTestnet, an as fetchPoolTokensFromContract, ao as normalizeTokenMetadata } from './index-Dvl0HZkw.js';
3
3
  import 'viem';
4
4
 
5
5
  type IndexedDbStoreOptions = {
@@ -17,7 +17,7 @@ declare class IndexedDbStore implements StorageAdapter {
17
17
  private walletId;
18
18
  private readonly cursors;
19
19
  private operations;
20
- private merkleTrees;
20
+ private chairmanMerkleLatestVersions;
21
21
  private db;
22
22
  private readonly maxOperations;
23
23
  /**
@@ -54,29 +54,31 @@ declare class IndexedDbStore implements StorageAdapter {
54
54
  */
55
55
  private load;
56
56
  /**
57
- * Get a merkle node by id.
57
+ * Get a chairmanMerkle node by id.
58
58
  */
59
- getMerkleNode(chainId: number, id: string): Promise<MerkleNodeRecord | undefined>;
59
+ getChairmanMerkleNode(chainId: number, id: string): Promise<ChairmanMerkleNodeRecord | undefined>;
60
60
  /**
61
- * Upsert merkle nodes and persist.
61
+ * Put chairmanMerkle nodes and persist.
62
62
  */
63
- upsertMerkleNodes(chainId: number, nodes: MerkleNodeRecord[]): Promise<void>;
63
+ putChairmanMerkleNodes(chainId: number, nodes: ChairmanMerkleNodeRecord[]): Promise<void>;
64
64
  /**
65
- * Clear merkle nodes for a chain.
65
+ * Get a chairmanMerkle version record by chainId and version.
66
66
  */
67
- clearMerkleNodes(chainId: number): Promise<void>;
67
+ getChairmanMerkleVersion(chainId: number, version: number): Promise<ChairmanMerkleVersionRecord | undefined>;
68
68
  /**
69
- * Get persisted merkle tree metadata for a chain.
69
+ * Get the latest chairmanMerkle version for a chain from in-memory cache,
70
+ * falling back to loading from the store if not cached.
70
71
  */
71
- getMerkleTree(chainId: number): Promise<MerkleTreeState | undefined>;
72
+ getLatestChairmanMerkleVersion(chainId: number): Promise<ChairmanMerkleVersionRecord | undefined>;
72
73
  /**
73
- * Persist merkle tree metadata for a chain.
74
+ * Persist a chairmanMerkle version record and update the in-memory cache
75
+ * if this is the latest version for the chain.
74
76
  */
75
- setMerkleTree(chainId: number, tree: MerkleTreeState): Promise<void>;
77
+ putChairmanMerkleVersion(chainId: number, record: ChairmanMerkleVersionRecord): Promise<void>;
76
78
  /**
77
- * Clear merkle tree metadata for a chain.
79
+ * Clear both chairmanMerkle nodes and versions for a chain and reset the cache.
78
80
  */
79
- clearMerkleTree(chainId: number): Promise<void>;
81
+ clearChairmanMerkleTree(chainId: number): Promise<void>;
80
82
  /**
81
83
  * Upsert entry memos and persist.
82
84
  */
@@ -201,4 +203,4 @@ declare class IndexedDbStore implements StorageAdapter {
201
203
  listOperations(input?: number | ListOperationsQuery): StoredOperation[];
202
204
  }
203
205
 
204
- export { EntryMemoRecord, EntryNullifierRecord, Hex, IndexedDbStore, type IndexedDbStoreOptions, ListEntryMemosQuery, ListEntryNullifiersQuery, ListOperationsQuery, ListUtxosQuery, MerkleNodeRecord, MerkleTreeState, OperationStatus, OperationType, StorageAdapter, StoredOperation, SyncCursor, UtxoRecord };
206
+ export { ChairmanMerkleNodeRecord, ChairmanMerkleVersionRecord, EntryMemoRecord, EntryNullifierRecord, Hex, IndexedDbStore, type IndexedDbStoreOptions, ListEntryMemosQuery, ListEntryNullifiersQuery, ListOperationsQuery, ListUtxosQuery, OperationStatus, OperationType, StorageAdapter, StoredOperation, SyncCursor, UtxoRecord };