Skip to main content

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 the most commonly asked chains. In case of SSS based private key providers, 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:

MPC Providers

Private Key Providers

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;
}