@stacks/rx
Reactive client library for the Stacks blockchain
Last updated 4 months ago by kyranjamie .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @stacks/rx 
SYNC missed versions from official npm registry.

@stacks/rx

Build and test status

Reactive Extensions client for the Stacks Blockchain ????

Getting Started

yarn add @stacks/rx rxjs
import { RxStacks, HIRO_API_URL } from '@stacks/rx';

const client = new RxStacks({ url: HIRO_API_URL });

client.blocks$.subscribe(block => console.log('New block: ', block.height));

Demo App

git clone https://github.com/blockstack/rx
cd demo/demo-app
yarn && yarn start

Open http://localhost:3000 to view it in your browser.

Tutorial

Broadcasting a transaction

Tutorial

Using @stacks/rx to follow a transaction's lifecycle

const { broadcastTx } = new RxStacks({ url });

broadcastTx(transaction)
  .pipe(
    concatMap(txid => {
      notifyBroadcastSuccess(tx);
      return mempoolTxs$.pipe(filterByTxid(txid));
    }),
    concatMap(memTx => {
      notifyTxInMempool(mempoolTx);
      return txs$.pipe(filterByTxid(txid));
    })
  )
  .subscribe(tx => notifyTransactionConfirm(tx));
const txid = await broadcastTx(transaction)({
  onBroadcastSuccess(),
  onBroadcastError(),
  onMempoolInclusion(),
  onTransactionConfirmedInBlock(),
})

Resources

Current Tags

  • 0.0.7                                ...           latest (4 months ago)

7 Versions

  • 0.0.7                                ...           4 months ago
  • 0.0.6                                ...           4 months ago
  • 0.0.5                                ...           4 months ago
  • 0.0.4                                ...           5 months ago
  • 0.0.3                                ...           5 months ago
  • 0.0.2                                ...           5 months ago
  • 0.0.1                                ...           5 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (16)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |