Modules@robinpath/currency
currency

@robinpath/currency

0.1.1Node.jsPublic

Currency module for RobinPath.

Currency

Currency module for RobinPath.

Package: @robinpath/currency | Category: Utility | Type: Utility

Authentication

No authentication required. All functions are available immediately.

Use Cases

Use the currency module when you need to:

  • getLatestRates -- Use currency.getLatestRates to perform this operation
  • convert -- Use currency.convert to perform this operation
  • convertBatch -- Use currency.convertBatch to perform this operation
  • getHistoricalRates -- Use currency.getHistoricalRates to perform this operation
  • listCurrencies -- Use currency.listCurrencies to perform this operation

Quick Reference

FunctionDescriptionReturns
getLatestRatesgetLatestRatesobject
convertconvertobject
convertBatchconvertBatchobject
getHistoricalRatesgetHistoricalRatesobject
listCurrencieslistCurrenciesobject
getRategetRateobject
getSupportedCodesgetSupportedCodesobject
getTimeSeriesRatesgetTimeSeriesRatesobject
formatCurrencyformatCurrencyobject
getPopularRatesgetPopularRatesobject

Functions

getLatestRates

getLatestRates

Module: currency | Returns: object -- API response.

currency.getLatestRates
ParameterTypeRequiredDescription
inputstringNoInput parameter

convert

convert

Module: currency | Returns: object -- API response.

currency.convert
ParameterTypeRequiredDescription
inputstringNoInput parameter

convertBatch

convertBatch

Module: currency | Returns: object -- API response.

currency.convertBatch
ParameterTypeRequiredDescription
inputstringNoInput parameter

getHistoricalRates

getHistoricalRates

Module: currency | Returns: object -- API response.

currency.getHistoricalRates
ParameterTypeRequiredDescription
inputstringNoInput parameter

listCurrencies

listCurrencies

Module: currency | Returns: object -- API response.

currency.listCurrencies
ParameterTypeRequiredDescription
inputstringNoInput parameter

getRate

getRate

Module: currency | Returns: object -- API response.

currency.getRate
ParameterTypeRequiredDescription
inputstringNoInput parameter

getSupportedCodes

getSupportedCodes

Module: currency | Returns: object -- API response.

currency.getSupportedCodes
ParameterTypeRequiredDescription
inputstringNoInput parameter

getTimeSeriesRates

getTimeSeriesRates

Module: currency | Returns: object -- API response.

currency.getTimeSeriesRates
ParameterTypeRequiredDescription
inputstringNoInput parameter

formatCurrency

formatCurrency

Module: currency | Returns: object -- API response.

currency.formatCurrency
ParameterTypeRequiredDescription
inputstringNoInput parameter

getPopularRates

getPopularRates

Module: currency | Returns: object -- API response.

currency.getPopularRates
ParameterTypeRequiredDescription
inputstringNoInput parameter

Error Handling

All functions throw on failure. Common errors:

ErrorCause
Currency API error (${res.status}): ${t}Check the error message for details
Currency: "..." not configured. Call currency.setCredentials first.Check the error message for details
@desc "Get latest rates and validate result"
do
  set $result as currency.getLatestRates
  if $result != null
    print "Success"
  else
    print "No result"
  end
enddo

Recipes

1. List and iterate LatestRates

Retrieve all items and loop through them.

@desc "Get latest rates and iterate results"
do
  set $result as currency.getLatestRates
  each $item in $result
    print $item
  end
enddo

2. Multi-step Currency workflow

Chain multiple currency operations together.

@desc "Get latest rates, convert, and more"
do
  set $r_getLatestRates as currency.getLatestRates
  set $r_convert as currency.convert
  set $r_convertBatch as currency.convertBatch
  print "All operations complete"
enddo

3. Safe getLatestRates with validation

Check results before proceeding.

@desc "Get latest rates and validate result"
do
  set $result as currency.getLatestRates
  if $result != null
    print "Success: " + $result
  else
    print "Operation returned no data"
  end
enddo

Related Modules

  • json -- JSON module for complementary functionality

Versions (1)

VersionTagPublished
0.1.1latest1 months ago
Install
$ robinpath add @robinpath/currency

Collaborators

Dumitru Balaban
Dumitru Balaban
@dumitru
View all @robinpath modules
Version0.1.1
LicenseMIT
Unpacked Size3.6 KB
Versions1
Weekly Downloads26
Total Downloads26
Stars0
Last Publish1 months ago
Created1 months ago

Category

utilities