@zama-fhe/sdk 3.8.0-beta.2 → 3.8.0-beta.21
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/cjs/alignment.cjs +2 -0
- package/dist/cjs/alignment.cjs.map +1 -0
- package/dist/cjs/base-signer.cjs +1 -1
- package/dist/cjs/base-signer.cjs.map +1 -1
- package/dist/cjs/chains.cjs +1 -1
- package/dist/cjs/chains.cjs.map +1 -1
- package/dist/cjs/cleartext.cjs +1 -1
- package/dist/cjs/cleartext.cjs.map +1 -1
- package/dist/cjs/eip1193-subscribe.cjs +1 -1
- package/dist/cjs/eip1193-subscribe.cjs.map +1 -1
- package/dist/cjs/encryption.cjs.map +1 -1
- package/dist/cjs/ethers/index.cjs +1 -1
- package/dist/cjs/ethers/index.cjs.map +1 -1
- package/dist/cjs/fatal-batch.cjs.map +1 -1
- package/dist/cjs/fhevm-relayer.cjs +2 -2
- package/dist/cjs/fhevm-relayer.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/internal/index.cjs +1 -1
- package/dist/cjs/internal/index.cjs.map +1 -1
- package/dist/cjs/log-decoding.cjs +2 -0
- package/dist/cjs/log-decoding.cjs.map +1 -0
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/query/index.cjs +1 -1
- package/dist/cjs/query/index.cjs.map +1 -1
- package/dist/cjs/query-keys.cjs +2 -0
- package/dist/cjs/query-keys.cjs.map +1 -0
- package/dist/cjs/relayer.cjs +1 -1
- package/dist/cjs/relayer.cjs.map +1 -1
- package/dist/cjs/signing.cjs +1 -1
- package/dist/cjs/signing.cjs.map +1 -1
- package/dist/cjs/telemetry.cjs +1 -1
- package/dist/cjs/telemetry.cjs.map +1 -1
- package/dist/cjs/token.cjs +1 -1
- package/dist/cjs/token.cjs.map +1 -1
- package/dist/cjs/typed-data.cjs +2 -0
- package/dist/cjs/typed-data.cjs.map +1 -0
- package/dist/cjs/validation.cjs.map +1 -1
- package/dist/cjs/vaults/index.cjs +1 -1
- package/dist/cjs/vaults/index.cjs.map +1 -1
- package/dist/cjs/viem/index.cjs +1 -1
- package/dist/cjs/viem/index.cjs.map +1 -1
- package/dist/cjs/web/index.cjs +1 -1
- package/dist/cjs/web/index.cjs.map +1 -1
- package/dist/cjs/wrappers-registry.cjs.map +1 -1
- package/dist/esm/alignment-o-YIndFR.js +2 -0
- package/dist/esm/alignment-o-YIndFR.js.map +1 -0
- package/dist/esm/{base-signer-BxIDBDTF.d.ts → base-signer-nenGJU9U.d.ts} +2 -7
- package/dist/esm/base-signer-p5iz9eeb.js +2 -0
- package/dist/esm/base-signer-p5iz9eeb.js.map +1 -0
- package/dist/esm/chains/index.d.ts +11 -1
- package/dist/esm/chains/index.js +1 -1
- package/dist/esm/chains-BQXSxIwU.js +2 -0
- package/dist/esm/chains-BQXSxIwU.js.map +1 -0
- package/dist/esm/cleartext/index.d.ts +9 -2
- package/dist/esm/cleartext/index.js +1 -1
- package/dist/esm/{cleartext-BnTAN4-g.d.ts → cleartext-BLMLdKFh.d.ts} +2 -5
- package/dist/esm/{cleartext-CvCakQal.js → cleartext-C1Y5zc1Y.js} +2 -2
- package/dist/esm/cleartext-C1Y5zc1Y.js.map +1 -0
- package/dist/esm/{decryption-B0mY2M8N.d.ts → decryption-Cp8calaa.d.ts} +3777 -126
- package/dist/esm/{eip1193-subscribe-CNxVHW6y.js → eip1193-subscribe-DxAQh8dY.js} +2 -2
- package/dist/esm/eip1193-subscribe-DxAQh8dY.js.map +1 -0
- package/dist/esm/{encrypt-worker-client-BW88njEe.d.ts → encrypt-worker-client-CkEIA0Tp.d.ts} +3 -6
- package/dist/esm/encrypt.worker.js +27 -33
- package/dist/esm/{encryption-6AVd-82z.js → encryption-BT886Jlj.js} +2 -2
- package/dist/esm/{encryption-6AVd-82z.js.map → encryption-BT886Jlj.js.map} +1 -1
- package/dist/esm/ethers/index.d.ts +39 -34
- package/dist/esm/ethers/index.js +1 -1
- package/dist/esm/ethers/index.js.map +1 -1
- package/dist/esm/{fatal-batch-BiiS7KdS.js → fatal-batch-BYeHrf0V.js} +2 -2
- package/dist/esm/fatal-batch-BYeHrf0V.js.map +1 -0
- package/dist/esm/fhevm-relayer-BEzN0aev.js +8 -0
- package/dist/esm/fhevm-relayer-BEzN0aev.js.map +1 -0
- package/dist/esm/{index-DXCcwJ77.d.ts → index-CI6f4jxt.d.ts} +7 -10
- package/dist/esm/{index-fsWBYM8S.d.ts → index-ClNBSbRy.d.ts} +7 -11
- package/dist/esm/{index-D1Wtji3m.d.ts → index-ZTcD9b_z.d.ts} +31 -29
- package/dist/esm/index.d.ts +26 -31
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/index.d.ts +14 -15
- package/dist/esm/internal/index.js +1 -1
- package/dist/esm/internal/index.js.map +1 -1
- package/dist/esm/{invalidation-CJ-pzOUG.d.ts → invalidation-IBiMIXGB.d.ts} +1 -4
- package/dist/esm/log-decoding-ZthqwHOv.js +2 -0
- package/dist/esm/log-decoding-ZthqwHOv.js.map +1 -0
- package/dist/esm/node/index.d.ts +12 -4
- package/dist/esm/node/index.js +1 -1
- package/dist/esm/node/index.js.map +1 -1
- package/dist/esm/query/index.d.ts +68 -141
- package/dist/esm/query/index.js +1 -1
- package/dist/esm/query/index.js.map +1 -1
- package/dist/esm/query-keys-CSPxPLBB.js +2 -0
- package/dist/esm/query-keys-CSPxPLBB.js.map +1 -0
- package/dist/esm/relayer-nWfQAlo7.js +2 -0
- package/dist/esm/relayer-nWfQAlo7.js.map +1 -0
- package/dist/esm/{signing-C6nbPCyd.js → signing-CVEOw21I.js} +2 -2
- package/dist/esm/signing-CVEOw21I.js.map +1 -0
- package/dist/esm/telemetry-YFH36F_7.js +2 -0
- package/dist/esm/telemetry-YFH36F_7.js.map +1 -0
- package/dist/esm/token-AXsOIUDB.js +2 -0
- package/dist/esm/token-AXsOIUDB.js.map +1 -0
- package/dist/esm/typed-data-eAgGr9V-.js +2 -0
- package/dist/esm/typed-data-eAgGr9V-.js.map +1 -0
- package/dist/esm/{types-Dc1fpXWt.d.ts → types-D253qkvB.d.ts} +3 -6
- package/dist/esm/{types-C2ccCjoA.d.ts → types-DH06Ap0n.d.ts} +3 -6
- package/dist/esm/{types-CHepK8MK.d.ts → types-Ubeo72FV.d.ts} +57 -41
- package/dist/esm/{validation-ClSvPh6P.js → validation-CZfDLOUh.js} +2 -2
- package/dist/esm/{validation-ClSvPh6P.js.map → validation-CZfDLOUh.js.map} +1 -1
- package/dist/esm/vaults/index.d.ts +247 -13771
- package/dist/esm/vaults/index.js +1 -1
- package/dist/esm/vaults/index.js.map +1 -1
- package/dist/esm/viem/index.d.ts +39 -34
- package/dist/esm/viem/index.js +1 -1
- package/dist/esm/viem/index.js.map +1 -1
- package/dist/esm/web/index.d.ts +13 -7
- package/dist/esm/web/index.js +1 -1
- package/dist/esm/web/index.js.map +1 -1
- package/dist/esm/wrappers-registry-Cm3JJeqx.js.map +1 -1
- package/package.json +2 -2
- package/dist/cjs/applied-runtime.cjs +0 -2
- package/dist/cjs/applied-runtime.cjs.map +0 -1
- package/dist/cjs/erc165.cjs +0 -2
- package/dist/cjs/erc165.cjs.map +0 -1
- package/dist/cjs/invalidation.cjs +0 -2
- package/dist/cjs/invalidation.cjs.map +0 -1
- package/dist/cjs/primitives.cjs +0 -2
- package/dist/cjs/primitives.cjs.map +0 -1
- package/dist/cjs/wrapped-token.cjs +0 -2
- package/dist/cjs/wrapped-token.cjs.map +0 -1
- package/dist/esm/applied-runtime-3fzqBC2V.js +0 -2
- package/dist/esm/applied-runtime-3fzqBC2V.js.map +0 -1
- package/dist/esm/base-signer-BoBsvn5Q.js +0 -2
- package/dist/esm/base-signer-BoBsvn5Q.js.map +0 -1
- package/dist/esm/chains-BwlDI944.js +0 -2
- package/dist/esm/chains-BwlDI944.js.map +0 -1
- package/dist/esm/cleartext-CvCakQal.js.map +0 -1
- package/dist/esm/eip1193-subscribe-CNxVHW6y.js.map +0 -1
- package/dist/esm/erc165-B8gx2luK.js +0 -2
- package/dist/esm/erc165-B8gx2luK.js.map +0 -1
- package/dist/esm/fatal-batch-BiiS7KdS.js.map +0 -1
- package/dist/esm/fhevm-relayer-CGvejcdJ.js +0 -8
- package/dist/esm/fhevm-relayer-CGvejcdJ.js.map +0 -1
- package/dist/esm/index-DkN4q5Cm.d.ts +0 -1
- package/dist/esm/invalidation-BgFjmXeQ.js +0 -2
- package/dist/esm/invalidation-BgFjmXeQ.js.map +0 -1
- package/dist/esm/primitives-Cym-3HKa.js +0 -2
- package/dist/esm/primitives-Cym-3HKa.js.map +0 -1
- package/dist/esm/relayer-C3jVhqSK.js +0 -2
- package/dist/esm/relayer-C3jVhqSK.js.map +0 -1
- package/dist/esm/signing-C6nbPCyd.js.map +0 -1
- package/dist/esm/telemetry-BDnhC-vh.js +0 -2
- package/dist/esm/telemetry-BDnhC-vh.js.map +0 -1
- package/dist/esm/token-g6sinwTx.js +0 -2
- package/dist/esm/token-g6sinwTx.js.map +0 -1
- package/dist/esm/wrapped-token-3usJd0oi.js +0 -2
- package/dist/esm/wrapped-token-3usJd0oi.js.map +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { d as AtLeastOneChain, f as FheChain } from "./index-
|
|
1
|
+
import { d as AtLeastOneChain, f as FheChain } from "./index-ZTcD9b_z.js";
|
|
2
2
|
import { Abi, Address, ContractFunctionArgs, ContractFunctionName, ContractFunctionReturnType, Hex } from "viem";
|
|
3
3
|
import { CreateUnsignedLegacyDecryptionPermitEip712Parameters, CreateUnsignedLegacyDecryptionPermitEip712ReturnType } from "@fhevm/sdk/actions/base";
|
|
4
4
|
import { createFhevmClient, setFhevmRuntimeConfig } from "@fhevm/sdk/viem";
|
|
5
5
|
import { Eip712Like, TypedValue, TypedValue as TypedValue$1 } from "@fhevm/sdk/types";
|
|
6
6
|
import { DecryptValuesParameters } from "@fhevm/sdk/actions/decrypt";
|
|
7
|
-
//#region src/relayer/types.d.ts
|
|
8
7
|
/** Canonical SDK type for an encrypted value — a `bytes32` ciphertext reference. */
|
|
9
8
|
type EncryptedValue = Hex;
|
|
10
9
|
/** Canonical SDK type for a decrypted clear-text value. */
|
|
@@ -112,6 +111,8 @@ interface FhevmRelayerOptions {
|
|
|
112
111
|
readonly auth?: FhevmRuntimeConfig["auth"];
|
|
113
112
|
/** Extra HTTP headers attached to each relayer request. */
|
|
114
113
|
readonly headers?: Record<string, string>;
|
|
114
|
+
/** Extra query parameters appended to each relayer request URL. */
|
|
115
|
+
readonly query?: Record<string, string>;
|
|
115
116
|
/**
|
|
116
117
|
* When `true`, `@fhevm/sdk`'s relayer emits verbose per-request trace logs to
|
|
117
118
|
* `console.log` (`[RelayerAsyncRequest]:…`), following each round-trip through
|
|
@@ -199,8 +200,6 @@ interface RelayerSDK extends Pick<FhevmClient, "encryptValue" | "encryptValues"
|
|
|
199
200
|
*/
|
|
200
201
|
dispose?(): void;
|
|
201
202
|
}
|
|
202
|
-
//#endregion
|
|
203
|
-
//#region src/types/transaction.d.ts
|
|
204
203
|
/** Framework-agnostic log shape compatible with any Ethereum provider. */
|
|
205
204
|
interface RawLog {
|
|
206
205
|
/** Address of the contract that emitted the log. Optional for adapter compatibility. */
|
|
@@ -214,6 +213,8 @@ interface RawLog {
|
|
|
214
213
|
interface TransactionReceipt {
|
|
215
214
|
/** Event logs emitted during the transaction. */
|
|
216
215
|
readonly logs: readonly RawLog[];
|
|
216
|
+
/** A provider that cannot report this omits it, and the SDK then assumes the transaction succeeded. */
|
|
217
|
+
readonly status?: "success" | "reverted";
|
|
217
218
|
}
|
|
218
219
|
/** Result of a write operation: the tx hash and its mined receipt. */
|
|
219
220
|
interface TransactionResult {
|
|
@@ -222,8 +223,6 @@ interface TransactionResult {
|
|
|
222
223
|
/** The mined transaction receipt. */
|
|
223
224
|
receipt: TransactionReceipt;
|
|
224
225
|
}
|
|
225
|
-
//#endregion
|
|
226
|
-
//#region src/events/onchain-events.d.ts
|
|
227
226
|
/**
|
|
228
227
|
* Event topic0 constants (keccak256 of the canonical Solidity signature).
|
|
229
228
|
* Pass to `getLogs({ topics: [Object.values(Topics)] })` to fetch all events.
|
|
@@ -436,8 +435,6 @@ declare function findRevokedDelegationForUserDecryption(logs: readonly RawLog[])
|
|
|
436
435
|
* all delegation events in a single RPC call.
|
|
437
436
|
*/
|
|
438
437
|
declare const ACL_TOPICS: readonly [`0x${string}`, `0x${string}`];
|
|
439
|
-
//#endregion
|
|
440
|
-
//#region src/types/callbacks.d.ts
|
|
441
438
|
/** Progress callbacks for multi-step unshield operations. */
|
|
442
439
|
interface UnshieldCallbacks {
|
|
443
440
|
/** Fired after the unwrap transaction is submitted. */
|
|
@@ -461,8 +458,6 @@ interface TransferCallbacks {
|
|
|
461
458
|
/** Fired after the transfer transaction is submitted. */
|
|
462
459
|
onTransferSubmitted?: (txHash: Hex) => void;
|
|
463
460
|
}
|
|
464
|
-
//#endregion
|
|
465
|
-
//#region src/types/token.d.ts
|
|
466
461
|
/** Options for {@link ConfidentialToken.confidentialTransfer}. */
|
|
467
462
|
interface TransferOptions extends TransferCallbacks {
|
|
468
463
|
/** Skip confidential balance validation (e.g. for smart wallets). Default: `false`. */
|
|
@@ -519,8 +514,6 @@ interface UnwrapResult extends TransactionResult {
|
|
|
519
514
|
/** The `unwrapRequestId` to hand to `finalizeUnwrap`. */
|
|
520
515
|
unwrapRequestId: EncryptedValue;
|
|
521
516
|
}
|
|
522
|
-
//#endregion
|
|
523
|
-
//#region src/events/sdk-events.d.ts
|
|
524
517
|
/**
|
|
525
518
|
* All SDK event keys, accessible as `ZamaSDKEvents.EncryptStart` etc.
|
|
526
519
|
*/
|
|
@@ -672,15 +665,18 @@ interface SetOperatorSubmittedEvent extends BaseEvent {
|
|
|
672
665
|
/** Hash of the submitted setOperator transaction. */
|
|
673
666
|
txHash: Hex;
|
|
674
667
|
}
|
|
675
|
-
/**
|
|
676
|
-
|
|
677
|
-
|
|
668
|
+
/**
|
|
669
|
+
* Which vault write a {@link VaultSubmittedEvent} describes: a batcher write,
|
|
670
|
+
* or `routerJoin` for a fan-out submitted through the vault router.
|
|
671
|
+
*/
|
|
672
|
+
type VaultOperation = "join" | "quit" | "claim" | "recover" | "dispatchBatch" | "finalize" | "routerJoin";
|
|
673
|
+
/** Emitted when a vault batcher or router transaction has been submitted to the network. */
|
|
678
674
|
interface VaultSubmittedEvent extends BaseEvent {
|
|
679
675
|
/** Event type discriminant. */
|
|
680
676
|
type: typeof ZamaSDKEvents.VaultSubmitted;
|
|
681
|
-
/** Hash of the submitted
|
|
677
|
+
/** Hash of the submitted transaction. */
|
|
682
678
|
txHash: Hex;
|
|
683
|
-
/** The
|
|
679
|
+
/** The vault write this transaction performs. */
|
|
684
680
|
vaultOperation: VaultOperation;
|
|
685
681
|
}
|
|
686
682
|
/** Emitted when an underlying-ERC-20 approval transaction has been submitted to the network. */
|
|
@@ -768,9 +764,7 @@ type ZamaSDKEventListener = (event: ZamaSDKEvent) => void;
|
|
|
768
764
|
* one (`shield:transferAndCall` vs. `shield:approveAndWrap`), routing both error
|
|
769
765
|
* and success events on a single field — see {@link transactionOperationMetadata}.
|
|
770
766
|
*/
|
|
771
|
-
type TransactionOperation = "approveUnderlying" | "approveUnderlying:reset" | "delegateDecryption" | "finalizeUnwrap" | "revokeDelegation" | "setOperator" | "shield:transferAndCall" | "shield:approveAndWrap" | "wrap" | "transfer" | "transferAndCall" | "transferFrom" | "transferFromAndCall" | "unwrap" | "unwrapAll" | "vault:join" | "vault:quit" | "vault:claim" | "vault:recover" | "vault:dispatchBatch";
|
|
772
|
-
//#endregion
|
|
773
|
-
//#region src/types/contract.d.ts
|
|
767
|
+
type TransactionOperation = "approveUnderlying" | "approveUnderlying:reset" | "delegateDecryption" | "finalizeUnwrap" | "revokeDelegation" | "setOperator" | "shield:transferAndCall" | "shield:approveAndWrap" | "wrap" | "transfer" | "transferAndCall" | "transferFrom" | "transferFromAndCall" | "unwrap" | "unwrapAll" | "vault:join" | "vault:quit" | "vault:claim" | "vault:recover" | "vault:dispatchBatch" | "vault:finalize" | "vault:routerJoin";
|
|
774
768
|
/** ABI type accepted by contract call builders. Supports both typed and untyped ABIs. */
|
|
775
769
|
type ContractAbi = Abi | readonly unknown[];
|
|
776
770
|
/** Extract read-only function names (`pure` | `view`) from a contract ABI. */
|
|
@@ -796,7 +790,14 @@ interface ReadContractConfig<TAbi extends ContractAbi = ContractAbi, TFunctionNa
|
|
|
796
790
|
readonly functionName: TFunctionName;
|
|
797
791
|
/** Contract call arguments inferred from the ABI and function name. */
|
|
798
792
|
readonly args: TArgs;
|
|
793
|
+
/**
|
|
794
|
+
* Chain to read from. Omitted, the provider's current chain. A provider
|
|
795
|
+
* bound to one chain throws `ConfigurationError` for another.
|
|
796
|
+
*/
|
|
797
|
+
readonly chainId?: number;
|
|
799
798
|
}
|
|
799
|
+
/** The decoded results of a multicall, one per call, in call order. */
|
|
800
|
+
type MulticallReturnType<TCalls extends readonly ReadContractConfig[]> = { -readonly [K in keyof TCalls]: TCalls[K] extends ReadContractConfig<infer TAbi, infer TFunctionName, infer TArgs> ? ReadContractReturnType<TAbi, TFunctionName, TArgs> : never; };
|
|
800
801
|
/**
|
|
801
802
|
* Typed write-contract configuration.
|
|
802
803
|
* Matches the shape returned by write contract builders in `src/contracts/`.
|
|
@@ -815,8 +816,6 @@ interface WriteContractConfig<TAbi extends ContractAbi = ContractAbi, TFunctionN
|
|
|
815
816
|
/** Gas limit override. */
|
|
816
817
|
readonly gas?: bigint;
|
|
817
818
|
}
|
|
818
|
-
//#endregion
|
|
819
|
-
//#region src/types/signer.d.ts
|
|
820
819
|
/** Snapshot of the connected wallet account at a point in time. */
|
|
821
820
|
interface WalletAccount {
|
|
822
821
|
/** Address of the connected wallet account. */
|
|
@@ -837,8 +836,10 @@ type WalletAccountListener = (change: WalletAccountChange) => void;
|
|
|
837
836
|
* Synchronous observable store for wallet account readiness.
|
|
838
837
|
*
|
|
839
838
|
* Direct subscriptions observe raw signer adapter transitions. For SDK-
|
|
840
|
-
* coordinated
|
|
841
|
-
* {@link ZamaSDK.onWalletAccountChange} so
|
|
839
|
+
* coordinated handling and React query invalidation, subscribe through
|
|
840
|
+
* {@link ZamaSDK.onWalletAccountChange} so the relayer chain switch and the
|
|
841
|
+
* credential cleanup (unless `clearCredentialsOnWalletChange` is `false`) run
|
|
842
|
+
* first.
|
|
842
843
|
*/
|
|
843
844
|
interface WalletAccountStore {
|
|
844
845
|
/** Synchronous, non-prompting snapshot of the currently connected wallet account. */
|
|
@@ -887,8 +888,6 @@ interface GenericSigner {
|
|
|
887
888
|
/** Release adapter-owned wallet watchers or provider event listeners. */
|
|
888
889
|
dispose?(): void;
|
|
889
890
|
}
|
|
890
|
-
//#endregion
|
|
891
|
-
//#region src/types/offline-signing.d.ts
|
|
892
891
|
/**
|
|
893
892
|
* Confidential ERC-7984 transfer request. Atomic shape ≡ the existing
|
|
894
893
|
* {@link Token.confidentialTransfer} `(to, amount)` arguments; the SDK builds an
|
|
@@ -1163,8 +1162,6 @@ interface PreparedFor<K extends TransactionKind> extends PreparedTransaction {
|
|
|
1163
1162
|
/** The request kind, pinned to `K`. */
|
|
1164
1163
|
readonly kind: K;
|
|
1165
1164
|
}
|
|
1166
|
-
//#endregion
|
|
1167
|
-
//#region src/types/provider.d.ts
|
|
1168
1165
|
/**
|
|
1169
1166
|
* Framework-agnostic read-only provider interface.
|
|
1170
1167
|
*
|
|
@@ -1183,10 +1180,23 @@ interface GenericProvider {
|
|
|
1183
1180
|
getChainId(): Promise<number>;
|
|
1184
1181
|
/** Execute a read-only call and return the decoded result. */
|
|
1185
1182
|
readContract<const TAbi extends ContractAbi, TFunctionName extends ReadFunctionName<TAbi>, const TArgs extends ReadContractArgs<TAbi, TFunctionName>>(config: ReadContractConfig<TAbi, TFunctionName, TArgs>): Promise<ReadContractReturnType<TAbi, TFunctionName, TArgs>>;
|
|
1183
|
+
/**
|
|
1184
|
+
* Run many reads in one Multicall3 call, on `chainId` when given, and return
|
|
1185
|
+
* the results in call order. One reverted read rejects the whole call. Each
|
|
1186
|
+
* call's own `chainId` is ignored. Optional: without it, the SDK reads one
|
|
1187
|
+
* call at a time.
|
|
1188
|
+
*/
|
|
1189
|
+
multicall?<const TCalls extends readonly ReadContractConfig[]>(params: {
|
|
1190
|
+
readonly calls: TCalls;
|
|
1191
|
+
readonly chainId?: number;
|
|
1192
|
+
}): Promise<MulticallReturnType<TCalls>>;
|
|
1186
1193
|
/** Wait for a transaction to be mined and return its receipt. */
|
|
1187
1194
|
waitForTransactionReceipt(hash: Hex): Promise<TransactionReceipt>;
|
|
1188
|
-
/**
|
|
1189
|
-
|
|
1195
|
+
/**
|
|
1196
|
+
* Return the latest block timestamp in seconds, on `chainId` when given
|
|
1197
|
+
* (see {@link ReadContractConfig.chainId}).
|
|
1198
|
+
*/
|
|
1199
|
+
getBlockTimestamp(chainId?: number): Promise<bigint>;
|
|
1190
1200
|
/**
|
|
1191
1201
|
* Build a fully-populated, RLP-encoded unsigned transaction from a
|
|
1192
1202
|
* write-contract config and the originating wallet address. The provider
|
|
@@ -1227,8 +1237,6 @@ interface GenericProvider {
|
|
|
1227
1237
|
};
|
|
1228
1238
|
}): Promise<Hex>;
|
|
1229
1239
|
}
|
|
1230
|
-
//#endregion
|
|
1231
|
-
//#region src/types/storage.d.ts
|
|
1232
1240
|
/**
|
|
1233
1241
|
* Pluggable key-value store for persisting FHE credentials.
|
|
1234
1242
|
*
|
|
@@ -1247,8 +1255,6 @@ interface GenericStorage {
|
|
|
1247
1255
|
/** Remove the entry for the given key (no-op if absent). */
|
|
1248
1256
|
delete(key: string): Promise<void>;
|
|
1249
1257
|
}
|
|
1250
|
-
//#endregion
|
|
1251
|
-
//#region src/types/logger.d.ts
|
|
1252
1258
|
/**
|
|
1253
1259
|
* Optional logger for SDK observability.
|
|
1254
1260
|
* Pass via config to observe operation lifecycle (start, success, error, timeout).
|
|
@@ -1263,8 +1269,6 @@ interface GenericLogger {
|
|
|
1263
1269
|
/** Log at error level. */
|
|
1264
1270
|
error: (message: string, data?: Record<string, unknown>) => void;
|
|
1265
1271
|
}
|
|
1266
|
-
//#endregion
|
|
1267
|
-
//#region src/config/types.d.ts
|
|
1268
1272
|
/**
|
|
1269
1273
|
* Base relayer config. `createRelayer` builds one single-chain relayer; the
|
|
1270
1274
|
* dispatcher calls it once per chain.
|
|
@@ -1297,6 +1301,13 @@ interface ZamaConfigBase<TChains extends AtLeastOneChain = AtLeastOneChain> {
|
|
|
1297
1301
|
transportKeyPairTTL?: number;
|
|
1298
1302
|
/** Permit lifetime in days. Default: 30. Clamped to `transportKeyPairTTL / 86400`. */
|
|
1299
1303
|
permitTTL?: number;
|
|
1304
|
+
/**
|
|
1305
|
+
* Wipe the previous account's transport key pair, permits, and decrypt cache
|
|
1306
|
+
* whenever the connected account changes or disconnects. Default: `true`.
|
|
1307
|
+
* Set to `false` to keep them until permits expire or `sdk.permits.clear()`
|
|
1308
|
+
* runs, so a user switching A → B → A does not sign a new permit each time.
|
|
1309
|
+
*/
|
|
1310
|
+
clearCredentialsOnWalletChange?: boolean;
|
|
1300
1311
|
/**
|
|
1301
1312
|
* Opt-in shared-tenant scope (B2B2C/WaaS operators) — an opaque identifier such
|
|
1302
1313
|
* as a tenant ID. Every signer configured with the same scope shares one
|
|
@@ -1310,8 +1321,14 @@ interface ZamaConfigBase<TChains extends AtLeastOneChain = AtLeastOneChain> {
|
|
|
1310
1321
|
registryTTL?: number;
|
|
1311
1322
|
/** SDK lifecycle event listener. */
|
|
1312
1323
|
onEvent?: ZamaSDKEventListener;
|
|
1313
|
-
/**
|
|
1314
|
-
|
|
1324
|
+
/**
|
|
1325
|
+
* How the SDK usage labels (SDK version, layer, runtime, operation) travel on
|
|
1326
|
+
* relayer requests: `"header"` sends `x-zama-sdk-*` headers (default),
|
|
1327
|
+
* `"query"` sends `zama_sdk_*` query parameters instead, for proxies that
|
|
1328
|
+
* rebuild the request headers, and `"off"` sends nothing. `true` and `false`
|
|
1329
|
+
* are accepted as `"header"` and `"off"`.
|
|
1330
|
+
*/
|
|
1331
|
+
telemetry?: "header" | "query" | "off" | boolean;
|
|
1315
1332
|
/**
|
|
1316
1333
|
* Global `@fhevm/sdk` runtime config — WASM load mode, threads, logger, auth,
|
|
1317
1334
|
* module versions. `runtime.auth` is the process-wide fallback; each chain's
|
|
@@ -1351,6 +1368,7 @@ type ZamaConfig = {
|
|
|
1351
1368
|
readonly permitStorage: GenericStorage;
|
|
1352
1369
|
readonly transportKeyPairTTL: number;
|
|
1353
1370
|
readonly permitTTL: number;
|
|
1371
|
+
readonly clearCredentialsOnWalletChange: boolean;
|
|
1354
1372
|
readonly transportKeyPairScope: string | undefined;
|
|
1355
1373
|
readonly registryTTL: number;
|
|
1356
1374
|
readonly onEvent: ZamaSDKEventListener | undefined;
|
|
@@ -1362,6 +1380,4 @@ type ZamaConfig = {
|
|
|
1362
1380
|
} & {
|
|
1363
1381
|
readonly [zamaConfigBrand]: true;
|
|
1364
1382
|
};
|
|
1365
|
-
|
|
1366
|
-
export { SetOperatorSubmittedEvent as $, TransactionReceipt as $t, WalletAccountListener as A, DelegatedForUserDecryptionEvent as At, ApproveUnderlyingSubmittedEvent as B, decodeConfidentialTransfer as Bt, TransferAndCallRequest as C, ShieldCallbacks as Ct, GenericSigner as D, AclEvent as Dt, WrapRequest as E, ACL_TOPICS as Et, ReadContractReturnType as F, UnwrapFinalizedEvent as Ft, DelegationSubmittedEvent as G, decodeUnwrapFinalized as Gt, DecryptEndEvent as H, decodeOnChainEvent as Ht, ReadFunctionName as I, UnwrapRequestedEvent as It, EncryptStartEvent as J, findDelegatedForUserDecryption as Jt, EncryptEndEvent as K, decodeUnwrapRequested as Kt, WriteContractArgs as L, WrapEvent as Lt, ContractAbi as M, RevokedDelegationForUserDecryptionEvent as Mt, ReadContractArgs as N, TOKEN_TOPICS as Nt, WalletAccount as O, AclTopics as Ot, ReadContractConfig as P, Topics as Pt, RevokeDelegationSubmittedEvent as Q, RawLog as Qt, WriteContractConfig as R, decodeAclEvent as Rt, TransactionKind as S, WrapOptions as St, UnwrapRequest as T, UnshieldCallbacks as Tt, DecryptErrorEvent as U, decodeOnChainEvents as Ut, BaseEvent as V, decodeDelegatedForUserDecryption as Vt, DecryptStartEvent as W, decodeRevokedDelegationForUserDecryption as Wt, PermitErrorEvent as X, findUnwrapRequested as Xt, FinalizeUnwrapSubmittedEvent as Y, findRevokedDelegationForUserDecryption as Yt, PermitOperation as Z, findWrap as Zt, PrepareTransactionRequest as _, ShieldOptions as _t, ZamaConfigBase as a, EncryptInput as an, UnshieldPhase1SubmittedEvent as at, RevokeDelegationRequest as b, UnshieldOptions as bt, GenericStorage as c, EncryptedValue as cn, UnwrapSubmittedEvent as ct, ConfidentialTransferFromRequest as d, FhevmRelayerOptions as dn, WrapSubmittedEvent as dt, TransactionResult as en, ShieldSubmittedEvent as et, ConfidentialTransferRequest as f, FhevmRuntimeConfig as fn, ZamaSDKEvent as ft, PrepareOptions as g, TypedValue$1 as gn, ApprovalStrategy as gt, PrepareFees as h, RelayerSDK as hn, ZamaSDKEvents as ht, ZamaConfig as i, EIP712TypedData as in, TransferSubmittedEvent as it, WalletAccountStore as j, OnChainEvent as jt, WalletAccountChange as k, ConfidentialTransferEvent as kt, GenericProvider as l, FhevmClient as ln, VaultOperation as lt, FinalizeUnwrapRequest as m, RelayerRequestOptions as mn, ZamaSDKEventType as mt, RelayerConfig as n, DecryptPublicValuesResult as nn, TransactionOperation as nt, ZamaConfigGeneric as o, EncryptParams as on, UnshieldPhase2StartedEvent as ot, DelegateDecryptionRequest as p, RelayerOptions as pn, ZamaSDKEventListener as pt, EncryptErrorEvent as q, decodeWrap as qt, WebRelayerConfig as r, DecryptValuesParameters as rn, TransferFromSubmittedEvent as rt, GenericLogger as s, EncryptResult as sn, UnshieldPhase2SubmittedEvent as st, CleartextRelayerConfig as t, ClearValue as tn, TransactionErrorEvent as tt, ApproveUnderlyingRequest as u, FhevmClientOptions as un, VaultSubmittedEvent as ut, PreparedFor as v, ShieldPath as vt, UnwrapAllRequest as w, TransferCallbacks as wt, SetOperatorRequest as x, UnwrapResult as xt, PreparedTransaction as y, TransferOptions as yt, WriteFunctionName as z, decodeAclEvents as zt };
|
|
1367
|
-
//# sourceMappingURL=types-CHepK8MK.d.ts.map
|
|
1383
|
+
export { RevokeDelegationSubmittedEvent as $, RawLog as $t, WalletAccountListener as A, ConfidentialTransferEvent as At, WriteFunctionName as B, decodeAclEvents as Bt, TransferAndCallRequest as C, WrapOptions as Ct, GenericSigner as D, ACL_TOPICS as Dt, WrapRequest as E, UnshieldCallbacks as Et, ReadContractConfig as F, Topics as Ft, DecryptStartEvent as G, decodeRevokedDelegationForUserDecryption as Gt, BaseEvent as H, decodeDelegatedForUserDecryption as Ht, ReadContractReturnType as I, UnwrapFinalizedEvent as It, EncryptErrorEvent as J, decodeWrap as Jt, DelegationSubmittedEvent as K, decodeUnwrapFinalized as Kt, ReadFunctionName as L, UnwrapRequestedEvent as Lt, ContractAbi as M, OnChainEvent as Mt, MulticallReturnType as N, RevokedDelegationForUserDecryptionEvent as Nt, WalletAccount as O, AclEvent as Ot, ReadContractArgs as P, TOKEN_TOPICS as Pt, PermitOperation as Q, findWrap as Qt, WriteContractArgs as R, WrapEvent as Rt, TransactionKind as S, UnwrapResult as St, UnwrapRequest as T, TransferCallbacks as Tt, DecryptEndEvent as U, decodeOnChainEvent as Ut, ApproveUnderlyingSubmittedEvent as V, decodeConfidentialTransfer as Vt, DecryptErrorEvent as W, decodeOnChainEvents as Wt, FinalizeUnwrapSubmittedEvent as X, findRevokedDelegationForUserDecryption as Xt, EncryptStartEvent as Y, findDelegatedForUserDecryption as Yt, PermitErrorEvent as Z, findUnwrapRequested as Zt, PrepareTransactionRequest as _, TypedValue$1 as _n, ApprovalStrategy as _t, ZamaConfigBase as a, EIP712TypedData as an, TransferSubmittedEvent as at, RevokeDelegationRequest as b, TransferOptions as bt, GenericStorage as c, EncryptResult as cn, UnshieldPhase2SubmittedEvent as ct, ConfidentialTransferFromRequest as d, FhevmClientOptions as dn, VaultSubmittedEvent as dt, TransactionReceipt as en, SetOperatorSubmittedEvent as et, ConfidentialTransferRequest as f, FhevmRelayerOptions as fn, WrapSubmittedEvent as ft, PrepareOptions as g, RelayerSDK as gn, ZamaSDKEvents as gt, PrepareFees as h, RelayerRequestOptions as hn, ZamaSDKEventType as ht, ZamaConfig as i, DecryptValuesParameters as in, TransferFromSubmittedEvent as it, WalletAccountStore as j, DelegatedForUserDecryptionEvent as jt, WalletAccountChange as k, AclTopics as kt, GenericProvider as l, EncryptedValue as ln, UnwrapSubmittedEvent as lt, FinalizeUnwrapRequest as m, RelayerOptions as mn, ZamaSDKEventListener as mt, RelayerConfig as n, ClearValue as nn, TransactionErrorEvent as nt, ZamaConfigGeneric as o, EncryptInput as on, UnshieldPhase1SubmittedEvent as ot, DelegateDecryptionRequest as p, FhevmRuntimeConfig as pn, ZamaSDKEvent as pt, EncryptEndEvent as q, decodeUnwrapRequested as qt, WebRelayerConfig as r, DecryptPublicValuesResult as rn, TransactionOperation as rt, GenericLogger as s, EncryptParams as sn, UnshieldPhase2StartedEvent as st, CleartextRelayerConfig as t, TransactionResult as tn, ShieldSubmittedEvent as tt, ApproveUnderlyingRequest as u, FhevmClient as un, VaultOperation as ut, PreparedFor as v, ShieldOptions as vt, UnwrapAllRequest as w, ShieldCallbacks as wt, SetOperatorRequest as x, UnshieldOptions as xt, PreparedTransaction as y, ShieldPath as yt, WriteContractConfig as z, decodeAclEvent as zt };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./relayer-
|
|
2
|
-
//# sourceMappingURL=validation-
|
|
1
|
+
import{t as e}from"./relayer-nWfQAlo7.js";import{z as t}from"zod/mini";function n(n,r){let i=t.safeParse(n,r);if(i.success)return i.data;throw new e(t.prettifyError(i.error),{cause:i.error})}export{n as t};
|
|
2
|
+
//# sourceMappingURL=validation-CZfDLOUh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-
|
|
1
|
+
{"version":3,"file":"validation-CZfDLOUh.js","names":["ConfigurationError","parseSchema","parsed","z","schema","value"],"sources":["../../src/validation.ts"],"sourcesContent":["import { z } from \"zod/mini\";\nimport { ConfigurationError } from \"./errors\";\n\nexport function parseSchema<T>(schema: z.core.$ZodType<T>, value: unknown): T {\n const parsed = z.safeParse(schema, value);\n if (parsed.success) {\n return parsed.data;\n }\n throw new ConfigurationError(z.prettifyError(parsed.error), { cause: parsed.error });\n}\n"],"mappings":"A,uEAGA,SAAgBC,EAAe,EAA4B,EAAmB,CAC5E,IAAMC,EAASC,EAAE,UAAUC,EAAQC,CAAK,EACxC,GAAIH,EAAO,QACT,OAAOA,EAAO,KAEhB,MAAM,IAAIF,EAAmBG,EAAE,cAAcD,EAAO,KAAK,EAAG,CAAE,MAAOA,EAAO,KAAM,CAAC,CACrF,C"}
|