shapeshiftio 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +76 -11
- data/lib/shapeshiftio/version.rb +1 -1
- data/shapeshiftio.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b62b2c2299505f6afc19972515c0815ae04a575
|
|
4
|
+
data.tar.gz: 8f16403ea3b4014c420fe1e114f5235f80a412af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27ff68cd37d4e8215b1fbcc4d349db05c8e3f93c580d6e63fe3ad710798ae764260488cb837d86d3ab10fa67bb0976ab4db96e83831ddb6b13cfac8de020f485
|
|
7
|
+
data.tar.gz: fe2daff0ba4698a62664c1032655f7bbebc0d108390be0fc6c34d13164be265948db4faa1bb1d59ddc05fca7142440d44d65987bdb2bcf385534c7fd72b3f1ca
|
data/README.md
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Shapeshiftio
|
|
2
|
+
A complete ruby wrapper for shapeshift.io API
|
|
2
3
|
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/shapeshift`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
4
|
-
|
|
5
|
-
TODO: Refactor and make code base more DRY
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
7
|
Add this line to your application's Gemfile:
|
|
10
8
|
|
|
11
9
|
```ruby
|
|
12
|
-
gem '
|
|
10
|
+
gem 'shapeshiftio'
|
|
13
11
|
```
|
|
14
12
|
|
|
15
13
|
And then execute:
|
|
@@ -18,21 +16,88 @@ And then execute:
|
|
|
18
16
|
|
|
19
17
|
Or install it yourself as:
|
|
20
18
|
|
|
21
|
-
$ gem install
|
|
19
|
+
$ gem install shapeshiftio
|
|
22
20
|
|
|
23
21
|
## Usage
|
|
22
|
+
..* All methods return a JSON object with the fields detailed at the [shapeshift's official website](https://info.shapeshift.io/api)
|
|
23
|
+
..* To call a method you only need the __required fields__, if you want to pass more parameters, just add a hash when callind a method (examples below)
|
|
24
|
+
|
|
25
|
+
# GET requests:
|
|
26
|
+
|
|
27
|
+
List available coins in the shapeshift API:
|
|
28
|
+
|
|
29
|
+
Shapeshiftio.get_coins
|
|
30
|
+
|
|
31
|
+
Gets the current deposit limit set by Shapeshift for a specific pair:
|
|
32
|
+
|
|
33
|
+
Shapeshiftio.limit("doge_dgb")
|
|
34
|
+
|
|
35
|
+
Market info of a specific pair:
|
|
36
|
+
|
|
37
|
+
Shapeshiftio.market_info("doge_dgb")
|
|
38
|
+
|
|
39
|
+
Gets the current rate offered by Shapeshift:
|
|
40
|
+
|
|
41
|
+
Shapeshiftio.rate("btc_eth")
|
|
42
|
+
|
|
43
|
+
Get a list of the most recent transactions:
|
|
44
|
+
|
|
45
|
+
Shapeshiftio.recent_tx(max) #[max] is an optional maximum number of transactions to return.
|
|
46
|
+
|
|
47
|
+
Returns the status of the most recent deposit transaction to the address:
|
|
48
|
+
|
|
49
|
+
Shapeshiftio.tx_stat(deposit_address) #[address] is the deposit address to look up.
|
|
50
|
+
|
|
51
|
+
Time Remaining on Fixed Amount Transaction:
|
|
52
|
+
|
|
53
|
+
Shapeshiftio.time_remaining(deposit_address) #[address] is the deposit address to look up.
|
|
54
|
+
|
|
55
|
+
Validate an address, given a currency symbol and address.
|
|
56
|
+
|
|
57
|
+
Shapeshiftio.validate(address,coin_symbol) #[address] the address that the user wishes to validate, [coinSymbol] the currency symbol of the coin
|
|
58
|
+
|
|
59
|
+
# POST requests
|
|
60
|
+
|
|
61
|
+
# Normal Transaction (convert coin):
|
|
62
|
+
|
|
63
|
+
withdrawal = the address for resulting coin to be sent to
|
|
64
|
+
pair = what coins are being exchanged in the form [input coin]_[output coin]
|
|
65
|
+
returnAddress = (Optional) address to return deposit to if anything goes wrong with the exchange
|
|
66
|
+
destTag = (Optional) Destination tag that you want appended to a Ripple payment to you
|
|
67
|
+
rsAddress = (Optional) For new NXT accounts to be funded, you supply this on NXT payment to you
|
|
68
|
+
apiKey = (Optional) Your affiliate PUBLIC KEY
|
|
69
|
+
|
|
70
|
+
example data: {"withdrawal":"AAAAAAAAAAAAA", "pair":"btc_ltc", returnAddress:"BBBBBBBBBBB"}
|
|
71
|
+
|
|
72
|
+
Shapeshiftio.shift("AAAAAAAAAAAAA","btc_ltc",options = {"returnAddress" : "BBBBBBBBBBB"})
|
|
73
|
+
Shapeshiftio.shift("RIPPLE ADDRESS","ltc_xrp",options = {"returnAddres" : "RIPPLE ADDRESS", "destTag" : "RIPPLE ADDRESS TAG"})
|
|
74
|
+
|
|
75
|
+
# Request Email Receipt
|
|
76
|
+
email = the address for receipt email to be sent to
|
|
77
|
+
txid = the transaction id of the transaction TO the user (ie the txid for the withdrawal NOT the deposit)
|
|
78
|
+
example data {"email":"mail@example.com", "txid":"123ABC"}
|
|
24
79
|
|
|
25
|
-
|
|
80
|
+
Shapeshiftio.receipt("mail@example.com","123ABC")
|
|
81
|
+
|
|
82
|
+
# Fixed Amount Transaction / Quote Send Exact Price
|
|
83
|
+
amount = the amount to be sent to the withdrawal address
|
|
84
|
+
withdrawal = the address for coin to be sent to
|
|
85
|
+
pair = what coins are being exchanged in the form [input coin]_[output coin]
|
|
86
|
+
returnAddress = (Optional) address to return deposit to if anything goes wrong with exchange
|
|
87
|
+
destTag = (Optional) Destination tag that you want appended to a Ripple payment to you
|
|
88
|
+
rsAddress = (Optional) For new NXT accounts to be funded, supply this on NXT payment to you
|
|
89
|
+
apiKey = (Optional) Your affiliate PUBLIC KEY
|
|
26
90
|
|
|
27
|
-
|
|
91
|
+
Shapeshiftio.fixed(amount, wallet_address, coin_pair, options = {})
|
|
92
|
+
Shapeshiftio.quote(amount, coin_pair)
|
|
28
93
|
|
|
29
|
-
|
|
94
|
+
# Cancel Pending Transaction
|
|
30
95
|
|
|
31
|
-
|
|
96
|
+
Shapeshiftio.cancel(deposit_address)
|
|
32
97
|
|
|
33
98
|
## Contributing
|
|
34
99
|
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub
|
|
100
|
+
Bug reports and pull requests are welcome on GitHub.
|
|
36
101
|
|
|
37
102
|
|
|
38
103
|
## License
|
data/lib/shapeshiftio/version.rb
CHANGED
data/shapeshiftio.gemspec
CHANGED
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.authors = ["Ricardo Malafaia"]
|
|
10
10
|
spec.email = ["ricardo.malafaia1994@gmail.com"]
|
|
11
11
|
|
|
12
|
-
spec.summary = %q{A complete Ruby wrapper for the shapeshift.io API.}
|
|
12
|
+
spec.summary = %q{A complete functional Ruby wrapper for the shapeshift.io API.}
|
|
13
13
|
spec.description = %q{}
|
|
14
14
|
spec.homepage = "https://github.com/rbm4/shapeshiftio"
|
|
15
15
|
spec.license = "MIT"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shapeshiftio
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ricardo Malafaia
|
|
@@ -78,5 +78,5 @@ rubyforge_project:
|
|
|
78
78
|
rubygems_version: 2.6.11
|
|
79
79
|
signing_key:
|
|
80
80
|
specification_version: 4
|
|
81
|
-
summary: A complete Ruby wrapper for the shapeshift.io API.
|
|
81
|
+
summary: A complete functional Ruby wrapper for the shapeshift.io API.
|
|
82
82
|
test_files: []
|