Socket
Socket
Sign inDemoInstall

@nestlab/byn-exchange

Package Overview
Dependencies
46
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nestlab/byn-exchange

Module for get currency exchange rates. Provider national bank of Belarus.


Version published
Weekly downloads
3
Maintainers
1
Created
Weekly downloads
 

Readme

Source

BYN exchange module

Module for get currency exchange rates. Provider national bank of Belarus.

Install

$ npm i @nestlab/byn-exchange

Configuration

@Module({
    imports: [
        BynExchangeModule.forRoot({
            useCache: true,
            cacheTtl: 24 * 3600 * 1000, // 1 day
        })
    ],
})
export class AppModule {
}

Usage


export class YourService {
    constructor(private readonly converter: BynExchangeConverter) {
    }
    
    async convert1000UsdToByn(): Promise<number> {
        this.converter.convert(Currency.USD).toByn(1000);
    }

    async convert1000BynToUsd(): Promise<number> {
        this.converter.convert(Currency.USD).fromByn(1000);
    }
}

Enjoy!

Keywords

FAQs

Last updated on 01 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc