For the complete documentation index, see llms.txt. This page is also available as Markdown.

API reference

Complete reference for Bloxchain TypeScript SDK classes and methods. Contract source of truth: Solidity in contracts/core/. See TECHNICAL_OVERVIEW.md and contracts/core/AUDIT.md.

πŸ“š Core Classes

SecureOwnable

The SecureOwnable class provides type-safe access to SecureOwnable contracts.

Constructor

constructor(
  client: PublicClient,
  walletClient?: WalletClient,
  contractAddress: Address,
  chain: Chain
)

Parameters:

  • client: Viem public client for read operations

  • walletClient: Optional wallet client for write operations

  • contractAddress: Address of the deployed contract

  • chain: Chain configuration

Read Methods

owner(): Promise<Address>

Returns the current owner of the contract.

getTimeLockPeriodSec(): Promise<bigint>

Returns the time lock period in seconds.

getBroadcasters(): Promise<Address[]>

Returns all broadcaster addresses for the broadcaster role.

getRecovery(): Promise<Address>

Returns the recovery address.

initialized(): Promise<boolean>

Returns whether the contract is initialized.

Write Methods

transferOwnershipRequest(options?: TransactionOptions): Promise<TransactionResult>

Requests a time-delayed transfer of the owner role to the recovery address at request time (snapshotted in the pending tx). Rotating recovery later does not change that stored beneficiary. See the Ownership transfer vs recovery section in the SecureOwnable guide.

transferOwnershipDelayedApproval(txId: bigint, options?: TransactionOptions): Promise<TransactionResult>

Approves a pending ownership transfer after the time lock. Callable by current owner or current recovery; execution still assigns owner to the address snapshotted at request time (may differ from getRecovery() at approval time).

updateBroadcasterRequest(newBroadcaster: Address, currentBroadcaster: Address, options?: TransactionOptions): Promise<TransactionResult>

Requests a broadcaster update by address pair: replace (currentBroadcaster β†’ newBroadcaster), add (currentBroadcaster = zero), or revoke (newBroadcaster = zero).

updateRecoveryRequestAndApprove(metaTx: MetaTransaction, options?: TransactionOptions): Promise<TransactionResult>

Requests and approves a recovery update using a signed meta-transaction (owner signs, broadcaster submits).

updateTimeLockRequestAndApprove(metaTx: MetaTransaction, options?: TransactionOptions): Promise<TransactionResult>

Requests and approves a time lock period update using a signed meta-transaction.

RuntimeRBAC

The RuntimeRBAC class provides type-safe access to RuntimeRBAC contracts. It extends BaseStateMachine and provides batch-based role configuration.

Constructor

Read Methods

getRole(roleHash: Hex): Promise<Role>

Gets role information by hash. Return shape includes roleName, roleHash (or roleHashReturn), maxWallets, walletCount, isProtected.

hasRole(roleHash: Hex, wallet: Address): Promise<boolean>

Checks if a wallet has a specific role.

getAuthorizedWallets(roleHash: Hex): Promise<Address[]>

Gets all authorized wallets for a role.

getWalletRoles(wallet: Address): Promise<Hex[]>

Gets all roles assigned to a wallet.

getSupportedRoles(): Promise<Hex[]>

Returns the list of supported roles.

getFunctionSchema(functionSelector: Hex): Promise<FunctionSchema>

Gets function schema information.

Write Methods

roleConfigBatchRequestAndApprove(metaTx: MetaTransaction, options?: TransactionOptions): Promise<TransactionResult>

Requests and approves a RBAC configuration batch using a meta-transaction.

roleConfigBatchExecutionParams(definitionAddress: Address, actions: RoleConfigAction[]): Promise<Hex>

Calls the deployed RuntimeRBACDefinitions contract to build execution params (single source of truth with Solidity).

πŸ“ Types & Interfaces

Core Types

πŸ”§ Transaction Options

πŸ“Š Error Types

🎯 Usage Examples

Basic Contract Interaction


Need more details? Check out the specific guides:

Last updated

Was this helpful?