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/config.js, line 69

number

# static isAllowHttp() → {boolean}

Returns the configured allowHttp flag.

View Source lib/config.js, line 60

boolean

# static setAllowHttp()

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

Default Value:
  • false

View Source lib/config.js, line 41

# static setDefault()

Sets all global config flags to default values.

View Source lib/config.js, line 77

# static setTimeout()

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

Default Value:
  • 0

View Source lib/config.js, line 51