seismic-viem 1.0.0

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.
@@ -0,0 +1,9 @@
1
+ import type { Account, BlockTag, Chain, GetStorageAtParameters, GetStorageAtReturnType, GetTransactionParameters, GetTransactionReturnType, Hex, RpcSchema, Transport } from 'viem';
2
+ import type { ShieldedPublicClient } from '../client';
3
+ export type ShieldedPublicActions<TChain extends Chain | undefined = Chain | undefined> = {
4
+ getTeePublicKey: () => Promise<Hex | string>;
5
+ getStorageAt: (args: GetStorageAtParameters) => Promise<GetStorageAtReturnType>;
6
+ getTransaction: (args: GetTransactionParameters) => Promise<GetTransactionReturnType<TChain, BlockTag>>;
7
+ };
8
+ export declare const shieldedPublicActions: <TTransport extends Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined, TRpcSchema extends RpcSchema | undefined = undefined>(client: ShieldedPublicClient<TTransport, TChain, TAccount, TRpcSchema>) => ShieldedPublicActions<TChain>;
9
+ //# sourceMappingURL=public.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { Account, Chain, Hex, Transport } from 'viem';
2
+ import { ShieldedWalletClient } from '../client';
3
+ import type { SignedReadContract } from '../contract/read';
4
+ import type { SeismicWriteContract } from '../contract/write';
5
+ import type { SendSeismicTransactionParameters, SendSeismicTransactionRequest, SendSeismicTransactionReturnType } from '../sendTransaction.js';
6
+ import type { SignedCall } from '../signedCall';
7
+ export type ShieldedWalletActions<TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined> = {
8
+ writeContract: SeismicWriteContract<TChain, TAccount>;
9
+ readContract: SignedReadContract;
10
+ signedCall: SignedCall<TChain>;
11
+ sendShieldedTransaction: <const request extends SendSeismicTransactionRequest<TChain, TChainOverride>, TChainOverride extends Chain | undefined = undefined>(args: SendSeismicTransactionParameters<TChain, TAccount, TChainOverride, request>) => Promise<SendSeismicTransactionReturnType>;
12
+ getEncryption: () => Hex;
13
+ };
14
+ export declare const shieldedWalletActions: <TTransport extends Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: ShieldedWalletClient<TTransport, TChain, TAccount>, encryption: Hex) => ShieldedWalletActions<TChain, TAccount>;
15
+ //# sourceMappingURL=wallet.d.ts.map
@@ -0,0 +1,47 @@
1
+ import type { Hex, Signature, TransactionSerializable } from 'viem';
2
+ export declare const serializeSeismicTransaction: (transaction: TransactionSerializable & {
3
+ seismicInput?: Hex | undefined;
4
+ }, signature?: Signature) => `0x${string}`;
5
+ export declare const seismicDevnet: {
6
+ blockExplorers?: {
7
+ [key: string]: {
8
+ name: string;
9
+ url: string;
10
+ apiUrl?: string | undefined;
11
+ };
12
+ default: {
13
+ name: string;
14
+ url: string;
15
+ apiUrl?: string | undefined;
16
+ };
17
+ } | undefined | undefined;
18
+ contracts?: {
19
+ [x: string]: import("viem").ChainContract | {
20
+ [sourceId: number]: import("viem").ChainContract | undefined;
21
+ } | undefined;
22
+ ensRegistry?: import("viem").ChainContract | undefined;
23
+ ensUniversalResolver?: import("viem").ChainContract | undefined;
24
+ multicall3?: import("viem").ChainContract | undefined;
25
+ universalSignatureVerifier?: import("viem").ChainContract | undefined;
26
+ } | undefined;
27
+ id: 1337;
28
+ name: "Seismic";
29
+ nativeCurrency: {
30
+ readonly decimals: 18;
31
+ readonly name: "Ether";
32
+ readonly symbol: "ETH";
33
+ };
34
+ rpcUrls: {
35
+ readonly default: {
36
+ readonly http: readonly ["http://127.0.0.1:8545"];
37
+ readonly webSocket: readonly ["ws://127.0.0.1:8545"];
38
+ };
39
+ };
40
+ sourceId?: number | undefined | undefined;
41
+ testnet?: boolean | undefined | undefined;
42
+ custom?: Record<string, unknown> | undefined;
43
+ fees?: import("viem").ChainFees<undefined> | undefined;
44
+ formatters?: undefined;
45
+ serializers?: import("viem").ChainSerializers<undefined, TransactionSerializable> | undefined;
46
+ };
47
+ //# sourceMappingURL=chain.d.ts.map
@@ -0,0 +1,23 @@
1
+ import type { Account, Chain, Client, Hex, Prettify, PublicActions, PublicRpcSchema, RpcSchema, Transport, WalletActions } from 'viem';
2
+ import type { PublicClientConfig } from 'viem';
3
+ import type { ShieldedPublicActions } from './actions/public';
4
+ import type { ShieldedWalletActions } from './actions/wallet';
5
+ export type ShieldedPublicClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, accountOrAddress extends Account | undefined = undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Client<transport, chain, accountOrAddress, rpcSchema extends RpcSchema ? [...PublicRpcSchema, ...rpcSchema] : PublicRpcSchema, PublicActions<transport, chain> & ShieldedPublicActions<chain>>>;
6
+ export type ShieldedWalletClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = Client<transport, chain, account, RpcSchema, PublicActions<transport, chain, account> & WalletActions<chain, account> & ShieldedWalletActions<chain, account>>;
7
+ type SeismicClients<transport extends Transport, chain extends Chain | undefined, account extends Account | undefined> = {
8
+ public: ShieldedPublicClient<transport, chain, undefined>;
9
+ wallet: ShieldedWalletClient<transport, chain, account>;
10
+ encryption: Hex;
11
+ };
12
+ type GetPublicClientParameters = {
13
+ chain: Chain;
14
+ transport: Transport;
15
+ };
16
+ type GetSeismicClientsParameters = GetPublicClientParameters & {
17
+ privateKey: Hex;
18
+ };
19
+ export declare function createShieldedPublicClient<transport extends Transport, chain extends Chain | undefined = undefined, rpcSchema extends RpcSchema | undefined = undefined>(parameters: PublicClientConfig<transport, chain, undefined, rpcSchema>): ShieldedPublicClient<transport, chain, undefined, rpcSchema>;
20
+ export declare const createShieldedWalletClient: ({ chain, transport, privateKey, }: GetSeismicClientsParameters) => Promise<ShieldedWalletClient<Transport, Chain, Account>>;
21
+ export declare const getSeismicAnvilClients: (privateKey: Hex) => Promise<SeismicClients<Transport, Chain, Account>>;
22
+ export {};
23
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { type AbiFunction } from 'viem';
2
+ export declare const remapSeismicAbiInputs: (abiFunction: AbiFunction) => AbiFunction;
3
+ export declare const hasShieldedInputs: (abiFunction: AbiFunction) => boolean;
4
+ export declare function getProcessedArgs<abiItem extends AbiFunction, args extends readonly unknown[] | undefined>(abiItem: abiItem, args: args): any[];
5
+ //# sourceMappingURL=abi.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { ExtractAbiFunctionNames } from 'abitype';
2
+ import type { Abi, Account, Address, Chain, Client, ContractFunctionName, GetContractParameters, GetContractReturnType, IsNarrowable, IsNever, Transport } from 'viem';
3
+ import type { ShieldedWalletClient } from '../client';
4
+ import type { KeyedClient } from '../viem-internal/client';
5
+ import type { GetReadFunction } from '../viem-internal/function';
6
+ type SignedReadContractReturnType<TAbi extends Abi | readonly unknown[], TClient extends Client | KeyedClient = Client | KeyedClient, _readFunctionNames extends string = TAbi extends Abi ? Abi extends TAbi ? string : ExtractAbiFunctionNames<TAbi, 'pure' | 'view'> : string, _narrowable extends boolean = IsNarrowable<TAbi, Abi>, _walletClient extends Client | unknown = TClient extends {
7
+ wallet: Client;
8
+ } ? TClient['wallet'] : TClient> = _walletClient extends Client ? IsNever<_readFunctionNames> extends true ? unknown : {
9
+ sread: {
10
+ [functionName in _readFunctionNames]: GetReadFunction<_narrowable, TAbi, functionName extends ContractFunctionName<TAbi, 'pure' | 'view'> ? functionName : never>;
11
+ };
12
+ } : unknown;
13
+ export declare function getShieldedContract<TTransport extends Transport, TAddress extends Address, const TAbi extends Abi | readonly unknown[], const TClient extends ShieldedWalletClient<TTransport, TChain, TAccount> | KeyedClient<TTransport, TChain, TAccount>, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>({ abi, address, client, }: GetContractParameters<TTransport, TChain, TAccount, TAbi, TClient, TAddress>): GetContractReturnType<TAbi, TClient, TAddress> & SignedReadContractReturnType<TAbi, TClient>;
14
+ export {};
15
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { Abi, Account, Chain, Client, ContractFunctionArgs, ContractFunctionName, ReadContractParameters, ReadContractReturnType, Transport } from 'viem';
2
+ export declare function signedReadContract<TChain extends Chain | undefined, TAccount extends Account | undefined, const TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, 'nonpayable' | 'payable'>, TArgs extends ContractFunctionArgs<TAbi, 'nonpayable' | 'payable', TFunctionName>>(client: Client<Transport, TChain, TAccount>, parameters: ReadContractParameters<TAbi, TFunctionName, TArgs>): Promise<ReadContractReturnType>;
3
+ export type SignedReadContract<TAbi extends Abi | readonly unknown[] = Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, 'nonpayable' | 'payable'> = ContractFunctionName<TAbi, 'nonpayable' | 'payable'>, TArgs extends ContractFunctionArgs<TAbi, 'nonpayable' | 'payable', TFunctionName> = ContractFunctionArgs<TAbi, 'payable' | 'nonpayable', TFunctionName>> = (args: ReadContractParameters<TAbi, TFunctionName, TArgs>) => Promise<ReadContractReturnType>;
4
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1,61 @@
1
+ import type { Abi, AbiItemName, Account, Chain, ContractFunctionArgs, ContractFunctionName, GetAbiItemParameters, Transport, WriteContractParameters, WriteContractReturnType } from 'viem';
2
+ import type { ShieldedWalletClient } from '../client';
3
+ /**
4
+ Determine whether the contract has shielded parameters.
5
+ If so, we will encrypt the entire payload;
6
+ If not, we will send a normal Ethereum transaction
7
+ */
8
+ export declare function useSeismicWrite<const abi extends Abi | readonly unknown[], name extends AbiItemName<abi>>(parameters: GetAbiItemParameters<abi, name, undefined>): boolean;
9
+ /**
10
+ * Executes a write function on a contract.
11
+ *
12
+ * - Docs: https://viem.sh/docs/contract/writeContract
13
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts
14
+ *
15
+ * A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state.
16
+ *
17
+ * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
18
+ *
19
+ * __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__
20
+ *
21
+ * @param client - Client to use
22
+ * @param parameters - {@link WriteContractParameters}
23
+ * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms#hash). {@link WriteContractReturnType}
24
+ *
25
+ * @example
26
+ * import { createWalletClient, custom, parseAbi } from 'viem'
27
+ * import { mainnet } from 'viem/chains'
28
+ * import { writeContract } from 'viem/contract'
29
+ *
30
+ * const client = createWalletClient({
31
+ * chain: mainnet,
32
+ * transport: custom(window.ethereum),
33
+ * })
34
+ * const hash = await writeContract(client, {
35
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
36
+ * abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
37
+ * functionName: 'mint',
38
+ * args: [69420],
39
+ * })
40
+ *
41
+ * @example
42
+ * // With Validation
43
+ * import { createWalletClient, http, parseAbi } from 'viem'
44
+ * import { mainnet } from 'viem/chains'
45
+ * import { simulateContract, writeContract } from 'viem/contract'
46
+ *
47
+ * const client = createWalletClient({
48
+ * chain: mainnet,
49
+ * transport: http(),
50
+ * })
51
+ * const { request } = await simulateContract(client, {
52
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
53
+ * abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
54
+ * functionName: 'mint',
55
+ * args: [69420],
56
+ * }
57
+ * const hash = await writeContract(client, request)
58
+ */
59
+ export declare function shieldedWriteContract<TTransport extends Transport, TChain extends Chain | undefined, TAccount extends Account | undefined, const TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, 'nonpayable' | 'payable'>, TArgs extends ContractFunctionArgs<TAbi, 'nonpayable' | 'payable', TFunctionName>, chainOverride extends Chain | undefined = undefined>(client: ShieldedWalletClient<TTransport, TChain, TAccount>, parameters: WriteContractParameters<TAbi, TFunctionName, TArgs, TChain, TAccount, chainOverride>): Promise<WriteContractReturnType>;
60
+ export type SeismicWriteContract<TChain extends Chain | undefined, TAccount extends Account | undefined, abi extends Abi | readonly unknown[] = Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'payable' | 'nonpayable'> = ContractFunctionName<abi, 'payable' | 'nonpayable'>, args extends ContractFunctionArgs<abi, 'payable' | 'nonpayable', functionName> = ContractFunctionArgs<abi, 'payable' | 'nonpayable', functionName>, TChainOverride extends Chain | undefined = undefined> = (args: WriteContractParameters<abi, functionName, args, TChain, TAccount, TChainOverride>) => Promise<WriteContractReturnType>;
61
+ //# sourceMappingURL=write.d.ts.map
@@ -0,0 +1,45 @@
1
+ import type { Hex } from 'viem';
2
+ export declare class AesGcmCrypto {
3
+ private readonly key;
4
+ private readonly ALGORITHM;
5
+ private readonly TAG_LENGTH;
6
+ private readonly NONCE_LENGTH;
7
+ private readonly U64_SIZE;
8
+ constructor(key: Hex);
9
+ /**
10
+ * Creates a nonce from a u64 number, matching Rust's implementation
11
+ * @param num - The number to convert (will be treated as u64)
12
+ */
13
+ private numberToNonce;
14
+ /**
15
+ * RLP encodes the input data
16
+ * @param data - The hex data to encode
17
+ */
18
+ private rlpEncodeInput;
19
+ /**
20
+ * Validates and converts a hex nonce to buffer
21
+ * @param nonce - The nonce in hex format
22
+ */
23
+ private validateAndConvertNonce;
24
+ /**
25
+ * Creates a nonce from a number in a way compatible with the Rust backend
26
+ */
27
+ createNonce(num: number | bigint): Hex;
28
+ /**
29
+ * Encrypts data using either a number-based nonce or hex nonce
30
+ */
31
+ encrypt(plaintext: Hex, nonce: number | bigint | Hex): {
32
+ ciphertext: Hex;
33
+ };
34
+ /**
35
+ * Decrypts data using either a number-based nonce or hex nonce
36
+ */
37
+ decrypt(ciphertext: Hex, nonce: number | bigint | Hex): Hex;
38
+ }
39
+ type AesInputKeys = {
40
+ privateKey: Hex;
41
+ networkPublicKey: string;
42
+ };
43
+ export declare const generateAesKey: (aesKeys: AesInputKeys) => Hex;
44
+ export {};
45
+ //# sourceMappingURL=aes.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { BaseError } from 'viem';
2
+ export type AccountNotFoundErrorType = AccountNotFoundError & {
3
+ name: 'AccountNotFoundError';
4
+ };
5
+ export declare class AccountNotFoundError extends BaseError {
6
+ constructor({ docsPath }?: {
7
+ docsPath?: string | undefined;
8
+ });
9
+ }
10
+ export type AccountTypeNotSupportedErrorType = AccountTypeNotSupportedError & {
11
+ name: 'AccountTypeNotSupportedError';
12
+ };
13
+ export declare class AccountTypeNotSupportedError extends BaseError {
14
+ constructor({ docsPath, metaMessages, type, }: {
15
+ docsPath?: string | undefined;
16
+ metaMessages?: string[] | undefined;
17
+ type: string;
18
+ });
19
+ }
20
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1,9 @@
1
+ export { seismicDevnet } from './chain';
2
+ export { signedCall } from './signedCall';
3
+ export { sendShieldedTransaction } from './sendTransaction';
4
+ export { getShieldedContract } from './contract/contract';
5
+ export { signedReadContract } from './contract/read';
6
+ export { shieldedWriteContract } from './contract/write';
7
+ export { createShieldedPublicClient, createShieldedWalletClient, } from './client';
8
+ export type { ShieldedPublicClient, ShieldedWalletClient } from './client';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { Account, Address, AssertCurrentChainErrorType, Chain, Client, DeriveChain, FormattedTransactionRequest, GetChainIdErrorType, GetChainParameter, GetTransactionRequestKzgParameter, Hash, Hex, PrepareTransactionRequestErrorType, SendRawTransactionErrorType, Transport, UnionOmit } from 'viem';
2
+ import type { ParseAccountErrorType, SignTransactionErrorType } from 'viem/accounts';
3
+ import type { RecoverAuthorizationAddressErrorType } from 'viem/experimental';
4
+ import type { AssertRequestErrorType, GetTransactionErrorReturnType, RequestErrorType } from 'viem/utils';
5
+ import type { AccountNotFoundErrorType, AccountTypeNotSupportedErrorType } from './error/account';
6
+ import type { GetAccountParameter } from './viem-internal/account';
7
+ import type { ErrorType } from './viem-internal/error';
8
+ export type SendSeismicTransactionRequest<chain extends Chain | undefined = Chain | undefined, chainOverride extends Chain | undefined = Chain | undefined, _derivedChain extends Chain | undefined = DeriveChain<chain, chainOverride>> = UnionOmit<FormattedTransactionRequest<_derivedChain>, 'from'> & GetTransactionRequestKzgParameter & {
9
+ seismicInput: Hex;
10
+ };
11
+ export type SendSeismicTransactionParameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined, chainOverride extends Chain | undefined = Chain | undefined, request extends SendSeismicTransactionRequest<chain, chainOverride> = SendSeismicTransactionRequest<chain, chainOverride>> = request & GetAccountParameter<account, Account | Address, true, true> & GetChainParameter<chain, chainOverride> & GetTransactionRequestKzgParameter<request>;
12
+ export type SendSeismicTransactionReturnType = Hash;
13
+ export type SendSeismicTransactionErrorType = ParseAccountErrorType | GetTransactionErrorReturnType<AccountNotFoundErrorType | AccountTypeNotSupportedErrorType | AssertCurrentChainErrorType | AssertRequestErrorType | GetChainIdErrorType | PrepareTransactionRequestErrorType | SendRawTransactionErrorType | RecoverAuthorizationAddressErrorType | SignTransactionErrorType | RequestErrorType> | ErrorType;
14
+ /**
15
+ * Sends a Seismic transaction,
16
+ * taking in `seismicInput` as the (ciphered) input
17
+ * to the node.
18
+ */
19
+ export declare function sendShieldedTransaction<TChain extends Chain | undefined, TAccount extends Account | undefined, const TRequest extends SendSeismicTransactionRequest<TChain, TChainOverride>, TChainOverride extends Chain | undefined = undefined>(client: Client<Transport, TChain, TAccount>, parameters: SendSeismicTransactionParameters<TChain, TAccount, TChainOverride, TRequest>): Promise<SendSeismicTransactionReturnType>;
20
+ //# sourceMappingURL=sendTransaction.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { CallParameters, CallReturnType, Chain, Client, Hex, Transport } from 'viem';
2
+ export type SignedCallParameters<chain extends Chain | undefined> = CallParameters<chain> & {
3
+ seismicInput?: Hex | undefined;
4
+ };
5
+ export type SignedCall<chain extends Chain | undefined> = (args: SignedCallParameters<chain>) => Promise<CallReturnType>;
6
+ export declare function signedCall<chain extends Chain | undefined>(client: Client<Transport, chain>, args: SignedCallParameters<chain>): Promise<CallReturnType>;
7
+ //# sourceMappingURL=signedCall.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { Account, Address, IsUndefined, MaybeRequired } from 'viem';
2
+ export type GetAccountParameter<account extends Account | undefined = Account | undefined, accountOverride extends Account | Address | undefined = Account | Address, required extends boolean = true, nullish extends boolean = false> = MaybeRequired<{
3
+ account?: accountOverride | Account | Address | (nullish extends true ? null : never) | undefined;
4
+ }, IsUndefined<account> extends true ? required extends true ? true : false : false>;
5
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1,64 @@
1
+ import type { AccountStateConflictErrorType, Address, CallParameters, Chain, Client, Hex, InvalidAddressErrorType, NumberToHexErrorType, RpcStateOverride, StateAssignmentConflictErrorType, StateOverride, TransactionRequest, Transport } from 'viem';
2
+ import { BaseError } from 'viem';
3
+ export declare function shouldPerformMulticall({ request, }: {
4
+ request: TransactionRequest;
5
+ }): boolean;
6
+ type InvalidBytesLengthErrorType = InvalidBytesLengthError & {
7
+ name: 'InvalidBytesLengthError';
8
+ };
9
+ declare class InvalidBytesLengthError extends BaseError {
10
+ constructor({ size, targetSize, type, }: {
11
+ size: number;
12
+ targetSize: number;
13
+ type: 'hex' | 'bytes';
14
+ });
15
+ }
16
+ type SerializeStateOverrideParameters = StateOverride | undefined;
17
+ type SerializeStateMappingErrorType = InvalidBytesLengthErrorType;
18
+ type SerializeAccountStateOverrideErrorType = NumberToHexErrorType | StateAssignmentConflictErrorType | SerializeStateMappingErrorType;
19
+ export type SerializeStateOverrideErrorType = InvalidAddressErrorType | AccountStateConflictErrorType | SerializeAccountStateOverrideErrorType;
20
+ export declare function serializeStateOverride(parameters?: SerializeStateOverrideParameters): RpcStateOverride | undefined;
21
+ export type ScheduleMulticallParameters<chain extends Chain | undefined> = Pick<CallParameters<chain>, 'blockNumber' | 'blockTag'> & {
22
+ data: Hex;
23
+ multicallAddress?: Address | undefined;
24
+ to: Address;
25
+ };
26
+ export declare function scheduleMulticall<chain extends Chain | undefined>(client: Client<Transport>, args: ScheduleMulticallParameters<chain>): Promise<{
27
+ data: undefined;
28
+ } | {
29
+ data: `0x${string}`;
30
+ }>;
31
+ export type ErrorType<name extends string = 'Error'> = Error & {
32
+ name: name;
33
+ };
34
+ export declare function toDeploylessCallViaBytecodeData(parameters: {
35
+ code: Hex;
36
+ data: Hex;
37
+ }): `0x${string}`;
38
+ export declare function toDeploylessCallViaFactoryData(parameters: {
39
+ data: Hex;
40
+ factory: Address;
41
+ factoryData: Hex;
42
+ to: Address;
43
+ }): `0x${string}`;
44
+ export declare function getRevertErrorData(err: unknown): `0x${string}` | undefined;
45
+ type Resolved<returnType extends readonly unknown[] = any> = [
46
+ result: returnType[number],
47
+ results: returnType
48
+ ];
49
+ type BatchResultsCompareFn<result = unknown> = (a: result, b: result) => number;
50
+ type CreateBatchSchedulerArguments<parameters = unknown, returnType extends readonly unknown[] = readonly unknown[]> = {
51
+ fn: (args: parameters[]) => Promise<returnType>;
52
+ id: number | string;
53
+ shouldSplitBatch?: ((args: parameters[]) => boolean) | undefined;
54
+ wait?: number | undefined;
55
+ sort?: BatchResultsCompareFn<returnType[number]> | undefined;
56
+ };
57
+ type CreateBatchSchedulerReturnType<parameters = unknown, returnType extends readonly unknown[] = readonly unknown[]> = {
58
+ flush: () => void;
59
+ schedule: parameters extends undefined ? (args?: parameters | undefined) => Promise<Resolved<returnType>> : (args: parameters) => Promise<Resolved<returnType>>;
60
+ };
61
+ export declare function withResolvers<type>(): PromiseWithResolvers<type>;
62
+ export declare function createBatchScheduler<parameters, returnType extends readonly unknown[]>({ fn, id, shouldSplitBatch, wait, sort, }: CreateBatchSchedulerArguments<parameters, returnType>): CreateBatchSchedulerReturnType<parameters, returnType>;
63
+ export {};
64
+ //# sourceMappingURL=call.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { Account, Chain, Client, Transport } from 'viem';
2
+ export type KeyedClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = {
3
+ public?: Client<transport, chain> | undefined;
4
+ wallet: Client<transport, chain, account>;
5
+ } | {
6
+ public: Client<transport, chain>;
7
+ wallet?: Client<transport, chain, account> | undefined;
8
+ };
9
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type ErrorType<name extends string = 'Error'> = Error & {
2
+ name: name;
3
+ };
4
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from 'abitype';
2
+ import type { Abi, AbiFunction, ContractFunctionArgs, ContractFunctionName, Prettify, ReadContractParameters, ReadContractReturnType, UnionOmit } from 'viem';
3
+ export declare function getFunctionParameters(values: [args?: readonly unknown[] | undefined, options?: object | undefined]): {
4
+ args: readonly unknown[];
5
+ options: object;
6
+ };
7
+ export type GetReadFunction<narrowable extends boolean, abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'pure' | 'view'>, args extends ContractFunctionArgs<abi, 'pure' | 'view', functionName> = ContractFunctionArgs<abi, 'pure' | 'view', functionName>, abiFunction extends AbiFunction = abi extends Abi ? ExtractAbiFunction<abi, functionName> : AbiFunction, _args = AbiParametersToPrimitiveTypes<abiFunction['inputs']>, _options = Prettify<UnionOmit<ReadContractParameters<abi, functionName, args>, 'abi' | 'address' | 'args' | 'functionName'>>> = narrowable extends true ? (...parameters: _args extends readonly [] ? [options?: _options] : [args: _args, options?: _options]) => Promise<ReadContractReturnType<abi, functionName, args>> : (...parameters: [options?: _options] | [args: readonly unknown[], options?: _options]) => Promise<ReadContractReturnType>;
8
+ //# sourceMappingURL=function.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { Chain, ExactPartial, SendTransactionParameters } from 'viem';
2
+ export type AssertRequestParameters = ExactPartial<SendTransactionParameters<Chain>>;
3
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { Signature, TransactionSerializableGeneric } from 'viem';
2
+ export declare function toYParitySignatureArray(transaction: TransactionSerializableGeneric, signature_?: Signature | undefined): `0x${string}`[];
3
+ //# sourceMappingURL=signature.d.ts.map
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "seismic-viem",
3
+ "version": "1.0.0",
4
+ "description": "Typescript interface for Seismic",
5
+ "type": "module",
6
+ "main": "dist/_cjs/index.js",
7
+ "module": "dist/_esm/index.ts",
8
+ "types": "dist/_types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "require": "./dist/_cjs/index.js",
12
+ "import": "./dist/_esm/index.js",
13
+ "types": "./dist/_types/index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist/_cjs/*.js",
18
+ "dist/_esm/*.js",
19
+ "dist/_types/**/*.d.ts",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "clean": "rimraf dist",
24
+ "typecheck": "tsc --noEmit; rm tsconfig.tsbuildinfo",
25
+ "build": "bun build:cjs && bun build:esm && bun build:types",
26
+ "build:cjs": "bun build src/index.ts --outdir dist/_cjs --target node --format cjs",
27
+ "build:esm": "bun build src/index.ts --outdir dist/_esm --target browser --format esm",
28
+ "build:types": "tsc --project tsconfig.types.json && tsc-alias --project tsconfig.types.json",
29
+ "postbuild": "rimraf ./dist/tsconfig.types.tsbuildinfo"
30
+ },
31
+ "dependencies": {
32
+ "viem": "^2.21.50"
33
+ },
34
+ "devDependencies": {
35
+ "eslint-config-prettier": "^9.1.0",
36
+ "eslint-plugin-no-relative-import-paths": "^1.5.5"
37
+ },
38
+ "license": "MIT",
39
+ "author": "Seismic Systems",
40
+ "homepage": "https://seismic.systems",
41
+ "repository": "https://github.com/SeismicSystems/seismic-client",
42
+ "keywords": [
43
+ "seismic",
44
+ "crypto",
45
+ "shielding",
46
+ "eth",
47
+ "ethereum",
48
+ "dapps",
49
+ "wallet",
50
+ "web3",
51
+ "typescript"
52
+ ]
53
+ }