@bit-gpt/h402
Version:
BitGPT's 402 open protocol for blockchain-native payments
68 lines • 3.55 kB
TypeScript
import type { Chain, Transport, Client, Account, RpcSchema, PublicActions, WalletActions, PublicClient, LocalAccount } from "viem";
import { baseSepolia, avalancheFuji, bsc } from "viem/chains";
import { type Hex } from "viem";
export type SignerWallet<chain extends Chain = Chain, transport extends Transport = Transport, account extends Account = Account> = Client<transport, chain, account, RpcSchema, PublicActions<transport, chain, account> & WalletActions<chain, account>>;
export type ConnectedClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain, account extends Account | undefined = undefined> = PublicClient<transport, chain, account>;
/**
* Creates a public client based on the provided network ID
*
* @param networkId - The network ID to create a client for
* @returns A public client instance for the specified network
* @throws Error if the network ID is not supported
*/
export declare function getPublicClient(networkId: string): ConnectedClient<Transport, any, undefined>;
/**
* Creates a public client configured for the Base Sepolia testnet
*
* @returns A public client instance connected to Base Sepolia
*/
export declare function createClientSepolia(): ConnectedClient<Transport, typeof baseSepolia, undefined>;
/**
* Creates a public client configured for the Avalanche Fuji testnet
*
* @returns A public client instance connected to Avalanche Fuji
*/
export declare function createClientAvalancheFuji(): ConnectedClient<Transport, typeof avalancheFuji, undefined>;
/**
* Creates a public client configured for the BSC mainnet
*
* @returns A public client instance connected to BSC
*/
export declare function createClientBsc(): ConnectedClient<Transport, typeof bsc, undefined>;
/**
* Creates a wallet client configured for the Base Sepolia testnet with a private key
*
* @param privateKey - The private key to use for signing transactions
* @returns A wallet client instance connected to Base Sepolia with the provided private key
*/
export declare function createSignerSepolia(privateKey: Hex): SignerWallet<typeof baseSepolia>;
/**
* Creates a wallet client configured for the Avalanche Fuji testnet with a private key
*
* @param privateKey - The private key to use for signing transactions
* @returns A wallet client instance connected to Avalanche Fuji with the provided private key
*/
export declare function createSignerAvalancheFuji(privateKey: Hex): SignerWallet<typeof avalancheFuji>;
/**
* Creates a wallet client configured for the BSC mainnet with a private key
*
* @param privateKey - The private key to use for signing transactions
* @returns A wallet client instance connected to BSC with the provided private key
*/
export declare function createSignerBsc(privateKey: Hex): SignerWallet<typeof bsc>;
/**
* Checks if a wallet is a signer wallet
*
* @param wallet - The wallet to check
* @returns True if the wallet is a signer wallet, false otherwise
*/
export declare function isSignerWallet<TChain extends Chain = Chain, TTransport extends Transport = Transport, TAccount extends Account = Account>(wallet: SignerWallet<TChain, TTransport, TAccount> | Account): wallet is SignerWallet<TChain, TTransport, TAccount>;
/**
* Checks if a wallet is an account
*
* @param wallet - The wallet to check
* @returns True if the wallet is an account, false otherwise
*/
export declare function isAccount(wallet: SignerWallet | Account): wallet is Account;
export type Wallet = SignerWallet | LocalAccount;
//# sourceMappingURL=wallet.d.ts.map