WalletAccount

Hierarchy

WalletAccount

Constructors

constructor

new WalletAccount(near: Near, appKeyPrefix: string | null): WalletAccount

Defined in wallet-account.ts:18

Parameters:

Name

Type

near

Near

appKeyPrefix

string | null

Returns: WalletAccount

Properties

_authData

● _authData: any

Defined in wallet-account.ts:17

_authDataKey

● _authDataKey: string

Defined in wallet-account.ts:15

_keyStore

● _keyStore: KeyStore

Defined in wallet-account.ts:16

_networkId

● _networkId: string

Defined in wallet-account.ts:18

_walletBaseUrl

● _walletBaseUrl: string

Defined in wallet-account.ts:14

Methods

_completeSignInWithAccessKey

_completeSignInWithAccessKey(): Promise<void>

Defined in wallet-account.ts:84

Complete sign in for a given account id and public key. To be invoked by the app when getting a callback from the wallet.

Returns: Promise<void>

_moveKeyFromTempToPermanent

_moveKeyFromTempToPermanent(accountId: string, publicKey: string): Promise<void>

Defined in wallet-account.ts:97

Parameters:

Name

Type

accountId

string

publicKey

string

Returns: Promise<void>

getAccountId

getAccountId(): any

Defined in wallet-account.ts:46

Returns authorized Account ID.

example: walletAccount.getAccountId();

Returns: any

isSignedIn

isSignedIn(): boolean

Defined in wallet-account.ts:37

Returns true, if this WalletAccount is authorized with the wallet.

example: walletAccount.isSignedIn();

Returns: boolean

requestSignIn

requestSignIn(contractId: string, title: string, successUrl: string, failureUrl: string): Promise<void>

Defined in wallet-account.ts:63

Redirects current page to the wallet authentication page.

example: walletAccount.requestSignIn( myContractId, title, onSuccessHref, onFailureHref);

Parameters:

Name

Type

Description

contractId

string

contract ID of the application

title

string

name of the application

successUrl

string

url to redirect on success

failureUrl

string

url to redirect on failure

Returns: Promise<void>

signOut

signOut(): void

Defined in wallet-account.ts:108

Sign out from the current account

example: walletAccount.signOut();

Returns: void