Auro Wallet Docs
  • Getting Started
  • How to integrate
    • Connect Wallet
    • Add or Switch Chain
    • Create Nullifier
    • Send Transaction
    • Send zk Transaction
    • Sign Message
    • VerifyMessage in server-side
    • Anonymous Credentials
    • Building zkApp on Android
  • Wallet Basics
    • Submit token info
    • ​Pull Up Auro Wallet with DeepLink
    • Mina Providers
  • Reference
    • API Reference
      • Methods
        • mina_accounts
        • mina_requestAccounts
        • mina_requestNetwork
        • mina_sendPayment
        • mina_sendStakeDelegation
        • mina_sendTransaction
        • mina_addChain
        • mina_switchChain
        • mina_createNullifier
        • mina_signMessage
        • mina_sign_JsonMessage
        • mina_verifyMessage
        • mina_signFields
        • mina_verifyFields
        • mina_storePrivateCredential
        • mina_requestPresentation
      • Events
      • Error
      • Source
Powered by GitBook
On this page
  • accountsChanged
  • chainChanged
Edit on GitHub
  1. Reference
  2. API Reference

Events

Here are the monitoring events of the provider. There are currently two types of events, account update and chain update.

accountsChanged

When user switch account in Auro Wallet, accountsChanged will be trigger.

window.mina?.on('accountsChanged', handler: (accounts: string[]) => void);
window.mina?.on('accountsChanged', handler: (accounts: string[]) => {
   console.log('connected accounts', accounts)
});

NOTE When switching to an unconnected account, an empty array will be returned.

chainChanged

When user switch chain in Auro Wallet, chainChanged will be trigger.

type ChainInfoArgs ={
  networkID:string
}

window.mina?.on('chainChanged', handler: (chainInfo: ChainInfoArgs) => void);
window.mina?.on('chainChanged', handler: (chainInfo: ChainInfoArgs) => {
   console.log('current networkID', chainInfo.networkID)
});
** Please update as soon as possible. **
`ChainInfoArgs` params have updated from App 2.0.2 & extension 2.2.17.
Only `networkID` is returned, no longer supports returning `chainId` and `name`. 

// @deprecated from App 2.0.2 & extension 2.2.17.
type ChainInfoArgs ={ 
    chainId:string,
    name:string
}
Previousmina_requestPresentationNextError

Last updated 11 months ago