diff --git a/packages/extension/src/libs/spark-handler/callRPC.ts b/packages/extension/src/libs/spark-handler/callRPC.ts index f369aa27f..006e7799b 100644 --- a/packages/extension/src/libs/spark-handler/callRPC.ts +++ b/packages/extension/src/libs/spark-handler/callRPC.ts @@ -21,6 +21,10 @@ export async function callRPC( }, } ); + + if (!response.data || response.data.result === undefined) { + throw new Error('Invalid RPC response structure'); + } return response.data.result; } catch (error) { console.error("RPC Error:", error); diff --git a/packages/extension/src/providers/bitcoin/libs/api-firo.ts b/packages/extension/src/providers/bitcoin/libs/api-firo.ts index f30d26ca7..f45201aeb 100644 --- a/packages/extension/src/providers/bitcoin/libs/api-firo.ts +++ b/packages/extension/src/providers/bitcoin/libs/api-firo.ts @@ -28,7 +28,7 @@ class API implements ProviderAPIInterface { return getBitcoinAddress(pubkey, this.networkInfo); } - // eslint-disable-next-line @typescript-eslint/no-empty-function + async init(): Promise {} async getRawTransaction(hash: string): Promise { @@ -133,7 +133,7 @@ class API implements ProviderAPIInterface { ret.sort((a, b) => { return a.value - b.value; }); - return [ret.at(-1)!]; // TODO: check or filter same values + return ret; } async getUTXOs(pubkey: string): Promise { @@ -145,7 +145,7 @@ class API implements ProviderAPIInterface { return filterOutOrdinals( address, this.networkInfo.name, - await this.FiroToHaskoinUTXOs(utxos, address) + [(await this.FiroToHaskoinUTXOs(utxos, address)).at(-1)!] ).then((futxos) => { futxos.sort((a, b) => { return a.value - b.value; diff --git a/packages/extension/src/providers/bitcoin/networks/firo-testnet.ts b/packages/extension/src/providers/bitcoin/networks/firo-testnet.ts index d4907f402..b1bee81de 100644 --- a/packages/extension/src/providers/bitcoin/networks/firo-testnet.ts +++ b/packages/extension/src/providers/bitcoin/networks/firo-testnet.ts @@ -1,4 +1,5 @@ import { NetworkNames } from "@enkryptcom/types"; +import icon from './icons/firo.svg'; import { BitcoinNetwork, BitcoinNetworkOptions, @@ -18,7 +19,7 @@ const firoOptions: BitcoinNetworkOptions = { isTestNetwork: true, currencyName: "tFIRO", currencyNameLong: "tFiro", - icon: require("./icons/firo.svg"), + icon, decimals: 8, node: "https://testexplorer.firo.org", coingeckoID: "zcoin", diff --git a/packages/extension/src/providers/bitcoin/networks/firo.ts b/packages/extension/src/providers/bitcoin/networks/firo.ts index a450cc014..5c36a1f59 100644 --- a/packages/extension/src/providers/bitcoin/networks/firo.ts +++ b/packages/extension/src/providers/bitcoin/networks/firo.ts @@ -1,4 +1,5 @@ import { NetworkNames } from "@enkryptcom/types"; +import icon from './icons/firo.svg'; import { BitcoinNetwork, BitcoinNetworkOptions, @@ -18,7 +19,7 @@ const firoOptions: BitcoinNetworkOptions = { isTestNetwork: false, currencyName: "FIRO", currencyNameLong: "Firo", - icon: require("./icons/firo.svg"), + icon, decimals: 8, node: "https://explorer.firo.org", coingeckoID: "zcoin", diff --git a/packages/extension/src/providers/bitcoin/ui/send-transaction/components/send-spark-address-input.vue b/packages/extension/src/providers/bitcoin/ui/send-transaction/components/send-spark-address-input.vue index 6f93cb626..7f9520883 100644 --- a/packages/extension/src/providers/bitcoin/ui/send-transaction/components/send-spark-address-input.vue +++ b/packages/extension/src/providers/bitcoin/ui/send-transaction/components/send-spark-address-input.vue @@ -33,8 +33,7 @@