Pricing

Bancor SDKGlobalsPricing

Class: Pricing

The Pricing module provides access to pricing and rates logic for tokens in the bancor network

Hierarchy

  • SDKModule

    Pricing

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Pricing(core: Core): Pricing

Inherited from History.constructor

Parameters:

Name

Type

core

Core

Returns: Pricing

Properties

core

core: any = null

Inherited from History.core

Methods

getPathAndRate

getPathAndRate(sourceToken: Token, targetToken: Token, amount: string): Promise‹object›

returns the best conversion path and rate for a given pair of tokens in the bancor network

Parameters:

Name

Type

Default

Description

sourceToken

-

source token

targetToken

-

target token

amount

string

"1"

input amount

Returns: Promise‹object›

the best path and rate between the source token and the target token

getRateByPath

getRateByPath(path: Token[], amount: string): Promise‹string›

returns the rate for a given conversion path in the bancor network

Parameters:

Name

Type

Default

Description

path

-

conversion path

amount

string

"1"

input amount

Returns: Promise‹string›

output amount for a conversion on the given path

Last updated