UNPKG

@privy-io/server-auth

Version:

Server-side client for the Privy API

27 lines (24 loc) 960 B
import { LocalAccount } from 'viem/accounts'; import { PrivyClient } from './index.js'; import { H as Hex } from './public-COOxC-bb.js'; import '@solana/web3.js'; import 'redaxios'; import '@privy-io/public-api'; /** Inputs to get a viem `Account` instance for a wallet. */ type GetViemAccountInputType = { /** ID for the wallet. */ walletId: string; /** Ethereum address for the wallet. */ address: Hex; /** Instance of your Privy client. */ privy: PrivyClient; }; /** * Given a wallet ID for an Ethereum wallet and an instance of the Privy client, returns a viem * `Account` instance that can be used to sign messages and send transactions with the wallet. * * @param input {GetViemAccountInputType} * @returns account {LocalAccount} viem account instance for the wallet */ declare const createViemAccount: (input: GetViemAccountInputType) => Promise<LocalAccount>; export { type GetViemAccountInputType, createViemAccount };