harmony-api 0.1.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eea4af60480391167cacb1aae61b9fb5d0577c9401c8f7d3c46afaa40202e868
4
- data.tar.gz: ee1fd543917f3ad408310e4944b69c819400473572c7ef6fc93a526a04ee4999
3
+ metadata.gz: a791e91f0d85db68948698f39978e0755c8d7ea87c651c53b46a92108ec41cd1
4
+ data.tar.gz: 6c2be4817ad70e4036f1d4c8b9fc3a3331ead5898d871affe62da53c465a8329
5
5
  SHA512:
6
- metadata.gz: c529167d76a0baac4cbab552a9d155b58767ce4237bbec19468a695a43dd1d4ba3a94bc2bcd3ba9a99f27afeb41b45db9952d355d742972ee0d645bad0ec87b4
7
- data.tar.gz: b248603f97e2da9bcb41d53b6adae8ec8bcfd696af3a59965a9644fb550da7e4001e2c852adb69473df8dfdd44fa9fd6870669536e0c21f4886e1547184f70f2
6
+ metadata.gz: 15cc179f9e1fe5966630a27d4f819e3ecdd265febfbbcedf56a6eaa77b24ae6645982d631c345eba9d94d0fcda120ea973dd7a956a2e5a897414032873299325
7
+ data.tar.gz: dd3282020d57d77d866c5a56c169789e6e54fbc0cd4a99dfe2a680522db8b653d598434e87c3a86a6d849ee47c3799e2dd86ace3f61b439f6b60047a1487ae12
data/README.md CHANGED
@@ -21,7 +21,7 @@ Or install it yourself as:
21
21
  ## Usage
22
22
 
23
23
  ```ruby
24
- client = Harmony::Api::V1::Client.new(network: :os, shard: 0)
24
+ client = Harmony::Api::V1::Client.new(network: :mainnet, shard: 0)
25
25
  client.get_all_validator_information
26
26
  ```
27
27
 
@@ -17,6 +17,7 @@ module Harmony
17
17
  include ::Harmony::Api::V1::Transactions::Error
18
18
  include ::Harmony::Api::V1::Staking::Validator
19
19
  include ::Harmony::Api::V1::Staking::Delegator
20
+ include ::Harmony::Api::V1::Staking::Transaction
20
21
  include ::Harmony::Api::V1::Staking::Utility
21
22
  include ::Harmony::Api::V1::Staking::Error
22
23
  include ::Harmony::Api::V1::Contracts::Contract
@@ -18,13 +18,13 @@ module Harmony
18
18
  # call contract method
19
19
  def call(address)
20
20
  params = [{ to: address }, 'latest']
21
- response(post('hmy_call', params: params))
21
+ response(post('call', params: params))
22
22
  end
23
23
 
24
24
  # get deployed contract's byte code
25
25
  def get_code(address)
26
26
  params = [address, 'latest']
27
- response(post('hmy_getCode', params: params))
27
+ response(post('getCode', params: params))
28
28
  end
29
29
  end
30
30
  end
@@ -20,15 +20,15 @@ module Harmony
20
20
  end
21
21
 
22
22
  def get_pending_cx_receipts
23
- response(post('hmy_getPendingCXReceipts'))
23
+ response(post('getPendingCXReceipts'))
24
24
  end
25
25
 
26
26
  def get_cx_receipt_by_hash(hash)
27
- response(post('hmy_getCXReceiptByHash', params: [hash]))
27
+ response(post('getCXReceiptByHash', params: [hash]))
28
28
  end
29
29
 
30
30
  def resend_cx(hash)
31
- response(post('hmy_resendCx', params: [hash]))
31
+ response(post('resendCx', params: [hash]))
32
32
  end
33
33
  end
34
34
  end
@@ -9,25 +9,25 @@ module Harmony
9
9
  # If the filter could not be found an empty array of logs is returned.
