blocksdk 0.1.0 → 0.1.1

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.
@@ -0,0 +1,45 @@
1
+ require_relative 'base'
2
+
3
+ class Market < Base
4
+ def getBlockChain(request = {})
5
+ return request("GET","/market/exchanges")
6
+ end
7
+
8
+ def getTrades(request = {})
9
+ request["from"].to_s.empty? ? request['from'] = nil : request['from']
10
+ request["to"].to_s.empty? ? request['to'] = "USD" : request["to"]
11
+
12
+ return request("GET","/market/trades",{
13
+ "from" => request['from'],
14
+ "to" => request['to']
15
+ })
16
+ end
17
+
18
+ def getRates(request = {})
19
+
20
+ return request("GET","/market/rates/" + (request['from']).to_s+ "",{
21
+ "to" => request['to'],
22
+ "from_amount" => request['from_amount']
23
+ })
24
+ end
25
+
26
+ def getExchangeTrades(request = {})
27
+ request["from"].to_s.empty? ? request['from'] = nil : request['from']
28
+ request["to"].to_s.empty? ? request['to'] = "USD" : request["to"]
29
+
30
+ return request("GET","/market/trades/" + (request['exchage_id']).to_s+ "",{
31
+ "from" => request['from'],
32
+ "to" => request['to']
33
+ })
34
+ end
35
+
36
+ def getExchangeRates(request = {})
37
+ request["to"].to_s.empty? ? request['to'] = "USD" : request["to"]
38
+
39
+ return request("GET","/market/rates/" + (request['exchage_id']).to_s + "/" + (request['from']).to_s,{
40
+ "to" => request['to'],
41
+ "from_amount" => request['from_amount']
42
+ })
43
+ end
44
+
45
+ end
@@ -2,7 +2,7 @@ require_relative 'base'
2
2
 
3
3
  class Monero < Base
4
4
  def getBlockChain(request = {})
5
- return request("GET","/xmr/block")
5
+ return request("GET","/xmr/info")
6
6
  end
7
7
 
8
8
  def getBlock(request = {})
@@ -10,7 +10,7 @@ class Monero < Base
10
10
  request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
11
11
  request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
12
12
 
