Skip to main content

Configuration

The SDK is configured through the BorrowSDKConfig object passed to the constructor.

Required Options

These options must be provided:

apiKey

Your SatsTerminal API key for authentication.

wallet

The wallet provider for signing operations.

Optional Options

workflowPollInterval

Interval (in milliseconds) for polling workflow status.

sessionValiditySeconds

How long sessions remain valid (in seconds).

autoTrackWorkflows

Automatically track workflow status after operations.

quoteSelector

Custom function to select a quote from available options.

storage

Custom storage provider for persisting signatures.

retryConfig

Configuration for automatic request retries.

logger

Custom logger for debugging.

rpcUrl

Custom RPC URL for the selected chain.

bundlerUrl

Custom bundler URL for ERC-4337 operations.

Full Configuration Example

Environment-Based Configuration

Validation

The SDK validates configuration on initialization:

Validation Rules