Skip to main content

initAccount

Creates a new account object with default values.

Import

You can import the entire package and access the function:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.initAccount()

Or import directly the specific function:


_10
import { initAccount } from "@onflow/sdk"
_10
_10
initAccount()

Usage


_10
import { initAccount } from "@onflow/sdk"
_10
_10
const account = initAccount();
_10
console.log(account.addr); // null
_10
console.log(account.keyId); // null
_10
console.log(account.role.proposer); // false
_10
_10
// Typically used internally by other functions
_10
// You'll more commonly use authorization() or prepAccount()

Returns

InteractionAccount


Rate this page