The createSessionClient function creates a new SessionClient instance directly, without requiring an existing AbstractClient. If you have an existing AbstractClient, use the toSessionClient method instead.

Usage

Parameters

account
Account | Address
required

The Abstract Global Wallet address or Account object that the session key will act on behalf of.

chain
ChainEIP712
required

The chain configuration object that supports EIP-712.

signer
Account
required

The session key account that will be used to sign transactions. Must match the signer address in the session configuration.

session
SessionConfig
required

The session configuration created by createSession.

transport
Transport

The transport configuration for connecting to the network. Defaults to HTTP if not provided.

Returns

sessionClient
SessionClient

A new SessionClient instance that uses the session key for signing transactions. All transactions will be validated against the session’s policies.