openassets-ruby 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -0
- data/README.md +3 -3
- data/Rakefile +1 -0
- data/lib/openassets/api.rb +1 -1
- data/lib/openassets/provider/bitcoin_core_provider.rb +11 -1
- data/lib/openassets/version.rb +1 -1
- data/openassets-ruby.gemspec +2 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb5b3172c23e5d191c18aa42e79e1de8e48a21d7
|
4
|
+
data.tar.gz: 8c87ab5668d6d74bb0c26c55d76860a1c595ac42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18c7d2be10311c301263af5669bf58548dccfae38101540bbd6722a78c0f73963b1013daf15846896c371eac62204c9cecd434eeedb0e62d14da845bc0f89567
|
7
|
+
data.tar.gz: 02d1eccbeb770aaadc29082629264f283959def62ace6d3ade800d1fb7f83b5ad29e2083d20411a64fe8757dbd7a7f786b5fc92e586f3371b4a153d1bcced68d
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# openassets-ruby
|
1
|
+
# openassets-ruby [![Build Status](https://travis-ci.org/haw-itn/openassets-ruby.svg?branch=master)](https://travis-ci.org/haw-itn/openassets-ruby) [![Gem Version](https://badge.fury.io/rb/openassets-ruby.svg)](https://badge.fury.io/rb/openassets-ruby) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
|
2
2
|
The implementation of the Open Assets Protocol for Ruby.
|
3
3
|
|
4
4
|
## Install
|
@@ -18,7 +18,7 @@ require 'openassets'
|
|
18
18
|
api = OpenAssets::Api.new({:network => 'mainnet',
|
19
19
|
:provider => 'bitcoind', :cache => 'cache.db',
|
20
20
|
:dust_limit => 600, :default_fees => 10000, :min_confirmation => 1, :max_confirmation => 9999999,
|
21
|
-
:rpc => {:user => 'xxx', :password => 'xxx', :schema => 'http', :port => 8332, :host => 'localhost'}})
|
21
|
+
:rpc => {:user => 'xxx', :password => 'xxx', :schema => 'http', :port => 8332, :host => 'localhost', :timeout => 60, :open_timeout => 60}})
|
22
22
|
```
|
23
23
|
|
24
24
|
* **use testnet**
|
@@ -29,7 +29,7 @@ require 'openassets'
|
|
29
29
|
api = OpenAssets::Api.new({:network => 'testnet',
|
30
30
|
:provider => 'bitcoind', :cache => 'testnet.db',
|
31
31
|
:dust_limit => 600, :default_fees => 10000, :min_confirmation => 1, :max_confirmation => 9999999,
|
32
|
-
:rpc => {:user => 'xxx', :password => 'xxx', :schema => 'http', :port => 18332, :host => 'localhost'}})
|
32
|
+
:rpc => {:user => 'xxx', :password => 'xxx', :schema => 'http', :port => 18332, :host => 'localhost', :timeout => 60, :open_timeout => 60}})
|
33
33
|
```
|
34
34
|
|
35
35
|
The configuration options are as follows:
|
data/Rakefile
CHANGED
data/lib/openassets/api.rb
CHANGED
@@ -18,7 +18,7 @@ module OpenAssets
|
|
18
18
|
@config = {:network => 'mainnet',
|
19
19
|
:provider => 'bitcoind', :cache => 'cache.db',
|
20
20
|
:dust_limit => 600, :default_fees => 10000, :min_confirmation => 1, :max_confirmation => 9999999,
|
21
|
-
:rpc => { :host => 'localhost', :port => 8332 , :user => '', :password => '', :schema => 'https'}}
|
21
|
+
:rpc => { :host => 'localhost', :port => 8332 , :user => '', :password => '', :schema => 'https', :timeout => 60, :open_timeout => 60}}
|
22
22
|
if config
|
23
23
|
@config.update(config)
|
24
24
|
end
|
@@ -64,6 +64,12 @@ module OpenAssets
|
|
64
64
|
request('sendrawtransaction', tx)
|
65
65
|
end
|
66
66
|
|
67
|
+
# Adds an address or pubkey script to the wallet without the associated private key, allowing you to watch for transactions affecting that address or pubkey script without being able to spend any of its outputs.
|
68
|
+
# @param [String] address Either a P2PKH or P2SH address encoded in base58check, or a pubkey script encoded as hex.
|
69
|
+
def import_address(address)
|
70
|
+
request('importaddress', address)
|
71
|
+
end
|
72
|
+
|
67
73
|
def method_missing(method, *params)
|
68
74
|
super unless RPC_API.include?(method)
|
69
75
|
request(method, *params)
|
@@ -105,13 +111,17 @@ module OpenAssets
|
|
105
111
|
:params => params,
|
106
112
|
:id => 'jsonrpc'
|
107
113
|
}
|
108
|
-
|
114
|
+
post(server_url, @config[:timeout], @config[:open_timeout], data.to_json, content_type: :json) do |respdata, request, result|
|
109
115
|
response = JSON.parse(respdata.gsub(/\\u([\da-fA-F]{4})/) { [$1].pack('H*').unpack('n*').pack('U*').encode('ISO-8859-1').force_encoding('UTF-8') })
|
110
116
|
raise ApiError, response['error'] if response['error']
|
111
117
|
response['result']
|
112
118
|
end
|
113
119
|
end
|
114
120
|
|
121
|
+
def post(url, timeout, open_timeout, payload, headers={}, &block)
|
122
|
+
RestClient::Request.execute(:method => :post, :url => url, :timeout => timeout, :open_timeout => open_timeout, :payload => payload, :headers => headers, &block)
|
123
|
+
end
|
124
|
+
|
115
125
|
end
|
116
126
|
end
|
117
127
|
end
|
data/lib/openassets/version.rb
CHANGED
data/openassets-ruby.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openassets-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- azuchi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bitcoin-ruby
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: octorelease
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
description: The implementation of the Open Assets Protocol for Ruby.
|
140
154
|
email:
|
141
155
|
- azuchi@haw.co.jp
|
@@ -148,6 +162,7 @@ files:
|
|
148
162
|
- ".rspec"
|
149
163
|
- ".ruby-gemset"
|
150
164
|
- ".ruby-version"
|
165
|
+
- ".travis.yml"
|
151
166
|
- CODE_OF_CONDUCT.md
|
152
167
|
- Gemfile
|
153
168
|
- LICENSE
|