Code Monkey home page Code Monkey logo

mutinyhooks's Introduction

MutinyHooks

Dev

Run

yarn start

Test

yarn test

.env

MUTINYNET_URL=https://mutinynet.com/api
NEW_UTXO_THRESHOLD=900
POLLING_INTERVAL=3000
CONFIRMATIONS=1
PORT=6969
METADATA={SECRET_THAT_YOUR_APP_CAN_CONFIRM | ANYTHING}

Your app subscribes to address changes in the MutinyNet Signet (Inspired by https://blockhooks.io/)

HTTP POST
http://localhost:6969/api/v2/watch-address

{
  network: 'testnet'
  address: string // A bitcoin address
  webhook: string // Your callback url (an endpoint for us to deliver notifications)
  metadata: string // (optional) An additional payload you want us to pass along with the notification
}

When MutinyHooks detects changes on your address it calls your webhook url and passes back this data:

{
  address: 'tb1pgj6n2w7xmn8ke5gqau07jxreaf6hpvhx8zxl425vwycjg8dzuxeqdhrzun',
  txid: 'c40275693516e2a9e3a7e5401aa7115845d621ada75fabd506b5c61305287a4a',
  hex: '020000000001019766728e0a258b3a70b02ab016b9cda5e875a3d6a4ac87a1fb3ee379cb3333a10100000000fdffffff02eab67f4a000000001600145e5b67bb8c0c4ceded6fdc2052b8d155a99f7ccd0e2700000000000022512044b5353bc6dccf6cd100ef1fe91879ea7570b2e6388dfaaa8c7131241da2e1b20247304402206c0099e14dd3c229612ec0cb069e24da4750a779763cd4253a34d1203e16d34a0220213782998530f1b08be96948d6e9556039557ce5ff2f2e032a5cf316dd54d226012102f1c01458cbe831241f2b7a589c2f3f79c268c008953bdfaa70fc5b9cba44a536f87c0700',
  confirmations: 6,
  network: 'testnet',
  timestamp: 1697178921000,
  webhook: 'http://host.docker.internal:3000/api/public/blockhooks-hook'
}

Docker Compose

To Run this in your dev env:

docker-compose

  blockhooks:
    image: ntheile/mutinyhooks:latest
    ports:
      - '6969:6969'
    restart: always
    environment:
      MUTINYNET_URL: https://mutinynet.com/api
      POLLING_INTERVAL: 3000
      CONFIRMATIONS: 1
      PORT: 6969
      METADATA: ANYTHING_YOU_WANT_PASSED_BACK_FROM_MUTINYHOOKS

MutinyNet Links

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.