Construct MeteorWallet. If you'd a quick and default way, you can also use init
// create new MeteorWallet instance (passing in your initialized Near connection)
const meteorWallet = new MeteorWallet({ near: connectedNear, appKeyPrefix: 'my-app' });
if(!meteorWallet.isSignedIn()) {
const { accountId } = await meteorWallet.requestSignIn();
}
Returns the current connected wallet account
Returns authorized Account ID.
const wallet = new MeteorWallet(near, 'my-app');
const accountId = wallet.getAccountId();
Returns true, if this app is authorized with an account in the wallet.
const wallet = new MeteorWallet({ near: connectedNear, appKeyPrefix: 'my-app' });
wallet.isSignedIn();
Requests a sign-in using Meteor Wallet. Will return a promise with the accountId of the
signed-in account, or throw a MeteorActionError error if the sign-in failed for whatever reason.
Sign transactions using Meteor Wallet. Will return a promise with an array of FinalExecutionOutcome
of the given transactions.
Sign out from the current account
Static initThe easiest way to set up the SDK. Returns an instance of MeteorWallet, automatically connected to the Near API.
If you need more control over the Near Network configuration- rather use new MeteorWallet
const wallet = await MeteorWallet.init({ networkId: "testnet" });
Generated using TypeDoc
This class is used in conjunction with
near-api-jsandBrowserLocalStorageKeyStore. It directs users to the Meteor Extension or (if not available) a popup of the Meteor Wallet website for key management.Example