fix getsparkmintmetadata call

This commit is contained in:
julian 2023-11-17 09:23:16 -06:00
parent f3612ab79b
commit d5fafb64dc
2 changed files with 10 additions and 20 deletions

View file

@ -910,20 +910,19 @@ class ElectrumXClient {
} }
} }
/// Takes [sparkCoinHashes] and returns the set id and block height /// Takes a list of [sparkCoinHashes] and returns the set id and block height
/// for each coin /// for each coin
/// ///
/// arg:
/// { /// {
/// "mints": [ /// "coinHashes": [
/// { /// "b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390",
/// "denom":5000000, /// "b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390",
/// "pubcoin":"b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390"
/// }
/// ] /// ]
/// } /// }
Future<Map<String, dynamic>> getSparkMintMetaData({ Future<List<Map<String, dynamic>>> getSparkMintMetaData({
String? requestID, String? requestID,
required List<({int denom, String pubCoin})> sparkCoinHashes, required List<String> sparkCoinHashes,
}) async { }) async {
try { try {
final response = await request( final response = await request(
@ -931,16 +930,11 @@ class ElectrumXClient {
command: 'spark.getsparkmintmetadata', command: 'spark.getsparkmintmetadata',
args: [ args: [
{ {
"mints": sparkCoinHashes "coinHashes": sparkCoinHashes,
.map((e) => {
"denom": e.denom,
"pubcoin": e.pubCoin,
})
.toList(),
}, },
], ],
); );
return Map<String, dynamic>.from(response["result"] as Map); return List<Map<String, dynamic>>.from(response["result"] as List);
} catch (e) { } catch (e) {
Logging.instance.log(e, level: LogLevel.Error); Logging.instance.log(e, level: LogLevel.Error);
rethrow; rethrow;

View file

@ -487,11 +487,7 @@ class HiddenSettings extends StatelessWidget {
final mintMetaData = final mintMetaData =
await e.getSparkMintMetaData( await e.getSparkMintMetaData(
sparkCoinHashes: [ sparkCoinHashes: [
( "b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390",
denom: 5000000,
pubCoin:
"b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390",
)
], ],
); );