Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/knip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install pnpm
run: corepack enable pnpm
run: npm i -g --force corepack && corepack enable pnpm

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: sudo apt-get install -y libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++

- name: Install pnpm
run: corepack enable pnpm
run: npm i -g --force corepack && corepack enable pnpm

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install pnpm
run: corepack enable pnpm
run: npm i -g --force corepack && corepack enable pnpm

- name: Install Node.js
uses: actions/setup-node@v3
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install pnpm
run: corepack enable pnpm
run: npm i -g --force corepack && corepack enable pnpm

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install pnpm
run: corepack enable pnpm
run: npm i -g --force corepack && corepack enable pnpm

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install pnpm
run: corepack enable pnpm
run: npm i -g --force corepack && corepack enable pnpm

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
- run: ./scripts/check-chrome.sh

- name: Install pnpm
run: corepack enable pnpm
run: npm i -g --force corepack && corepack enable pnpm

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down
12 changes: 6 additions & 6 deletions e2e/specs/stateless/extendNames.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ test('should be able to extend a single unwrapped name from profile', async ({

await test.step('should show correct fiat values', async () => {
await extendNamesModal.getCurrencyToggle.click({ force: true })
await expect(extendNamesModal.getInvoiceExtensionFee).toContainText('$10.00')
await expect(extendNamesModal.getInvoiceTransactionFee).toContainText('$0.13')
await expect(extendNamesModal.getInvoiceTotal).toContainText('$10.13')
await expect(extendNamesModal.getInvoiceExtensionFee).toContainText('$10.0')
await expect(extendNamesModal.getInvoiceTransactionFee).toContainText('$0.1')
await expect(extendNamesModal.getInvoiceTotal).toContainText('$10.1')
await extendNamesModal.getCounterMinusButton.click()
await expect(extendNamesModal.getInvoiceExtensionFee).toContainText('$5.00')
await expect(extendNamesModal.getInvoiceTransactionFee).toContainText('$0.13')
await expect(extendNamesModal.getInvoiceTotal).toContainText('$5.13')
await expect(extendNamesModal.getInvoiceExtensionFee).toContainText('$5.0')
await expect(extendNamesModal.getInvoiceTransactionFee).toContainText('$0.1')
await expect(extendNamesModal.getInvoiceTotal).toContainText('$5.1')
})

await test.step('should extend', async () => {
Expand Down
34 changes: 34 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,40 @@ const nextConfig = {
images: {
domains: ['metadata.ens.domains'],
},
// async headers() {
// // keep this in case we need to debug Safe in the future
// if (process.env.NODE_ENV === 'development') {
// return [
// {
// source: '/manifest.json',
// headers: [
// {
// key: 'Access-Control-Allow-Origin',
// value: '*',
// },
// {
// key: 'Access-Control-Allow-Methods',
// value: 'GET, OPTIONS',
// },
// {
// key: 'Access-Control-Allow-Headers',
// value: 'X-Requested-With, content-type, Authorization',
// },
// ],
// },
// {
// source: '/(.*)',
// headers: [
// {
// key: 'Content-Security-Policy',
// value: "frame-ancestors 'self' https://app.safe.global;",
// },
// ],
// },
// ]
// }
// return []
// },
async rewrites() {
return [
{
Expand Down
3 changes: 2 additions & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
],
"theme_color": "#5298FF",
"background_color": "#F6F6F6",
"display": "standalone"
"display": "standalone",
"description": "Decentralised naming for wallets, websites, & more"
}
57 changes: 33 additions & 24 deletions src/utils/getDefaultWallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,46 @@ import {
walletConnectWallet,
} from '@rainbow-me/rainbowkit/wallets'

import { isInsideSafe } from './safe'

export const getDefaultWallets = ({
appName,
projectId,
}: {
appName: string
projectId: string
}) => {
const wallets: WalletList = [
{
groupName: 'Popular',
wallets: [
// injected / not always shown
injectedWallet,
safeWallet,
braveWallet,
() => ({
...phantomWallet(),
iconUrl: async () => (await import('../assets/PhantomWallet')).default,
iconBackground: '#9A8AEE',
downloadUrls: {},
}),
// always shown
walletConnectWallet,
rainbowWallet,
coinbaseWallet,
metaMaskWallet,
ledgerWallet,
argentWallet,
],
},
]
const wallets: WalletList = isInsideSafe()
? [
{
groupName: 'Popular',
wallets: [safeWallet],
},
]
: [
{
groupName: 'Popular',
wallets: [
// injected / not always shown
injectedWallet,
safeWallet,
braveWallet,
() => ({
...phantomWallet(),
iconUrl: async () => (await import('../assets/PhantomWallet')).default,
iconBackground: '#9A8AEE',
downloadUrls: {},
}),
// always shown
walletConnectWallet,
rainbowWallet,
coinbaseWallet,
metaMaskWallet,
ledgerWallet,
argentWallet,
],
},
]

return connectorsForWallets(wallets, {
appName,
Expand Down
3 changes: 2 additions & 1 deletion src/utils/query/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {

import { WC_PROJECT_ID } from '../constants'
import { getDefaultWallets } from '../getDefaultWallets'
import { isInsideSafe } from '../safe'

const isLocalProvider = !!process.env.NEXT_PUBLIC_PROVIDER

Expand Down Expand Up @@ -107,7 +108,7 @@ const transports = {
const wagmiConfig_ = createConfig({
connectors,
ssr: true,
multiInjectedProviderDiscovery: true,
multiInjectedProviderDiscovery: !isInsideSafe(),
storage: createStorage({ storage: localStorageWithInvertMiddleware(), key: prefix }),
chains,
client: ({ chain }) => {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/safe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,5 @@ export const fetchTxFromSafeTxHash = async ({
transactionHash: data.txHash,
}
}

export const isInsideSafe = () => typeof window !== 'undefined' && window !== window.parent