Skip to content

Commit

Permalink
Merge pull request #7 from aurora-is-near/ycg/skip-access-key
Browse files Browse the repository at this point in the history
Ycg/skip access key
  • Loading branch information
yellowCrimsonGator authored Oct 25, 2024
2 parents cfd6a4f + 37a9667 commit bd2bb51
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 57 deletions.
4 changes: 2 additions & 2 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const cspHeader = `
form-action 'self';
worker-src 'self' blob:;
frame-ancestors 'self' *.walletconnect.com *.walletconnect.org;
connect-src 'self' d3hb14vkzrxvla.cloudfront.net beaconapi.helpscout.net chatapi.helpscout.net *.near.org *.ref-finance.com *.ref.finance *.aurora.dev api.web3modal.com *.walletconnect.org *.walletconnect.com *.sentry.io wss://relay.walletconnect.com wss://relay.walletconnect.org *.walletlink.org wss://www.walletlink.org *.coinbase.com https://rpc.testnet.near.org https://closerpc.aurora.dev https://api.web3modal.org www.googletagmanager.com *.google-analytics.com;
frame-src *.walletconnect.org *.walletconnect.com;
connect-src 'self' d3hb14vkzrxvla.cloudfront.net beaconapi.helpscout.net chatapi.helpscout.net *.near.org *.ref-finance.com *.ref.finance *.aurora.dev api.web3modal.com *.walletconnect.org *.walletconnect.com *.sentry.io wss://relay.walletconnect.com wss://relay.walletconnect.org *.walletlink.org wss://www.walletlink.org *.coinbase.com https://rpc.testnet.near.org https://closerpc.aurora.dev https://api.web3modal.org www.googletagmanager.com *.google-analytics.com https://h4n.app https://*.peersyst.tech;
frame-src *.walletconnect.org *.walletconnect.com https://my.herewallet.app https://*.peersyst.tech/;
`;

/** @type {import('next').NextConfig} */
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
"dependencies": {
"@headlessui/react": "2.1.1",
"@heroicons/react": "2.1.3",
"@near-wallet-selector/ethereum-wallets": "8.9.13",
"@near-wallet-selector/account-export": "8.9.13",
"@near-wallet-selector/core": "8.9.13",
"@near-wallet-selector/meteor-wallet": "8.9.13",
"@near-wallet-selector/modal-ui": "8.9.13",
"@near-wallet-selector/my-near-wallet": "8.9.13",
"@near-wallet-selector/wallet-connect": "8.9.13",
"@near-wallet-selector/wallet-utils": "8.9.13",
"@near-wallet-selector/ethereum-wallets": "8.9.14",
"@near-wallet-selector/account-export": "8.9.14",
"@near-wallet-selector/core": "8.9.14",
"@near-wallet-selector/here-wallet": "8.9.14",
"@near-wallet-selector/meteor-wallet": "8.9.14",
"@near-wallet-selector/modal-ui": "8.9.14",
"@near-wallet-selector/my-near-wallet": "8.9.14",
"@near-wallet-selector/wallet-connect": "8.9.14",
"@near-wallet-selector/wallet-utils": "8.9.14",
"@ref-finance/ref-sdk": "1.4.0",
"@sentry/nextjs": "8.9.2",
"@supabase/supabase-js": "2.43.4",
Expand Down
Binary file added public/img/wallets/here-wallet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/app/(index)/WalletsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const nearWallets = [
url: "https://mynearwallet.com",
imgUrl: "/img/wallets/mynearwallet.png",
},
{
name: "HERE wallet",
url: "https://www.herewallet.app",
imgUrl: "/img/wallets/here-wallet.png",
},
{
name: "Meteor",
url: "https://wallet.meteorwallet.app",
Expand Down
10 changes: 9 additions & 1 deletion src/contexts/WalletSelectorContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupEthereumWallets } from "@near-wallet-selector/ethereum-wallets";
import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
import { setupHereWallet } from "@near-wallet-selector/here-wallet";
import type { ReactNode } from "react";
import React, {
useCallback,
Expand Down Expand Up @@ -138,6 +139,7 @@ export const WalletSelectorContextProvider: React.FC<{
wagmiConfig,
web3Modal,
alwaysOnboardDuringSignIn: true,
skipSignInAccessKey: true,
}),
setupWalletConnect({
projectId: projectId,
Expand All @@ -151,9 +153,15 @@ export const WalletSelectorContextProvider: React.FC<{
],
}),
setupMeteorWallet(),
setupHereWallet(),
],
});
const _modal = setupModal(_selector, { contractId: "" });
// const _modal = setupModal(_selector, { contractId: "" });
// NOTE: We use an acces key to be compatible with all NEAR wallets,
// but skip the login access key when possible, for example skipSignInAccessKey with setupEthereumWallets.
const _modal = setupModal(_selector, {
contractId: IS_MAINNET ? "welcome-to.near" : "welcome-to-near.testnet",
});
const state = _selector.store.getState();
setAccounts(state.accounts);
setSelector(_selector);
Expand Down
Loading

0 comments on commit bd2bb51

Please sign in to comment.