Giter Site home page Giter Site logo

bitgo-ruby's Introduction

Bitgo Ruby Gem

Lightweight wrapper for Bitgo and Bitgo Express REST API.

Note: This wrapper is work in progress and does not cover every API yet.

BitGo Documentation: https://www.bitgo.com/api/

Installation

gem install bitgo

Usage

# Setup an api instance
api = Bitgo::V1::Api.new(Bitgo::V1::Api::TEST )
api.session_token = "your session token"

# Available pre-defined API end points
# Bitgo::V1::Api::TEST : https://test.bitgo.com/api/v1
# Bitgo::V1::Api::LIVE : https://bitgo.com/api/v1
# Bitgo::V1::Api::EXPRESS : http://127.0.0.1:3080/api/v1

Custom Endpoint

# If you have a custom bitgo express end point, you may use it
api = Bitgo::V1::Api.new('https://my-bitgo-express-endpoint.com')

User API

api.session_info
api.login(email: 'xx', password: 'xx', otp: 'xx')
api.logout
api.send_otp(send_sms: false)
api.session_information
api.lock
api.unlock(otp: 'xx', duration_seconds: 600)

Keychains API

api.list_keychains
api.create_keychains(seed)
api.add_keychain(xpub: 'xx', encrypted_xprv: 'xx')
api.create_bitgo_keychain

Address Labels API

api.list_labels
api.list_labels_for_wallet(wallet_id: 'xx')
api.set_label(wallet_id: 'xx', address: 'xx', label: 'xx')
api.delete_label(wallet_id: 'xx', address: 'xx')

Wallets API

api.list_wallets
api.simple_create_wallet(passphrase: 'xx', label: 'xx') # Bitgo express
api.add_wallet(label: 'xx', m: 2, n: 3, keychains: 'xxx', enterprise: 'xx')
api.get_wallet(wallet_id: 'xx')
api.list_wallet_addresses(walet_id: 'xx')
api.create_address(wallet_id: 'xx', chain: 'xx')
api.send_coins_to_address(wallet_id: 'xx', address: 'address', amount: 'xx', wallet_passphrase: 'xx')

Webhooks API

api.add_webhook(wallet_id: 'xx', type: 'xx', url: 'xx', confirmations: 'xx')
api.remove_webhook(wallet_id: 'xx', type: 'xx', url: 'xx')
api.list_webhooks(wallet_id: 'xx')

Utilities API (Via Bitgo Express)

api.encrypt(input: 'string to encrypt, usually xprv', password: 'password to encrypt')
api.decrypt(input: 'string to decrypt, output of encrypt()', password: 'password to decrypt')
api.verify_address(address: 'xx')

Contributors

Todo

  • Cover all APIs
  • Unit Tests

bitgo-ruby's People

Contributors

ugomare avatar

Watchers

 avatar  avatar

Forkers

bridge21

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.