diff --git a/src/Address.svelte b/src/Address.svelte
index f1a4c2410..a9847b30e 100644
--- a/src/Address.svelte
+++ b/src/Address.svelte
@@ -2,7 +2,7 @@
import { onMount } from 'svelte';
import { link } from 'svelte-routing';
import { ethers } from 'ethers';
- import { explorerLink } from '@app/utils';
+ import { explorerLink, safeLink } from '@app/utils';
import Blockies from '@app/Blockies.svelte';
import Loading from '@app/Loading.svelte';
import type { Config } from '@app/config';
@@ -53,12 +53,13 @@
{#if addressType === AddressType.Org}
{addressLabel}
org
+ {:else if addressType === AddressType.Safe}
+ {addressLabel}
+ safe
{:else}
{addressLabel}
{#if addressType === AddressType.Contract}
contract
- {:else if addressType === AddressType.Safe}
- safe
{:else if addressType === AddressType.EOA}
{:else}
diff --git a/src/config.json b/src/config.json
index 1f2b46d28..9bf0e4076 100644
--- a/src/config.json
+++ b/src/config.json
@@ -11,7 +11,8 @@
"address": "0x0000000000000000000000000000000000000000"
},
"safe": {
- "api": "https://safe-transaction.gnosis.io/api/v1"
+ "api": "https://safe-transaction.gnosis.io/api/v1",
+ "viewer": "https://gnosis-safe.io/app/#/safes"
}
},
"ropsten": {
@@ -30,7 +31,8 @@
"contractHash": "0xc5bd5bc3cbcb709540df530c5ad2a9d91463ebb891a789286872938d963c12e9"
},
"safe": {
- "api": null
+ "api": null,
+ "viewer": null
}
},
"rinkeby": {
@@ -49,7 +51,8 @@
"contractHash": "0xc5bd5bc3cbcb709540df530c5ad2a9d91463ebb891a789286872938d963c12e9"
},
"safe": {
- "api": "https://safe-transaction.rinkeby.gnosis.io/api/v1"
+ "api": "https://safe-transaction.rinkeby.gnosis.io/api/v1",
+ "viewer": "https://rinkeby.gnosis-safe.io/app/#/safes"
}
},
"seed": {
diff --git a/src/config.ts b/src/config.ts
index 6ea40a291..7d0d4362f 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -25,7 +25,7 @@ export class Config {
provider: ethers.providers.JsonRpcProvider;
signer: ethers.Signer & TypedDataSigner | null;
seed: { url: string };
- safe: { api: string | null };
+ safe: { api: string | null, viewer: string | null };
constructor(
network: { name: string, chainId: number },
diff --git a/src/utils.ts b/src/utils.ts
index c0a917887..eef3ad7a1 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -81,6 +81,14 @@ export function explorerLink(addr: string, config: Config): string {
return `https://etherscan.io/address/${addr}`;
}
+// Get the Gnosis Safe link of an address, eg. Etherscan.
+export function safeLink(addr: string, config: Config): string {
+ if (config.safe.viewer) {
+ return `${config.safe.viewer}/${addr}`;
+ }
+ return explorerLink(addr, config);
+}
+
// Query a subgraph.
export async function querySubgraph(
query: string,