confederacy

0.1.5 • Public • Published

Confederacy API

Confederacy API for UTXO Tracking

Overview

Configure topic managers and lookup service providers. Then, submit transactions that contain tokens that get tracked in the topics. Spend them to update hte tokens, and look up the tokens you need.

Usage

const Confederacy = require('confederacy')
const UMPManager = require('ump-manager')
const UMPLookupService = require('ump-lookup-service')

// Construct a Confederacy with managers and lookup services
const confederacy = new Confederacy({
  managers: {
    ump: new UMPManager()
  },
  lookupServices: {
    ump: new UMPLookupService()
  }
})

// Submit transactions that interact with tokens for a given topic
confederacy.submit({
  rawTx: '...',
  inputs: {},
  mapiResponses: [],
  topics: ['ump']
})

// Look up tokens that are actively in a topic
confederacy.lookup({
  provider: 'ump',
  query: {
    tokenTextContains: '...'
  }
})

// Spend a token to remove it from a topic, optionally replacing it
confederacy.submit({
  rawTx: '...',
  inputs: {},
  mapiResponses: [],
  topics: ['ump']
})

UHRP-Confederacy

Loosely-federated User Management Protocol UTXO tracking

Overview

Configure topic managers and lookup service providers. Then, submit transactions that contain tokens that get tracked in the topics. Spend them to update hte tokens, and look up the tokens you need.

Usage

const Confederacy = require('confederacy')
const UHRPManager = require('uhrp-manager')
const UHRPLookupService = require('uhrp-lookup-service')

// Construct a Confederacy with managers and lookup services
const confederacy = new Confederacy({
  managers: {
    uhrp: new UHRPManager()
  },
  lookupServices: {
    uhrp: new UHRPLookupService()
  }
})

// Submit transactions that interact with tokens for a given topic
confederacy.submit({
  rawTx: '...',
  inputs: {},
  mapiResponses: [],
  topics: ['uhrp']
})

// Look up tokens that are actively in a topic
confederacy.lookup({
  provider: 'uhrp',
  query: {
    tokenTextContains: '...'
  }
})

// Spend a token to remove it from a topic, optionally replacing it
confederacy.submit({
  rawTx: '...',
  inputs: {},
  mapiResponses: [],
  topics: ['uhrp']
})

Readme

Keywords

none

Package Sidebar

Install

npm i confederacy

Weekly Downloads

0

Version

0.1.5

License

Open BSV License

Unpacked Size

66.2 kB

Total Files

39

Last publish

Collaborators

  • tonesnotes