Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Accounts

@ivem/core provides local account helpers for modern IOST wallet workflows.

Create Local Account

import { accountFromPrivateKey } from '@ivem/core'
 
const account = accountFromPrivateKey('alice', 'BASE58_PRIVATE_KEY')
  • Creates a LocalAccount with active and owner key permissions.
  • Works with createWalletClient({ account, ... }).

Generate Key Pair

import { generateKeyPair, getB58PubKey, getB58SecKey } from '@ivem/core'
 
const keyPair = generateKeyPair()
const publicKey = getB58PubKey(keyPair)
const privateKey = getB58SecKey(keyPair)

Restore Key Pair

import { createKeyPair, keyPairFromB58SecKey } from '@ivem/core'
 
const keyPairA = createKeyPair('BASE58_PRIVATE_KEY')
const keyPairB = keyPairFromB58SecKey('BASE58_PRIVATE_KEY')

createKeyPair and keyPairFromB58SecKey both build a usable key pair from base58 private key text.

Account Utilities

import { addKeyPair, getAccountId, getKeyPair } from '@ivem/core'
import { createKeyPair } from '@ivem/core'
 
let account = accountFromPrivateKey('alice')
const activeKeyPair = createKeyPair('BASE58_PRIVATE_KEY')
 
account = addKeyPair(account, activeKeyPair, 'active')
 
const accountId = getAccountId(account)
const active = getKeyPair(account, 'active')

Sign Capabilities

LocalAccount supports:

  • signTx(tx, permission)
  • signPublishTx(tx)
  • signMessage(message, permission)

These are used internally by walletClient.signTransaction and walletClient.signMessage.