JavaScript client library for the Blink stack. This is used in front-end applications like the web and mobile wallets.
npm install @blinkbitcoin/blink-clientJavaScript client library for the Blink stack. This is used in front-end applications like the web and mobile wallets.
Install the package with:
``bash`
yarn add @blinkbitcoin/blink-client
`js
import { parsePaymentDestination } from "@blinkbitcoin/blink-client"
const { valid, paymentType, amount } = parsePaymentDestination({
destination: "username or invoice or bitcoin address",
network: "mainnet", // or signet or regtest
})
`
Test with Jest framework:
`bash`
pnpm test
Build production (distribution) files in dist folder:
`bash`
pnpm build
using pnpm
Run:
`bash`
pnpm link --global
and in your test project run:
`bash`
pnpm link --global @blinkbitcoin/blink-client
If you want to remove the link, run:
`bashin your test project
pnpm unlink @blinkbitcoin/blink-client
using yarn
Run:
`bash
yarn link
`and in your test project run:
`bash
yarn link @galoymoney/client
`If you want to remove the symlink, run:
`bash
in your test project
yarn unlink @galoymoney/clientin galoymoney/client folder
yarn unlink
`
using yalc
Run:
`bash
in galoymoney/client folder
yalc publish
`in your test project run:
`bash
yalc add @galoymoney/client
`If you want to remove the symlink, run:
`bash
in your test project
yalc remove @galoymoney/client
`to update changes, you have to run yalc publish before run:
`bash
in your test project
yalc update
``