blocksdk 0.0.5 → 0.1.3
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/lib/blocksdk.rb +1 -49
- data/lib/blocksdk_ruby/base.rb +2 -26
- data/lib/blocksdk_ruby/binancesmart.rb +238 -0
- data/lib/blocksdk_ruby/bitcoin.rb +42 -38
- data/lib/blocksdk_ruby/bitcoincash.rb +66 -54
- data/lib/blocksdk_ruby/blocksdk.rb +16 -6
- data/lib/blocksdk_ruby/dash.rb +82 -50
- data/lib/blocksdk_ruby/ethereum.rb +174 -16
- data/lib/blocksdk_ruby/klaytn.rb +294 -0
- data/lib/blocksdk_ruby/litecoin.rb +67 -68
- data/lib/blocksdk_ruby/market.rb +69 -0
- data/lib/blocksdk_ruby/monero.rb +22 -14
- data/lib/blocksdk_ruby/price.rb +6 -6
- data/lib/blocksdk_ruby/solc.rb +12 -0
- data/lib/blocksdk_ruby/tool.rb +7 -0
- data/lib/blocksdk_ruby/webhook.rb +9 -9
- metadata +21 -2
@@ -2,7 +2,7 @@ require_relative 'base'
|
|
2
2
|
|
3
3
|
class Ethereum < Base
|
4
4
|
def getBlockChain(request = {})
|
5
|
-
return request("GET","/eth/
|
5
|
+
return request("GET","/eth/info")
|
6
6
|
end
|
7
7
|
|
8
8
|
def getBlock(request = {})
|
@@ -10,7 +10,7 @@ class Ethereum < 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","/eth/
|
13
|
+
return request("GET","/eth/blocks/" + (request['block']).to_s,{"rawtx" => request['rawtx'],"offset" => request['offset'],"limit" => request['limit']})
|
14
14
|
end
|
15
15
|
|
16
16
|
def getMemPool(request = {})
|
@@ -21,27 +21,27 @@ class Ethereum < Base
|
|
21
21
|
return request("GET","/eth/mempool",{"rawtx" => request['rawtx'],"offset" => request['offset'],"limit" => request['limit']})
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def getAddress(request = {})
|
25
25
|
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
26
26
|
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
27
27
|
|
28
|
-
return request("GET","/eth/
|
28
|
+
return request("GET","/eth/addresses",{
|
29
29
|
"offset" => request['offset'],
|
30
30
|
"limit" => request['limit']
|
31
31
|
})
|
32
32
|
end
|
33
33
|
|
34
34
|
def loadAddress(request = {})
|
35
|
-
return request("POST","/eth/
|
35
|
+
return request("POST","/eth/addresses/" + (request['address']).to_s + "/load",{"private_key" => request['private_key'],"password" => request['password']})
|
36
36
|
end
|
37
37
|
|
38
|
-
def
|
39
|
-
return request("POST","/eth/
|
38
|
+
def unloadAddress(request = {})
|
39
|
+
return request("POST","/eth/addresses/" + (request['address']).to_s + "/unload")
|
40
40
|
end
|
41
41
|
|
42
42
|
def createAddress(request = {})
|
43
43
|
request["name"].to_s.empty? ? request['name'] = 0 : request["name"]
|
44
|
-
return request("POST","/eth/
|
44
|
+
return request("POST","/eth/addresses",{"name" => request['name']})
|
45
45
|
end
|
46
46
|
|
47
47
|
def getAddressInfo(request = {})
|
@@ -51,11 +51,11 @@ class Ethereum < Base
|
|
51
51
|
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
52
52
|
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
53
53
|
|
54
|
-
return request("GET","/eth/
|
54
|
+
return request("GET","/eth/addresses/" + (request['address']).to_s ,{"reverse" => request['reverse'],"rawtx" => request['rawtx'],"offset" => request['offset'],"limit" => request['limit']})
|
55
55
|
end
|
56
56
|
|
57
57
|
def getAddressBalance(request = {})
|
58
|
-
return request("GET","/eth/
|
58
|
+
return request("GET","/eth/addresses/" + (request['address']).to_s + "/balance")
|
59
59
|
end
|
60
60
|
|
61
61
|
def sendToAddress(request = {})
|
@@ -63,18 +63,176 @@ class Ethereum < Base
|
|
63
63
|
blockChain = getBlockChain()
|
64
64
|
request['gwei'] = blockChain['medium_gwei']
|
65
65
|
end
|
66
|
-
request["
|
66
|
+
request["private_key"].to_s.empty? ? request['private_key'] = nil : request["private_key"]
|
67
67
|
request["password"].to_s.empty? ? request['password'] = nil : request["password"]
|
68
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
68
69
|
|
69
|
-
return request("POST","/eth/
|
70
|
+
return request("POST","/eth/addresses/" + (request['from']).to_s + "/sendtoaddress",{"to" => request['to'],"amount" => request['amount'],"private_key" => request['private_key'],"password" => request['password'],"gwei" => request['gwei'],"gas_limit" => request['gas_limit']})
|
70
71
|
end
|
71
72
|
|
72
73
|
def sendTransaction(request = {})
|
73
|
-
return request("POST","/eth/
|
74
|
+
return request("POST","/eth/transactions/send",{"hex" => request['hex']})
|
74
75
|
end
|
75
76
|
|
76
|
-
def
|
77
|
-
return request("GET","/eth/
|
77
|
+
def getTransactions(request = {})
|
78
|
+
return request("GET","/eth/transactions/" + (request['hash']).to_s)
|
79
|
+
end
|
80
|
+
|
81
|
+
def getErc20(request = {})
|
82
|
+
return request("GET","/eth/erc20-tokens/" + (request['contract_address']).to_s)
|
83
|
+
end
|
84
|
+
|
85
|
+
def getErc20Balance(request = {})
|
86
|
+
return request("GET","/eth/erc20-tokens/" + (request['contract_address']).to_s + "/" + (request['from']).to_s + "/balance")
|
87
|
+
end
|
88
|
+
|
89
|
+
def getErc20Transfer(request = {})
|
90
|
+
if request["gwei"].to_s.empty?
|
91
|
+
blockChain = getBlockChain()
|
92
|
+
request['gwei'] = blockChain['high_gwei']
|
93
|
+
end
|
94
|
+
request["private_key"].to_s.empty? ? request['private_key'] = nil : request["private_key"]
|
95
|
+
request["password"].to_s.empty? ? request['password'] = nil : request["password"]
|
96
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
97
|
+
|
98
|
+
return request("POST","/eth/erc20-tokens/" + (request['contract_address']).to_s + "/" + (request['from']).to_s + "/transfer",{"to" => request['to'],"amount" => request['amount'],"private_key" => request['private_key'],"password" => request['password'],"gwei" => request['gwei'],"gas_limit" => request['gas_limit']})
|
99
|
+
end
|
100
|
+
|
101
|
+
def getNfts(request = {})
|
102
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
103
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
104
|
+
|
105
|
+
return request("GET","/eth/erc721-tokens/" + (request['contract_address']).to_s + "/tokens",{
|
106
|
+
"offset" => request['offset'],
|
107
|
+
"limit" => request['limit']
|
108
|
+
})
|
109
|
+
end
|
110
|
+
|
111
|
+
def getOwnerNfts(request = {})
|
112
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
113
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
114
|
+
|
115
|
+
return request("GET","/eth/erc721-tokens/" + (request['contract_address']).to_s + "/" + (request['owner_address']).to_s + "/owner",{
|
116
|
+
"offset" => request['offset'],
|
117
|
+
"limit" => request['limit']
|
118
|
+
})
|
119
|
+
end
|
120
|
+
|
121
|
+
def getCreatorNfts(request = {})
|
122
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
123
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
124
|
+
|
125
|
+
return request("GET","/eth/erc721-tokens/" + (request['contract_address']).to_s + "/" + (request['creator_address']).to_s + "/creator",{
|
126
|
+
"offset" => request['offset'],
|
127
|
+
"limit" => request['limit']
|
128
|
+
})
|
129
|
+
end
|
130
|
+
|
131
|
+
def getAuctionNfts(request = {})
|
132
|
+
request["order_by"].to_s.empty? ? request['order_by'] = 'end_time' : request["order_by"]
|
133
|
+
request["order_direction"].to_s.empty? ? request['order_direction'] = 'desc' : request["order_direction"]
|
134
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
135
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
136
|
+
|
137
|
+
return request("GET","/eth/erc721-tokens/" + (request['contract_address']).to_s + "/auction",{
|
138
|
+
"order_by" => request['order_by'],
|
139
|
+
"order_direction" => request['order_direction'],
|
140
|
+
"offset" => request['offset'],
|
141
|
+
"limit" => request['limit']
|
142
|
+
})
|
143
|
+
end
|
144
|
+
|
145
|
+
def getSaleNfts(request = {})
|
146
|
+
request["order_direction"].to_s.empty? ? request['order_direction'] = 'desc' : request["order_direction"]
|
147
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
148
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
149
|
+
|
150
|
+
return request("GET","/eth/erc721-tokens/" + (request['contract_address']).to_s + "/" + (request['seller_address']).to_s + "/sale",{
|
151
|
+
"order_direction" => request['order_direction'],
|
152
|
+
"offset" => request['offset'],
|
153
|
+
"limit" => request['limit']
|
154
|
+
})
|
155
|
+
end
|
156
|
+
|
157
|
+
def getNftBids(request = {})
|
158
|
+
request["rawtx"].to_s.empty? ? request['rawtx'] = 0 : request["rawtx"]
|
159
|
+
request["order_direction"].to_s.empty? ? request['order_direction'] = 'desc' : request["order_direction"]
|
160
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
161
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
162
|
+
|
163
|
+
return request("GET","/eth/erc721-tokens/" + (request['contract_address']).to_s + "/" + (request['token_id']).to_s + "/bid",{
|
164
|
+
"rawtx" => request['rawtx'],
|
165
|
+
"order_direction" => request['order_direction'],
|
166
|
+
"offset" => request['offset'],
|
167
|
+
"limit" => request['limit']
|
168
|
+
})
|
169
|
+
end
|
170
|
+
|
171
|
+
def getNftInfo(request = {})
|
172
|
+
return request("GET","/eth/erc721-tokens/" + (request['contract_address']).to_s + "/" + (request['token_id']).to_s + "/info")
|
173
|
+
end
|
174
|
+
|
175
|
+
def getNftTransfers(request = {})
|
176
|
+
request["rawtx"].to_s.empty? ? request['rawtx'] = 0 : request["rawtx"]
|
177
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
178
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
179
|
+
|
180
|
+
return request("GET","/eth/erc721-tokens/" + (request['contract_address']).to_s + "/" + (request['token_id']).to_s + "/bid",{
|
181
|
+
"rawtx" => request['rawtx'],
|
182
|
+
"order_direction" => request['order_direction'],
|
183
|
+
"offset" => request['offset'],
|
184
|
+
"limit" => request['limit']
|
185
|
+
})
|
186
|
+
end
|
187
|
+
|
188
|
+
def getContractRead(request = {})
|
189
|
+
request["parameter_type"].to_s.empty? ? request['parameter_type'] = nil : request["parameter_type"]
|
190
|
+
request["parameter_data"].to_s.empty? ? request['parameter_data'] = nil : request["parameter_data"]
|
191
|
+
|
192
|
+
return request("POST","/eth/contracts/" + (request['contract_address']).to_s + "/read",{
|
193
|
+
"method" => request['method'],
|
194
|
+
"return_type" => request['return_type'],
|
195
|
+
"parameter_type" => request['parameter_type'],
|
196
|
+
"parameter_data" => request['parameter_data']
|
197
|
+
})
|
198
|
+
end
|
199
|
+
|
200
|
+
def getContractWrite(request = {})
|
201
|
+
request["private_key"].to_s.empty? ? request['private_key'] = nil : request["private_key"]
|
202
|
+
request["password"].to_s.empty? ? request['password'] = nil : request["password"]
|
203
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
204
|
+
|
205
|
+
request["parameter_type"].to_s.empty? ? request['parameter_type'] = nil : request["parameter_type"]
|
206
|
+
request["parameter_data"].to_s.empty? ? request['parameter_data'] = nil : request["parameter_data"]
|
207
|
+
|
208
|
+
return request("POST","/eth/contracts/" + (request['contract_address']).to_s + "/write",{
|
209
|
+
"method" => request['method'],
|
210
|
+
"return_type" => request['return_type'],
|
211
|
+
"parameter_type" => request['parameter_type'],
|
212
|
+
"parameter_data" => request['parameter_data'],
|
213
|
+
"from" => request['from'],
|
214
|
+
"private_key" => request['private_key'],
|
215
|
+
"password" => request['password'],
|
216
|
+
"amount" => request['amount'],
|
217
|
+
"gas_limit" => request['gas_limit']
|
218
|
+
})
|
219
|
+
end
|
220
|
+
|
221
|
+
def getContractWriteFees(request = {})
|
222
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
223
|
+
|
224
|
+
request["parameter_type"].to_s.empty? ? request['parameter_type'] = nil : request["parameter_type"]
|
225
|
+
request["parameter_data"].to_s.empty? ? request['parameter_data'] = nil : request["parameter_data"]
|
226
|
+
|
227
|
+
return request("POST","/eth/contracts/" + (request['contract_address']).to_s + "/write/fees",{
|
228
|
+
"method" => request['method'],
|
229
|
+
"return_type" => request['return_type'],
|
230
|
+
"parameter_type" => request['parameter_type'],
|
231
|
+
"parameter_data" => request['parameter_data'],
|
232
|
+
"from" => request['from'],
|
233
|
+
"amount" => request['amount'],
|
234
|
+
"gas_limit" => request['gas_limit']
|
235
|
+
})
|
78
236
|
end
|
79
237
|
|
80
|
-
end
|
238
|
+
end
|
@@ -0,0 +1,294 @@
|
|
1
|
+
require_relative 'base'
|
2
|
+
|
3
|
+
class Klaytn < Base
|
4
|
+
def getBlockChain(request = {})
|
5
|
+
return request("GET","/klay/info")
|
6
|
+
end
|
7
|
+
|
8
|
+
def getBlock(request = {})
|
9
|
+
request["rawtx"].to_s.empty? ? request['rawtx'] = false : request['rawtx']
|
10
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
11
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
12
|
+
|
13
|
+
return request("GET","/klay/blocks/" + (request['block']).to_s,{"rawtx" => request['rawtx'],"offset" => request['offset'],"limit" => request['limit']})
|
14
|
+
end
|
15
|
+
|
16
|
+
def getMemPool(request = {})
|
17
|
+
request["rawtx"].to_s.empty? ? request['rawtx'] = false : request['rawtx']
|
18
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
19
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
20
|
+
|
21
|
+
return request("GET","/klay/mempool",{"rawtx" => request['rawtx'],"offset" => request['offset'],"limit" => request['limit']})
|
22
|
+
end
|
23
|
+
|
24
|
+
def getAddress(request = {})
|
25
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
26
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
27
|
+
|
28
|
+
return request("GET","/klay/addresses",{
|
29
|
+
"offset" => request['offset'],
|
30
|
+
"limit" => request['limit']
|
31
|
+
})
|
32
|
+
end
|
33
|
+
|
34
|
+
def loadAddress(request = {})
|
35
|
+
return request("POST","/klay/addresses/" + (request['address']).to_s + "/load",{"private_key" => request['private_key'],"password" => request['password']})
|
36
|
+
end
|
37
|
+
|
38
|
+
def unloadAddress(request = {})
|
39
|
+
return request("POST","/klay/addresses/" + (request['address']).to_s + "/unload")
|
40
|
+
end
|
41
|
+
|
42
|
+
def createAddress(request = {})
|
43
|
+
request["name"].to_s.empty? ? request['name'] = 0 : request["name"]
|
44
|
+
return request("POST","/klay/addresses",{"name" => request['name']})
|
45
|
+
end
|
46
|
+
|
47
|
+
def getAddressInfo(request = {})
|
48
|
+
|
49
|
+
request["reverse"].to_s.empty? ? request['reverse'] = true : request['reverse']
|
50
|
+
request["rawtx"].to_s.empty? ? request['rawtx'] = false : request['rawtx']
|
51
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
52
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
53
|
+
|
54
|
+
return request("GET","/klay/addresses/" + (request['address']).to_s ,{"reverse" => request['reverse'],"rawtx" => request['rawtx'],"offset" => request['offset'],"limit" => request['limit']})
|
55
|
+
end
|
56
|
+
|
57
|
+
def getAddressBalance(request = {})
|
58
|
+
return request("GET","/klay/addresses/" + (request['address']).to_s + "/balance")
|
59
|
+
end
|
60
|
+
|
61
|
+
def sendToAddress(request = {})
|
62
|
+
request["nonce"].to_s.empty? ? request['nonce'] = nil : request["nonce"]
|
63
|
+
request["data"].to_s.empty? ? request['data'] = nil : request["data"]
|
64
|
+
request["private_key"].to_s.empty? ? request['private_key'] = nil : request["private_key"]
|
65
|
+
request["password"].to_s.empty? ? request['password'] = nil : request["password"]
|
66
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
67
|
+
|
68
|
+
return request("POST","/klay/addresses/" + (request['from']).to_s + "/sendtoaddress",{"to" => request['to'],"amount" => request['amount'],"private_key" => request['private_key'],"password" => request['password'],"gas_limit" => request['gas_limit']})
|
69
|
+
end
|
70
|
+
|
71
|
+
def sendTransaction(request = {})
|
72
|
+
return request("POST","/klay/transactions/send",{"hex" => request['hex']})
|
73
|
+
end
|
74
|
+
|
75
|
+
def getTransactions(request = {})
|
76
|
+
return request("GET","/klay/transactions/" + (request['hash']).to_s)
|
77
|
+
end
|
78
|
+
|
79
|
+
def getKIP7(request = {})
|
80
|
+
return request("GET","/klay/kip7-tokens/" + (request['contract_address']).to_s)
|
81
|
+
end
|
82
|
+
|
83
|
+
def getKIP7Balance(request = {})
|
84
|
+
return request("GET","/klay/kip7-tokens/" + (request['contract_address']).to_s + "/" + (request['from']).to_s + "/balance")
|
85
|
+
end
|
86
|
+
|
87
|
+
def getKIP7Transfer(request = {})
|
88
|
+
request["private_key"].to_s.empty? ? request['private_key'] = nil : request["private_key"]
|
89
|
+
request["password"].to_s.empty? ? request['password'] = nil : request["password"]
|
90
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
91
|
+
|
92
|
+
return request("POST","/klay/kip7-tokens/" + (request['contract_address']).to_s + "/" + (request['from']).to_s + "/transfer",{"to" => request['to'],"amount" => request['amount'],"private_key" => request['private_key'],"password" => request['password'],"gas_limit" => request['gas_limit']})
|
93
|
+
end
|
94
|
+
|
95
|
+
def getKIP7Sign(request = {})
|
96
|
+
request["private_key"].to_s.empty? ? request['private_key'] = nil : request["private_key"]
|
97
|
+
request["password"].to_s.empty? ? request['password'] = nil : request["password"]
|
98
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
99
|
+
|
100
|
+
return request("POST","/klay/kip7-tokens/" + (request['contract_address']).to_s + "/" + (request['from']).to_s + "/transfer/sign",{"to" => request['to'],"amount" => request['amount'],"private_key" => request['private_key'],"password" => request['password'],"gas_limit" => request['gas_limit']})
|
101
|
+
end
|
102
|
+
|
103
|
+
def getKIP7Feedelegated(request = {})
|
104
|
+
request["private_key"].to_s.empty? ? request['private_key'] = nil : request["private_key"]
|
105
|
+
request["password"].to_s.empty? ? request['password'] = nil : request["password"]
|
106
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
107
|
+
|
108
|
+
return request("POST","/klay/kip7-tokens/" + (request['contract_address']).to_s + "/" + (request['from']).to_s + "/transfer/sign",{"from" => request['from'], "to" => request['to'],"amount" => request['amount'],"private_key" => request['private_key'],"password" => request['password'],"gwei" => request['gwei'],"gas_limit" => request['gas_limit'],"nonce" => request["nonce"],"v" => request['v'],"r" => request['r'],"s" => request['s'],})
|
109
|
+
end
|
110
|
+
|
111
|
+
def getNfts(request = {})
|
112
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
113
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
114
|
+
|
115
|
+
return request("GET","/klay/kip17-tokens/" + (request['contract_address']).to_s + "/tokens",{
|
116
|
+
"offset" => request['offset'],
|
117
|
+
"limit" => request['limit']
|
118
|
+
})
|
119
|
+
end
|
120
|
+
|
121
|
+
def getOwnerNfts(request = {})
|
122
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
123
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
124
|
+
|
125
|
+
return request("GET","/klay/kip17-tokens/" + (request['contract_address']).to_s + "/" + (request['owner_address']).to_s + "/owner",{
|
126
|
+
"offset" => request['offset'],
|
127
|
+
"limit" => request['limit']
|
128
|
+
})
|
129
|
+
end
|
130
|
+
|
131
|
+
def getCreatorNfts(request = {})
|
132
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
133
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
134
|
+
|
135
|
+
return request("GET","/klay/kip17-tokens/" + (request['contract_address']).to_s + "/" + (request['creator_address']).to_s + "/creator",{
|
136
|
+
"offset" => request['offset'],
|
137
|
+
"limit" => request['limit']
|
138
|
+
})
|
139
|
+
end
|
140
|
+
|
141
|
+
def getAuctionNfts(request = {})
|
142
|
+
request["order_by"].to_s.empty? ? request['order_by'] = 'end_time' : request["order_by"]
|
143
|
+
request["order_direction"].to_s.empty? ? request['order_direction'] = 'desc' : request["order_direction"]
|
144
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
145
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
146
|
+
|
147
|
+
return request("GET","/klay/kip17-tokens/" + (request['contract_address']).to_s + "/auction",{
|
148
|
+
"order_by" => request['order_by'],
|
149
|
+
"order_direction" => request['order_direction'],
|
150
|
+
"offset" => request['offset'],
|
151
|
+
"limit" => request['limit']
|
152
|
+
})
|
153
|
+
end
|
154
|
+
|
155
|
+
def getSaleNfts(request = {})
|
156
|
+
request["order_direction"].to_s.empty? ? request['order_direction'] = 'desc' : request["order_direction"]
|
157
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
158
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
159
|
+
|
160
|
+
return request("GET","/klay/kip17-tokens/" + (request['contract_address']).to_s + "/" + (request['seller_address']).to_s + "/sale",{
|
161
|
+
"order_direction" => request['order_direction'],
|
162
|
+
"offset" => request['offset'],
|
163
|
+
"limit" => request['limit']
|
164
|
+
})
|
165
|
+
end
|
166
|
+
|
167
|
+
def getNftBids(request = {})
|
168
|
+
request["rawtx"].to_s.empty? ? request['rawtx'] = 0 : request["rawtx"]
|
169
|
+
request["order_direction"].to_s.empty? ? request['order_direction'] = 'desc' : request["order_direction"]
|
170
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
171
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
172
|
+
|
173
|
+
return request("GET","/klay/kip17-tokens/" + (request['contract_address']).to_s + "/" + (request['token_id']).to_s + "/bid",{
|
174
|
+
"rawtx" => request['rawtx'],
|
175
|
+
"order_direction" => request['order_direction'],
|
176
|
+
"offset" => request['offset'],
|
177
|
+
"limit" => request['limit']
|
178
|
+
})
|
179
|
+
end
|
180
|
+
|
181
|
+
def getNftInfo(request = {})
|
182
|
+
return request("GET","/klay/kip17-tokens/" + (request['contract_address']).to_s + "/" + (request['token_id']).to_s + "/info")
|
183
|
+
end
|
184
|
+
|
185
|
+
def getNftTransfers(request = {})
|
186
|
+
request["rawtx"].to_s.empty? ? request['rawtx'] = 0 : request["rawtx"]
|
187
|
+
request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
|
188
|
+
request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
|
189
|
+
|
190
|
+
return request("GET","/klay/kip17-tokens/" + (request['contract_address']).to_s + "/" + (request['token_id']).to_s + "/bid",{
|
191
|
+
"rawtx" => request['rawtx'],
|
192
|
+
"order_direction" => request['order_direction'],
|
193
|
+
"offset" => request['offset'],
|
194
|
+
"limit" => request['limit']
|
195
|
+
})
|
196
|
+
end
|
197
|
+
|
198
|
+
def getContractRead(request = {})
|
199
|
+
request["parameter_type"].to_s.empty? ? request['parameter_type'] = nil : request["parameter_type"]
|
200
|
+
request["parameter_data"].to_s.empty? ? request['parameter_data'] = nil : request["parameter_data"]
|
201
|
+
|
202
|
+
return request("POST","/klay/contracts/" + (request['contract_address']).to_s + "/read",{
|
203
|
+
"method" => request['method'],
|
204
|
+
"return_type" => request['return_type'],
|
205
|
+
"parameter_type" => request['parameter_type'],
|
206
|
+
"parameter_data" => request['parameter_data']
|
207
|
+
})
|
208
|
+
end
|
209
|
+
|
210
|
+
def getContractWrite(request = {})
|
211
|
+
request["private_key"].to_s.empty? ? request['private_key'] = nil : request["private_key"]
|
212
|
+
request["password"].to_s.empty? ? request['password'] = nil : request["password"]
|
213
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
214
|
+
|
215
|
+
request["parameter_type"].to_s.empty? ? request['parameter_type'] = nil : request["parameter_type"]
|
216
|
+
request["parameter_data"].to_s.empty? ? request['parameter_data'] = nil : request["parameter_data"]
|
217
|
+
|
218
|
+
return request("POST","/klay/contracts/" + (request['contract_address']).to_s + "/write",{
|
219
|
+
"method" => request['method'],
|
220
|
+
"return_type" => request['return_type'],
|
221
|
+
"parameter_type" => request['parameter_type'],
|
222
|
+
"parameter_data" => request['parameter_data'],
|
223
|
+
"from" => request['from'],
|
224
|
+
"private_key" => request['private_key'],
|
225
|
+
"password" => request['password'],
|
226
|
+
"amount" => request['amount'],
|
227
|
+
"gas_limit" => request['gas_limit']
|
228
|
+
})
|
229
|
+
end
|
230
|
+
|
231
|
+
def getContractWriteSign(request = {})
|
232
|
+
request["private_key"].to_s.empty? ? request['private_key'] = nil : request["private_key"]
|
233
|
+
request["password"].to_s.empty? ? request['password'] = nil : request["password"]
|
234
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
235
|
+
|
236
|
+
request["parameter_type"].to_s.empty? ? request['parameter_type'] = nil : request["parameter_type"]
|
237
|
+
request["parameter_data"].to_s.empty? ? request['parameter_data'] = nil : request["parameter_data"]
|
238
|
+
|
239
|
+
return request("POST","/klay/contracts/" + (request['contract_address']).to_s + "/write/sign",{
|
240
|
+
"method" => request['method'],
|
241
|
+
"return_type" => request['return_type'],
|
242
|
+
"parameter_type" => request['parameter_type'],
|
243
|
+
"parameter_data" => request['parameter_data'],
|
244
|
+
"from" => request['from'],
|
245
|
+
"private_key" => request['private_key'],
|
246
|
+
"password" => request['password'],
|
247
|
+
"amount" => request['amount'],
|
248
|
+
"gas_limit" => request['gas_limit']
|
249
|
+
})
|
250
|
+
end
|
251
|
+
|
252
|
+
def getContractWriteFeedelegated(request = {})
|
253
|
+
request["private_key"].to_s.empty? ? request['private_key'] = nil : request["private_key"]
|
254
|
+
request["password"].to_s.empty? ? request['password'] = nil : request["password"]
|
255
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
256
|
+
|
257
|
+
request["parameter_type"].to_s.empty? ? request['parameter_type'] = nil : request["parameter_type"]
|
258
|
+
request["parameter_data"].to_s.empty? ? request['parameter_data'] = nil : request["parameter_data"]
|
259
|
+
|
260
|
+
return request("POST","/klay/contracts/" + (request['contract_address']).to_s + "/write/feedelegated",{
|
261
|
+
"method" => request['method'],
|
262
|
+
"return_type" => request['return_type'],
|
263
|
+
"parameter_type" => request['parameter_type'],
|
264
|
+
"parameter_data" => request['parameter_data'],
|
265
|
+
"from" => request['from'],
|
266
|
+
"fee_payer" => request['fee_payer'],
|
267
|
+
"private_key" => request['private_key'],
|
268
|
+
"password" => request['password'],
|
269
|
+
"amount" => request['amount'],
|
270
|
+
"gwei" => request['gwei'],
|
271
|
+
"gas_limit" => request['gas_limit']
|
272
|
+
})
|
273
|
+
end
|
274
|
+
|
275
|
+
def getContractWriteFees(request = {})
|
276
|
+
request["gas_limit"].to_s.empty? ? request['gas_limit'] = nil : request["gas_limit"]
|
277
|
+
|
278
|
+
request["parameter_type"].to_s.empty? ? request['parameter_type'] = nil : request["parameter_type"]
|
279
|
+
request["parameter_data"].to_s.empty? ? request['parameter_data'] = nil : request["parameter_data"]
|
280
|
+
|
281
|
+
return request("POST","/klay/kip17-tokens/" + (request['contract_address']).to_s + "/write/fees",{
|
282
|
+
"method" => request['method'],
|
283
|
+
"return_type" => request['return_type'],
|
284
|
+
"parameter_type" => request['parameter_type'],
|
285
|
+
"parameter_data" => request['parameter_data'],
|
286
|
+
"from" => request['from'],
|
287
|
+
"amount" => request['amount'],
|
288
|
+
"gas_limit" => request['gas_limit']
|
289
|
+
})
|
290
|
+
end
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
end
|