bitget.rb 0.9.0 → 0.9.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.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +18 -0
  3. data/README.md +3 -0
  4. data/bitget.rb.gemspec +1 -1
  5. data/lib/Bitget/V2/Client.rb +6 -1
  6. data/lib/Bitget/VERSION.rb +1 -1
  7. data/test/V2/Client_test.rb +12 -0
  8. data/test/fixtures/vcr_cassettes/v2/spot/account/assets-when_an_error_occurs.yml +69 -0
  9. data/test/fixtures/vcr_cassettes/v2/spot/account/assets.yml +69 -0
  10. data/test/fixtures/vcr_cassettes/v2/spot/account/bills-when_an_error_occurs.yml +63 -0
  11. data/test/fixtures/vcr_cassettes/v2/spot/account/bills.yml +69 -0
  12. data/test/fixtures/vcr_cassettes/v2/spot/account/bleradaf-info.yml +67 -0
  13. data/test/fixtures/vcr_cassettes/v2/spot/account/deduct-info-when_an_error_occurs.yml +63 -0
  14. data/test/fixtures/vcr_cassettes/v2/spot/account/deduct-info.yml +67 -0
  15. data/test/fixtures/vcr_cassettes/v2/spot/account/info-when_an_error_occurs.yml +67 -0
  16. data/test/fixtures/vcr_cassettes/v2/spot/account/info.yml +67 -0
  17. data/test/fixtures/vcr_cassettes/v2/spot/account/sub-main-trans-record-when_an_error_occurs.yml +67 -0
  18. data/test/fixtures/vcr_cassettes/v2/spot/account/sub-main-trans-record.yml +67 -0
  19. data/test/fixtures/vcr_cassettes/v2/spot/account/subaccount-assets-when_an_error_occurs.yml +67 -0
  20. data/test/fixtures/vcr_cassettes/v2/spot/account/subaccount-assets.yml +102 -0
  21. data/test/fixtures/vcr_cassettes/v2/spot/account/switch-deduct-when_an_error_occurs.yml +63 -0
  22. data/test/fixtures/vcr_cassettes/v2/spot/account/switch-deduct.yml +69 -0
  23. data/test/fixtures/vcr_cassettes/v2/spot/account/transferRecords-when_an_error_occurs.yml +63 -0
  24. data/test/fixtures/vcr_cassettes/v2/spot/account/transferRecords.yml +63 -0
  25. data/test/fixtures/vcr_cassettes/v2/spot/market/candles-when_an_error_occurs.yml +63 -0
  26. data/test/fixtures/vcr_cassettes/v2/spot/market/candles.yml +69 -0
  27. data/test/fixtures/vcr_cassettes/v2/spot/market/fills-history-when_an_error_occurs.yml +63 -0
  28. data/test/fixtures/vcr_cassettes/v2/spot/market/fills-history.yml +69 -0
  29. data/test/fixtures/vcr_cassettes/v2/spot/market/fills-when_an_error_occurs.yml +63 -0
  30. data/test/fixtures/vcr_cassettes/v2/spot/market/fills.yml +69 -0
  31. data/test/fixtures/vcr_cassettes/v2/spot/market/history-candles-when_an_error_occurs.yml +63 -0
  32. data/test/fixtures/vcr_cassettes/v2/spot/market/history-candles.yml +69 -0
  33. data/test/fixtures/vcr_cassettes/v2/spot/market/merge-depth-when_an_error_occurs.yml +63 -0
  34. data/test/fixtures/vcr_cassettes/v2/spot/market/merge-depth.yml +69 -0
  35. data/test/fixtures/vcr_cassettes/v2/spot/market/orderbook-when_an_error_occurs.yml +63 -0
  36. data/test/fixtures/vcr_cassettes/v2/spot/market/orderbook.yml +69 -0
  37. data/test/fixtures/vcr_cassettes/v2/spot/market/tickers-when_an_error_occurs.yml +69 -0
  38. data/test/fixtures/vcr_cassettes/v2/spot/market/tickers-when_symbol_is_not_supplied.yml +69 -0
  39. data/test/fixtures/vcr_cassettes/v2/spot/market/tickers-when_symbol_is_supplied.yml +67 -0
  40. data/test/fixtures/vcr_cassettes/v2/spot/market/vip-fee-rate-when_an_error_occurs.yml +69 -0
  41. data/test/fixtures/vcr_cassettes/v2/spot/market/vip-fee-rate.yml +69 -0
  42. data/test/fixtures/vcr_cassettes/v2/spot/public/coins-when_an_error_occurs.yml +69 -0
  43. data/test/fixtures/vcr_cassettes/v2/spot/public/coins-when_coin_is_not_supplied.yml +69 -0
  44. data/test/fixtures/vcr_cassettes/v2/spot/public/coins-when_coin_is_supplied.yml +69 -0
  45. data/test/fixtures/vcr_cassettes/v2/spot/public/coins-when_error_occurs.yml +64 -0
  46. data/test/fixtures/vcr_cassettes/v2/spot/public/symbols-when_an_error_occurs.yml +69 -0
  47. data/test/fixtures/vcr_cassettes/v2/spot/public/symbols-when_symbol_is_not_supplied.yml +69 -0
  48. data/test/fixtures/vcr_cassettes/v2/spot/public/symbols-when_symbol_is_supplied.yml +67 -0
  49. data/test/fixtures/vcr_cassettes/v2/spot/trade/batch-cancel-order-when_an_error_occurs.yml +63 -0
  50. data/test/fixtures/vcr_cassettes/v2/spot/trade/batch-cancel-order.yml +84 -0
  51. data/test/fixtures/vcr_cassettes/v2/spot/trade/batch-cancel-plan-order-when_an_error_occurs.yml +67 -0
  52. data/test/fixtures/vcr_cassettes/v2/spot/trade/batch-cancel-plan-order.yml +67 -0
  53. data/test/fixtures/vcr_cassettes/v2/spot/trade/batch-cancel-replace-order-when_an_error_occurs.yml +63 -0
  54. data/test/fixtures/vcr_cassettes/v2/spot/trade/batch-cancel-replace-order.yml +63 -0
  55. data/test/fixtures/vcr_cassettes/v2/spot/trade/batch-orders-when_an_error_occurs.yml +63 -0
  56. data/test/fixtures/vcr_cassettes/v2/spot/trade/batch-orders.yml +67 -0
  57. data/test/fixtures/vcr_cassettes/v2/spot/trade/cancel-order-when_an_error_occurs.yml +63 -0
  58. data/test/fixtures/vcr_cassettes/v2/spot/trade/cancel-order.yml +73 -0
  59. data/test/fixtures/vcr_cassettes/v2/spot/trade/cancel-plan-order-when_an_error_occurs.yml +63 -0
  60. data/test/fixtures/vcr_cassettes/v2/spot/trade/cancel-plan-order.yml +72 -0
  61. data/test/fixtures/vcr_cassettes/v2/spot/trade/cancel-replace-order-when_an_error_occurs.yml +63 -0
  62. data/test/fixtures/vcr_cassettes/v2/spot/trade/cancel-replace-order.yml +68 -0
  63. data/test/fixtures/vcr_cassettes/v2/spot/trade/cancel-symbol-order-when_an_error_occurs.yml +63 -0
  64. data/test/fixtures/vcr_cassettes/v2/spot/trade/cancel-symbol-order.yml +67 -0
  65. data/test/fixtures/vcr_cassettes/v2/spot/trade/current-plan-order-when_an_error_occurs.yml +63 -0
  66. data/test/fixtures/vcr_cassettes/v2/spot/trade/current-plan-order.yml +67 -0
  67. data/test/fixtures/vcr_cassettes/v2/spot/trade/fills-when_an_error_occurs.yml +63 -0
  68. data/test/fixtures/vcr_cassettes/v2/spot/trade/fills.yml +95 -0
  69. data/test/fixtures/vcr_cassettes/v2/spot/trade/history-orders-when_an_error_occurs.yml +63 -0
  70. data/test/fixtures/vcr_cassettes/v2/spot/trade/history-orders.yml +97 -0
  71. data/test/fixtures/vcr_cassettes/v2/spot/trade/history-plan-order-when_an_error_occurs.yml +63 -0
  72. data/test/fixtures/vcr_cassettes/v2/spot/trade/history-plan-order.yml +63 -0
  73. data/test/fixtures/vcr_cassettes/v2/spot/trade/modify-plan-order-when_an_error_occurs.yml +63 -0
  74. data/test/fixtures/vcr_cassettes/v2/spot/trade/modify-plan-order.yml +63 -0
  75. data/test/fixtures/vcr_cassettes/v2/spot/trade/orderInfo-when_an_error_occurs.yml +61 -0
  76. data/test/fixtures/vcr_cassettes/v2/spot/trade/orderInfo.yml +61 -0
  77. data/test/fixtures/vcr_cassettes/v2/spot/trade/place-order-when_an_error_occurs.yml +63 -0
  78. data/test/fixtures/vcr_cassettes/v2/spot/trade/place-order.yml +67 -0
  79. data/test/fixtures/vcr_cassettes/v2/spot/trade/place-plan-order-when_an_error_occurs.yml +63 -0
  80. data/test/fixtures/vcr_cassettes/v2/spot/trade/place-plan-order.yml +67 -0
  81. data/test/fixtures/vcr_cassettes/v2/spot/trade/plan-sub-order-when_an_error_occurs.yml +63 -0
  82. data/test/fixtures/vcr_cassettes/v2/spot/trade/plan-sub-order.yml +75 -0
  83. data/test/fixtures/vcr_cassettes/v2/spot/trade/unfilled-orders-when_an_error_occurs.yml +63 -0
  84. data/test/fixtures/vcr_cassettes/v2/spot/trade/unfilled-orders.yml +97 -0
  85. data/test/fixtures/vcr_cassettes/v2/spot/wallet/cancel-withdrawal-when_an_error_occurs.yml +63 -0
  86. data/test/fixtures/vcr_cassettes/v2/spot/wallet/cancel-withdrawal.yml +63 -0
  87. data/test/fixtures/vcr_cassettes/v2/spot/wallet/deposit-address-when_an_error_occurs.yml +63 -0
  88. data/test/fixtures/vcr_cassettes/v2/spot/wallet/deposit-address.yml +67 -0
  89. data/test/fixtures/vcr_cassettes/v2/spot/wallet/deposit-records-when_an_error_occurs.yml +63 -0
  90. data/test/fixtures/vcr_cassettes/v2/spot/wallet/deposit-records.yml +63 -0
  91. data/test/fixtures/vcr_cassettes/v2/spot/wallet/modify-deposit-account-when_an_error_occurs.yml +63 -0
  92. data/test/fixtures/vcr_cassettes/v2/spot/wallet/modify-deposit-account.yml +63 -0
  93. data/test/fixtures/vcr_cassettes/v2/spot/wallet/subaccount-deposit-address-when_an_error_occurs.yml +63 -0
  94. data/test/fixtures/vcr_cassettes/v2/spot/wallet/subaccount-deposit-address.yml +63 -0
  95. data/test/fixtures/vcr_cassettes/v2/spot/wallet/subaccount-deposit-records-when_an_error_occurs.yml +63 -0
  96. data/test/fixtures/vcr_cassettes/v2/spot/wallet/subaccount-deposit-records.yml +63 -0
  97. data/test/fixtures/vcr_cassettes/v2/spot/wallet/subaccount-transfer-when_an_error_occurs.yml +63 -0
  98. data/test/fixtures/vcr_cassettes/v2/spot/wallet/subaccount-transfer.yml +63 -0
  99. data/test/fixtures/vcr_cassettes/v2/spot/wallet/transfer-coin-info-when_an_error_occurs.yml +63 -0
  100. data/test/fixtures/vcr_cassettes/v2/spot/wallet/transfer-coin-info.yml +69 -0
  101. data/test/fixtures/vcr_cassettes/v2/spot/wallet/transfer-when_an_error_occurs.yml +63 -0
  102. data/test/fixtures/vcr_cassettes/v2/spot/wallet/transfer.yml +63 -0
  103. data/test/fixtures/vcr_cassettes/v2/spot/wallet/withdrawal-records-when_an_error_occurs.yml +63 -0
  104. data/test/fixtures/vcr_cassettes/v2/spot/wallet/withdrawal-records.yml +67 -0
  105. data/test/fixtures/vcr_cassettes/v2/spot/wallet/withdrawal-when_an_error_occurs.yml +63 -0
  106. data/test/fixtures/vcr_cassettes/v2/spot/wallet/withdrawal.yml +73 -0
  107. data/test/gemspec_test.rb +4 -0
  108. metadata +100 -1
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.bitget.com/api/v2/spot/public/coins?coin=BTC
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Access-Key:
17
+ - "<API_KEY>"
18
+ Access-Sign:
19
+ - f5e63c0e23f5b9efe90e7fb6e3f088ea91e5f6b01fd1671549ce2a6c7cc0ae1c1017af1b1a512602523bab9be54643ca4d8c3d6001234a1098ac771c133b4ba0
20
+ Access-Timestamp:
21
+ - '1742728926'
22
+ Access-Passphrase:
23
+ - "<API_PASSPHRASE>"
24
+ Content-Type:
25
+ - application/json
26
+ Locale:
27
+ - en-AU
28
+ response:
29
+ status:
30
+ code: 200
31
+ message: OK
32
+ headers:
33
+ Date:
34
+ - Sun, 23 Mar 2025 11:22:10 GMT
35
+ Content-Type:
36
+ - application/json
37
+ Transfer-Encoding:
38
+ - chunked
39
+ Connection:
40
+ - keep-alive
41
+ Vary:
42
+ - Accept-Encoding
43
+ X-Mbx-Used-Remain-Limit:
44
+ - '2'
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ Access-Control-Allow-Origin:
50
+ - "*"
51
+ Access-Control-Allow-Methods:
52
+ - GET, POST, OPTIONS
53
+ Cf-Cache-Status:
54
+ - DYNAMIC
55
+ Set-Cookie:
56
+ - __cf_bm=6XkMMAqqYANSC1_6_iIrX.dhmaUQL_eoaNB4CjvoNbU-1742728930-1.0.1.1-8vyoPffk8oIol7aoyThrPJo0gBIX0RGejdZ9vria9b9NUtnMzeHWmNuVEHO3nymF3.Mv8RoGvo3b7MqXil8MGzgvfn2jf9r.zMMjtpg3p3c;
57
+ path=/; expires=Sun, 23-Mar-25 11:52:10 GMT; domain=.api.bitget.com; HttpOnly;
58
+ Secure; SameSite=None
59
+ X-Frame-Options:
60
+ - SAMEORIGIN
61
+ Server:
62
+ - cloudflare
63
+ Cf-Ray:
64
+ - 924d8ca6b9be993f-FRA
65
+ body:
66
+ encoding: ASCII-8BIT
67
+ string: '{"code":"00000","msg":"success","requestTime":1742728930495,"data":[{"coinId":"1","coin":"BTC","transfer":"true","chains":[{"chain":"BTC","needTag":"false","withdrawable":"true","rechargeable":"true","withdrawFee":"0.00005","extraWithdrawFee":"0","depositConfirm":"1","withdrawConfirm":"1","minDepositAmount":"0.00001","minWithdrawAmount":"0.0005","browserUrl":"https://www.blockchain.com/explorer/transactions/btc/","contractAddress":null,"withdrawStep":"0","withdrawMinScale":"8","congestion":"normal"},{"chain":"LIGHTNING","needTag":"false","withdrawable":"true","rechargeable":"true","withdrawFee":"0.00001","extraWithdrawFee":"0","depositConfirm":"1","withdrawConfirm":"5","minDepositAmount":"0.000001","minWithdrawAmount":"0.00002","browserUrl":"","contractAddress":null,"withdrawStep":"0","withdrawMinScale":"8","congestion":"normal"},{"chain":"BEP20","needTag":"false","withdrawable":"true","rechargeable":"true","withdrawFee":"0.00000831","extraWithdrawFee":"0","depositConfirm":"15","withdrawConfirm":"15","minDepositAmount":"0.000001","minWithdrawAmount":"0.0000078","browserUrl":"https://bscscan.com/tx/","contractAddress":"0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c","withdrawStep":"0","withdrawMinScale":"8","congestion":"normal"}],"areaCoin":"no"}]}'
68
+ recorded_at: Sun, 23 Mar 2025 11:22:08 GMT
69
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.bitget.com/api/v2/spot/public/coins?coin=INVALID
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Access-Key:
17
+ - "<API_KEY>"
18
+ Access-Sign:
19
+ - mcKODZxzN0xrD5TLM4W2TIDbIpZAXglJ2y7huWUttvU=
20
+ Access-Timestamp:
21
+ - '1748170741314'
22
+ Access-Passphrase:
23
+ - "<API_PASSPHRASE>"
24
+ Content-Type:
25
+ - application/json
26
+ X-Channel-Api-Code:
27
+ - spot
28
+ response:
29
+ status:
30
+ code: 400
31
+ message: Bad Request
32
+ headers:
33
+ Date:
34
+ - Sun, 25 May 2025 10:59:03 GMT
35
+ Content-Type:
36
+ - application/json
37
+ Content-Length:
38
+ - '89'
39
+ Connection:
40
+ - keep-alive
41
+ X-Mbx-Used-Remain-Limit:
42
+ - '2'
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Access-Control-Allow-Methods:
46
+ - GET, POST, OPTIONS
47
+ Cf-Cache-Status:
48
+ - DYNAMIC
49
+ Set-Cookie:
50
+ - __cf_bm=1e4jl3L2o21E.DGsV864rO0V9deNiRmMHZ72ZvdyDQA-1748170743-1.0.1.1-LbLJ7FpkTNNApnRXvf2ofO0RMnGNh_NGAR4o9OQJJq3FpxB58BsysBtDTogff3bvEb.M0QJTjzV_ShwtcSxqxbD11_YjJTUyvnBBUa5iPQE;
51
+ path=/; expires=Sun, 25-May-25 11:29:03 GMT; domain=.api.bitget.com; HttpOnly;
52
+ Secure; SameSite=None
53
+ X-Frame-Options:
54
+ - SAMEORIGIN
55
+ Server:
56
+ - cloudflare
57
+ Cf-Ray:
58
+ - 9454856bfd3337c0-AMS
59
+ body:
60
+ encoding: ASCII-8BIT
61
+ string: !binary |-
62
+ eyJjb2RlIjoiNDAwMzQiLCJtc2ciOiLlj4LmlbAgSU5WQUxJRCDkuI3lrZjlnKgiLCJyZXF1ZXN0VGltZSI6MTc0ODE3MDc0MzgwNSwiZGF0YSI6bnVsbH0=
63
+ recorded_at: Sun, 25 May 2025 10:59:02 GMT
64
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.bitget.com/api/v2/spot/public/symbols
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Access-Key:
17
+ - "<API_KEY>"
18
+ Access-Sign:
19
+ - EGw74AVdaFFQ+y3u/Fk/0znkMdpaA3jFu9uyymWg2D4=
20
+ Access-Timestamp:
21
+ - '1747574810365'
22
+ Access-Passphrase:
23
+ - "<API_PASSPHRASE>"
24
+ Content-Type:
25
+ - application/json
26
+ X-Channel-Api-Code:
27
+ - spot
28
+ response:
29
+ status:
30
+ code: 418
31
+ message: I'm a teapot
32
+ headers:
33
+ Date:
34
+ - Sun, 18 May 2025 13:26:51 GMT
35
+ Content-Type:
36
+ - application/json
37
+ Transfer-Encoding:
38
+ - chunked
39
+ Connection:
40
+ - keep-alive
41
+ Vary:
42
+ - Accept-Encoding
43
+ X-Mbx-Used-Remain-Limit:
44
+ - '19'
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ Access-Control-Allow-Origin:
50
+ - "*"
51
+ Access-Control-Allow-Methods:
52
+ - GET, POST, OPTIONS
53
+ Cf-Cache-Status:
54
+ - DYNAMIC
55
+ Set-Cookie:
56
+ - __cf_bm=qOo_lcVnVqoLzt62JdGIZpufzP6ZMGTzLjsgYfS24Lo-1747574811-1.0.1.1-4_9XEZW7pbwo2BnL0Mb2alwlqygZNg6kAZP320eHP5VeWfcTRpNajHJ5H7hPpzEnsPNBOlrgmuIeNimvlWg414QBvZrr9GMIwPh8vS6RcZU;
57
+ path=/; expires=Sun, 18-May-25 13:56:51 GMT; domain=.api.bitget.com; HttpOnly;
58
+ Secure; SameSite=None
59
+ X-Frame-Options:
60
+ - SAMEORIGIN
61
+ Server:
62
+ - cloudflare
63
+ Cf-Ray:
64
+ - 941bb04c89c99df9-AMS
65
+ body:
66
+ encoding: ASCII-8BIT
67
+ string: ''
68
+ recorded_at: Sun, 18 May 2025 13:26:51 GMT
69
+ recorded_with: VCR 6.3.1