Skip to content
/ rx Public

Reactive Extensions client for the Stacks Blockchain

Notifications You must be signed in to change notification settings

hirosystems/rx

Repository files navigation

@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

from(broadcastTransaction(transaction)).pipe(

  tap(tx => notifyBroadcastSuccess(tx)),
  
  concatMap(txid => mempoolTxs$.pipe(filterByTxid(txid))),

  tap(mempoolTx => notifyTxInMempool(mempoolTx)),

  concatMap(memTx => txs$.pipe(filterByTxid(txid))),
)
.subscribe(tx => notifyTransactionConfirm());

Resources

About

Reactive Extensions client for the Stacks Blockchain

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published