Skip to content

Commit

Permalink
fix: custom safe url for core
Browse files Browse the repository at this point in the history
Signed-off-by: Reinis Martinsons <[email protected]>
  • Loading branch information
Reinis-FRP committed Feb 20, 2024
1 parent bad0a2e commit ff3ff3e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
18 changes: 16 additions & 2 deletions src/plugins/oSnap/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,8 @@ export const EXPLORER_API_URLS = {
'246': 'https://explorer.energyweb.org/api',
'137': 'https://api.polygonscan.com/api',
'56': 'https://api.bscscan.com/api',
'42161': 'https://api.arbiscan.io/api'
'42161': 'https://api.arbiscan.io/api',
// '1116': Add 'https://openapi.coredao.org/api' if API key requirement is removed
} as const;

export const GNOSIS_SAFE_TRANSACTION_API_URLS = {
Expand All @@ -1116,7 +1117,20 @@ export const GNOSIS_SAFE_TRANSACTION_API_URLS = {
'246': 'https://safe-transaction-ewc.safe.global/api',
'137': 'https://safe-transaction-polygon.safe.global/api',
'56': 'https://safe-transaction-bsc.safe.global/api',
'42161': 'https://safe-transaction-arbitrum.safe.global/api'
'42161': 'https://safe-transaction-arbitrum.safe.global/api',
// '1116': Add when public tx service is available for Core
} as const;

export const SAFE_APP_URLS = {
'1': 'https://app.safe.global/apps/open',
'5': 'https://app.safe.global/apps/open',
'100': 'https://app.safe.global/apps/open',
'73799': 'https://app.safe.global/apps/open',
'246': 'https://app.safe.global/apps/open',
'137': 'https://app.safe.global/apps/open',
'56': 'https://app.safe.global/apps/open',
'42161': 'https://app.safe.global/apps/open',
'1116': 'https://safe.coredao.org/apps/open'
} as const;

// ABIs
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/oSnap/utils/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
GNOSIS_SAFE_TRANSACTION_API_URLS,
OPTIMISTIC_GOVERNOR_ABI,
OPTIMISTIC_ORACLE_V3_ABI,
SAFE_APP_URLS,
contractData,
safePrefixes,
solidityZeroHexString
Expand Down Expand Up @@ -247,9 +248,9 @@ export function makeConfigureOsnapUrl(params: {
network,
spaceName,
spaceUrl,
baseUrl = 'https://app.safe.global/apps/open',
appUrl = 'https://osnap.uma.xyz/'
} = params;
const baseUrl = params.baseUrl ?? SAFE_APP_URLS[network] ?? 'https://app.safe.global/apps/open';
const safeAddressPrefix = getSafeNetworkPrefix(network);
const appUrlSearchParams = new URLSearchParams();
appUrlSearchParams.set('spaceName', spaceName);
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/safeSnap/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export const EXPLORER_API_URLS = {
'246': 'https://explorer.energyweb.org/api',
'137': 'https://api.polygonscan.com/api',
'56': 'https://api.bscscan.com/api',
'42161': 'https://api.arbiscan.io/api'
'42161': 'https://api.arbiscan.io/api',
// '1116': Add 'https://openapi.coredao.org/api' if API key requirement is removed
};

export const GNOSIS_SAFE_TRANSACTION_API_URLS = {
Expand All @@ -41,7 +42,8 @@ export const GNOSIS_SAFE_TRANSACTION_API_URLS = {
'246': 'https://safe-transaction-ewc.safe.global/api',
'137': 'https://safe-transaction-polygon.safe.global/api',
'56': 'https://safe-transaction-bsc.safe.global/api',
'42161': 'https://safe-transaction-arbitrum.safe.global/api'
'42161': 'https://safe-transaction-arbitrum.safe.global/api',
// '1116': // Add when public tx service is available for Core
};

// ABIs
Expand Down

0 comments on commit ff3ff3e

Please sign in to comment.