@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / native / sessionAddress

Function: sessionAddress()

sessionAddress(seed): `0x${string}`

Defined in: packages/sdk/src/native/session.ts:115

The address a session seed controls — computed locally, no RPC.

Identical to what somnia_getSessionAddress returns for the same seed, and cheaper: use it to display or pre-fund a session account before any network call. client.getSessionAddress(seed) asks the node the same question if you want the round-trip as confirmation.

Details

  • seed: 32-byte session seed.
  • Returns: The checksummed address of the derived account.

Gotchas

  • Throws If the seed is not 32 bytes of hex.

Example (Deriving a session address)

ts
import { sessionAddress } from "@somnia-chain/markets-sdk/native";

const seed = "0x1111111111111111111111111111111111111111111111111111111111111111";
sessionAddress(seed); // "0xD56D8c05Aa8dA0f3Afd676Aec94014e89aF3cc51" — fund this

Parameters

seed

`0x${string}`

Returns

`0x${string}`