Arkena Docs

Provider methods

Every canton_* method on window.arkena, with parameters, return types, and the errors each can raise.

The Arkena provider exposes its API through a single entry point:

Code
const result = await window.arkena.request({ method, params });

This page lists every supported method. Methods are grouped by purpose. The provider also implements CIP-103 discovery (EIP-6963 pattern) and is also available as window.canton.

Connection

canton_connect

Request connection to the dApp. Shows the user an approval popup.

paramsobject

Optional. No fields are accepted at this time; the wallet always grants the default permission set on approval.

Returns:

Code
{
  accounts: string[],   // The user's party IDs (currently always length 1)
  network: "devnet" | "testnet" | "mainnet",
}

Throws: 4001 if the user rejects.

Code
const { accounts, network } = await provider.request({ method: "canton_connect" });

canton_disconnect

Revoke the current origin's access. The next canton_connect will show the popup again.

Returns: void.

Code
await provider.request({ method: "canton_disconnect" });

Read

canton_getAccounts

Return the user's connected accounts. Currently always a single-element array.

Returns: string[].

canton_getNetwork

Return the network the wallet is currently configured for.

Returns: "devnet" | "testnet" | "mainnet".

canton_getBalance

Return native balances. For richer balance data (USDCx, NFT count), fetch from the backend with a SIWC token instead.

params{ partyId?: string }

Optional. Defaults to the primary account.

Returns:

Code
{
  cc: string,      // e.g. "12.345"
  usdcx: string,   // e.g. "100.00"
}

Sign

canton_signMessage

Sign a structured message — used for SIWC. The wallet shows the message in a sign-in card.

params{ message: string }required

The message to sign. Format follows the EIP-4361 / SIWC convention.

Returns:

Code
{ signature: string, signedBy: string, partyId: string }

Throws: 4001 (rejected), 4100 (wallet locked or unauthorized).

canton_signTransaction

Sign a Canton transaction prepared by the backend. The wallet shows the summary from the prepare response as a card.

params.hashstringrequired

The transaction hash to sign. Comes from the backend's prepare response.

params.commandIdstringrequired

The deduplication ID for this submission. Pass through unchanged from the prepare response.

params.hashingSchemeVersionstringrequired

Canton's hashing scheme version. Pass through unchanged from the prepare response.

params.summaryTxSummaryrequired

The structured transaction summary the wallet renders to the user. The backend builds this; pass through unchanged.

Returns:

Code
{ signature: string, signedBy: string, partyId: string }

Throws: 4001 (rejected), 4100 (locked), -32003 (transaction rejected by the wallet's policy checks).

canton_getAuthToken

Convenience wrapper around the SIWC flow. Combines challenge fetch, message sign, and JWT issuance in a single round-trip when the wallet holds a fresh challenge for the current origin.

params{ partyId?: string }

Optional. Defaults to the primary account.

Returns:

Code
{ token: string, expiresAt: number }

For finer control, use the manual SIWC flow described in Sign-In with Canton.

CIP-103 aliases

The provider accepts a small set of CIP-103 / OpenAccount-style aliases for the canonical canton_* names. They map to the same handlers and are useful when integrating with a wallet-agnostic library:

AliasMaps to
connectcanton_connect
disconnectcanton_disconnect
getActiveNetworkcanton_getNetwork
listAccountscanton_getAccounts
signMessagecanton_signMessage
prepareExecutecanton_signTransaction

What's next

  • Provider events — the subscribe-to-state side of the API.
  • Error codes — every error code this page references, with example payloads.