13
- return request("GET","/xmr/block/" + (request['block']).to_s+ "",{
13
+ return request("GET","/xmr/blocks/" + (request['block']).to_s+ "",{
14
14
  "rawtx" => request['rawtx'],
15
15
  "offset" => request['offset'],
16
16
  "limit" => request['limit']
@@ -29,11 +29,11 @@ class Monero < Base
29
29
  })
30
30
  end
31
31
 
32
- def listAddress(request = {})
32
+ def getAddresses(request = {})
33
33
  request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
34
34
  request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
35
35
 
36
- return request("GET","/xmr/address",{
36
+ return request("GET","/xmr/addresses",{
37
37
  "offset" => request['offset'],
38
38
  "limit" => request['limit']
39
39
  })
@@ -41,7 +41,7 @@ class Monero < Base
41
41
 
42
42
  def createAddress(request = {})
43
43
  request["name"].to_s.empty? ? request['name'] = nil : request["name"]
44
- return request("POST","/xmr/address",{
44
+ return request("POST","/xmr/addresses",{
45
45
  "name" => request['name']
46
46
  })
47
47
  end
@@ -50,7 +50,7 @@ class Monero < Base
50
50
  request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
51
51
  request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
52
52
 
53
- return request("GET","/xmr/address/" + (request['address_id']).to_s+ "",{
53
+ return request("GET","/xmr/addresses/" + (request['address_id']).to_s+ "",{
54
54
  "offset" => request['offset'],
55
55
  "limit" => request['limit'],
56
56
  "private_spend_key" => request['private_spend_key'],
@@ -58,20 +58,20 @@ class Monero < Base
58
58
  end
59
59
 
60
60
  def getAddressBalance(request = {})
61
- return request("GET","/xmr/address/" + (request['address_id']).to_s+ "/balance",{
61
+ return request("GET","/xmr/addresses/" + (request['address_id']).to_s+ "/balance",{
62
62
  "private_spend_key" => request['private_spend_key'],
63
63
  })
64
64
  end
65
65
 
66
66
  def loadAddress(request = {})
67
- return request("POST","/xmr/address/" + (request['address_id']).to_s+ "/load",{
67
+ return request("POST","/xmr/addresses/" + (request['address_id']).to_s+ "/load",{
68
68
  "private_spend_key" => request['private_spend_key'],
69
69
  "password" => request['password']
70
70
  })
71
71
  end
72
72
 
73
- def unLoadAddress(request = {})
74
- return request("POST","/xmr/address/" + (request['address_id']).to_s+ "/unload")
73
+ def unloadAddress(request = {})
74
+ return request("POST","/xmr/addresses/" + (request['address_id']).to_s+ "/unload")
75
75
  end
76
76
 
77
77
  def sendToAddress(request = {})
@@ -83,17 +83,25 @@ class Monero < Base
83
83
 
84
84
  request["private_spend_key"].to_s.empty? ? request['private_spend_key'] = nil : request["private_spend_key"]
85
85
  request["password"].to_s.empty? ? request['password'] = nil : request["password"]
86
+ request["subtractfeefromamount"].to_s.empty? ? request['subtractfeefromamount'] = false : request['subtractfeefromamount']
86
87
 
87
- return request("POST","/xmr/address/" + (request['address_id']).to_s+ "/sendtoaddress",{
88
+ return request("POST","/xmr/addresses/" + (request['address_id']).to_s+ "/sendtoaddress",{
88
89
  "address" => request['address'],
89
90
  "amount" => request['amount'],
90
91
  "private_spend_key" => request['private_spend_key'],
91
92
  "password" => request['password'],
92
- "kbfee" => request['kbfee']
93
+ "kbfee" => request['kbfee'],
94
+ "subtractfeefromamount" => request['subtractfeefromamount']
95
+ })
96
+ end
97
+
98
+ def sendTransaction(request = {})
99
+ return request("POST","/xmr/transactions/send",{
100
+ "hex" => request['hex']
93
101
  })
94
102
  end
95
103
 
96
104
  def getTransaction(request = {})
97
- return request("GET","/xmr/transaction/" + (request['hash']).to_s+ "")
105
+ return request("GET","/xmr/transactions/" + (request['hash']).to_s+ "")
98
106
  end
99
- end
107
+ end
@@ -1,10 +1,10 @@
1
1
  require_relative 'base'
2
2
 
3
- class Price < Base
4
- def listPrice(request = {})
5
- return request("GET","/price")
3
+ class Token < Base
4
+ def getUsages(request = {})
5
+ return request("GET","/token/usage",{
6
+ "stat_date" => request['stat_date'],
7
+ "end_date" => request['end_date']
8
+ })
6
9
  end
7
10
  end
8
-
9
- # priceInstance = Price.new("ad38QFTevz8fEEAG4fKsf4T5L8pwqgcy6LXMHpqU")
10
- # puts priceInstance.listPrice()
@@ -0,0 +1,7 @@
1
+ require_relative 'base'
2
+
3
+ class Tool < Base
4
+ def getTransaction(request = {})
5
+ return getHashType("GET","/tools/hash-type/" + (request['hash']).to_s+ "")
6
+ end
7
+ end
@@ -3,32 +3,32 @@ require_relative 'base'
3
3
  class WebHook < Base
4
4
 
5
5
  def create(request={})
6
- return request("POST","/hook",{"callback"=>request['callback'],"category"=>request['category'],"address"=>request['address']})
6
+ return request("POST","/hooks",{"callback_url"=>request['callback_url'],"symbol"=>request['symbol'],"address"=>request['address']})
7
7
  end
8
8
 
9
9
  def list(request = {})
10
10
  request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
11
11
  request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
12
- return request("GET","/hook",{"offset"=>request['offset'],"limit"=>request['limit']})
12
+ return request("GET","/hooks",{"offset"=>request['offset'],"limit"=>request['limit']})
13
13
  end
14
14
 
15
15
  def get(request={})
16
- return request("GET","/hook/" + (request['hook_id']).to_s)
16
+ return request("GET","/hooks/" + (request['hook_id']).to_s)
17
17
  end
18
18
 
19
19
  def delete(request={})
20
- return request("POST","/hook/" + (request['hook_id']).to_s + "/delete")
20
+ return request("DELETE","/hooks/" + (request['hook_id']).to_s)
21
21
  end
22
22
 
23
- def listResponse(request = {})
23
+ def getResponses(request = {})
24
24
  request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
25
25
  request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
26
- return request("GET","/hook/response",{"offset"=>request['offset'],"limit"=>request['limit']})
26
+ return request("GET","/hooks/responses",{"offset"=>request['offset'],"limit"=>request['limit']})
27
27
  end
28
28
 
29
- def getResponse(request={})
29
+ def getHookResponses(request={})
30
30
  request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
31
31
  request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
32
- return request("GET","/hook/" + (request['hook_id']).to_s + "/response",{"offset"=>request['offset'],"limit"=>request['limit']})
32
+ return request("GET","/hooks/" + (request['hook_id']).to_s + "/responses",{"offset"=>request['offset'],"limit"=>request['limit']})
33
33
  end
34
- end
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blocksdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BlockSDK
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-04 00:00:00.000000000 Z
11
+ date: 2021-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -38,8 +38,10 @@ files:
38
38
  - lib/blocksdk_ruby/dash.rb
39
39
  - lib/blocksdk_ruby/ethereum.rb
40
40
  - lib/blocksdk_ruby/litecoin.rb
41
+ - lib/blocksdk_ruby/market.rb
41
42
  - lib/blocksdk_ruby/monero.rb
42
43
  - lib/blocksdk_ruby/price.rb
44
+ - lib/blocksdk_ruby/tool.rb
43
45
  - lib/blocksdk_ruby/webhook.rb
44
46
  homepage: http://www.blocksdk.com
45
47
  licenses: