UNPKG

@kaiachain/viem-ext

Version:
14 lines (13 loc) 1.27 kB
import type { Address } from 'abitype'; import type { Chain, LocalAccount, JsonRpcAccount } from 'viem'; import type { Account } from 'viem/accounts'; import type { KaiaTransactionRequest, KaiaTransactionResponse } from '../types/transactions.js'; import { KaiaWalletClient } from '../types/client.js'; export type KaiaWalletAction<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = { signTransactionAsFeePayer: (parameters: string | KaiaTransactionRequest) => Promise<string>; signTransaction: (parameters: string | KaiaTransactionRequest) => Promise<string>; sendTransactionAsFeePayer: (parameters: string | KaiaTransactionRequest) => Promise<string>; prepareTransactionRequest: <chainOverride extends Chain | undefined = chain, accountOverride extends Account | Address | undefined = account>(args: KaiaTransactionRequest) => Promise<KaiaTransactionResponse>; sendTransaction: (args: KaiaTransactionRequest) => Promise<`0x${string}`>; }; export declare function kaiaWalletAction(): <chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined>(client: KaiaWalletClient<LocalAccount | JsonRpcAccount>) => KaiaWalletAction<chain, account>;