web3-hpb 0.0.2 → 0.1.0
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/Gemfile +2 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -49
- data/lib/web3/hpb/transaction.rb +1 -1
- data/lib/web3/hpb/version.rb +1 -1
- metadata +2 -3
- data/web3-hpb-0.1.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e372dcdc3e93d69a4319d7ce15da4ba63855639a4eeb110c12c40c3d62ea5d8e
|
4
|
+
data.tar.gz: eb572757b4463669b635db3cd53882dd833846681636b8ce799d090ed78bad35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37f5be5db727b1fac8c886b02fc9c9d4ccf900a83f2e9cbee061010b68d4159aa01b1a43fecf0053e79822714001c102c589224882e590f2a3e5b11f0c843d4a
|
7
|
+
data.tar.gz: 64c4bde04933db85b8a13ce880f275f32e3d21a88ab776c96057ee6ff0221e4c5a6c34b07b0ebbdd13ed76e5e6acab22d35996651f765a3815905b0ff36bb0a3
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -22,55 +22,7 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
26
|
-
初始化一个web3对象
|
27
|
-
```ruby
|
28
|
-
web3 = Web3::Hpb::Rpc.new
|
29
|
-
```
|
30
|
-
默认配置为
|
31
|
-
```ruby
|
32
|
-
web3 = Web3::Hpb::Rpc.new host: 'node.host.com',
|
33
|
-
port: 8545,
|
34
|
-
connect_options: { use_ssl: true, read_timeout: 120 }
|
35
|
-
```
|
36
|
-
|
37
|
-
### 使用hpb接口
|
38
|
-
|
39
|
-
```
|
40
|
-
>> web3.hpb.blockNumber
|
41
|
-
4376369
|
42
|
-
|
43
|
-
>> web3.hpb.getBalance '0x4c8a1996754c11ac255c747fdb36a4288d230541'
|
44
|
-
3916.6597314456685
|
45
|
-
|
46
|
-
>> block = web3.hpb.getBlockByNumber 4376369
|
47
|
-
#<Web3::Hpb::Block:0x007f844d6f1138 @block_data={"author"=>"0x4c8a1996754c11ac255c797fdb36f4288d230541", ...
|
48
|
-
|
49
|
-
>> block.timestamp_time
|
50
|
-
2017-10-17 12:51:36 +0300
|
51
|
-
|
52
|
-
>> block.transactions.count
|
53
|
-
129
|
54
|
-
|
55
|
-
>> block.transactions[0].from
|
56
|
-
"0x4c8a199481ac255c747fdb36f4288d230541"
|
57
|
-
|
58
|
-
>> block.transactions[0].value_eth
|
59
|
-
0.51896811
|
60
|
-
|
61
|
-
```
|
62
|
-
|
63
|
-
### 使用abi接口
|
64
|
-
```
|
65
|
-
# creation of contract object
|
66
|
-
myContract = web3.hpb.contract(abi);
|
67
|
-
|
68
|
-
# initiate contract for an address
|
69
|
-
myContractInstance = myContract.at('0x57d180cbaffbc97237f572148fc1b283b68d8861');
|
70
|
-
|
71
|
-
# call constant function
|
72
|
-
result = myContractInstance.balanceOf('0x...'); # any constant method works
|
73
|
-
```
|
25
|
+
TODO: Write usage instructions here
|
74
26
|
|
75
27
|
## Development
|
76
28
|
|
data/lib/web3/hpb/transaction.rb
CHANGED
data/lib/web3/hpb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web3-hpb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alize
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rlp
|
@@ -112,7 +112,6 @@ files:
|
|
112
112
|
- lib/web3/hpb/transaction_receipt.rb
|
113
113
|
- lib/web3/hpb/utility.rb
|
114
114
|
- lib/web3/hpb/version.rb
|
115
|
-
- web3-hpb-0.1.0.gem
|
116
115
|
- web3-hpb.gemspec
|
117
116
|
homepage: https://github.com/alize/web3-hpb
|
118
117
|
licenses:
|
data/web3-hpb-0.1.0.gem
DELETED
Binary file
|