Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/update examples #1305

Merged
merged 19 commits into from
Mar 7, 2025
Merged
Changes from 3 commits
Commits
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
Original file line number Diff line number Diff line change
@@ -27,9 +27,10 @@ import { setupMintbaseWallet } from "@near-wallet-selector/mintbase-wallet";
import { setupBitteWallet } from "@near-wallet-selector/bitte-wallet";
import { setupOKXWallet } from "@near-wallet-selector/okx-wallet";
import { setupEthereumWallets } from "@near-wallet-selector/ethereum-wallets";
import { createWeb3Modal } from "@web3modal/wagmi";
import { reconnect, http, createConfig, type Config } from "@wagmi/core";
import { type Chain } from "@wagmi/core/chains";
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";
import { createAppKit } from "@reown/appkit/react";
import { defineChain } from "@reown/appkit/networks";
import type { CreateConnectorFn } from "@wagmi/core";
import { injected, walletConnect } from "@wagmi/connectors";
import { CONTRACT_ID } from "../../../constants";

@@ -40,11 +41,13 @@ declare global {
}
}

// Get a project ID at https://cloud.walletconnect.com
// Get a project ID at https://cloud.reown.com
const projectId = "30147604c5f01d0bc4482ab0665b5697";

const near: Chain = {
const near = defineChain({
id: 398,
caipNetworkId: "eip155:398",
chainNamespace: "eip155",
name: "NEAR Protocol Testnet",
nativeCurrency: {
decimals: 18,
@@ -62,33 +65,42 @@ const near: Chain = {
},
},
testnet: true,
};
});

