Providers - Web3Auth
Providers are basically pre configured RPC clients for different blockchains. They are used to interact with the blockchain network. Web3Auth provides you with a few common providers for EVM compatible chains and Solana Blockchain. You can also use the private key of the user to connect to other blockchain networks, in case of SSS based infrastructure. For MPC, you can only use the dedicated providers provided by Web3Auth.
Currently, Web3Auth supports the following providers:
- EIP1193 Provider for EVM Compatible Chains
- Solana Provider for Solana Blockchain
- XRPL Provider for XRPL Blockchain
- Common Provider for Other Blockchains
Base Type Reference for Web3Auth Providers
For facilitating these providers, Web3Auth exposes a IProvider
which is a provider type helping you make standardized RPC calls to a blockchain.
This provider contains two functions, send
and request
. You can find its type reference below:
export interface IProvider extends SafeEventEmitter {
sendAsync: <T, IProvider=> Promise<U>;
send: <T, U>(req: JRPCRequest<T>, callback: SendCallBack<U>) => void;
request: <T>(args: RequestArguments) => Promise<Maybe<T>>;
}
export interface JRPCRequest<T> extends JRPCBase {
method: string;
params?: T;
}
export interface JRPCBase {
jsonrpc?: JRPCVersion;
id?: JRPCId;
}
export declare type JRPCVersion = "2.0";
export declare type JRPCId = number | string | void;
export interface RequestArguments {
method: string;
params?: unknown[] | object;
}