AssetPrice
@nevermined-io/sdk - v3.0.44 / AssetPrice
Class: AssetPrice
Table of contents
Constructors
Properties
Methods
- addNetworkFees
- adjustToIncludeNetworkFees
- getAmounts
- getAmountsString
- getReceivers
- getReceiversString
- getRewards
- getTokenAddress
- getTotalPrice
- setReceiver
- setTokenAddress
- toString
- sumAmounts
Constructors
constructor
• new AssetPrice(): AssetPrice
Returns
Defined in
• new AssetPrice(_rewards
): AssetPrice
Parameters
Name | Type |
---|---|
_rewards | Map \<string , bigint > |
Returns
Defined in
• new AssetPrice(address
, amount
): AssetPrice
Parameters
Name | Type |
---|---|
address | string |
amount | bigint |
Returns
Defined in
• new AssetPrice(address
, amount
, tokenAddress
): AssetPrice
Parameters
Name | Type |
---|---|
address | string |
amount | bigint |
tokenAddress | string |
Returns
Defined in
Properties
rewards
• Private
rewards: Map
\<string
, bigint
>
Defined in
tokenAddress
• Private
Optional
tokenAddress: string
Defined in
totalPrice
• Private
totalPrice: bigint
Defined in
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
the asset rewards object
See
AssetPrice.NETWORK_FEE_DENOMINATOR
Defined in
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
the asset rewards object
See
AssetPrice.NETWORK_FEE_DENOMINATOR
Defined in
getAmounts
▸ getAmounts(): bigint
[]
Returns
bigint
[]
Defined in
getAmountsString
▸ getAmountsString(): string
Returns
string
Defined in
getReceivers
▸ getReceivers(): string
[]
Returns
string
[]
Defined in
getReceiversString
▸ getReceiversString(): string
Returns
string
Defined in
getRewards
▸ getRewards(): Map
\<string
, bigint
>
Returns
Map
\<string
, bigint
>
Defined in
getTokenAddress
▸ getTokenAddress(): string
Returns
string
Defined in
getTotalPrice
▸ getTotalPrice(): bigint
Returns
bigint
Defined in
setReceiver
▸ setReceiver(receiver
, amount
): AssetPrice
Parameters
Name | Type |
---|---|
receiver | string |
amount | bigint |
Returns
Defined in
setTokenAddress
▸ setTokenAddress(address
): AssetPrice
Parameters
Name | Type |
---|---|
address | string |
Returns
Defined in
toString
▸ toString(): string
Returns
string
Defined in
sumAmounts
▸ sumAmounts(amounts
): bigint
Parameters
Name | Type |
---|---|
amounts | bigint [] |
Returns
bigint