chain-sdk 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/chain/config.rb +4 -0
- data/lib/chain/query.rb +1 -1
- data/lib/chain/response_object.rb +1 -1
- data/lib/chain/transaction_feed.rb +25 -0
- data/lib/chain/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5af937202113aa24173fde927a2695a87cec5a2
|
4
|
+
data.tar.gz: 39ba00e11865ea11a2cece9588a2b3c13425c5b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e45100ee3ca7cbb65a72cbf4dcec32b155821a923a8ce91c1e6f284412f9dd8c82bf06d4593615776755a867a842e74919bde758e881fd49d9dd905eb11574bf
|
7
|
+
data.tar.gz: a03d40326111b14fe5420bc1aa9a81b9d9a88ea3adba41971333cbfdfae043e211818c860f74ad99bc96668efc83946575501256e6ee744dc6192719f1bd21e1
|
data/README.md
CHANGED
@@ -4,12 +4,12 @@
|
|
4
4
|
|
5
5
|
### Get the gem
|
6
6
|
|
7
|
-
The Ruby SDK is available [via Rubygems](https://rubygems.org/gems/chain-sdk). Make sure to use the most recent version whose major and minor components (`major.minor.x`) match your version of Chain Core. Ruby 2 is required.
|
7
|
+
The Ruby SDK is available [via Rubygems](https://rubygems.org/gems/chain-sdk). Make sure to use the most recent version whose major and minor components (`major.minor.x`) match your version of Chain Core. Ruby 2.1 or greater is required.
|
8
8
|
|
9
9
|
For most applications, you can simply add the following to your `Gemfile`:
|
10
10
|
|
11
11
|
```
|
12
|
-
gem 'chain-sdk', '~> 1.0.
|
12
|
+
gem 'chain-sdk', '~> 1.0.1', require: 'chain'
|
13
13
|
```
|
14
14
|
|
15
15
|
### In your code
|
data/lib/chain/config.rb
CHANGED
data/lib/chain/query.rb
CHANGED
@@ -25,7 +25,7 @@ module Chain
|
|
25
25
|
attrib_name = attrib_name.to_sym
|
26
26
|
raise KeyError.new("key not found: #{attrib_name}") unless self.class.attrib_opts.key?(attrib_name)
|
27
27
|
|
28
|
-
instance_variable_get "
|
28
|
+
instance_variable_get "@#{attrib_name}"
|
29
29
|
end
|
30
30
|
|
31
31
|
def []=(attrib_name, value)
|
@@ -3,6 +3,7 @@ require 'securerandom'
|
|
3
3
|
require_relative './client_module'
|
4
4
|
require_relative './connection'
|
5
5
|
require_relative './constants'
|
6
|
+
require_relative './query'
|
6
7
|
require_relative './response_object'
|
7
8
|
|
8
9
|
module Chain
|
@@ -94,6 +95,30 @@ module Chain
|
|
94
95
|
TransactionFeed.new(client.conn.request('get-transaction-feed', opts), client.conn)
|
95
96
|
end
|
96
97
|
|
98
|
+
# @param [Hash] opts
|
99
|
+
# @option opts [String] :id ID of the transaction feed. You must provide either :id or :alias.
|
100
|
+
# @option opts [String] :alias ID of the transaction feed. You must provide either :id or :alias.
|
101
|
+
# @return [void]
|
102
|
+
def delete(opts)
|
103
|
+
client.conn.request('delete-transaction-feed', opts)
|
104
|
+
nil
|
105
|
+
end
|
106
|
+
|
107
|
+
# @return [Query]
|
108
|
+
def query
|
109
|
+
Query.new(client)
|
110
|
+
end
|
111
|
+
|
112
|
+
end
|
113
|
+
|
114
|
+
class Query < Chain::Query
|
115
|
+
def fetch(query)
|
116
|
+
client.conn.request('list-transaction-feeds', query)
|
117
|
+
end
|
118
|
+
|
119
|
+
def translate(raw)
|
120
|
+
TransactionFeed.new(raw, client.conn)
|
121
|
+
end
|
97
122
|
end
|
98
123
|
|
99
124
|
end
|
data/lib/chain/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chain-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chain Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -64,7 +64,7 @@ dependencies:
|
|
64
64
|
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: 0.9.5
|
67
|
-
description: The Official Ruby SDK for
|
67
|
+
description: The Official Ruby SDK for Chain Core
|
68
68
|
email:
|
69
69
|
executables: []
|
70
70
|
extensions: []
|
@@ -103,9 +103,9 @@ require_paths:
|
|
103
103
|
- lib
|
104
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
|
-
- - "
|
106
|
+
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
108
|
+
version: '2.1'
|
109
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
110
|
requirements:
|
111
111
|
- - ">="
|
@@ -113,8 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.5.
|
116
|
+
rubygems_version: 2.5.2
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
|
-
summary: The Official Ruby SDK for
|
119
|
+
summary: The Official Ruby SDK for Chain Core
|
120
120
|
test_files: []
|