Git Product home page Git Product logo

p2pkh-raw-tx's Introduction

P2PKH Raw Transaction

This endpoint will be used to create a raw transaction that spends from a P2PKH address and that supports paying to mulitple addresses (either P2PKH or P2SH). The endpoint should return a transaction that spends from the source address and that pays to the output addresses. An extra output for change should be included in the resulting transaction if the change is > 5430 SAT.

  • Path: /payment_transactions
  • Method: POST
  • Request Body:
{
    source_address (string): The address to spend from
    outputs (dictionary): A dictionary that maps addresses to amounts (in SAT)
    fee_kb (int): The fee per kb in SAT
}
  • Response Body:
{
    raw (string): The unsigned raw transaction
    inputs (array of dicts): The inputs used
    {
        txid (string): The transaction id
        vout (int): The output number
        script_pub_key (string): The script pub key
        amount (int): The amount in SAT
    }
}
  • Example:
curl -X POST \
  http://localhost:5000/payment_transactions \
  -H 'Content-Type: application/json' \ 
  -d '{
        "source_address": "3E1WB5Y7jxDPT428A3Si6g94L9j7Rt2vt4",
        "outputs": {
                "1HCuHELi5PX8mnLTSkPv27T48K4ig4CJUP": 9999
        },
        "fee_kb": 2500
}'

Running

Local

  • Install packages and run:
make start

OR

make install-packages
make run

Docker

  • Run:
make docker

OR

make docker-build
make docker-run
  • Stop:
make docker-stop

Run unit tests

  • Install test packages:
make install-test-packages
  • Run tests:
make test

Help

make help

p2pkh-raw-tx's People

Contributors

pantani avatar

Watchers

 avatar  avatar  avatar

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.