@zama-fhe/sdk 3.5.0-alpha.1 → 3.5.0-alpha.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/esm/index.d.ts +93 -2
- package/dist/esm/query/index.d.ts +2 -520
- package/dist/esm/{index-bro9lghR.d.ts → zama-sdk-BkSM558P.d.ts} +1940 -1514
- package/package.json +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -3,6 +3,97 @@ import { $ as UnshieldOptions, A as EncryptErrorEvent, At as findWrap, B as Unsh
|
|
|
3
3
|
import { t as cleartext } from "./cleartext-CT4qh3Ra.js";
|
|
4
4
|
import { t as ZamaConfigEthers } from "./types-CPJdosAz.js";
|
|
5
5
|
import { n as MutableWalletAccountStore, r as createWalletAccountStore, t as BaseSigner } from "./base-signer-rvOfr9wl.js";
|
|
6
|
-
import { $ as
|
|
6
|
+
import { $t as DelegationExpiredError, Ar as symbolContract, At as SigningFailedError, Br as underlyingContract, Bt as BalanceCheckUnavailableError, Cn as WrappersRegistryConfig, Cr as isConfidentialWrapperContract, Ct as WrappedToken, D as DecryptResult, Dn as SerializedTransportKeyPair, Dr as balanceOfContract, Dt as ErrorForCode, En as SerializedPermitEip712, Er as approveContract, Et as Token, Fr as finalizeUnwrapContract, Ft as WalletNotConnectedError, Gt as InsufficientERC20BalanceError, Hr as unwrapFromBalanceContract, Ht as ERC20ReadFailedError, Ir as inferredTotalSupplyContract, It as RpcRateLimitError, Jt as AclPausedError, Kt as DecryptionFailedError, Lr as isOperatorContract, Lt as NotEntitledError, Mr as confidentialTotalSupplyContract, Mt as SignerNotConfiguredError, Nr as confidentialTransferContract, Nt as SignerRequiredError, O as EncryptedInput, On as ChecksummedAddress, Or as decimalsContract, Ot as matchZamaError, Pr as confidentialTransferFromContract, Pt as WalletAccountNotReadyError, Qt as DelegationExpirationTooSoonError, Rr as rateContract, Rt as ConfigurationError, Sn as WrappersRegistry, Sr as isConfidentialTokenContract, Tn as SerializedPermit, Tr as allowanceContract, Tt as BatchDecryptAsOptions, Ur as wrapContract, Ut as InsufficientAllowanceError, Vr as unwrapContract, Vt as BalanceErrorDetails, Wr as createConfig, Wt as InsufficientConfidentialBalanceError, Xt as DelegationCooldownError, Yt as DelegationContractIsSelfError, Zt as DelegationDelegateEqualsContractError, _r as revokeDelegationContract, a as DelegatedDecryptOptions, an as NoCiphertextError, ar as TokenWrapperPair, bn as DefaultRegistryAddresses, br as ERC7984_INTERFACE_ID, cn as ZamaError, cr as getTokenAddressContract, dn as retryAfterSeconds, dr as getTokenPairsLengthContract, en as DelegationExpiryUnchangedError, fr as getTokenPairsSliceContract, gr as isHandleDelegatedContract, hr as getDelegationExpiryContract, i as BatchDecryptResult, in as InvalidTransportKeyPairError, ir as PaginatedResult, jr as confidentialBalanceOfContract, jt as SigningRejectedError, kr as nameContract, kt as TransactionRevertedError, ln as ZamaErrorCode, lr as getTokenPairContract, mr as delegateForUserDecryptionContract, n as Decryption, nn as DelegationNotPropagatedError, o as Delegations, on as TransportKeyPairExpiredError, or as TokenWrapperPairWithMetadata, pr as isConfidentialTokenValidContract, qt as EncryptionFailedError, r as BatchDecryptItem, rn as DelegationSelfNotAllowedError, s as Permits, sn as ChainMismatchError, sr as getConfidentialTokenAddressContract, t as ZamaSDK, tn as DelegationNotFoundError, u as DelegationStatus, un as isRetryable, ur as getTokenPairsContract, vr as transferAndCallContract, wn as Permission, wr as supportsInterfaceContract, wt as BatchBalancesResult, xn as ListPairsOptions, xr as ERC7984_WRAPPER_INTERFACE_ID, yr as ERC1363_INTERFACE_ID, zr as setOperatorContract, zt as RelayerRequestFailedError } from "./zama-sdk-BkSM558P.js";
|
|
7
7
|
import { t as ZamaConfigViem } from "./types-C24EbhTi.js";
|
|
8
|
-
|
|
8
|
+
import { Address, Hex } from "viem";
|
|
9
|
+
//#region src/utils/handles.d.ts
|
|
10
|
+
/** All-zero encrypted-value sentinel — a 32-byte zero handle representing the cleartext value `0`. */
|
|
11
|
+
declare const ZERO_ENCRYPTED_VALUE: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
12
|
+
/**
|
|
13
|
+
* Check whether an encrypted value represents the zero value.
|
|
14
|
+
*/
|
|
15
|
+
declare function isEncryptedValueZero(encryptedValue: string): boolean;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/storage/memory-storage.d.ts
|
|
18
|
+
/** In-memory credential store. Credentials are lost on page reload. */
|
|
19
|
+
declare class MemoryStorage implements GenericStorage {
|
|
20
|
+
#private;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieve a value by key.
|
|
23
|
+
* @returns The stored value, or `null` if the key does not exist.
|
|
24
|
+
*/
|
|
25
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
26
|
+
/** Store a value under the given key, overwriting any existing entry. */
|
|
27
|
+
set<T = unknown>(key: string, value: T): Promise<void>;
|
|
28
|
+
/** Remove the entry for the given key (no-op if absent). */
|
|
29
|
+
delete(key: string): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/** Default singleton for application-wide use. */
|
|
32
|
+
declare const memoryStorage: MemoryStorage;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/storage/indexeddb-storage.d.ts
|
|
35
|
+
/**
|
|
36
|
+
* IndexedDB-backed {@link GenericStorage}.
|
|
37
|
+
*
|
|
38
|
+
* Stores keypair and permit objects keyed by a hashed wallet address. The
|
|
39
|
+
* SDK delegates security to the storage backend — values are persisted
|
|
40
|
+
* verbatim with no SDK-layer encryption.
|
|
41
|
+
*/
|
|
42
|
+
declare class IndexedDBStorage implements GenericStorage {
|
|
43
|
+
#private;
|
|
44
|
+
constructor(dbName?: string, dbVersion?: number, storeName?: string);
|
|
45
|
+
/**
|
|
46
|
+
* Retrieve a value by key.
|
|
47
|
+
* @returns The stored value, or `null` if the key does not exist.
|
|
48
|
+
*/
|
|
49
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
50
|
+
/** Store a value under the given key, overwriting any existing entry. */
|
|
51
|
+
set<T = unknown>(key: string, value: T): Promise<void>;
|
|
52
|
+
/** Remove the entry for the given key (no-op if absent). */
|
|
53
|
+
delete(key: string): Promise<void>;
|
|
54
|
+
/** Remove all stored entries. */
|
|
55
|
+
clear(): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
/** Default singleton for application-wide use. */
|
|
58
|
+
declare const indexedDBStorage: IndexedDBStorage;
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/storage/chrome-session-storage.d.ts
|
|
61
|
+
/**
|
|
62
|
+
* {@link GenericStorage} backed by `chrome.storage.session`.
|
|
63
|
+
*
|
|
64
|
+
* Use this in MV3 web extensions so the wallet signature survives
|
|
65
|
+
* service worker restarts and is shared across popup, background,
|
|
66
|
+
* and content script contexts.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* import { ZamaSDK, indexedDBStorage, chromeSessionStorage } from "@zama-fhe/sdk";
|
|
71
|
+
* import { createConfig } from "@zama-fhe/sdk/viem";
|
|
72
|
+
*
|
|
73
|
+
* const config = createConfig({
|
|
74
|
+
* chains: [mySepolia],
|
|
75
|
+
* publicClient,
|
|
76
|
+
* walletClient,
|
|
77
|
+
* relayers: { [mySepolia.id]: web() },
|
|
78
|
+
* storage: indexedDBStorage, // encrypted transport key pair — persistent
|
|
79
|
+
* permitStorage: chromeSessionStorage, // signed permits — ephemeral
|
|
80
|
+
* });
|
|
81
|
+
* const sdk = new ZamaSDK(config);
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
declare class ChromeSessionStorage implements GenericStorage {
|
|
85
|
+
/**
|
|
86
|
+
* Retrieve a value by key.
|
|
87
|
+
* @returns The stored value, or `null` if the key does not exist.
|
|
88
|
+
*/
|
|
89
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
90
|
+
/** Store a value under the given key, overwriting any existing entry. */
|
|
91
|
+
set(key: string, value: unknown): Promise<void>;
|
|
92
|
+
/** Remove the entry for the given key (no-op if absent). */
|
|
93
|
+
delete(key: string): Promise<void>;
|
|
94
|
+
}
|
|
95
|
+
/** Default singleton for application-wide use. */
|
|
96
|
+
declare const chromeSessionStorage: ChromeSessionStorage;
|
|
97
|
+
//#endregion
|
|
98
|
+
export { ACL_TOPICS, type AclEvent, AclPausedError, AclTopics, type Address, type ApprovalStrategy, type ApproveUnderlyingSubmittedEvent, type AtLeastOneChain, BalanceCheckUnavailableError, type BalanceErrorDetails, type BaseEvent, BaseSigner, type BatchBalancesResult, type BatchDecryptAsOptions, type BatchDecryptItem, type BatchDecryptResult, ChainMismatchError, type ChecksummedAddress, ChromeSessionStorage, type ClearValue, type CleartextRelayerConfig, type ConfidentialTransferEvent, ConfigurationError, type ContractAbi, type DecryptEndEvent, type DecryptErrorEvent, type EncryptedInput as DecryptInput, type DecryptPublicValuesResult, type DecryptResult, type DecryptStartEvent, type DecryptValuesParameters, Decryption, DecryptionFailedError, DefaultRegistryAddresses, type DelegatedDecryptOptions, type DelegatedForUserDecryptionEvent, DelegationContractIsSelfError, DelegationCooldownError, DelegationDelegateEqualsContractError, DelegationExpirationTooSoonError, DelegationExpiredError, DelegationExpiryUnchangedError, DelegationNotFoundError, DelegationNotPropagatedError, DelegationSelfNotAllowedError, type DelegationStatus, type DelegationSubmittedEvent, Delegations, type EIP712TypedData, ERC1363_INTERFACE_ID, ERC20ReadFailedError, ERC7984_INTERFACE_ID, ERC7984_WRAPPER_INTERFACE_ID, type EncryptEndEvent, type EncryptErrorEvent, type EncryptInput, type EncryptParams, type EncryptResult, type EncryptStartEvent, type EncryptedValue, EncryptionFailedError, type ErrorForCode, type FheChain, type FheChainAuth, type FhevmClient, type FhevmClientOptions, type FhevmRelayerOptions, type FhevmRuntimeConfig, type FinalizeUnwrapSubmittedEvent, type GenericLogger, type GenericProvider, type GenericSigner, type GenericStorage, type Hex, IndexedDBStorage, InsufficientAllowanceError, InsufficientConfidentialBalanceError, InsufficientERC20BalanceError, InvalidTransportKeyPairError, type ListPairsOptions, MemoryStorage, MutableWalletAccountStore, NoCiphertextError, NotEntitledError, type OnChainEvent, type PaginatedResult, type Permission, Permits, type RawLog, type ReadContractArgs, type ReadContractConfig, type ReadContractReturnType, type ReadFunctionName, type RelayerConfig, type RelayerOptions, RelayerRequestFailedError, type RelayerSDK, type RevokeDelegationSubmittedEvent, type RevokedDelegationForUserDecryptionEvent, RpcRateLimitError, type SerializedPermit, type SerializedPermitEip712, type SerializedTransportKeyPair, type SetOperatorSubmittedEvent, type ShieldCallbacks, type ShieldOptions, type ShieldPath, type ShieldSubmittedEvent, SignerNotConfiguredError, SignerRequiredError, SigningFailedError, SigningRejectedError, TOKEN_TOPICS, Token, type TokenWrapperPair, type TokenWrapperPairWithMetadata, Topics, type TransactionErrorEvent, type TransactionOperation, type TransactionReceipt, type TransactionResult, TransactionRevertedError, type TransferCallbacks, type TransferFromSubmittedEvent, type TransferOptions, type TransferSubmittedEvent, TransportKeyPairExpiredError, type TypedValue, type UnshieldCallbacks, type UnshieldOptions, type UnshieldPhase1SubmittedEvent, type UnshieldPhase2StartedEvent, type UnshieldPhase2SubmittedEvent, type UnwrapFinalizedEvent, type UnwrapRequestedEvent, type UnwrapResult, type UnwrapSubmittedEvent, type WalletAccount, type WalletAccountChange, type WalletAccountListener, WalletAccountNotReadyError, type WalletAccountStore, WalletNotConnectedError, type WrapEvent, type WrapOptions, type WrapSubmittedEvent, WrappedToken, WrappersRegistry, type WrappersRegistryConfig, type WriteContractArgs, type WriteContractConfig, type WriteFunctionName, ZERO_ENCRYPTED_VALUE, type ZamaConfig, type ZamaConfigBase, type ZamaConfigEthers, type ZamaConfigGeneric, type ZamaConfigViem, ZamaError, ZamaErrorCode, ZamaSDK, type ZamaSDKEvent, type ZamaSDKEventListener, type ZamaSDKEventType, ZamaSDKEvents, allowanceContract, anvil, approveContract, balanceOfContract, bscTestnet, chains, chromeSessionStorage, cleartext, confidentialBalanceOfContract, confidentialTotalSupplyContract, confidentialTransferContract, confidentialTransferFromContract, createConfig, createWalletAccountStore, decimalsContract, decodeAclEvent, decodeAclEvents, decodeConfidentialTransfer, decodeDelegatedForUserDecryption, decodeOnChainEvent, decodeOnChainEvents, decodeRevokedDelegationForUserDecryption, decodeUnwrapFinalized, decodeUnwrapRequested, decodeWrap, delegateForUserDecryptionContract, finalizeUnwrapContract, findDelegatedForUserDecryption, findRevokedDelegationForUserDecryption, findUnwrapRequested, findWrap, getConfidentialTokenAddressContract, getDelegationExpiryContract, getTokenAddressContract, getTokenPairContract, getTokenPairsContract, getTokenPairsLengthContract, getTokenPairsSliceContract, hardhat, hoodi, indexedDBStorage, inferredTotalSupplyContract, ingenTestnet, isConfidentialTokenContract, isConfidentialTokenValidContract, isConfidentialWrapperContract, isEncryptedValueZero, isHandleDelegatedContract, isOperatorContract, isRetryable, mainnet, matchZamaError, memoryStorage, nameContract, polygonAmoy, rateContract, retryAfterSeconds, revokeDelegationContract, sepolia, setOperatorContract, supportsInterfaceContract, symbolContract, transferAndCallContract, underlyingContract, unwrapContract, unwrapFromBalanceContract, wrapContract };
|
|
99
|
+
//# sourceMappingURL=index.d.ts.map
|