@0xfacet/sdk
Version:
A toolkit for Facet blockchain integration.
40 lines (39 loc) • 2.46 kB
TypeScript
import { Abi, Account, Chain, ContractFunctionArgs, ContractFunctionName, Hex, SendTransactionParameters, SendTransactionRequest, SendTransactionReturnType, Transport, WalletClient, WriteContractParameters, WriteContractReturnType } from "viem";
import { FacetTransactionParams } from "../types";
/**
* Creates a set of L1 facet actions bound to the provided wallet client
* @param l1WalletClient - The viem wallet client for L1 interactions
* @returns Object containing facet transaction functions
*/
export declare const walletL1FacetActions: <transport extends Transport, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined>(l1WalletClient: WalletClient<transport, chain, account>) => {
/**
* Sends a transaction through the Facet protocol using the bound L1 wallet client
*
* @param parameters - The transaction parameters
* @returns A promise that resolves to the transaction hash
*/
sendFacetTransaction: <const request extends SendTransactionRequest<chain, chainOverride>, chainOverride extends Chain | undefined = undefined>(parameters: SendTransactionParameters<chain, account, chainOverride, request> & {
mineBoost?: Hex;
}) => Promise<SendTransactionReturnType>;
/**
* Sends a raw transaction through the Facet protocol using the bound L1 wallet client
*
* @param parameters - The Facet transaction parameters
* @returns A promise that resolves to the transaction result containing L1 and Facet transaction hashes
*/
sendRawFacetTransaction: (parameters: FacetTransactionParams) => Promise<{
l1TransactionHash: Hex;
facetTransactionHash: Hex;
fctMintAmount: bigint;
fctMintRate: bigint;
}>;
/**
* Writes to a contract through the Facet protocol using the bound L1 wallet client
*
* @param parameters - The contract write parameters
* @returns A promise that resolves to the transaction hash
*/
writeFacetContract: <const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, "payable" | "nonpayable">, args extends ContractFunctionArgs<abi, "payable" | "nonpayable", functionName>, chainOverride_1 extends Chain | undefined = undefined>(parameters: WriteContractParameters<abi, functionName, args, chain, account, chainOverride_1> & {
mineBoost?: Hex;
}) => Promise<WriteContractReturnType>;
};