10
10
  def get_filter_logs(filter_id)
11
11
  params = [Harmony::Api::Utilities.int_to_hex(filter_id)]
12
- response(post('hmy_getFilterLogs', params: params))
12
+ response(post('getFilterLogs', params: params))
13
13
  end
14
14
 
15
15
  def get_filter_changes(filter_id)
16
16
  params = [Harmony::Api::Utilities.int_to_hex(filter_id)]
17
- response(post('hmy_getFilterChanges', params: params))
17
+ response(post('getFilterChanges', params: params))
18
18
  end
19
19
 
20
20
  def new_filter(block_hash)
21
- response(post('hmy_newFilter', params: [block_hash]))
21
+ response(post('newFilter', params: [block_hash]))
22
22
  end
23
23
 
24
24
  def new_pending_transaction_filter(topics: [])
25
25
  params = [{ topics: topics }]
26
- response(post('hmy_newPendingTransactionFilter', params: params))
26
+ response(post('newPendingTransactionFilter', params: params))
27
27
  end
28
28
 
29
29
  def new_block_filter(_block_hash)
30
- response(post('hmy_newBlockFilter'))
30
+ response(post('newBlockFilter'))
31
31
  end
32
32
  end
33
33
  end
@@ -7,7 +7,7 @@ module Harmony
7
7
  module Log
8
8
  def get_logs(block_hash)
9
9
  params = [{"BlockHash" => block_hash}]
10
- response(post('hmy_getLogs', params: params))
10
+ response(post('getLogs', params: params))
11
11
  end
12
12
  end
13
13
  end
@@ -9,13 +9,13 @@ module Harmony
9
9
  response(post('sendRawStakingTransaction', params: [hash]))
10
10
  end
11
11
 
12
- def send_raw_staking_transaction(hash)
12
+ def get_staking_transaction_by_hash(hash)
13
13
  response(post('getStakingTransactionByHash', params: [hash]))
14
14
  end
15
15
 
16
16
  def get_staking_transaction_by_block_number_and_index(block_number, index)
17
17
  params = [Harmony::Api::Utilities.int_to_hex(block_number), Harmony::Api::Utilities.int_to_hex(index)]
18
- response(post('hmy_getStakingTransactionByBlockNumberAndIndex', params: params))
18
+ response(post('getStakingTransactionByBlockNumberAndIndex', params: params))
19
19
  end
20
20
 
21
21
  def get_staking_transaction_by_block_hash_and_index(hash, index)
@@ -14,7 +14,7 @@ module Harmony
14
14
  end
15
15
 
16
16
  def get_staking_network_info
17
- response(post('hmy_getStakingNetworkInfo'))
17
+ response(post('getStakingNetworkInfo'))
18
18
  end
19
19
 
20
20
  def get_median_raw_stake_snapshot
@@ -6,7 +6,7 @@ module Harmony
6
6
  module Transactions
7
7
  module Error
8
8
  def getCurrentTransactionErrorSink
9
- response(post('hmy_getCurrentTransactionErrorSink'))
9
+ response(post('getCurrentTransactionErrorSink'))
10
10
  end
11
11
  end
12
12
  end
@@ -1,5 +1,5 @@
1
1
  module Harmony
2
2
  module Api
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
data/lib/harmony/api.rb CHANGED
@@ -19,6 +19,7 @@ require 'harmony/api/v1/transactions/transaction'
19
19
  require 'harmony/api/v1/transactions/error'
20
20
  require 'harmony/api/v1/staking/validator'
21
21
  require 'harmony/api/v1/staking/delegator'
22
+ require 'harmony/api/v1/staking/transaction'
22
23
  require 'harmony/api/v1/staking/utility'
23
24
  require 'harmony/api/v1/staking/error'
24
25
  require 'harmony/api/v1/contracts/contract'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harmony-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Johnsson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-19 00:00:00.000000000 Z
11
+ date: 2020-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday