sdk-js

@nevermined-io/sdk - v3.0.44 / AssetPrice

Class: AssetPrice

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new AssetPrice(): AssetPrice

Returns

AssetPrice

Defined in

src/models/AssetPrice.ts:10

new AssetPrice(_rewards): AssetPrice

Parameters

Name Type
_rewards Map<string, bigint>

Returns

AssetPrice

Defined in

src/models/AssetPrice.ts:11

new AssetPrice(address, amount): AssetPrice

Parameters

Name Type
address string
amount bigint

Returns

AssetPrice

Defined in

src/models/AssetPrice.ts:12

new AssetPrice(address, amount, tokenAddress): AssetPrice

Parameters

Name Type
address string
amount bigint
tokenAddress string

Returns

AssetPrice

Defined in

src/models/AssetPrice.ts:13

Properties

rewards

Private rewards: Map<string, bigint>

Defined in

src/models/AssetPrice.ts:6


tokenAddress

Private Optional tokenAddress: string

Defined in

src/models/AssetPrice.ts:8


totalPrice

Private totalPrice: bigint

Defined in

src/models/AssetPrice.ts:4

Methods

addNetworkFees

addNetworkFees(feeReceiver, networkFeePercent): AssetPrice

It adds network fees on top of the already configured asset rewards

Parameters

Name Type Description
feeReceiver string the address receiving the fees
networkFeePercent bigint the percent of fees to receive, it uses the contract denominator

Returns

AssetPrice

the asset rewards object

See

AssetPrice.NETWORK_FEE_DENOMINATOR

Defined in

src/models/AssetPrice.ts:77


adjustToIncludeNetworkFees

adjustToIncludeNetworkFees(feeReceiver, networkFeePercent): AssetPrice

It includes network fees on the existing asset rewards subtracting the proportion taking into account the receivers percent

Parameters

Name Type Description
feeReceiver string the address receiving the fees
networkFeePercent bigint the percent of fees to receive, it uses the contract denominator

Returns

AssetPrice

the asset rewards object

See

AssetPrice.NETWORK_FEE_DENOMINATOR

Defined in

src/models/AssetPrice.ts:88


getAmounts

getAmounts(): bigint[]

Returns

bigint[]

Defined in

src/models/AssetPrice.ts:46


getAmountsString

getAmountsString(): string

Returns

string

Defined in

src/models/AssetPrice.ts:104


getReceivers

getReceivers(): string[]

Returns

string[]

Defined in

src/models/AssetPrice.ts:50


getReceiversString

getReceiversString(): string

Returns

string

Defined in

src/models/AssetPrice.ts:110


getRewards

getRewards(): Map<string, bigint>

Returns

Map<string, bigint>

Defined in

src/models/AssetPrice.ts:42


getTokenAddress

getTokenAddress(): string

Returns

string

Defined in

src/models/AssetPrice.ts:67


getTotalPrice

getTotalPrice(): bigint

Returns

bigint

Defined in

src/models/AssetPrice.ts:38


setReceiver

setReceiver(receiver, amount): AssetPrice

Parameters

Name Type
receiver string
amount bigint

Returns

AssetPrice

Defined in

src/models/AssetPrice.ts:54


setTokenAddress

setTokenAddress(address): AssetPrice

Parameters

Name Type
address string

Returns

AssetPrice

Defined in

src/models/AssetPrice.ts:62


toString

toString(): string

Returns

string

Defined in

src/models/AssetPrice.ts:115


sumAmounts

sumAmounts(amounts): bigint

Parameters

Name Type
amounts bigint[]

Returns

bigint

Defined in

src/models/AssetPrice.ts:34