getWalletClient
Using wallet client to make write calls
WalletClient
Wallet clients are used to make write
calls.
example.ts
import { mintclub } from 'mint.club-v2-sdk'
const const walletClient: {
account: Account | undefined;
batch?: {
multicall?: boolean | {
batchSize?: number | undefined;
wait?: number | undefined;
} | undefined;
} | undefined;
... 26 more ...;
extend: <const client extends {
[x: string]: unknown;
account?: undefined;
batch?: undefined;
cacheTime?: undefined;
ccipRead?: undefined;
chain?: undefined;
key?: undefined;
name?: undefined;
pollingInterval?: undefined;
request?: undefined;
transport?: undefined;
type?: undefined;
uid?: undefined;
} & ExactPartial<Pick<PublicActions<Transport, Chain | undefined, Account | undefined>, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<WalletActions<Chain | undefined, Account | undefined>, "sendTransaction" | "writeContract">>>(fn: (client: Client<Transport, Chain | undefined, Account | undefined, WalletRpcSchema, WalletActions<Chain | undefined, Account | undefined>>) => client) => Client<Transport, Chain | undefined, Account | undefined, WalletRpcSchema, { [K_1 in keyof client]: client[K_1]; } & WalletActions<Chain | undefined, Account ...walletClient = await mintclub.network('base').getWalletClient()
example.ts
import { mintclub } from 'mint.club-v2-sdk'
const walletClient = await mintclub.network('base').getWalletClient()
const [account] = await walletClient?.getAddresses() || []
if(account) {
const const signed: `0x${string}` | undefinedsigned = await walletClient?.signMessage({
account,
message: 'Hello, Mint Club!'
})
}
Viem Documentation
For more information on how to use the wallet client more effectively, you can refer to the Viem's documentation