@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.
- package/dist/browser.cjs +413 -286
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +18 -16
- package/dist/browser.d.ts +18 -16
- package/dist/browser.js +413 -286
- package/dist/browser.js.map +1 -1
- package/dist/{index-CI7UllxU.d.cts → index-Dvl0HZkw.d.cts} +66 -64
- package/dist/{index-CI7UllxU.d.ts → index-Dvl0HZkw.d.ts} +66 -64
- package/dist/index.cjs +353 -249
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +353 -249
- package/dist/index.js.map +1 -1
- package/dist/node.cjs +459 -337
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +24 -23
- package/dist/node.d.ts +24 -23
- package/dist/node.js +459 -337
- package/dist/node.js.map +1 -1
- package/package.json +1 -1
package/dist/browser.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StorageAdapter,
|
|
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,
|
|
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
|
|
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
|
|
57
|
+
* Get a chairmanMerkle node by id.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
getChairmanMerkleNode(chainId: number, id: string): Promise<ChairmanMerkleNodeRecord | undefined>;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Put chairmanMerkle nodes and persist.
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
putChairmanMerkleNodes(chainId: number, nodes: ChairmanMerkleNodeRecord[]): Promise<void>;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Get a chairmanMerkle version record by chainId and version.
|
|
66
66
|
*/
|
|
67
|
-
|
|
67
|
+
getChairmanMerkleVersion(chainId: number, version: number): Promise<ChairmanMerkleVersionRecord | undefined>;
|
|
68
68
|
/**
|
|
69
|
-
* Get
|
|
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
|
-
|
|
72
|
+
getLatestChairmanMerkleVersion(chainId: number): Promise<ChairmanMerkleVersionRecord | undefined>;
|
|
72
73
|
/**
|
|
73
|
-
* Persist
|
|
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
|
-
|
|
77
|
+
putChairmanMerkleVersion(chainId: number, record: ChairmanMerkleVersionRecord): Promise<void>;
|
|
76
78
|
/**
|
|
77
|
-
* Clear
|
|
79
|
+
* Clear both chairmanMerkle nodes and versions for a chain and reset the cache.
|
|
78
80
|
*/
|
|
79
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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
|
|
57
|
+
* Get a chairmanMerkle node by id.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
getChairmanMerkleNode(chainId: number, id: string): Promise<ChairmanMerkleNodeRecord | undefined>;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Put chairmanMerkle nodes and persist.
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
putChairmanMerkleNodes(chainId: number, nodes: ChairmanMerkleNodeRecord[]): Promise<void>;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Get a chairmanMerkle version record by chainId and version.
|
|
66
66
|
*/
|
|
67
|
-
|
|
67
|
+
getChairmanMerkleVersion(chainId: number, version: number): Promise<ChairmanMerkleVersionRecord | undefined>;
|
|
68
68
|
/**
|
|
69
|
-
* Get
|
|
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
|
-
|
|
72
|
+
getLatestChairmanMerkleVersion(chainId: number): Promise<ChairmanMerkleVersionRecord | undefined>;
|
|
72
73
|
/**
|
|
73
|
-
* Persist
|
|
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
|
-
|
|
77
|
+
putChairmanMerkleVersion(chainId: number, record: ChairmanMerkleVersionRecord): Promise<void>;
|
|
76
78
|
/**
|
|
77
|
-
* Clear
|
|
79
|
+
* Clear both chairmanMerkle nodes and versions for a chain and reset the cache.
|
|
78
80
|
*/
|
|
79
|
-
|
|
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,
|
|
206
|
+
export { ChairmanMerkleNodeRecord, ChairmanMerkleVersionRecord, EntryMemoRecord, EntryNullifierRecord, Hex, IndexedDbStore, type IndexedDbStoreOptions, ListEntryMemosQuery, ListEntryNullifiersQuery, ListOperationsQuery, ListUtxosQuery, OperationStatus, OperationType, StorageAdapter, StoredOperation, SyncCursor, UtxoRecord };
|