0.2.31 • Published 3 days ago

payment-tokenator v0.2.31

Weekly downloads
-
License
Open BSV License
Repository
-
Last release
3 days ago

payment-tokenator

Overview

PaymentTokenator makes sending Bitcoin payments peer-to-peer between Babbage users a breeze!

Example Usage

This example demonstrates sending and receiving payments with payment-tokenator

const PaymentTokenator = require('payment-tokenator')
const johnSmith = '022600d2ef37d123fdcac7d25d7a464ada7acd3fb65a0daf85412140ee20884311'

const init = async () => {
    // Create a new instance of the PaymentTokenator class
    // Optionally configure a custom peerServHost
    const tokenator = new PaymentTokenator({
        peerServHost: 'https://staging-peerserv.babbage.systems'
    })
    // Send a payment using Babbage
    await tokenator.sendPayment({
        recipient: johnSmith,
        amount: 1033 // satoshis
    })

    // List Incoming Payments
    const payments = await tokenator.listIncomingPayments()

    // Accept the first payment received (for example)
    await tokenator.acceptPayment(payments[0])
}

init()

API

Table of Contents

PaymentTokenator

Extends Tokenator

Extends the Tokenator class to enable peer-to-peer Bitcoin payments

Parameters

  • obj object All parameters are given in an object. (optional, default {})

    • obj.peerServHost String? The PeerServ host you want to connect to. (optional, default 'https://staging-peerserv.babbage.systems')
    • obj.clientPrivateKey String? A private key to use for mutual authentication with Authrite. (Optional - Defaults to Babbage signing strategy).

sendPayment

Sends Bitcoin to a PeerServ recipient

Parameters
  • payment Object The payment object

    • payment.recipient string The recipient of the payment
    • payment.amount Number The amount in satoshis to send

acceptPayment

Accepts a payment into the default basket

Parameters
  • payment Object The payment object

    • payment.messageId Number The Id of the paymentMessage
    • payment.sender String The identityKey of the sender
    • payment.amount Number The amount of the payment
    • payment.token Object containing the P2PKH derivation instructions

listIncomingPayments

Lists incoming Bitcoin payments

Returns Array of payments to receive

PaymentTokenator

Extends Tokenator

Extends the Tokenator class to enable peer-to-peer Bitcoin payments

Parameters

  • obj object All parameters are given in an object. (optional, default {})

    • obj.peerServHost String? The PeerServ host you want to connect to. (optional, default 'https://staging-peerserv.babbage.systems')
    • obj.clientPrivateKey String? A private key to use for mutual authentication with Authrite. (Optional - Defaults to Babbage signing strategy).

sendPayment

Sends Bitcoin to a PeerServ recipient

Parameters

  • payment Object The payment object

    • payment.recipient string The recipient of the payment
    • payment.amount Number The amount in satoshis to send

acceptPayment

Accepts a payment into the default basket

Parameters

  • payment Object The payment object

    • payment.messageId Number The Id of the paymentMessage
    • payment.sender String The identityKey of the sender
    • payment.amount Number The amount of the payment
    • payment.token Object containing the P2PKH derivation instructions

listIncomingPayments

Lists incoming Bitcoin payments

Returns Array of payments to receive

0.2.31

3 days ago

0.2.30

6 days ago

0.2.29

6 days ago

0.2.28

9 days ago

0.2.27

16 days ago

0.2.26

17 days ago

0.2.25

25 days ago

0.2.24

25 days ago

0.2.23

26 days ago

0.2.22

29 days ago

0.2.21

29 days ago

0.2.20

30 days ago

0.2.19

1 month ago

0.2.18

1 month ago

0.2.17

1 month ago

0.2.16

1 month ago

0.2.15

1 month ago

0.2.14

1 month ago

0.2.13

1 month ago

0.2.12

1 month ago

0.2.11

2 months ago

0.2.10

2 months ago

0.2.7

2 months ago

0.2.9

2 months ago

0.2.8

2 months ago

0.2.6

2 months ago

0.2.5

2 months ago

0.2.4

2 months ago

0.2.1

2 months ago

0.2.0

2 months ago

0.2.3

2 months ago

0.2.2

2 months ago

0.1.31

2 months ago

0.1.32

2 months ago

0.1.30

3 months ago

0.1.28

3 months ago

0.1.29

3 months ago

0.1.27

3 months ago

0.1.26

3 months ago

0.1.23

3 months ago

0.1.24

3 months ago

0.1.25

3 months ago

0.1.22

3 months ago

0.1.21

3 months ago

0.1.20

3 months ago

0.1.18

3 months ago

0.1.19

3 months ago

0.1.17

3 months ago

0.1.16

4 months ago

0.1.12

4 months ago

0.1.13

4 months ago

0.1.14

4 months ago

0.1.15

4 months ago

0.1.10

4 months ago

0.1.11

4 months ago

0.1.9

4 months ago

0.1.8

4 months ago

0.1.7

4 months ago

0.1.6

5 months ago

0.1.5

5 months ago

0.1.4

5 months ago

0.1.3

8 months ago

0.1.2

12 months ago

0.1.1

1 year ago

0.1.0

1 year ago