Skip to main content

isAccount

Checks if an object is an account resolver.

Import

You can import the entire package and access the function:


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

Or import directly the specific function:


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

Usage


_10
import { isAccount, authorization } from "@onflow/sdk"
_10
_10
const authz = authorization("0x123", signingFunction);
_10
const accountResolver = { kind: "ACCOUNT", addr: "0x123" };
_10
const regularObject = { name: "test" };
_10
_10
console.log(isAccount(accountResolver)); // true
_10
console.log(isAccount(regularObject)); // false

Parameters

account

  • Type: Record<string, any>
  • Description: The object to check

Returns

boolean


Rate this page