From d5fafb64dc4295dbb81bd6dd9127db54665b3468 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 17 Nov 2023 09:23:16 -0600 Subject: [PATCH] fix getsparkmintmetadata call --- lib/electrumx_rpc/electrumx_client.dart | 24 +++++++------------ .../global_settings_view/hidden_settings.dart | 6 +---- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/lib/electrumx_rpc/electrumx_client.dart b/lib/electrumx_rpc/electrumx_client.dart index 93ae73624..1a5c1d641 100644 --- a/lib/electrumx_rpc/electrumx_client.dart +++ b/lib/electrumx_rpc/electrumx_client.dart @@ -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 /// + /// arg: /// { - /// "mints": [ - /// { - /// "denom":5000000, - /// "pubcoin":"b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390" - /// } + /// "coinHashes": [ + /// "b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390", + /// "b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390", /// ] /// } - Future> getSparkMintMetaData({ + Future>> getSparkMintMetaData({ String? requestID, - required List<({int denom, String pubCoin})> sparkCoinHashes, + required List sparkCoinHashes, }) async { try { final response = await request( @@ -931,16 +930,11 @@ class ElectrumXClient { command: 'spark.getsparkmintmetadata', args: [ { - "mints": sparkCoinHashes - .map((e) => { - "denom": e.denom, - "pubcoin": e.pubCoin, - }) - .toList(), + "coinHashes": sparkCoinHashes, }, ], ); - return Map.from(response["result"] as Map); + return List>.from(response["result"] as List); } catch (e) { Logging.instance.log(e, level: LogLevel.Error); rethrow; diff --git a/lib/pages/settings_views/global_settings_view/hidden_settings.dart b/lib/pages/settings_views/global_settings_view/hidden_settings.dart index e2bebe314..04bdc18e3 100644 --- a/lib/pages/settings_views/global_settings_view/hidden_settings.dart +++ b/lib/pages/settings_views/global_settings_view/hidden_settings.dart @@ -487,11 +487,7 @@ class HiddenSettings extends StatelessWidget { final mintMetaData = await e.getSparkMintMetaData( sparkCoinHashes: [ - ( - denom: 5000000, - pubCoin: - "b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390", - ) + "b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390", ], );