Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WalletConnection

Hierarchy

  • WalletConnection

Index

Constructors

  • Parameters

    • near: Near
    • appKeyPrefix: null | string

    Returns WalletConnection

Properties

_requestSignTransactions: any

Methods

  • account(): ConnectedWalletAccount
  • Returns the current connected wallet account

    Returns ConnectedWalletAccount

  • getAccountId(): any
  • Returns authorized Account ID.

    example
    const wallet = new WalletConnection(near, 'my-app');
    wallet.getAccountId();

    Returns any

  • isSignedIn(): boolean
  • Returns true, if this WalletAccount is authorized with the wallet.

    example
    const wallet = new WalletConnection(near, 'my-app');
    wallet.isSignedIn();

    Returns boolean

  • requestSignIn(contractIdOrOptions?: string | SignInOptions, title?: string, successUrl?: string, failureUrl?: string): Promise<void>
  • Redirects current page to the wallet authentication page.

    example
    const wallet = new WalletConnection(near, 'my-app');
    // redirects to the NEAR Wallet
    wallet.requestSignIn({ contractId: 'account-with-deploy-contract.near' });

    Parameters

    • Optional contractIdOrOptions: string | SignInOptions
    • Optional title: string
    • Optional successUrl: string
    • Optional failureUrl: string

    Returns Promise<void>

  • requestSignTransactions(options: RequestSignTransactionsOptions): Promise<void>
  • requestSignTransactions(transactions: Transaction[], callbackUrl?: string, meta?: string): Promise<void>
  • Requests the user to quickly sign for a transaction or batch of transactions by redirecting to the NEAR wallet.

    deprecated

    Requests the user to quickly sign for a transaction or batch of transactions by redirecting to the NEAR wallet.

    Parameters

    • options: RequestSignTransactionsOptions

    Returns Promise<void>

  • deprecated

    Requests the user to quickly sign for a transaction or batch of transactions by redirecting to the NEAR wallet.

    Parameters

    • transactions: Transaction[]

      Array of Transaction objects that will be requested to sign

    • Optional callbackUrl: string

      The url to navigate to after the user is prompted to sign

    • Optional meta: string

    Returns Promise<void>

  • signOut(): void
  • Sign out from the current account

    example

    walletAccount.signOut();

    Returns void

Generated using TypeDoc