@robinpath/currency
0.1.1Node.jsPublicCurrency 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.getLatestRatesto perform this operation - convert -- Use
currency.convertto perform this operation - convertBatch -- Use
currency.convertBatchto perform this operation - getHistoricalRates -- Use
currency.getHistoricalRatesto perform this operation - listCurrencies -- Use
currency.listCurrenciesto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
getLatestRates | getLatestRates | object |
convert | convert | object |
convertBatch | convertBatch | object |
getHistoricalRates | getHistoricalRates | object |
listCurrencies | listCurrencies | object |
getRate | getRate | object |
getSupportedCodes | getSupportedCodes | object |
getTimeSeriesRates | getTimeSeriesRates | object |
formatCurrency | formatCurrency | object |
getPopularRates | getPopularRates | object |
Functions
getLatestRates
getLatestRates
Module: currency | Returns: object -- API response.
currency.getLatestRates
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
convert
convert
Module: currency | Returns: object -- API response.
currency.convert
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
convertBatch
convertBatch
Module: currency | Returns: object -- API response.
currency.convertBatch
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getHistoricalRates
getHistoricalRates
Module: currency | Returns: object -- API response.
currency.getHistoricalRates
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listCurrencies
listCurrencies
Module: currency | Returns: object -- API response.
currency.listCurrencies
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getRate
getRate
Module: currency | Returns: object -- API response.
currency.getRate
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getSupportedCodes
getSupportedCodes
Module: currency | Returns: object -- API response.
currency.getSupportedCodes
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getTimeSeriesRates
getTimeSeriesRates
Module: currency | Returns: object -- API response.
currency.getTimeSeriesRates
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
formatCurrency
formatCurrency
Module: currency | Returns: object -- API response.
currency.formatCurrency
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getPopularRates
getPopularRates
Module: currency | Returns: object -- API response.
currency.getPopularRates
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
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)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | 1 months ago |
Related Modules
@robinpathv0.1.4
SMTP email sending and address parsing for RobinPath
hash
JS@robinpathv0.1.3
Cryptographic hashing utilities: MD5, SHA family, HMAC, CRC32, file hashing, UUID v5 generation, secure random bytes, and content fingerprinting
csv
JS@robinpathv0.1.2
Parse and stringify CSV data
apollo
JS@robinpathv0.1.2
Apollo module for RobinPath.
$ robinpath add @robinpath/currency
