Skip to content

Commit 0be9d30

Browse files
committed
refactor(onchain-interactions): Move v2 for some networks to cost script
1 parent 7ad356b commit 0be9d30

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

libs/ts/base-utils/src/evm/networks.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ export const networkMetadata = {
772772
{
773773
type: 'blockscout',
774774
webUrl: 'https://blockscout-testnet.expchain.ai',
775-
apiUrl: 'https://blockscout-testnet.gadsgcxobnadfogadsihg.com/api/v2',
775+
apiUrl: 'https://blockscout-testnet.gadsgcxobnadfogadsihg.com/api',
776776
},
777777
],
778778
currency: Currency.tZKJ,
@@ -820,7 +820,7 @@ export const networkMetadata = {
820820
{
821821
type: 'blockscout',
822822
webUrl: 'https://coston2-explorer.flare.network',
823-
apiUrl: 'https://coston2-explorer.flare.network/api/v2',
823+
apiUrl: 'https://coston2-explorer.flare.network/api',
824824
},
825825
],
826826
currency: Currency.C2FLR,
@@ -1255,7 +1255,7 @@ export const networkMetadata = {
12551255
{
12561256
type: 'blockscout',
12571257
webUrl: 'https://sepolia-explorer.metisdevops.link',
1258-
apiUrl: 'https://sepolia-explorer-api.metisdevops.link/api/v2',
1258+
apiUrl: 'https://sepolia-explorer-api.metisdevops.link/api',
12591259
},
12601260
],
12611261
currency: Currency.sMETIS,
@@ -1267,7 +1267,7 @@ export const networkMetadata = {
12671267
{
12681268
type: 'blockscout',
12691269
webUrl: 'https://explorer.test.mezo.org',
1270-
apiUrl: 'https://api.explorer.test.mezo.org/api/v2/',
1270+
apiUrl: 'https://api.explorer.test.mezo.org/api',
12711271
},
12721272
],
12731273
currency: Currency.BTC,
@@ -1315,7 +1315,7 @@ export const networkMetadata = {
13151315
{
13161316
type: 'blockscout',
13171317
webUrl: 'https://explorer-holesky.morphl2.io',
1318-
apiUrl: 'https://explorer-api-holesky.morphl2.io/api/v2',
1318+
apiUrl: 'https://explorer-api-holesky.morphl2.io/api',
13191319
},
13201320
],
13211321
currency: Currency.ETH,
@@ -1685,7 +1685,7 @@ export const networkMetadata = {
16851685
{
16861686
type: 'blockscout',
16871687
webUrl: 'https://coston-explorer.flare.network',
1688-
apiUrl: 'https://coston-explorer.flare.network/api/v2',
1688+
apiUrl: 'https://coston-explorer.flare.network/api',
16891689
},
16901690
],
16911691
currency: Currency.CFLR,
@@ -1781,7 +1781,7 @@ export const networkMetadata = {
17811781
{
17821782
type: 'blockscout',
17831783
webUrl: 'https://explorer.hoodi.surge.wtf',
1784-
apiUrl: 'https://api.explorer.hoodi.surge.wtf/api/v2',
1784+
apiUrl: 'https://api.explorer.hoodi.surge.wtf/api',
17851785
},
17861786
],
17871787
currency: Currency.ETH,

libs/ts/onchain-interactions/src/scripts/cost-calculations.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ const fetchTransactionsForNetwork = async (
211211
let response: AxiosResponse<any>;
212212
let rawTransactions: any[] = [];
213213
if (networksV2Api.includes(network)) {
214-
response = await axios.get(`${apiUrl}/addresses/${address}/transactions`);
214+
response = await axios.get(
215+
`${apiUrl}/v2/addresses/${address}/transactions`,
216+
);
215217
rawTransactions = response.data.items || [];
216218
} else if (network === 'telos-testnet') {
217219
response = await axios.get(`${apiUrl}/address/${address}/transactions`);

0 commit comments

Comments
 (0)