difcli
Version:
CLI tool for Diffuse Prime
66 lines • 2.97 kB
TypeScript
import { PublicClient, WalletClient } from 'viem';
import { ChainType } from '../config';
export interface ClientPair {
publicClient: PublicClient;
walletClient: WalletClient;
}
export declare class ClientFactory {
/**
* Creates a public client for the specified chain
*/
static createPublicClient(chainType: ChainType): Promise<PublicClient>;
/**
* Creates a wallet client for the specified chain using stored private key
*/
static createWalletClient(chainType: ChainType): Promise<WalletClient>;
/**
* Creates both public and wallet clients for the specified chain
*/
static createClientPair(chainType: ChainType): Promise<ClientPair>;
/**
* Gets the account from stored private key
*/
static getAccount(): Promise<{
address: import("viem").Address;
nonceManager?: import("viem").NonceManager | undefined;
sign: (parameters: {
hash: import("viem").Hash;
}) => Promise<import("viem").Hex>;
signAuthorization: (parameters: import("viem").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
signMessage: ({ message }: {
message: import("viem").SignableMessage;
}) => Promise<import("viem").Hex>;
signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
serializer?: serializer | undefined;
} | undefined) => Promise<import("viem").IsNarrowable<import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>>, import("viem").Hex> extends true ? import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>> : import("viem").Hex>;
signTypedData: <const typedData extends import("viem").TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<import("viem").Hex>;
publicKey: import("viem").Hex;
source: "privateKey";
type: "local";
}>;
/**
* Gets chain configuration for the specified chain type
*/
static getChainConfig(chainType: ChainType): {
rpc: string;
vaultContract: string;
tokenContract: string;
} | {
rpc: string;
vaultContract: string;
tokenContract: string;
} | {
rpc: string;
vaultContract: string;
tokenContract: string;
} | {
rpc: string;
vaultContract: string;
tokenContract: string;
};
/**
* Gets current chain from storage
*/
static getCurrentChain(): Promise<ChainType>;
}
//# sourceMappingURL=client-utils.d.ts.map