blocksdk 0.1.0 → 0.1.4

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,69 @@
1
+ require_relative 'base'
2
+
3
+ class Market < Base
4
+ def getExchanges(request = {})
5
+ return request("GET","/market/exchanges")
6
+ end
7
+
8
+ def getAssets(request = {})
9
+ return request("GET","/market/assets")
10
+ end
11
+
12
+ def getAsset(request = {})
13
+ return request("GET","/market/assets/" + (request['asset_id']).to_s)
14
+ end
15
+
16
+ def getOhlcvLast(request = {})
17
+ return request("GET","/market/ohlcv/latest",request)
18
+ end
19
+
20
+ def getOhlcvHistory(request = {})
21
+ return request("GET","/market/ohlcv/history/" + (request['symbol']).to_s,request)
22
+ end
23
+
24
+ def getExchangeOhlcvLast(request = {})
25
+ return request("GET","/market/ohlcv/" + (request['exchage_id']).to_s + "/latest",request)
26
+ end
27
+
28
+ def getExchangeOhlcvHistory(request = {})
29
+ return request("GET","/market/ohlcv/" + (request['exchage_id']).to_s + "/history/" + (request['symbol']).to_s,request)
30
+ end
31
+
32
+ def getTrades(request = {})
33
+ request["from"].to_s.empty? ? request['from'] = nil : request['from']
34
+ request["to"].to_s.empty? ? request['to'] = "USD" : request["to"]
35
+
36
+ return request("GET","/market/trades",{
37
+ "from" => request['from'],
38
+ "to" => request['to']
39
+ })
40
+ end
41
+
42
+ def getRates(request = {})
43
+
44
+ return request("GET","/market/rates/" + (request['from']).to_s+ "",{
45
+ "to" => request['to'],
46
+ "from_amount" => request['from_amount']
47
+ })
48
+ end
49
+
50
+ def getExchangeTrades(request = {})
51
+ request["from"].to_s.empty? ? request['from'] = nil : request['from']
52
+ request["to"].to_s.empty? ? request['to'] = "USD" : request["to"]
53
+
54
+ return request("GET","/market/trades/" + (request['exchage_id']).to_s+ "",{
55
+ "from" => request['from'],
56
+ "to" => request['to']
57
+ })
58
+ end
59
+
60
+ def getExchangeRates(request = {})
61
+ request["to"].to_s.empty? ? request['to'] = "USD" : request["to"]
62
+
63
+ return request("GET","/market/rates/" + (request['exchage_id']).to_s + "/" + (request['from']).to_s,{
64
+ "to" => request['to'],
65
+ "from_amount" => request['from_amount']
66
+ })
67
+ end
68
+
69
+ 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,12 @@
1
+ require_relative 'base'
2
+
3
+ class Solc < Base
4
+ def genContract(request = {})
5
+ return request("GET","/solc/" + (request['net']).to_s + "/" + (request['type']).to_s,request)
6
+ end
7
+
8
+ def getAssets(request = {})
9
+ return request("GET","/solc/encodefunction",request)
10
+ end
11
+
12
+ end
@@ -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.4
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-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description: Ruby library to help you build your crypto application on BlockSDK
28
42
  email: contact@blocksdk.com
29
43
  executables: []
@@ -32,14 +46,19 @@ extra_rdoc_files: []
32
46
  files:
33
47
  - lib/blocksdk.rb
34
48
  - lib/blocksdk_ruby/base.rb
49
+ - lib/blocksdk_ruby/binancesmart.rb
35
50
  - lib/blocksdk_ruby/bitcoin.rb
36
51
  - lib/blocksdk_ruby/bitcoincash.rb
37
52
  - lib/blocksdk_ruby/blocksdk.rb
38
53
  - lib/blocksdk_ruby/dash.rb
39
54
  - lib/blocksdk_ruby/ethereum.rb
55
+ - lib/blocksdk_ruby/klaytn.rb
40
56
  - lib/blocksdk_ruby/litecoin.rb
57
+ - lib/blocksdk_ruby/market.rb
41
58
  - lib/blocksdk_ruby/monero.rb
42
59
  - lib/blocksdk_ruby/price.rb
60
+ - lib/blocksdk_ruby/solc.rb
61
+ - lib/blocksdk_ruby/tool.rb
43
62
  - lib/blocksdk_ruby/webhook.rb
44
63
  homepage: http://www.blocksdk.com
45
64
  licenses: