Gun-Vue docs v0.21.4 • Docs
Gun-Vue docs v0.21.4 / Account / useAccount
Function: useAccount()
useAccount(
pubKey
):object
Load and handle user's account by a public key
Parameters
• pubKey: MaybeRef
<string
>
Returns
object
account
account:
ComputedRef
<Account
>
setPetname()
setPetname: (
pub
,name
) =>Promise
<void
>
Parameters
• pub: string
• name: string
Returns
Promise
<void
>
Example
ts
import { ref } from 'vue'
import { useAccount, SEA } from '@gun-vue/composables'
const pub = ref()
async function generatePair() {
pub.value = await SEA.pair()
}
const { account } = useAccount(pub)
generatePair()