Giter Site home page Giter Site logo

apitool's Introduction

apitool

Building

to build you need to have a recent version of Go installed, go into apitool`s directory and type:

go build -o apitool github.com/qredo/apitool/cmd/cli

this will produce a binary called apitool

CLI

the following command will sign and print the required headers to make a request:

./apitool -api-key _lJCqc-T3cnNpw \
          -secret JDJhJDA0JGV0aGt1LnE1a0NyZUFhaHFYVnlzZnVpU0Ryd2xOVThIZTY0TkhpRzRaLjF6YS9ZSi95SExL \
          -method GET \
          -url http://127.0.0.1:8002/qapi/v1/balance sign 

output:

qredo-api-sign: ZPjvuaQHtHVKg26nd5FMNJKRyA45d5VzwonbZkRxt9w
qredo-api-key: _lJCqc-T3cnNpw 
qredo-api-ts: 1644848012

and this will automatically sign and send the request and print the response from the server:

./apitool -api-key _lJCqc-T3cnNpw \
          -secret JDJhJDA0JGV0aGt1LnE1a0NyZUFhaHFYVnlzZnVpU0Ryd2xOVThIZTY0TkhpRzRaLjF6YS9ZSi95SExL \
          -method GET \
          -url http://127.0.0.1:8002/qapi/v1/balance send 

output:

{"assets":{"BTC-TESTNET":{"total":0,"available":0,"pendingIn":0,"pendingOut":0,"scale":100000000},"QCOIN-1":{"total":200000,"available":200000,"pendingIn":0,"pendingOut":0,"scale":1},"QCOIN-2":{"total":100000,"available":100000,"pendingIn":0,"pendingOut":0,"scale":1}}}

Web UI

apitool has a simplistic web ui for generating signatures and also sending signed requests, to start it type:

./apitool ui
WebUI listening on http://127.0.0.1:4569

and click on the link or copy&paste it in your browser

Final notes

This project is released under the terms of the Apache 2.0 License - see LICENSE for details. The copyright owner are listed in the .reuse/dep5 file. Feel free to send Pull Requests (see CONTRIBUTING.md for instructions)

apitool's People

Contributors

ruphy avatar tfl0pz avatar

Forkers

citrullin

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.