Skip to main content

Request signature

The request method facilitates the use of templated transaction screens for signing transactions. The method will return SignResponse. It can be used to sign transactions for any EVM chain and screens can be whitelabeled to your branding.

Please check the list of JSON RPC methods, noting that the request method currently supports only the signing methods.

Request Method

Arguments

ArgumentsDescription
chainConfigDefines the chain to be used for signature.
methodJSON RPC method name in String. Currently, the request method only supports the signing methods.
requestParamsParameters for the corresponding method. The parameters should be in the list and correct sequence. Take a look at RPC methods to know more.

Usage

Usage

try {
List<dynamic> params = [];
// Message to be signed
params.add("Hello, Web3Auth from Flutter!");
// User's EOA address
params.add("<User Address in Hex>");

final response = await Web3AuthFlutter.request(
ChainConfig(
chainId: "0x1",
rpcTarget: "https://mainnet.infura.io/v3/$key",
),
"personal_sign",
params,
);

log(response.toString());
} on UserCancelledException {
log("User cancelled.");
} catch(e) {
log("Unknown exception occurred");
}

SignResponse

NameDescription
successDetermines whether the request was successful or not.
result?Holds the signature for the request when success is true.
error?Holds the error for the request when success is false.