ShelfNetwork

ShelfNetwork

Shelf.Network Software Development Toolkit.

Constructor

new ShelfNetwork(optsopt)

Make a new ShelfNetwork SDK instance.

Source:
Parameters:
Name Type Attributes Description
opts object <optional>
Name Type Attributes Description
platformId string <optional>

Shelf.Network platform ID.

gatewayUrl string <optional>

Gateway server url.

horizonUrl string <optional>

Horizon server url.

walletServerUrl string <optional>

Wallet server url.

cartServerUrl string <optional>

Cart server url.

parserServerUrl string <optional>

Parser server url.

transportationServerUrl string <optional>

Transportation server url.

feeCalculatorServerUrl string <optional>

Fee server url.

paymentServerUrl string <optional>

Payment server url.

authServerUrl string <optional>

Auth server url.

azryLeasingUrl string <optional>

AZRY leasing server url.

allowHttp boolean <optional>

Allow connecting to http servers, default: false. This must be set to false in production deployments!

proxy object <optional>

Proxy configuration. Look axios docs for more info

httpBasicAuth object <optional>

HTTP basic auth credentials. Look axios docs for more info.

customHeaders object <optional>

Custom headers for request.

withCredentials boolean <optional>

Indicates whether or not cross-site Access-Control requests should be made using credentials.

Members

auth :AuthServer

Notification server instance.

Source:
Type:

azryLeasing :AuthServer

AZRY leasing server url.

Source:
Type:

cart :CartServer

Cart server instance.

Source:
Type:

clockDiff :Number

Clock difference with the backend.

Source:
Type:
  • Number

feeCalculator :FeeCalculatorServer

Fee server instance.

Source:
Type:

files :FileServer

File server instance.

Source:
Type:

horizon :HorizonServer

Horizon server instance.

Source:
Type:

notifications :NotificationServer

Notification server instance.

Source:
Type:

parser :ParserServer

Parser server instance.

Source:
Type:

payments :PaymentServer

Payment server instance.

Source:
Type:

platformId :string

Shelf.Network platform ID.

Source:
Type:
  • string

token :Token

User's token.

Source:
Type:

transportation :TransportationServer

Transportation server instance.

Source:
Type:

wallet :Wallet

User's wallet.

Source:
Type:

wallets :WalletServer

Wallet server instance.

Source:
Type:

Methods

(async, static) create(optsopt) → {Promise.<ShelfNetwork>}

Make a new ShelfNetwork SDK instance. Deprecated. Use constructor instead.

Deprecated:
  • Yes
Source:
Parameters:
Name Type Attributes Description
opts object <optional>
Name Type Attributes Description
platformId string <optional>

Shelf.Network platform ID.

gatewayUrl string <optional>

Gateway server url.

horizonUrl string <optional>

Horizon server url.

walletServerUrl string <optional>

Wallet server url.

cartServerUrl string <optional>

Cart server url.

parserServerUrl string <optional>

Parser server url.

transportationServerUrl string <optional>

Transportation server url.

feeCalculatorServerUrl string <optional>

Fee server url.

paymentServerUrl string <optional>

Payment server url.

authServerUrl string <optional>

Auth server url.

azryLeasingUrl string <optional>

AZRY leasing server url.

allowHttp boolean <optional>

Allow connecting to http servers, default: false. This must be set to false in production deployments!

proxy object <optional>

Proxy configuration. Look axios docs for more info

httpBasicAuth object <optional>

HTTP basic auth credentials. Look axios docs for more info.

customHeaders object <optional>

Custom headers for request.

withCredentials boolean <optional>

Indicates whether or not cross-site Access-Control requests should be made using credentials.

Returns:
Type:
Promise.<ShelfNetwork>

ejectToken()

Eject current JWT token.

Source:

ejectWallet()

Eject current wallet.

Source:

(async) fetchNetworkDetails() → {Promise}

Fetch network details. Use it if you are going to use wallets or manually sign transactions.

Source:
Returns:
Type:
Promise

useToken(token)

Use user's token to authenticate requests.

Source:
Parameters:
Name Type Description
token Token

User's token.

useWallet(wallet)

Use a wallet to sign transactions.

Source:
Parameters:
Name Type Description
wallet Wallet

User's wallet.