Class

Config

Config

Global config class.

View Source lib/config.js, line 33

Examples

Usage in node

import { Config } from '@stellar/stellar-sdk';
Config.setAllowHttp(true);
Config.setTimeout(5000);

Usage in the browser

StellarSdk.Config.setAllowHttp(true);
StellarSdk.Config.setTimeout(5000);

Methods

# static getTimeout() → {number}

Returns the configured timeout flag.

View Source lib/no-eventsource/config.d.ts, line 55

number

# static isAllowHttp() → {boolean}

Returns the configured allowHttp flag.

View Source lib/no-eventsource/config.d.ts, line 48

boolean

# static setAllowHttp(value) → {void}

Sets allowHttp flag globally. When set to true, connections to insecure http protocol servers will be allowed. Must be set to false in production.

Parameters:
Name Type Description
value boolean
Default Value:
  • false

View Source lib/no-eventsource/config.d.ts, line 31

void

# static setDefault() → {void}

Sets all global config flags to default values.

View Source lib/no-eventsource/config.d.ts, line 62

void

# static setTimeout(value) → {void}

Sets timeout flag globally. When set to anything besides 0, the request will timeout after specified time (ms).

Parameters:
Name Type Description
value number
Default Value:
  • 0

View Source lib/no-eventsource/config.d.ts, line 41

void