Module: Binance::Spot::Mining

Included in:
Binance::Spot
Defined in:
lib/binance/spot/mining.rb

Overview

Mining endpoints The endpoints below allow to interact with Binance Pool.

Instance Method Summary collapse

Instance Method Details

#mining_account_list(algo:, userName:, **kwargs) ⇒ Object

Account List (USER_DATA)

GET /sapi/v1/mining/statistics/user/list

Parameters:

  • algo (String)
  • userName (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



124
125
126
127
128
129
130
131
132
# File 'lib/binance/spot/mining.rb', line 124

def (algo:, userName:, **kwargs)
  Binance::Utils::Validation.require_param('algo', algo)
  Binance::Utils::Validation.require_param('userName', userName)

  @session.sign_request(:get, '/sapi/v1/mining/statistics/user/list', params: kwargs.merge(
    algo: algo,
    userName: userName
  ))
end

#mining_algo_listObject

Acquiring Algorithm (MARKET_DATA)

GET /sapi/v1/mining/pub/algoList



14
15
16
# File 'lib/binance/spot/mining.rb', line 14

def mining_algo_list
  @session.limit_request(path: '/sapi/v1/mining/pub/algoList')
end

#mining_coin_listObject

Acquiring CoinName (MARKET_DATA)

GET /sapi/v1/mining/pub/coinList



23
24
25
# File 'lib/binance/spot/mining.rb', line 23

def mining_coin_list
  @session.limit_request(path: '/sapi/v1/mining/pub/coinList')
end

#mining_extra_bonus(algo:, userName:, **kwargs) ⇒ Object

Extra Bonus List (USER_DATA)

GET /sapi/v1/mining/payment/other

Parameters:

  • algo (String)
  • userName (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :coin (String)
  • :startDate (Integer)

    Search date, millisecond timestamp, while empty query all

  • :endDate (Integer)

    Search date, millisecond timestamp, while empty query all

  • :pageIndex (Integer)

    Page number, empty default first page, starting from 1

  • :pageSize (Integer)

    Number of pages, minimum 10, maximum 200

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



148
149
150
151
152
153
154
155
156
# File 'lib/binance/spot/mining.rb', line 148

def mining_extra_bonus(algo:, userName:, **kwargs)
  Binance::Utils::Validation.require_param('algo', algo)
  Binance::Utils::Validation.require_param('userName', userName)

  @session.sign_request(:get, '/sapi/v1/mining/payment/other', params: kwargs.merge(
    algo: algo,
    userName: userName
  ))
end

#mining_resale_cancel(configId:, userName:, **kwargs) ⇒ Object

Cancel hashrate resale configuration(USER_DATA)

POST /sapi/v1/mining/hash-transfer/config/cancel

Parameters:

  • configId (String)

    Mining ID

  • userName (String)

    Mining Account

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



232
233
234
235
236
237
238
239
240
# File 'lib/binance/spot/mining.rb', line 232

def mining_resale_cancel(configId:, userName:, **kwargs)
  Binance::Utils::Validation.require_param('userName', userName)
  Binance::Utils::Validation.require_param('configId', configId)

  @session.sign_request(:post, '/sapi/v1/mining/hash-transfer/config/cancel', params: kwargs.merge(
    configId: configId,
    userName: userName
  ))
end

#mining_resale_detail(configId:, userName:, **kwargs) ⇒ Object

Hashrate Resale Detail (USER_DATA)

GET /sapi/v1/mining/hash-transfer/profit/details

Parameters:

  • configId (String)

    Mining ID

  • userName (String)

    Mining Account

  • kwargs (Hash)

Options Hash (**kwargs):

  • :pageIndex (Integer)

    Page number, empty default first page, starting from 1

  • :pageSize (Integer)

    Number of pages, minimum 10, maximum 200

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



182
183
184
185
186
187
188
189
190
# File 'lib/binance/spot/mining.rb', line 182

def mining_resale_detail(configId:, userName:, **kwargs)
  Binance::Utils::Validation.require_param('configId', configId)
  Binance::Utils::Validation.require_param('userName', userName)

  @session.sign_request(:get, '/sapi/v1/mining/hash-transfer/profit/details', params: kwargs.merge(
    configId: configId,
    userName: userName
  ))
end

#mining_resale_list(**kwargs) ⇒ Object

Hashrate Resale List (USER_DATA)

GET /sapi/v1/mining/hash-transfer/config/details/list

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :pageIndex (Integer)

    Page number, empty default first page, starting from 1

  • :pageSize (Integer)

    Number of pages, minimum 10, maximum 200

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



167
168
169
# File 'lib/binance/spot/mining.rb', line 167

def mining_resale_list(**kwargs)
  @session.sign_request(:get, '/sapi/v1/mining/hash-transfer/config/details/list', params: kwargs)
end

#mining_resale_request(userName:, algo:, startDate:, endDate:, toPoolUser:, hashRate:, **kwargs) ⇒ Object

Hashrate Resale Request (USER_DATA)

POST /sapi/v1/mining/hash-transfer/config

Parameters:

  • userName (String)

    Mining Account

  • algo (String)

    Transfer algorithm(sha256)

  • startDate (Integer)

    Resale End Time (Millisecond timestamp)

  • endDate (Integer)

    Number of pages, minimum 10, maximum 200

  • toPoolUser (Integer)

    Mining Account

  • hashRate (Integer)

    Resale hashrate h/s must be transferred (BTC is greater than 500000000000 ETH is greater than 500000)

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/binance/spot/mining.rb', line 205

def mining_resale_request(userName:, algo:, startDate:, endDate:, toPoolUser:, hashRate:, **kwargs)
  Binance::Utils::Validation.require_param('userName', userName)
  Binance::Utils::Validation.require_param('algo', algo)
  Binance::Utils::Validation.require_param('startDate', startDate)
  Binance::Utils::Validation.require_param('endDate', endDate)
  Binance::Utils::Validation.require_param('toPoolUser', toPoolUser)
  Binance::Utils::Validation.require_param('hashRate', hashRate)

  @session.sign_request(:post, '/sapi/v1/mining/hash-transfer/config', params: kwargs.merge(
    userName: userName,
    algo: algo,
    startDate: startDate,
    endDate: endDate,
    toPoolUser: toPoolUser,
    hashRate: hashRate
  ))
end

#mining_revenue_list(algo:, userName:, **kwargs) ⇒ Object

Earnings List(USER_DATA)

GET /sapi/v1/mining/payment/list

Parameters:

  • algo (String)
  • userName (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :coin (String)
  • :startDate (Integer)
  • :endDate (Integer)
  • :pageIndex (Integer)
  • :pageSize (Integer)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



86
87
88
89
90
91
92
93
94
# File 'lib/binance/spot/mining.rb', line 86

def mining_revenue_list(algo:, userName:, **kwargs)
  Binance::Utils::Validation.require_param('algo', algo)
  Binance::Utils::Validation.require_param('userName', userName)

  @session.sign_request(:get, '/sapi/v1/mining/payment/list', params: kwargs.merge(
    algo: algo,
    userName: userName
  ))
end

#mining_statistics_list(algo:, userName:, **kwargs) ⇒ Object

Statistic List (USER_DATA)

GET /sapi/v1/mining/statistics/user/status

Parameters:

  • algo (String)
  • userName (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



105
106
107
108
109
110
111
112
113
# File 'lib/binance/spot/mining.rb', line 105

def mining_statistics_list(algo:, userName:, **kwargs)
  Binance::Utils::Validation.require_param('algo', algo)
  Binance::Utils::Validation.require_param('userName', userName)

  @session.sign_request(:get, '/sapi/v1/mining/statistics/user/status', params: kwargs.merge(
    algo: algo,
    userName: userName
  ))
end

#mining_worker(algo:, userName:, workerName:, **kwargs) ⇒ Object

Request for Detail Miner List (USER_DATA)

GET /sapi/v1/mining/worker/detail

Parameters:

  • algo (String)
  • userName (String)
  • workerName (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/binance/spot/mining.rb', line 37

def mining_worker(algo:, userName:, workerName:, **kwargs)
  Binance::Utils::Validation.require_param('algo', algo)
  Binance::Utils::Validation.require_param('userName', userName)
  Binance::Utils::Validation.require_param('workerName', workerName)

  @session.sign_request(:get, '/sapi/v1/mining/worker/detail', params: kwargs.merge(
    algo: algo,
    userName: userName,
    workerName: workerName
  ))
end

#mining_worker_list(algo:, userName:, **kwargs) ⇒ Object

Request for Miner List (USER_DATA)

GET /sapi/v1/mining/worker/list

Parameters:

  • algo (String)
  • userName (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :pageIndex (String)
  • :sort (String)
  • :sortColumn (String)
  • :workerStatus (String)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



62
63
64
65
66
67
68
69
70
# File 'lib/binance/spot/mining.rb', line 62

def mining_worker_list(algo:, userName:, **kwargs)
  Binance::Utils::Validation.require_param('algo', algo)
  Binance::Utils::Validation.require_param('userName', userName)

  @session.sign_request(:get, '/sapi/v1/mining/worker/list', params: kwargs.merge(
    algo: algo,
    userName: userName
  ))
end