Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PR build

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

concurrency:
group: pr-build-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Test
run: pnpm test

- name: Build
env:
NEXT_PUBLIC_SNOWBRIDGE_ENV: polkadot_mainnet
NEXT_PUBLIC_GRAPHQL_API_URL: https://snowbridge.squids.live/snowbridge-subsquid-polkadot@v1/api/graphql
NEXT_PUBLIC_ALCHEMY_KEY: pr-build
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: pr-build
NEXT_PUBLIC_POSTHOG_HOST: https://us.i.posthog.com
NEXT_PUBLIC_SERVICE_FEE_RECIPIENT: "0x0000000000000000000000000000000000000000"
NEXT_PUBLIC_SERVICE_FEE_DOT: "0"
NEXT_PUBLIC_SERVICE_FEE_KSM: "0"
run: pnpm build
2 changes: 2 additions & 0 deletions app/activity/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ const getExplorerLinks = (
registry.environment,
(source as ParachainLocation).key,
tx.submitted.transactionHash,
tx.submitted.blockNumber,
),
});
links.push({
Expand All @@ -171,6 +172,7 @@ const getExplorerLinks = (
registry.environment,
(source as ParachainLocation).key,
tx.submitted.extrinsic_hash,
tx.submitted.block_num,
),
});
if (tx.bridgeHubXcmDelivered) {
Expand Down
1 change: 1 addition & 0 deletions app/localtxcomplete/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function TxCard(props: TxCardProps) {
registry.environment,
(source as ParachainLocation).key,
transfer.submitted.extrinsic_hash,
transfer.submitted.block_num,
),
});
if (transfer.destinationReceived) {
Expand Down
11 changes: 10 additions & 1 deletion lib/explorerLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const EXPLORERS: { [env: string]: { [explorer: string]: string } } = {
subscan_polkadot_2004: "https://moonbeam.subscan.io/",
subscan_polkadot_2030: "https://bifrost.subscan.io/",
subscan_polkadot_3369: "https://mythos.subscan.io/",
subscan_polkadot_3397:
"https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.jamton.network#/explorer/query/",
subscan_polkadot_2043: "https://neuroweb.subscan.io/",
subscan_polkadot_2086: "https://spiritnet.subscan.io/",
subscan_relaychain: "https://polkadot.subscan.io/",
Expand Down Expand Up @@ -90,11 +92,15 @@ export const subscanExtrinsicLink = (
envName: string,
para: ChainKey<ParachainKind> | "relaychain",
extrinsicIndex: string,
block?: number,
): string => {
const baseUrl = EXPLORERS[envName][`subscan_${para}`];
if (!baseUrl) {
return `#no-explorer-url-for-extrinsic-${para}`;
}
if (para === "polkadot_3397") {
return `${baseUrl}${block ?? extrinsicIndex.split("-")[0]}`;
}
const slash = baseUrl.endsWith("/") ? "" : "/";
return `${baseUrl}${slash}extrinsic/${extrinsicIndex}`;
};
Expand All @@ -108,8 +114,11 @@ export const subscanEventLink = (
if (!baseUrl) {
return `#no-explorer-url-for-event-${para}`;
}
const block = eventIndex.split("-")[0];
const slash = baseUrl.endsWith("/") ? "" : "/";
const block = eventIndex.split("-")[0];
if (para === "polkadot_3397") {
return `${baseUrl}${block}`;
}
return `${baseUrl}${slash}block/${block}?event=${eventIndex}&tab=event`;
};

Expand Down
Loading