UNPKG

@parifi/sdk

Version:

Parifi SDK with common utility functions

56 lines (53 loc) 2.32 kB
import * as viem from 'viem'; import { Transport, Chain } from 'viem'; import { SmartAccountClient } from 'permissionless'; import { RelayerI, RpcConfig } from '../../interfaces/classConfigs.mjs'; import { SmartAccount } from 'permissionless/accounts'; import { EntryPoint } from 'permissionless/types/entrypoint'; import '@parifi/references'; declare const getPimlicoSmartAccountClient: (pimlicoConfig: RelayerI, rpcConfig: RpcConfig, privateKey: `0x${string}`) => Promise<SmartAccountClient<EntryPoint, Transport, Chain, SmartAccount<EntryPoint>>>; declare const executeTxUsingPimlico: (smartAccountClient: SmartAccountClient<EntryPoint, Transport, Chain, SmartAccount<EntryPoint>>, targetContractAddress: string, txData: string) => Promise<{ txHash: string; }>; declare const executeBatchTxsUsingPimlico: (smartAccountClient: SmartAccountClient<EntryPoint, Transport, Chain, SmartAccount<EntryPoint>>, targetContractAddresses: string[], txDatas: string[]) => Promise<{ txHash: string; }>; /** * Gets the chain object for the given chain id. * @param chainId - Chain id of the target EVM chain. * @returns Viem's chain object. */ declare const getViemChainById: (chainId: number) => { blockExplorers: { readonly default: { readonly name: "Arbiscan"; readonly url: "https://arbiscan.io"; readonly apiUrl: "https://api.arbiscan.io/api"; }; }; contracts: { readonly multicall3: { readonly address: "0xca11bde05977b3631167028862be2a173976ca11"; readonly blockCreated: 7654707; }; }; id: 42161; name: "Arbitrum One"; nativeCurrency: { readonly name: "Ether"; readonly symbol: "ETH"; readonly decimals: 18; }; rpcUrls: { readonly default: { readonly http: readonly ["https://arb1.arbitrum.io/rpc"]; }; }; sourceId?: number | undefined; testnet?: boolean | undefined; custom?: Record<string, unknown> | undefined; fees?: viem.ChainFees<undefined> | undefined; formatters?: undefined; serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined; } | undefined; export { executeBatchTxsUsingPimlico, executeTxUsingPimlico, getPimlicoSmartAccountClient, getViemChainById };