const wagmiConfig: Config = createConfig({
chains: [near],
transports: {
[near.id]: http(),
},
connectors: [
walletConnect({
projectId,
metadata: {
name: "NEAR Guest Book",
description: "A guest book with comments stored on the NEAR blockchain",
url: "https://near.github.io/wallet-selector",
icons: ["https://near.github.io/wallet-selector/favicon.ico"],
},
showQrModal: false,
}),
injected({ shimDisconnect: true }),
],
const connectors: Array<CreateConnectorFn> = [
walletConnect({
projectId,
metadata: {
name: "NEAR Guest Book",
description: "A guest book with comments stored on the NEAR blockchain",
url: "https://near.github.io/wallet-selector",
icons: ["https://near.github.io/wallet-selector/favicon.ico"],
},
showQrModal: false, // showQrModal must be false
}),
injected({ shimDisconnect: true }),
];

const wagmiAdapter = new WagmiAdapter({
projectId,
connectors,
networks: [near],
});
reconnect(wagmiConfig);

const web3Modal = createWeb3Modal({
wagmiConfig: wagmiConfig,
const web3Modal = createAppKit({
adapters: [wagmiAdapter],
projectId,
enableOnramp: false,
networks: [near],
defaultNetwork: near,
enableWalletConnect: true,
features: {
analytics: true,
swaps: false,
onramp: false,
email: false, // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
socials: false, // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
},
coinbasePreference: "eoaOnly", // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
allWallets: "SHOW",
});

@@ -156,7 +168,10 @@ export class WalletSelectorComponent implements OnInit {
setupNearMobileWallet(),
setupMintbaseWallet({ contractId: CONTRACT_ID }),
setupBitteWallet({ contractId: CONTRACT_ID }),
setupEthereumWallets({ wagmiConfig, web3Modal }),
setupEthereumWallets({
wagmiConfig: wagmiAdapter.wagmiConfig,
web3Modal,
}),
],
});

4 changes: 2 additions & 2 deletions examples/react/components/Content.tsx
Original file line number Diff line number Diff line change
@@ -338,7 +338,7 @@ const Content: React.FC = () => {
</div>
<div style={{ marginTop: 30 }}>
{/* @ts-ignore */}
<w3m-button label="Log in with Ethereum" />
<appkit-button label="Log in with Ethereum" />
</div>
<SignIn />
</Fragment>
@@ -358,7 +358,7 @@ const Content: React.FC = () => {
{isEthereumWallet && (
<div style={{ marginTop: 30 }}>
{/* @ts-ignore */}
<w3m-button label="Log in with Ethereum" />
<appkit-button label="Log in with Ethereum" />
</div>
)}
<Form
283 changes: 283 additions & 0 deletions examples/react/contexts/WalletSelectorContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
import { setupCoin98Wallet } from "@near-wallet-selector/coin98-wallet";
import type {
AccountState,
InjectedWalletBehaviour,
WalletSelector,
} from "@near-wallet-selector/core";
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupHereWallet } from "@near-wallet-selector/here-wallet";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
import { setupNarwallets } from "@near-wallet-selector/narwallets";
import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui";
import { setupModal } from "@near-wallet-selector/modal-ui";
import { setupNearFi } from "@near-wallet-selector/nearfi";
import { setupNightly } from "@near-wallet-selector/nightly";
import { setupSender } from "@near-wallet-selector/sender";
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupWelldoneWallet } from "@near-wallet-selector/welldone-wallet";
import { setupNearSnap } from "@near-wallet-selector/near-snap";
import { setupNeth } from "@near-wallet-selector/neth";
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupLedger } from "@near-wallet-selector/ledger";
import { setupXDEFI } from "@near-wallet-selector/xdefi";
import { setupRamperWallet } from "@near-wallet-selector/ramper-wallet";
import { setupNearMobileWallet } from "@near-wallet-selector/near-mobile-wallet";
import { setupMintbaseWallet } from "@near-wallet-selector/mintbase-wallet";
import { setupBitteWallet } from "@near-wallet-selector/bitte-wallet";
import { setupOKXWallet } from "@near-wallet-selector/okx-wallet";
import { setupEthereumWallets } from "@near-wallet-selector/ethereum-wallets";

import type { ReactNode } from "react";
import React, {
useCallback,
useContext,
useEffect,
useState,
useMemo,
} from "react";
import { distinctUntilChanged, map } from "rxjs";
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";
import { createAppKit } from "@reown/appkit/react";
import { defineChain } from "@reown/appkit/networks";
import type { CreateConnectorFn, GetAccountReturnType } from "@wagmi/core";
import { reconnect, watchAccount } from "@wagmi/core";
import { injected, walletConnect } from "@wagmi/connectors";

import { Loading } from "../components/Loading";
import { CONTRACT_ID } from "../constants";

declare global {
interface Window {
selector: WalletSelector;
modal: WalletSelectorModal;
}
}

interface WalletSelectorContextValue {
selector: WalletSelector;
modal: WalletSelectorModal;
accounts: Array<AccountState>;
accountId: string | null;
}

const WalletSelectorContext =
React.createContext<WalletSelectorContextValue | null>(null);

// Get a project ID at https://cloud.reown.com
const projectId = "30147604c5f01d0bc4482ab0665b5697";

const near = defineChain({
id: 398,
caipNetworkId: "eip155:398",
chainNamespace: "eip155",
name: "NEAR Protocol Testnet",
nativeCurrency: {
decimals: 18,
name: "NEAR",
symbol: "NEAR",
},
rpcUrls: {
default: { http: ["https://eth-rpc.testnet.near.org"] },
public: { http: ["https://eth-rpc.testnet.near.org"] },
},
blockExplorers: {
default: {
name: "NEAR Explorer",
url: "https://eth-explorer-testnet.near.org",
},
},
testnet: true,
});

const connectors: Array<CreateConnectorFn> = [
walletConnect({
projectId,
metadata: {
name: "NEAR Guest Book",
description: "A guest book with comments stored on the NEAR blockchain",
url: "https://near.github.io/wallet-selector",
icons: ["https://near.github.io/wallet-selector/favicon.ico"],
},
showQrModal: false, // showQrModal must be false
}),
injected({ shimDisconnect: true }),
];

const wagmiAdapter = new WagmiAdapter({
projectId,
connectors,
networks: [near],
});
reconnect(wagmiAdapter.wagmiConfig);

const web3Modal = createAppKit({
adapters: [wagmiAdapter],
projectId,
networks: [near],
defaultNetwork: near,
enableWalletConnect: true,
features: {
analytics: true,
swaps: false,
onramp: false,
email: false, // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
socials: false, // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
},
coinbasePreference: "eoaOnly", // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
allWallets: "SHOW",
});

export const WalletSelectorContextProvider: React.FC<{
children: ReactNode;
}> = ({ children }) => {
const [selector, setSelector] = useState<WalletSelector | null>(null);
const [modal, setModal] = useState<WalletSelectorModal | null>(null);
const [accounts, setAccounts] = useState<Array<AccountState>>([]);
const [loading, setLoading] = useState<boolean>(true);

// Log in with Ethereum flow: auto connect to ethereum-wallets without showing the NEAR modal.
useEffect(() => {
if (!selector) {
return;
}
// Watch the connected Ethereum account and connect to the `ethereum-wallets` module automatically.
watchAccount(wagmiAdapter.wagmiConfig, {
onChange: (data: GetAccountReturnType) => {
if (!data.address || selector.store.getState().selectedWalletId) {
return;
}
selector.wallet("ethereum-wallets").then((wallet) =>
(wallet as InjectedWalletBehaviour).signIn({
contractId: CONTRACT_ID,
})
);
},
});
}, [selector]);

const init = useCallback(async () => {
const _selector = await setupWalletSelector({
network: "testnet",
debug: true,
modules: [
setupMyNearWallet(),
setupLedger(),
setupSender(),
setupBitgetWallet(),
setupMathWallet(),
setupNightly(),
setupMeteorWallet(),
setupNearSnap(),
setupOKXWallet(),
setupNarwallets(),
setupWelldoneWallet(),
setupHereWallet(),
setupCoin98Wallet(),
setupNearFi(),
setupRamperWallet(),
setupNeth({
gas: "300000000000000",
bundle: false,
}),
setupXDEFI(),
setupWalletConnect({
projectId: "c4f79cc...",
metadata: {
name: "NEAR Wallet Selector",
description: "Example dApp used by NEAR Wallet Selector",
url: "https://github.com/near/wallet-selector",
icons: ["https://avatars.githubusercontent.com/u/37784886"],
},
}),
setupNearMobileWallet(),
setupMintbaseWallet({ contractId: CONTRACT_ID }),
setupBitteWallet({ contractId: CONTRACT_ID }),
setupEthereumWallets({
wagmiConfig: wagmiAdapter.wagmiConfig,
web3Modal,
}),
],
});
const _modal = setupModal(_selector, {
contractId: CONTRACT_ID,
});
const state = _selector.store.getState();
setAccounts(state.accounts);

// this is added for debugging purpose only
// for more information (https://github.com/near/wallet-selector/pull/764#issuecomment-1498073367)
window.selector = _selector;
window.modal = _modal;

setSelector(_selector);
setModal(_modal);
setLoading(false);
}, []);

useEffect(() => {
init().catch((err) => {
console.error(err);
alert("Failed to initialise wallet selector");
});
}, [init]);

useEffect(() => {
if (!selector) {
return;
}

const subscription = selector.store.observable
.pipe(
map((state) => state.accounts),
distinctUntilChanged()
)
.subscribe((nextAccounts) => {
console.log("Accounts Update", nextAccounts);

setAccounts(nextAccounts);
});

const onHideSubscription = modal!.on("onHide", ({ hideReason }) => {
console.log(`The reason for hiding the modal ${hideReason}`);
});

return () => {
subscription.unsubscribe();
onHideSubscription.remove();
};
}, [selector, modal]);

const walletSelectorContextValue = useMemo<WalletSelectorContextValue>(
() => ({
selector: selector!,
modal: modal!,
accounts,
accountId: accounts.find((account) => account.active)?.accountId || null,
}),
[selector, modal, accounts]
);

if (loading) {
return <Loading />;
}

return (
<WalletSelectorContext.Provider value={walletSelectorContextValue}>
{children}
</WalletSelectorContext.Provider>
);
};

export function useWalletSelector() {
const context = useContext(WalletSelectorContext);

if (!context) {
throw new Error(
"useWalletSelector must be used within a WalletSelectorContextProvider"
);
}

return context;
}
4 changes: 2 additions & 2 deletions examples/vanilla/src/near-wallet.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ import { setupHereWallet } from '@near-wallet-selector/here-wallet';
import { setupNearMobileWallet } from '@near-wallet-selector/near-mobile-wallet';
import { setupWelldoneWallet } from '@near-wallet-selector/welldone-wallet';

import { wagmiConfig, web3Modal } from './web3modal';
import { wagmiAdapter, web3Modal } from './web3modal';


const THIRTY_TGAS = '30000000000000';
@@ -54,7 +54,7 @@ export class Wallet {
network: this.networkId,
modules: [
setupMeteorWallet(),
setupEthereumWallets({ wagmiConfig, web3Modal, alwaysOnboardDuringSignIn: true }),
setupEthereumWallets({ wagmiConfig: wagmiAdapter.wagmiConfig, web3Modal }),
setupLedger(),
setupBitteWallet(),
setupHereWallet(),
82 changes: 36 additions & 46 deletions examples/vanilla/src/web3modal.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,46 @@
import { createWeb3Modal } from "@web3modal/wagmi";

import { reconnect, http, createConfig } from "@wagmi/core";
import { createAppKit } from "@reown/appkit/react";
import { reconnect } from "@wagmi/core";
import { injected, walletConnect } from "@wagmi/connectors";
import { nearTestnet } from "@reown/appkit/networks";
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";

// Get a project ID at https://cloud.walletconnect.com
const projectId = "30147604c5f01d0bc4482ab0665b5697";

const near = {
id: 398,
name: "NEAR Protocol Testnet",
nativeCurrency: {
decimals: 18,
name: "NEAR",
symbol: "NEAR",
},
rpcUrls: {
default: { http: ["https://eth-rpc.testnet.near.org"] },
public: { http: ["https://eth-rpc.testnet.near.org"] },
},
blockExplorers: {
default: {
name: "NEAR Explorer",
url: "https://eth-explorer-testnet.near.org",
const connectors = [
walletConnect({
projectId,
metadata: {
name: "NEAR Guest Book",
description: "A guest book with comments stored on the NEAR blockchain",
url: "https://near.github.io/wallet-selector",
icons: ["https://near.github.io/wallet-selector/favicon.ico"],
},
},
testnet: true,
};
showQrModal: false, // showQrModal must be false
}),
injected({ shimDisconnect: true }),
];

export const wagmiConfig = createConfig({
chains: [near],
transports: {
[near.id]: http(),
},
connectors: [
walletConnect({
projectId,
metadata: {
name: "NEAR Guest Book",
description: "A guest book with comments stored on the NEAR blockchain",
url: "https://near.github.io/wallet-selector",
icons: ["https://near.github.io/wallet-selector/favicon.ico"],
},
showQrModal: false,
}),
injected({ shimDisconnect: true }),
],
export const wagmiAdapter = new WagmiAdapter({
projectId,
connectors,
networks: [nearTestnet],
});
reconnect(wagmiConfig);

export const web3Modal = createWeb3Modal({
wagmiConfig: wagmiConfig,
reconnect(wagmiAdapter.wagmiConfig);

export const web3Modal = createAppKit({
adapters: [wagmiAdapter],
projectId,
enableOnramp: false,
allWallets: "SHOW",
});
networks: [nearTestnet],
defaultNetwork: nearTestnet,
enableWalletConnect: true,
features: {
analytics: true,
swaps: false,
onramp: false,
email: false, // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
socials: false, // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
},
coinbasePreference: "eoaOnly", // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
});
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -104,10 +104,12 @@
"@noble/hashes": "1.4.0",
"@peersyst/near-mobile-signer": "1.1.2",
"@ramper/near": "0.0.30",
"@reown/appkit": "1.5.2",
"@reown/appkit-adapter-wagmi": "1.5.2",
"@tanstack/react-query": "5.24.8",
"@walletconnect/modal": "2.6.2",
"@walletconnect/sign-client": "2.13.0",
"@web3modal/wagmi": "5.0.6",
"@walletconnect/modal": "2.7.0",
"@walletconnect/sign-client": "2.17.0",
"better-sqlite3": "11.3.0",
"big.js": "6.2.2",
"borsh": "1.0.0",
"browserify-fs": "1.0.0",
@@ -133,8 +135,9 @@
"stream-http": "3.2.0",
"tslib": "2.7.0",
"url": "0.11.0",
"viem": "2.16.2",
"wagmi": "2.10.9",
"viem": "2.21.26",
"vite-plugin-node-polyfills": "0.23.0",
"wagmi": "2.12.17",
"zone.js": "0.12.0"
},
"devDependencies": {
98 changes: 60 additions & 38 deletions packages/ethereum-wallets/README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ The package adds support for Ethereum wallets by creating Ethereum-compatible tr

Ethereum wallet support NEP: https://github.com/near/NEPs/issues/518

Any Ethereum wallet can be connected via Web3Modal: the App can chose which wallets to support and a multichain App can switch networks using the same wallet connection.
Any Ethereum wallet can be connected via Web3Modal (now AppKit): the App can chose which wallets to support and a multichain App can switch networks using the same wallet connection.

SignIn requires switching to NEAR network to ensure that the wallet is compatible, if the user switches to other networks he will be prompted to switch back to NEAR before making a transaction.

@@ -23,38 +23,43 @@ NEP-518 rpc relayer uses a FunctionCall access key to execute transactions on be

```bash
# Using Yarn
yarn add near-api-js @web3modal/wagmi wagmi viem @tanstack/react-query @near-wallet-selector/ethereum-wallets
yarn add near-api-js @reown/appkit @reown/appkit-adapter-wagmi wagmi viem @tanstack/react-query @near-wallet-selector/ethereum-wallets

# Using NPM.
npm install near-api-js @web3modal/wagmi wagmi viem @tanstack/react-query @near-wallet-selector/ethereum-wallets
npm install near-api-js @reown/appkit @reown/appkit-adapter-wagmi wagmi viem @tanstack/react-query @near-wallet-selector/ethereum-wallets
```

Then use it in your App:

Visit https://docs.walletconnect.com for the latest configuration of Web3Modal.
Visit https://docs.reown.com for the latest configuration of AppKit.

Tested versions from `/examples`:
```json
"dependencies": {
"@web3modal/wagmi": "5.0.6",
"@reown/appkit": "1.5.2",
"@reown/appkit-adapter-wagmi": "1.5.2",
"@tanstack/react-query": "5.24.8",
"viem": "2.16.2",
"wagmi": "2.10.9",
"viem": "2.21.26",
"wagmi": "2.21.17",
}
```

```ts
import type { Config } from "@wagmi/core";
import type { Chain } from "@wagmi/core/chains";
import { reconnect, http, createConfig } from "@wagmi/core";
import { walletConnect, injected } from "@wagmi/connectors";
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";
import { createAppKit } from "@reown/appkit/react";
import { defineChain } from "@reown/appkit/networks";
import type { CreateConnectorFn, GetAccountReturnType } from "@wagmi/core";
import { watchAccount } from "@wagmi/core";
import { injected, walletConnect } from "@wagmi/connectors";
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupModal } from "@near-wallet-selector/modal-ui";
import { setupEthereumWallets } from "@near-wallet-selector/ethereum-wallets";

// Mainnet
const near: Chain = {
const near = defineChain({
id: 397,
caipNetworkId: "eip155:398",
chainNamespace: "eip155",
name: "NEAR Protocol",
nativeCurrency: {
decimals: 18,
@@ -71,12 +76,14 @@ const near: Chain = {
url: "https://eth-explorer.near.org",
},
},
}
})

// Testnet
/*
const near: Chain = {
const near = defineChain({
id: 398,
caipNetworkId: "eip155:398",
chainNamespace: "eip155",
name: "NEAR Protocol Testnet",
nativeCurrency: {
decimals: 18,
@@ -94,43 +101,58 @@ const near: Chain = {
},
},
testnet: true,
};
});
*/

// Get a project ID at https://cloud.walletconnect.com
// Get a project ID at https://cloud.reown.com
const projectId = ""

const wagmiConfig: Config = createConfig({
chains: [near],
transports: {
[near.id]: http(),
},
connectors: [
walletConnect({
projectId,
metadata: {
name: "NEAR Guest Book",
description: "A guest book with comments stored on the NEAR blockchain",
url: "https://near.github.io/wallet-selector",
icons: ["https://near.github.io/wallet-selector/favicon.ico"],
},
showQrModal: false
}),
injected({ shimDisconnect: true }),
],
const connectors: Array<CreateConnectorFn> = [
walletConnect({
projectId,
metadata: {
name: "NEAR Guest Book",
description: "A guest book with comments stored on the NEAR blockchain",
url: "https://near.github.io/wallet-selector",
icons: ["https://near.github.io/wallet-selector/favicon.ico"],
},
showQrModal: false, // showQrModal must be false
}),
injected({ shimDisconnect: true }),
];

const wagmiAdapter = new WagmiAdapter({
projectId,
connectors,
networks: [near],
});

const web3Modal = createWeb3Modal({
wagmiConfig,
const web3Modal = createAppKit({
adapters: [wagmiAdapter],
projectId,
networks: [near],
defaultNetwork: near,
enableWalletConnect: true,
features: {
analytics: true,
swaps: false,
onramp: false,
email: false, // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
socials: false, // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
},
coinbasePreference: "eoaOnly", // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
allWallets: "SHOW",
});

export const WalletSelectorContextProvider = () => {
const init = useCallback(async () => {
const _selector = await setupWalletSelector({
network: "mainnet",
modules: [
setupEthereumWallets({ wagmiConfig, web3Modal }),
setupEthereumWallets({
wagmiConfig: wagmiAdapter.wagmiConfig,
web3Modal
}),
],
});
const _modal = setupModal(_selector, { contractId: "" })
@@ -140,7 +162,7 @@ export const WalletSelectorContextProvider = () => {

## Wallet Connect Configuration

Project ID is required, please obtain it from [walletconnect.com](https://walletconnect.com/)
Project ID is required, please obtain it from [cloud.reown.com](https://cloud.reown.com)

## Options

1 change: 0 additions & 1 deletion packages/ethereum-wallets/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -55,7 +55,6 @@ export interface EthereumWalletsParams {
subscribeEvents: (
f: (event: { data: { event: string } }) => void
) => () => void;
getState: () => { open: boolean; selectedNetworkId?: number };
};
wagmiCore?: WagmiCoreActionsType;
chainId?: number;
2,892 changes: 1,938 additions & 954 deletions yarn.lock

Large diffs are not rendered by default.