getMPCAccount method
Implementation
Future<MPCAccountInfo> getMPCAccount({
required String accountId,
String path = "flutterchain",
String chain = BlockChains.ethereum,
String typeOfNetwork = "testnet",
String? mpcPublicKey,
}) async {
final mpcAccountInfoData = await jsVMService.callJSAsync(
"window.generateAddressForNearMPC('$accountId', '$path', '$chain', ${mpcPublicKey != null ? "'$mpcPublicKey'" : 'undefined'}, '$typeOfNetwork')",
);
final mpcAccountInfo =
json.decode(mpcAccountInfoData) as Map<String, dynamic>;
return MPCAccountInfo(
adress: mpcAccountInfo["address"],
publicKey: mpcAccountInfo["publicKey"],
);
}