You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`chainConfig`| Defines the chain to be used for signature. |
588
594
|`method`| JSON RPC method name in `String`. Currently, the request method only supports the singing methods. |
589
595
|`requestParams`| Parameters for the corresponding method. The parameters should be in the list and correct sequence. Take a look at [RPC methods](<[https://docs.metamask.io/wallet/reference/json-rpc-api/](https://docs.metamask.io/wallet/reference/json-rpc-api/)>) to know more. |
590
596
@@ -594,19 +600,28 @@ that the request method currently supports only the signing methods.
594
600
595
601
try {
596
602
List<dynamic> params = [];
603
+
// Message to be signed
597
604
params.add("Hello, Web3Auth from Flutter!");
605
+
// User's EOA address
598
606
params.add("<User Address in Hex>");
599
607
608
+
// highlight-start
600
609
await Web3AuthFlutter.request(
610
+
ChainConfig(
611
+
chainId: "0x1",
612
+
rpcTarget: "https://mainnet.infura.io/v3/$key",
613
+
),
601
614
"personal_sign",
602
615
params,
603
616
);
617
+
// highlight-end
604
618
} on UserCancelledException {
605
619
log("User cancelled.");
606
620
} catch(e) {
607
621
log("Unknown exception occurred");
608
622
}
609
623
624
+
// highlight-next-line
610
625
final signResponse = await Web3AuthFlutter.getSignResponse();
0 commit comments