🔗convertToVLRY

Description

The convertToVLRY function is a synchronous function that converts an amount from USD to VLRY based on a predefined exchange rate.

The function takes a USD amount as input and calculates the equivalent amount in VLRY using the exchange rate.

Parameters

ParameterData TypeDescription

usdAmount

number

The amount in USD to be converted to VLRY.

Response

FieldData TypeDescription

code

Number

A numeric value indicating the execution status (1 for success, 0 for error).

error

any

The error object containing details about the encountered error, if applicable.

result

Object

An object containing the converted amount in VLRY and the exchange rate.

Example Request and Response

Prerequisites

Before making requests with NEST® SDK, you must have it installed.

You can install NEST® SDK using either npm or yarn. Use the following commands to install NEST® SDK:

npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib

Request

Here is an example of how to make a convertToVLRY request using the NEST® SDK:

const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const response = nft.USDToVLRY(1);
    console.log(response);
}

main();

Response

{ code: 1, result: { vlryAmount: 6.666666666666667, vlryRate: 0.15 } }

Use Cases

  • The convertToVLRY function can be used to convert an amount from USD to VLRY. For example, if you have an amount in USD and you want to know the equivalent value in VLRY, you can use this function. It calculates the conversion based on the predefined exchange rate and returns the converted amount along with the exchange rate.

Last updated