getLedger method
Future<LedgerData>
getLedger(
{ - bool queue = false,
- bool full = false,
- bool accounts = false,
- bool transactions = false,
- bool expand = false,
- bool ownerFunds = false,
- bool binary = false,
- String? ledgerHash,
- XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated,
- LedgerEntryType? type,
})
Implementation
Future<LedgerData> getLedger(
{bool queue = false,
bool full = false,
bool accounts = false,
bool transactions = false,
bool expand = false,
bool ownerFunds = false,
bool binary = false,
String? ledgerHash,
XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated,
LedgerEntryType? type}) async {
final Map<String, dynamic> configParams = {};
createRpcConfig(configParams, "full", full);
createRpcConfig(configParams, "queue", queue);
createRpcConfig(configParams, "accounts", accounts);
createRpcConfig(configParams, "transactions", transactions);
createRpcConfig(configParams, "expand", expand);
createRpcConfig(configParams, "owner_funds", ownerFunds);
createRpcConfig(configParams, "binary", false);
createRpcConfig(configParams, "type", type?.name);
createRpcConfig(configParams, "ledger_index", ledgerIndex?.value);
createRpcConfig(configParams, "ledger_hash", ledgerHash);
final response = await makeCustomCall<Map<String, dynamic>>(
"ledger", configParams.isEmpty ? [] : [configParams]);
return LedgerData.fromJson(response);
}