requestAirdrop method
request Airdrop
Implementation
Future<RPCResponse<String>> requestAirdrop(
{required String pubkey, required int amount}) async {
if (_url == clusterApiUrl(Cluster.mainnetBeta)) {
return Future.error(Exception('Not supported'));
}
final body = json.encode({
"jsonrpc": "2.0",
"id": 1,
"method": RPCMethod.requestAirdrop,
"params": [pubkey, amount]
});
final response = await _httpClient.post(_url, data: body);
return RPCResponse<String>.fromJson(
response.data,
);
}