@pbwebdev/cardano-wallet-browser-extensions-interface
TypeScript icon, indicating that this package has built-in type declarations

1.7.0 • Public • Published

Cardano Wallet Browser Extensions Interface

A helper javascript library/package to interact with Cardano Wallets

Installation

npm install @pbwebdev/cardano-wallet-browser-extensions-interface

Supported Wallets

  • Eternl
  • Yoroi
  • Typhon
  • GeroWallet
  • NuFi
  • Lace
  • Begin

Usage

Simple ADA payment to an address

import Extensions from '@pbwebdev/cardano-wallet-browser-extensions-interface'
import { adaToLovelace } from '@pbwebdev/cardano-wallet-browser-extensions-interface/utils'

const amountInAda = 123
const wantedWallet = 'Lace'
const payeeAddress =
    'addr_test1qqr585tvlc7ylnqvz8pyqwauzrdu0mxag3m7q56grgmgu7sxu2hyfhlkwuxupa9d5085eunq2qywy7hvmvej456flknswgndm3'
const protocolParameters = {} // latest protocol parameters

const Wallet = await Extensions.getWallet(wantedWallet)
const transaction = await Wallet.payTo(payeeAddress, adaToLovelace(amountInAda), protocolParameters)

console.log('Transaction Hash', transaction)

Simple stake pool delegation

import Extensions from '@pbwebdev/cardano-wallet-browser-extensions-interface'

const poolId = '6658713e2cbfa4e347691a0435953f5acbe9f03d330e94caa3a0cfb4'
const wantedWallet = 'Eternl'
const protocolParameters = {} // latest protocol parameters
const accountInformation = {} // stake account information

const Wallet = await Extensions.getWallet(wantedWallet)
const transaction = await Wallet.delegateTo(poolId, protocolParameters, accountInformation)

console.log('Transaction Hash', transaction)

Dependents (0)

Package Sidebar

Install

npm i @pbwebdev/cardano-wallet-browser-extensions-interface

Weekly Downloads

6

Version

1.7.0

License

MIT

Unpacked Size

21.4 kB

Total Files

23

Last publish

Collaborators

  • astroboysoup
  • kermage