Skip to content

Commit

Permalink
Merge pull request #189 from palladians/fix/pending-transaction-urls
Browse files Browse the repository at this point in the history
fix(txs): fix pending transactions urls in tx list
  • Loading branch information
mrcnk authored Aug 6, 2024
2 parents 0ce65dc + 367d982 commit 997f6c6
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion apps/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@palladxyz/extension",
"version": "0.6.0",
"version": "0.6.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion packages/features/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@palladxyz/features",
"version": "0.6.0",
"version": "0.6.1",
"description": "",
"type": "module",
"module": "dist/index.js",
Expand Down
18 changes: 13 additions & 5 deletions packages/features/src/error-renderer/views/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ export const ErrorView = ({ error, resetErrorBoundary }: FallbackProps) => {
}
return (
<div className="flex flex-1 flex-col justify-center items-center min-h-screen w-full p-8">
<div className="card bg-secondary w-full">
<div className="card-body gap-4 p-4">
<h1 className="card-title">Woops</h1>
<p>An error happened.</p>
<div className="card flex flex-col flex-1 bg-secondary w-full">
<div className="card-body flex-1 flex flex-col gap-4 p-4">
<h1 className="text-xl">Woops</h1>
<p className="flex-[0] text-gray-400">An error happened.</p>
<a
href="https://get.pallad.co/status"
target="_blank"
rel="noopener noreferrer"
className="underline"
>
Check services status.
</a>
<textarea
className="textarea textarea-bordered rounded-xl resize-none h-64"
className="textarea textarea-bordered rounded-xl resize-none flex-1"
value={stringifiedError}
readOnly
/>
Expand Down
4 changes: 2 additions & 2 deletions packages/features/src/transactions/routes/transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ export const TransactionsRoute = () => {
.filter((hash) => !transactions?.map((tx) => tx.hash).includes(hash)),
)
const openPendingTransactions = () => {
const url = currentNetworkInfo.explorer.accountUrl.replace(
const url = currentNetworkInfo.explorer.pendingTransactionsUrl.replace(
"{publicKey}",
publicKey,
)
window.open(`${url}/txs`, "_blank")?.focus()
window.open(url, "_blank")?.focus()
}
// biome-ignore lint: only run on first render
useEffect(() => {
Expand Down
1 change: 1 addition & 0 deletions packages/providers/src/unified-providers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type ProviderConfig = {
explorer: {
transactionUrl: string
accountUrl: string
pendingTransactionsUrl: string
}
networkName: string
networkType: "testnet" | "mainnet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe.skip("Unified Chain History Provider (Functional)", () => {
explorer: {
accountUrl: "",
transactionUrl: "",
pendingTransactionsUrl: "",
},
networkName: "Devnet",
chainId: "...",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe("Unified Chain provider", () => {
explorer: {
accountUrl: "",
transactionUrl: "",
pendingTransactionsUrl: "",
},
networkName: "Devnet",
chainId: "...",
Expand Down
29 changes: 9 additions & 20 deletions packages/vault/src/network-info/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ export const DEFAULT_NETWORK_INFO: Record<NetworkName, ProviderConfig> = {
explorer: {
transactionUrl: "https://minascan.io/devnet/tx/{hash}/txInfo",
accountUrl: "https://minascan.io/devnet/account/{publicKey}",
pendingTransactionsUrl:
"https://minascan.io/devnet/txs/pending-txs?search={publicKey}",
},
networkName: "Devnet",
networkType: "testnet",
chainId: "...", // todo: fetch chainId from a provider
chainId: "",
},
Mainnet: {
nodeEndpoint: {
Expand All @@ -40,10 +42,12 @@ export const DEFAULT_NETWORK_INFO: Record<NetworkName, ProviderConfig> = {
explorer: {
transactionUrl: "https://minascan.io/mainnet/tx/{hash}/txInfo",
accountUrl: "https://minascan.io/mainnet/account/{publicKey}",
pendingTransactionsUrl:
"https://minascan.io/mainnet/txs/pending-txs?search={publicKey}",
},
networkName: "Mainnet",
networkType: "mainnet",
chainId: "...", // todo: fetch chainId from a provider
chainId: "",
},
ZekoDevNet: {
nodeEndpoint: {
Expand All @@ -57,26 +61,11 @@ export const DEFAULT_NETWORK_INFO: Record<NetworkName, ProviderConfig> = {
explorer: {
transactionUrl: "https://zekoscan.io/devnet/tx/{hash}/txInfo",
accountUrl: "https://zekoscan.io/devnet/account/{publicKey}",
pendingTransactionsUrl:
"https://zekoscan.io/devnet/txs/user-txs?search={publicKey}",
},
networkName: "ZekoDevNet",
networkType: "testnet",
chainId: "...", // todo: fetch chainId from a provider
},
OptimismSepolia: {
nodeEndpoint: {
providerName: "evm-rpc",
url: "wss://optimism-sepolia-rpc.publicnode.com",
},
archiveNodeEndpoint: {
providerName: "evm-explorer",
url: "https://api-sepolia-optimism.etherscan.io/",
},
explorer: {
transactionUrl: "",
accountUrl: "",
},
networkName: "OptimismSepolia",
networkType: "testnet",
chainId: "...", // todo: fetch chainId from a provider
chainId: "",
},
}
3 changes: 3 additions & 0 deletions packages/vault/test/network-info/network-info-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe("CredentialStore", () => {
explorer: {
accountUrl: "",
transactionUrl: "",
pendingTransactionsUrl: "",
},
networkName: networkNameMainnet,
networkType: networkType,
Expand All @@ -50,6 +51,7 @@ describe("CredentialStore", () => {
explorer: {
accountUrl: "",
transactionUrl: "",
pendingTransactionsUrl: "",
},
networkName: networkNameDevnet,
networkType: networkType,
Expand All @@ -67,6 +69,7 @@ describe("CredentialStore", () => {
explorer: {
accountUrl: "",
transactionUrl: "",
pendingTransactionsUrl: "",
},
networkName: networkNameRopsten,
networkType: networkType,
Expand Down

0 comments on commit 997f6c6

Please sign in to comment.