Socket
Book a DemoInstallSign in
Socket

@yoroi/banxa

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yoroi/banxa

The Banxa integration package of Yoroi SDK

1.5.0
latest
Source
npmnpm
Version published
Maintainers
3
Created
Source

Yoroi Banxa Module

The Yoroi Banxa package is a utility for interacting with Banxa resources/APIs.

Installation

Install the package using npm or yarn :

npm install @yoroi/banxa --save
yarn add @yoroi/banxa --save

Usage

Generating a referral URL to redirect/open

import { Banxa, banxaModuleMaker } from '@yoroi/banxa';

const options: Banxa.ReferralUrlBuilderOptions = {
    isProduction: true,
    partner: 'emurgo',
};

const params: Banxa.ReferralUrlQueryStringParams = {
    fiatType: 'USD',
    coinType: 'ADA',
    walletAddress:
        'addr1q9v8dvht2mv847gwarl7r4p49yzys8r7zlep7c8t2hqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquvupf',
};

const banxa = banxaModuleMaker(options);

const url = banxa.createReferralUrl(params);

console.log(url.toString())

Error handling

try {
    // some Banxa code
} catch (error) {
    if (error instanceof Banxa.ValidationError) {
        console.error("Validation error:", error.message);
    } else if (error instanceof Banxa.UnknownError) {
        console.error("Unknown error:", error.message);
    }
}

Running on mobile

To use this module on a react-native application it is required to polyfill the URL object by using modules such as react-native-url-polyfill

Keywords

yoroi

FAQs

Package last updated on 08 Jan 2024

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.