diff --git a/package-lock.json b/package-lock.json index b669d0d1..549f371d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simple-staking", - "version": "0.2.41", + "version": "0.2.42", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simple-staking", - "version": "0.2.41", + "version": "0.2.42", "dependencies": { "@bitcoinerlab/secp256k1": "^1.1.1", "@keystonehq/animated-qr": "^0.8.6", diff --git a/package.json b/package.json index 5fbaa7e3..61d49e36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-staking", - "version": "0.2.41", + "version": "0.2.42", "private": true, "scripts": { "dev": "next dev", diff --git a/src/app/api/getFinalityProviders.ts b/src/app/api/getFinalityProviders.ts index 59941156..41a0fa8a 100644 --- a/src/app/api/getFinalityProviders.ts +++ b/src/app/api/getFinalityProviders.ts @@ -58,21 +58,31 @@ export const getFinalityProviders = async ( finalityProvidersAPIResponse.data; const finalityProviders = finalityProvidersAPI.map( - (fp: FinalityProviderAPI): FinalityProvider => ({ - description: { - moniker: fp.description.moniker, - identity: fp.description.identity, - website: fp.description.website, - securityContact: fp.description.security_contact, - details: fp.description.details, - }, - commission: fp.commission, - btcPk: fp.btc_pk, - activeTVLSat: fp.active_tvl, - totalTVLSat: fp.total_tvl, - activeDelegations: fp.active_delegations, - totalDelegations: fp.total_delegations, - }), + (fp: FinalityProviderAPI): FinalityProvider => { + let webUrl = fp.description.website; + if ( + webUrl && + !webUrl.startsWith("http://") && + !webUrl.startsWith("https://") + ) { + webUrl = "https://" + webUrl; + } + return { + description: { + moniker: fp.description.moniker, + identity: fp.description.identity, + website: webUrl, + securityContact: fp.description.security_contact, + details: fp.description.details, + }, + commission: fp.commission, + btcPk: fp.btc_pk, + activeTVLSat: fp.active_tvl, + totalTVLSat: fp.total_tvl, + activeDelegations: fp.active_delegations, + totalDelegations: fp.total_delegations, + }; + }, ); const pagination: Pagination = {