Skip to content

Commit

Permalink
feat: Add skipSignInAccessKey for onboarding apps.
Browse files Browse the repository at this point in the history
  • Loading branch information
paouvrard committed Oct 2, 2024
1 parent e813ad0 commit 74374e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/ethereum-wallets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Project ID is required, please obtain it from [walletconnect.com](https://wallet
- `iconUrl` (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/ethereum-wallets-icon.png`.
- `wagmiCore` (`typeof import("@wagmi/core")?`): Optional, @wagmi/core functions can be overidden by the App to interract with the wallet.
- `alwaysOnboardDuringSignIn` (`boolean?`): Apps without SignIn access key will not onboard the relayer by default, this option does the relayer onboarding during login.
- `skipSignInAccessKey` (`boolean?`): Allows connecting Ethereum wallets without adding a Limited Access Key which would require owning NEAR to execute the transaction (for rainbowbridge.app and welcome.near.org).
- `nearNodeUrl` (`string?`): NEAR node url to query the NEAR transaction status and onboarding access key.

Developent options (before the NEAR protocol upgrade to support 0x accounts natively):
Expand Down
4 changes: 3 additions & 1 deletion packages/ethereum-wallets/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface EthereumWalletsParams {
devModeAccount?: string;
deprecated?: boolean;
nearNodeUrl?: string;
skipSignInAccessKey?: boolean;
}

interface EthereumWalletsState {
Expand Down Expand Up @@ -105,6 +106,7 @@ const EthereumWallets: WalletBehaviourFactory<
devMode,
devModeAccount = "eth-wallet.testnet",
nearNodeUrl,
skipSignInAccessKey,
},
}) => {
if (!wagmiCore) {
Expand Down Expand Up @@ -848,7 +850,7 @@ const EthereumWallets: WalletBehaviourFactory<
// Login with FunctionCall access key, reuse keypair or create a new one.
const accountId = devMode ? address + "." + devModeAccount : address;
let publicKey;
if (contractId) {
if (contractId && !skipSignInAccessKey) {
const keyPair = await _state.keystore.getKey(
options.network.networkId,
accountId
Expand Down

0 comments on commit 74374e5

Please sign in to comment.