Mainly used for the mina account of the website requesting to connect to the user, if authorized, it will directly return to the current authorized account
1
window.mina.requestAccounts(): Promise<string[]>;
Copied!
1
let accounts
2
// data.result is an array that contains approve account`s address
3
try{
4
accounts =await window.mina.requestAccounts()
5
}catch(error){
6
// if user reject, requestAccounts will throw an error with code and message filed