RetrieveUser
This function does not trigger any UI elements
This function retrieves information about the currently logged in user. The fields returned include the userIdentifier, the user's wallet addresses, and the wallet balances.
async RetrieveUser()
This function has no arguments
This function returns a
Promise
that resolves to the following object:{
"userIdentifier":"userIdentifier",
"balances": {
"goerli_eth": {
"accountBalances": [
{
"address": "address1",
"balance": "balance1",
},
],
"totalBalance": "totalBalance",
},
"asset_2": {
...
}
},
"chainWallets": {
"goerli": [
"address1",
...
],
"chain2": [
...
]
...
}
}
custom-tokens.js
1
import { useEffect } from 'react'
2
import { useMetafi } from '@metafi/react-sdk';
3
4
function App() {
5
const { RetrieveUser } = useMetafi();
6
7
useEffect(() => {
8
var userInfo = await RetrieveUser();
9
console.log("Retrieved user information", userInfo);
10
}, []);
11
12
return ();
13
};
Last modified 3mo ago