Skip to content

cardano-wallet-interface 1.0.12

Install from the command line:
Learn more about npm packages
$ npm install @HarmonicPool/cardano-wallet-interface@1.0.12
Install via package.json:
"@HarmonicPool/cardano-wallet-interface": "1.0.12"

About this version

cardano-wallet-interface

brought to you by Harmonic Pool

Contents

Prerequisites

make sure to enable web-assembly if not configured by default.

You may find some help at documentation/known_issues/allowing_webassembly.md

Installation

make sure you have a folder called node_modules in your project

run the following in your project directory

npm install https://github.com/HarmonicPool/cardano-wallet-interface

Usage

basic delegation functionality

/*... other imports ...*/
import { Wallet } from "@harmonicpool/cardano-wallet-interface";

/*...*/

Wallet.Nami.delegateTo(
    "<your pool id>",
    "<your blockforst api key>"
);

Wallet.CCValut.delegateTo(
    "<your pool id>",
    "<your blockforst api key>"
);

/*...*/

an example using the Nami wallet with some logic

/*... other imports ...*/
import { Wallet } from "@harmonicpool/cardano-wallet-interface";


/*...*/

async function myDelegationFunction()
{
    Wallet.setBlockforst("<your blockforst api key>");

    const currentUserDelegation = await Wallet.Nami.getCurrentDelegation(/*add <your blockforst api key> if you choose to not call Wallet.setBlockforst*/);

    if( currentUserDelegation.pool_id === "<your pool id>" )
    {
        /* thank your delegator*/
    }
    else
    {
        Wallet.Nami.delegateTo(
            "<your pool id>",
            "<your blockforst api key>" // not needed if called Wallet.setBlockforst previously
        );
    }
}

/*...*/

other examples

check the documentation/examples folder for more

Support Harmonic

Any code correction you may find useful is a great form of support for all the Cardano community, you can send them to the Harmonic Pool mail

other great forms to show support are:

addr1qxyryaacjdwau64wyf5truhq2akuc50dunrzlpj82pcjjkwpcdn8a48cpt55dp9d7wc8khg8aksheu62u4nhrdtgddeqd4r83d

any of the above will be really appreciated <3

Details


Assets

  • cardano-wallet-interface-1.0.12-npm.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0