diff --git a/src/app/features/add-network/add-network-form.tsx b/src/app/features/add-network/add-network-form.tsx index eb346aeaa9b..0634a758452 100644 --- a/src/app/features/add-network/add-network-form.tsx +++ b/src/app/features/add-network/add-network-form.tsx @@ -4,7 +4,11 @@ import { NetworkSelectors } from '@tests/selectors/network.selectors'; import { useFormikContext } from 'formik'; import { HStack, styled } from 'leather-styles/jsx'; -import type { BitcoinNetworkModes } from '@leather.io/models'; +import { + BITCOIN_API_BASE_URL_MAINNET, + BITCOIN_API_BASE_URL_TESTNET, + type BitcoinNetworkModes, +} from '@leather.io/models'; import { CheckmarkIcon, ChevronDownIcon, @@ -60,11 +64,11 @@ export function AddNetworkForm() { switch (values.bitcoinNetwork) { case 'mainnet': setStacksUrl('https://api.hiro.so'); - setBitcoinUrl('https://blockstream.info/api'); + setBitcoinUrl(BITCOIN_API_BASE_URL_MAINNET); break; case 'testnet': setStacksUrl('https://api.testnet.hiro.so'); - setBitcoinUrl('https://blockstream.info/testnet/api'); + setBitcoinUrl(BITCOIN_API_BASE_URL_TESTNET); break; case 'signet': setStacksUrl('https://api.testnet.hiro.so'); diff --git a/src/app/features/add-network/add-network.tsx b/src/app/features/add-network/add-network.tsx index d0678d03393..22ce48149de 100644 --- a/src/app/features/add-network/add-network.tsx +++ b/src/app/features/add-network/add-network.tsx @@ -2,7 +2,7 @@ import { NetworkSelectors } from '@tests/selectors/network.selectors'; import { Form, Formik } from 'formik'; import { Stack, styled } from 'leather-styles/jsx'; -import { Button } from '@leather.io/ui'; +import { Button, Link } from '@leather.io/ui'; import { ErrorLabel } from '@app/components/error-label'; import { Card, Content, Page } from '@app/components/layout'; @@ -31,21 +31,21 @@ export function AddNetwork() { > Use this form to add a new instance of the{' '} - Stacks Blockchain API - {' '} + {' '} or{' '} - Bitcoin Blockchain API - + . Make sure you review and trust the host before you add it. diff --git a/src/app/store/networks/networks.utils.ts b/src/app/store/networks/networks.utils.ts index 12877df9770..0ac60b138c7 100644 --- a/src/app/store/networks/networks.utils.ts +++ b/src/app/store/networks/networks.utils.ts @@ -86,7 +86,7 @@ export function transformNetworkStateToMultichainStucture( bitcoin: { blockchain: 'bitcoin', bitcoinNetwork: bitcoinNetwork ? bitcoinNetwork : 'testnet', - bitcoinUrl: bitcoinUrl ? bitcoinUrl : 'https://blockstream.info/testnet/api', + bitcoinUrl: bitcoinUrl ? bitcoinUrl : BITCOIN_API_BASE_URL_TESTNET, }, }, }, diff --git a/tests/specs/ledger/ledger.spec.ts b/tests/specs/ledger/ledger.spec.ts index b3ad04bd0f8..2473e1715eb 100644 --- a/tests/specs/ledger/ledger.spec.ts +++ b/tests/specs/ledger/ledger.spec.ts @@ -12,7 +12,7 @@ const specs = { }; async function interceptBitcoinRequests(homePage: HomePage) { - const requestPromise = homePage.page.waitForRequest(/bestinslot|blockstream|inscriptions/, { + const requestPromise = homePage.page.waitForRequest(/bestinslot|mempool|inscriptions/, { timeout: 1000, }); return requestPromise; diff --git a/tests/specs/network/add-network.spec.ts b/tests/specs/network/add-network.spec.ts index 37bb07902f5..1c902dc7927 100644 --- a/tests/specs/network/add-network.spec.ts +++ b/tests/specs/network/add-network.spec.ts @@ -1,6 +1,8 @@ import { NetworkSelectors } from '@tests/selectors/network.selectors'; import { SettingsSelectors } from '@tests/selectors/settings.selectors'; +import { BITCOIN_API_BASE_URL_TESTNET } from '@leather.io/models'; + import { test } from '../../fixtures/fixtures'; test.describe('Networks tests', () => { @@ -19,9 +21,9 @@ test.describe('Networks tests', () => { await page.getByTestId(NetworkSelectors.AddNetworkBitcoinAPISelector).click(); await page.getByTestId(NetworkSelectors.BitcoinAPIOptionTestnet).click(); - const bitcoinUrl = await page.getByTestId(NetworkSelectors.NetworkBitcoinAddress); + const bitcoinUrl = page.getByTestId(NetworkSelectors.NetworkBitcoinAddress); - test.expect(await bitcoinUrl.inputValue()).toEqual('https://blockstream.info/testnet/api'); + test.expect(await bitcoinUrl.inputValue()).toEqual(BITCOIN_API_BASE_URL_TESTNET); }); test('validation error when stacks api url is empty', async ({ networkPage }) => { diff --git a/tests/specs/onboarding/onboarding.spec.ts b/tests/specs/onboarding/onboarding.spec.ts index fc9f5c64be8..94979157267 100644 --- a/tests/specs/onboarding/onboarding.spec.ts +++ b/tests/specs/onboarding/onboarding.spec.ts @@ -6,6 +6,8 @@ import { import { testSoftwareAccountDefaultWalletState } from '@tests/page-object-models/onboarding.page'; import { OnboardingSelectors } from '@tests/selectors/onboarding.selectors'; +import { BITCOIN_API_BASE_URL_MAINNET } from '@leather.io/models'; + import { test } from '../../fixtures/fixtures'; test.describe('Onboarding an existing user', () => { @@ -64,7 +66,7 @@ test.describe('Onboarding an existing user', () => { test('Activity tab', async ({ extensionId, globalPage, onboardingPage, homePage, page }) => { await globalPage.setupAndUseApiCalls(extensionId); await onboardingPage.signUpNewUser(); - await page.route(`**/blockstream.info/api/address/**/txs`, route => + await page.route(`${BITCOIN_API_BASE_URL_MAINNET}/address/**/txs`, route => route.fulfill({ json: [], })