From 6aa07ce4e577439c19543ac248e5a3aae17c8437 Mon Sep 17 00:00:00 2001 From: Edwin Tops Date: Wed, 6 Sep 2023 17:47:08 +0200 Subject: [PATCH] Fix build --- packages/snap/package.json | 2 +- packages/snap/snap.manifest.json | 4 ++-- packages/snap/src/index.ts | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/snap/package.json b/packages/snap/package.json index 5e012ab..b2e8acf 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -1,6 +1,6 @@ { "name": "@celo/gas-snap", - "version": "0.5.6-alpha.1", + "version": "0.5.6-alpha.2", "description": "A MetaMask snap for sending Celo transactions with alternate gas currencies", "repository": { "type": "git", diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index e39792f..5a6a5ab 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -1,5 +1,5 @@ { - "version": "0.5.6-alpha.1", + "version": "0.5.6-alpha.2", "description": "An example Snap written in TypeScript.", "proposedName": "Celo Gas Snap", "repository": { @@ -7,7 +7,7 @@ "url": "https://github.com/celo-org/gas-snap.git" }, "source": { - "shasum": "813VSdbqA0zMg8GLCTRFQqTR2G0jZJzjr3HZveLX344=", + "shasum": "6aOtQKHS3CanzoiGnYkCskSTCs6h7nG3uBFKS7I8m98=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/snap/src/index.ts b/packages/snap/src/index.ts index 86882ea..355cb73 100644 --- a/packages/snap/src/index.ts +++ b/packages/snap/src/index.ts @@ -91,10 +91,11 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => { ], placeholder: `cusd, ceur, creal, celo`, }); - if(overrideFeeCurrency === '') { - overrideFeeCurrency = suggestedFeeCurrency + if (overrideFeeCurrency === '') { + overrideFeeCurrency = suggestedFeeCurrency; } - if ( VALID_CURRENCIES.includes(overrideFeeCurrency.toLowerCase()) ) { + + if (VALID_CURRENCIES.includes(overrideFeeCurrency.toLowerCase())) { tx.feeCurrency = getFeeCurrencyAddressFromName( overrideFeeCurrency.toLowerCase(), network.name, @@ -117,6 +118,7 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => { `${network.explorer}/tx/${txReceipt?.transactionHash}`, ], }); + // eslint-disable-next-line consistent-return return txReceipt?.transactionHash; } catch (e) { const message = (e as Error).message.includes('insufficient funds')