Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Donate via Zerocracy

EO principles respected here Managed by Zerocracy DevOps By Rultor.com We recommend RubyMine

Build Status PDD status Gem Version Test Coverage Yard Docs

License Hits-of-Code

Here is the White Paper.

Join our Telegram group to discuss it all live.

This is a simple Ruby SDK for making payments, checking balances, and finding transactions in Zold wallets via WTS system.

There are other languages too: Java SDK.

First, you install it:

gem install zold-ruby-sdk

Then, you get your API key here.

The, you make an instance of class Zold::WTS:

require 'zold/wts'
wts = Zold::WTS.new(key)

Now you can pull your wallet and then check its balance:

job = wts.pull # Initiate PULL and returns the unique ID of the job
wts.wait(job) # Wait for the job to finish
b = wts.balance # Retrieve the balance as an instance of Zold::Amount
puts b

To make a payment you will need to know your keygap:

job = wts.pay(keygap, 'yegor256', '19.95', 'For pizza') # Initiate a payment request
wts.wait(job) # Wait for the job to finish

To find a payment in your wallet, you do this (don't forget to pull first):

# Finds all payments that match this query and returns
# an array of Zold::Txn objects.
txns = wts.find(id: '123', details: /pizza/)

That's it.

How to contribute

Read these guidelines. Make sure you build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:

$ bundle update
$ bundle exec rake

If it's clean and you don't see any error messages, submit your pull request.