Skip to content

ClientConfig

Defined in: src/Client.ts:147

Configuration for creating a client.

Constraint: Only one network ID is supported per process. The Midnight SDK uses a global setNetworkId call internally, so creating two clients targeting different networks in the same process will cause undefined behaviour.

Since

0.2.0

Properties

feeRelay?

optional feeRelay: object

Defined in: src/Client.ts:167

Fee relay — delegate fee payment to a remote HTTP relay server.

The relay pays dust (tx fees) while the user’s wallet provides value inputs. User’s wallet balances with { payFees: false }, relay adds dust only.

url

url: string


logging?

optional logging: boolean

Defined in: src/Client.ts:161

Enable logging (default: true)


network?

optional network: string

Defined in: src/Client.ts:149

Network to connect to (default: ‘local’)


networkConfig?

optional networkConfig: NetworkConfig

Defined in: src/Client.ts:151

Custom network configuration (overrides network preset)


privateStateProvider

privateStateProvider: PrivateStateProvider

Defined in: src/Client.ts:157

Private state provider (required)


seed?

optional seed: string

Defined in: src/Client.ts:155

Wallet seed (required for non-local networks). Ignored if wallet is provided.


storage?

optional storage: StorageConfig

Defined in: src/Client.ts:159

Storage configuration


txTtlMs?

optional txTtlMs: number

Defined in: src/Client.ts:169

Transaction TTL in milliseconds (default: 30 minutes). Used as the fallback when no per-call TTL is provided to balanceTx.


wallet?

optional wallet: ConnectedWallet

Defined in: src/Client.ts:153

Pre-created wallet (from Wallet.fromSeed or Wallet.fromBrowser)