Returns the current connected wallet account
Redirects current page to the wallet authentication page.
An optional options object
const wallet = new WalletConnection(near, 'my-app');
// redirects to the NEAR Wallet
wallet.requestSignIn({ contractId: 'account-with-deploy-contract.near' });
Constructs string URL to the wallet authentication page.
An optional options object
const wallet = new WalletConnection(near, 'my-app');
// return string URL to the NEAR Wallet
const url = await wallet.requestSignInUrl({ contractId: 'account-with-deploy-contract.near' });
This class is not intended for use outside the browser. Without
window
(i.e. in server contexts), it will instantiate but will throw a clear error when used.See
https://docs.near.org/tools/near-api-js/quick-reference#wallet
Example