sequence-sdk 0.0.1 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93b43395a8383a8c4edd19c99c50de2dada0a75c
4
- data.tar.gz: 53afaf9fa088eedd79d9911036ebbbdd2892a4c7
3
+ metadata.gz: abe132b7e4e1918feefd27530475e9c4632927bb
4
+ data.tar.gz: 45212dce65e2fa5cec782900b024d4ae671b5e97
5
5
  SHA512:
6
- metadata.gz: 74ce7aefe71e28a2553caa702cdcb717274eb0abc0af9220ac8c39c60bffdace868f0fac477a6b0300cd9ad0eab61c6cf5bd870ffa19a9861d6d83ae4412e9ab
7
- data.tar.gz: ab8ee3bcd99c650c6f9e58c87882c53df5aeae0f838f3b9ed018655b63d4830c2c2332cec7cbca0921c1059e6ec310cb64a50c15369433c02616b7b436f52efd
6
+ metadata.gz: 5a0212cc63fbfaa9483ce87dfa9f7f3d24884f25d3aeacc81ae08bde699bd40eec0f5b14f1e21939128eabecf0a5740c8d3419587aa5f781c1433a07e9197a34
7
+ data.tar.gz: 8de4aa0cb76b510678044afb5dcc7b7a2477f1c2fb078eed32e34c15a9a9dc5c5a54148ab3e7848229d84a3841c314e83cb9b06565405e9a495689313b5f4d70
data/LICENSE CHANGED
@@ -176,7 +176,7 @@
176
176
 
177
177
  END OF TERMS AND CONDITIONS
178
178
 
179
- Copyright 2016 Chain, Inc.
179
+ Copyright 2017 Chain, Inc.
180
180
 
181
181
  Licensed under the Apache License, Version 2.0 (the "License");
182
182
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,41 +1,30 @@
1
- # Chain Ruby SDK
1
+ # Sequence Ruby SDK
2
2
 
3
3
  ## Usage
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.
7
+ The Ruby SDK is available [via Rubygems](https://rubygems.org/gems/sequence-sdk).
8
8
 
9
9
  Ruby 2.0 or greater is required. We strongly recommend upgrading to Ruby 2.1 or greater, as [Ruby 2.0 has reached end-of-life](https://www.ruby-lang.org/en/downloads/branches/) and will no longer receive security updates and bugfixes.
10
10
 
11
11
  For most applications, you can simply add the following to your `Gemfile`:
12
12
 
13
13
  ```
14
- gem 'chain-sdk', '~> 1.2.0', require: 'chain'
14
+ gem 'sequence-sdk', '~> 1.0.0'
15
15
  ```
16
16
 
17
17
  ### In your code
18
18
 
19
19
  ```
20
- chain = Chain::Client.new
21
- ```
22
-
23
- ## Testing
24
-
25
- To run integration tests, run ledgerd listening on ports 1998 and 1999, and then provision the
26
- subdomain `test`. The `ledgerd provision` command will output an access token: export this to the
27
- `ACCESS_TOKEN` environment variable.
28
-
29
- The explorer will be up at https://test.chain.localhost:1999. Run:
20
+ require 'sequence'
30
21
 
22
+ ledger = Sequence::Client.new(
23
+ url: 'https://example-ledger.sequenceledger.com',
24
+ access_token: '...'
25
+ )
31
26
  ```
32
- bundle exec rspec
33
- ```
34
-
35
- ## Documenation
36
27
 
37
- To build documentation as you're working us the `yard` command:
28
+ ### Documentation
38
29
 
39
- ```
40
- yard server
41
- ```
30
+ Comprehensive instructions and examples are available in the [developer documentation](https://dashboard.sequenceledger.com/docs).
data/lib/sequence.rb ADDED
@@ -0,0 +1,3 @@
1
+ require_relative './sequence/client'
2
+ require_relative './sequence/constants'
3
+ require_relative './sequence/version'
@@ -3,7 +3,7 @@ require_relative './errors'
3
3
  require_relative './query'
4
4
  require_relative './response_object'
5
5
 
6
- module Chain
6
+ module Sequence
7
7
  class Account < ResponseObject
8
8
 
9
9
  # @!attribute [r] id
@@ -36,7 +36,7 @@ module Chain
36
36
  attrib :alias
37
37
  end
38
38
 
39
- class ClientModule < Chain::ClientModule
39
+ class ClientModule < Sequence::ClientModule
40
40
  # @param [Hash] opts Options hash specifiying account creation details.
41
41
  # @option opts [String] alias User specified, unique identifier.
42
42
  # @option opts [Array<Hash>] keys The list of keys used to create control programs under the account. A key is a hash containing either an `id` or `alias` key.
@@ -66,7 +66,7 @@ module Chain
66
66
  end
67
67
  end
68
68
 
69
- class Query < Chain::Query
69
+ class Query < Sequence::Query
70
70
  def fetch(query)
71
71
  client.conn.request('list-accounts', query)
72
72
  end
@@ -5,7 +5,7 @@ require_relative './errors'
5
5
  require_relative './query'
6
6
  require_relative './response_object'
7
7
 
8
- module Chain
8
+ module Sequence
9
9
  class Asset < ResponseObject
10
10
 
11
11
  # @!attribute [r] id
@@ -41,7 +41,7 @@ module Chain
41
41
  attrib :alias
42
42
  end
43
43
 
44
- class ClientModule < Chain::ClientModule
44
+ class ClientModule < Sequence::ClientModule
45
45
  # @param [Hash] opts Options hash specifiying asset creation details.
46
46
  # @option opts [String] alias User specified, unique identifier.
47
47
  # @option opts [Array<Hash>] keys The list of keys used to create the issuance program for the asset. A key is a hash containing either an `id` or `alias` key.
@@ -71,7 +71,7 @@ module Chain
71
71
  end
72
72
  end
73
73
 
74
- class Query < Chain::Query
74
+ class Query < Sequence::Query
75
75
  def fetch(query)
76
76
  client.conn.request('list-assets', query)
77
77
  end
@@ -2,24 +2,24 @@ require_relative './client_module'
2
2
  require_relative './response_object'
3
3
  require_relative './query'
4
4
 
5
- module Chain
5
+ module Sequence
6
6
  class Balance < ResponseObject
7
7
 
8
8
  # @!attribute [r] amount
9
- # Sum of the unspent outputs.
9
+ # Sum of the contracts.
10
10
  # @return [Integer]
11
11
  attrib :amount
12
12
 
13
13
  # @!attribute [r] sum_by
14
- # List of parameters on which to sum unspent outputs.
14
+ # List of parameters on which to sum contracts.
15
15
  # @return [Hash<String => String>]
16
16
  attrib :sum_by
17
17
 
18
- class ClientModule < Chain::ClientModule
18
+ class ClientModule < Sequence::ClientModule
19
19
  # @param [Hash] opts Filtering information
20
20
  # @option opts [String] filter Filter string, see {https://chain.com/docs/core/build-applications/queries}.
21
21
  # @option opts [Array<String|Integer>] filter_params Parameter values for filter string (if needed).
22
- # @option opts [Array<String>] sum_by List of unspent output attributes to sum by.
22
+ # @option opts [Array<String>] sum_by List of contract attributes to sum by.
23
23
  # @option opts [Integer] timestamp A millisecond Unix timestamp. By using this parameter, you can perform queries that reflect the state of the blockchain at different points in time.
24
24
  # @return [Query]
25
25
  def query(opts = {})
@@ -27,7 +27,7 @@ module Chain
27
27
  end
28
28
  end
29
29
 
30
- class Query < Chain::Query
30
+ class Query < Sequence::Query
31
31
  def fetch(query)
32
32
  client.conn.request('list-balances', query)
33
33
  end
@@ -2,13 +2,13 @@ require_relative './account'
2
2
  require_relative './asset'
3
3
  require_relative './balance'
4
4
  require_relative './constants'
5
+ require_relative './contract'
5
6
  require_relative './dev_utils'
6
7
  require_relative './key'
7
8
  require_relative './stats'
8
9
  require_relative './transaction'
9
- require_relative './unspent_output'
10
10
 
11
- module Chain
11
+ module Sequence
12
12
  class Client
13
13
 
14
14
  def initialize(opts = {})
@@ -52,9 +52,9 @@ module Chain
52
52
  @transactions ||= Transaction::ClientModule.new(self)
53
53
  end
54
54
 
55
- # @return [UnspentOutput::ClientModule]
56
- def unspent_outputs
57
- @unspent_outputs ||= UnspentOutput::ClientModule.new(self)
55
+ # @return [Contract::ClientModule]
56
+ def contracts
57
+ @contracts ||= Contract::ClientModule.new(self)
58
58
  end
59
59
 
60
60
  # @return [Stats::ClientModule]
@@ -1,4 +1,4 @@
1
- module Chain
1
+ module Sequence
2
2
  class ClientModule
3
3
 
4
4
  attr_reader :client
@@ -4,11 +4,10 @@ require 'net/https'
4
4
  require 'openssl'
5
5
  require 'thread'
6
6
 
7
- require_relative './batch_response'
8
7
  require_relative './errors'
9
8
  require_relative './version'
10
9
 
11
- module Chain
10
+ module Sequence
12
11
  class Connection
13
12
 
14
13
  # Parameters to the retry exponential backoff function.
@@ -45,47 +44,6 @@ module Chain
45
44
  _request_with_retries(path, body)[:body]
46
45
  end
47
46
 
48
- def batch_request(path, body = {}, &translate)
49
- res = _request_with_retries(path, body)
50
- body = res[:body]
51
- response = res[:response]
52
-
53
- successes = {}
54
- errors = {}
55
-
56
- body.each_with_index do |item, i|
57
- if !!item['code']
58
- errors[i] = APIError.new(item, response)
59
- else
60
- if translate
61
- successes[i] = translate.call(item)
62
- else
63
- successes[i] = item
64
- end
65
- end
66
- end
67
-
68
- BatchResponse.new(
69
- successes: successes,
70
- errors: errors,
71
- response: response,
72
- )
73
- end
74
-
75
- def singleton_batch_request(path, body = {}, &translate)
76
- batch = batch_request(path, body, &translate)
77
-
78
- if batch.size != 1
79
- raise "Invalid response, expected a single response object but got #{batch.items.size}"
80
- end
81
-
82
- raise batch.errors.values.first if batch.errors.size == 1
83
-
84
- batch.successes.values.first
85
- end
86
-
87
- private
88
-
89
47
  def _request_with_retries(path, body)
90
48
  attempts = 0
91
49
 
@@ -121,7 +79,7 @@ module Chain
121
79
  req = Net::HTTP::Post.new(full_path)
122
80
  req['Accept'] = 'application/json'
123
81
  req['Content-Type'] = 'application/json'
124
- req['User-Agent'] = 'chain-sdk-ruby/' + Chain::VERSION
82
+ req['User-Agent'] = 'chain-sdk-ruby/' + Sequence::VERSION
125
83
  req.body = JSON.dump(body)
126
84
 
127
85
  if @access_token
@@ -1,3 +1,3 @@
1
- module Chain
1
+ module Sequence
2
2
  MAX_BLOCK_HEIGHT = (2 ** 63) - 1
3
3
  end
@@ -2,8 +2,8 @@ require_relative './client_module'
2
2
  require_relative './response_object'
3
3
  require_relative './query'
4
4
 
5
- module Chain
6
- class UnspentOutput < ResponseObject
5
+ module Sequence
6
+ class Contract < ResponseObject
7
7
  # @!attribute [r] id
8
8
  # @return [String]
9
9
  attrib :id
@@ -48,7 +48,7 @@ module Chain
48
48
  # @return [Hash]
49
49
  attrib :reference_data
50
50
 
51
- class ClientModule < Chain::ClientModule
51
+ class ClientModule < Sequence::ClientModule
52
52
  # @param [Hash] opts Filtering information
53
53
  # @option opts [String] filter Filter string, see {https://chain.com/docs/core/build-applications/queries}.
54
54
  # @option opts [Array<String|Integer>] filter_params Parameter values for filter string (if needed).
@@ -59,13 +59,13 @@ module Chain
59
59
  end
60
60
  end
61
61
 
62
- class Query < Chain::Query
62
+ class Query < Sequence::Query
63
63
  def fetch(query)
64
- client.conn.request('list-unspent-outputs', query)
64
+ client.conn.request('list-contracts', query)
65
65
  end
66
66
 
67
67
  def translate(raw)
68
- UnspentOutput.new(raw)
68
+ Contract.new(raw)
69
69
  end
70
70
  end
71
71
  end
@@ -2,9 +2,9 @@ require 'securerandom'
2
2
 
3
3
  require_relative './client_module'
4
4
 
5
- module Chain
5
+ module Sequence
6
6
  class DevUtils
7
- class ClientModule < Chain::ClientModule
7
+ class ClientModule < Sequence::ClientModule
8
8
  # Deletes all data in the ledger. (development ledgers only)
9
9
  def reset
10
10
  client.conn.request('/reset', client_token: SecureRandom.uuid)
@@ -1,4 +1,4 @@
1
- module Chain
1
+ module Sequence
2
2
 
3
3
  # Base class for all errors raised by the Chain SDK.
4
4
  class BaseError < StandardError; end
@@ -3,7 +3,7 @@ require_relative './connection'
3
3
  require_relative './query'
4
4
  require_relative './response_object'
5
5
 
6
- module Chain
6
+ module Sequence
7
7
  class Key < ResponseObject
8
8
  # @!attribute [r] alias
9
9
  # User specified, unique identifier of the key.
@@ -15,7 +15,7 @@ module Chain
15
15
  # @return [String]
16
16
  attrib :id
17
17
 
18
- class ClientModule < Chain::ClientModule
18
+ class ClientModule < Sequence::ClientModule
19
19
 
20
20
  # Creates a key object.
21
21
  # @param [Hash] opts Parameters for MockHSM key creation.
@@ -33,7 +33,7 @@ module Chain
33
33
  end
34
34
  end
35
35
 
36
- class Query < Chain::Query
36
+ class Query < Sequence::Query
37
37
  def fetch(query)
38
38
  client.conn.request('list-keys', query)
39
39
  end
@@ -1,6 +1,6 @@
1
1
  require_relative './response_object'
2
2
 
3
- module Chain
3
+ module Sequence
4
4
  class Page < ResponseObject
5
5
  # @!attribute [r] items
6
6
  # List of items.
@@ -1,6 +1,6 @@
1
1
  require_relative './page'
2
2
 
3
- module Chain
3
+ module Sequence
4
4
  class Query
5
5
  include ::Enumerable
6
6
 
@@ -1,7 +1,7 @@
1
1
  require 'json'
2
2
  require 'time'
3
3
 
4
- module Chain
4
+ module Sequence
5
5
  class ResponseObject
6
6
  def initialize(raw_attribs)
7
7
  raw_attribs.each do |k, v|
@@ -2,7 +2,7 @@ require_relative './client_module'
2
2
  require_relative './response_object'
3
3
  require_relative './query'
4
4
 
5
- module Chain
5
+ module Sequence
6
6
  class Stats < ResponseObject
7
7
 
8
8
  # @!attribute [r] asset_count
@@ -20,7 +20,7 @@ module Chain
20
20
  # @return [Integer]
21
21
  attrib :tx_count
22
22
 
23
- class ClientModule < Chain::ClientModule
23
+ class ClientModule < Sequence::ClientModule
24
24
  # @return [Stats]
25
25
  def get
26
26
  Stats.new(client.conn.request('stats'))
@@ -4,7 +4,7 @@ require_relative './client_module'
4
4
  require_relative './query'
5
5
  require_relative './response_object'
6
6
 
7
- module Chain
7
+ module Sequence
8
8
  class Transaction < ResponseObject
9
9
 
10
10
  # @!attribute [r] id
@@ -17,6 +17,11 @@ module Chain
17
17
  # @return [Time]
18
18
  attrib :timestamp, rfc3339_time: true
19
19
 
20
+ # @!attribute [r] sequence_number
21
+ # Sequence number of the transaction.
22
+ # @return [Integer]
23
+ attrib :sequence_number
24
+
20
25
  # @!attribute [r] reference_data
21
26
  # User specified, unstructured data embedded within a transaction.
22
27
  # @return [Hash]
@@ -24,10 +29,15 @@ module Chain
24
29
 
25
30
  # @!attribute [r] actions
26
31
  # List of a transaction's actions.
27
- # @return [Array<Input>]
32
+ # @return [Array<Action>]
28
33
  attrib(:actions) { |raw| raw.map { |v| Action.new(v) } }
29
34
 
30
- class ClientModule < Chain::ClientModule
35
+ # @!attribute [r] contracts
36
+ # List of a transaction's contracts.
37
+ # @return [Array<Contract>]
38
+ attrib(:contracts) { |raw| raw.map { |v| Contract.new(v) } }
39
+
40
+ class ClientModule < Sequence::ClientModule
31
41
  # Builds, signs, and submits a transaction.
32
42
  # @param [Builder] builder Builder object with actions defined. If provided, overrides block parameter.
33
43
  # @yield Block defining transaction actions. A {Builder} object is passed as the only parameter.
@@ -61,7 +71,7 @@ module Chain
61
71
  end
62
72
  end
63
73
 
64
- class Query < Chain::Query
74
+ class Query < Sequence::Query
65
75
  def fetch(query)
66
76
  client.conn.request('list-transactions', query)
67
77
  end
@@ -201,41 +211,41 @@ module Chain
201
211
  # You must specify either an ID or an alias.
202
212
  # @option params [String] :destination_account_alias Alias of account receiving the newly-issued asset units.
203
213
  # You must specify either an ID or an alias.
204
- # @option params [Hash] :destination_reference_data Reference data to add to the receiving output.
214
+ # @option params [Hash] :reference_data Reference data to add to the receiving contract.
205
215
  # @return [Builder]
206
216
  def issue(params)
207
217
  add_action(params.merge(type: :issue))
208
218
  end
209
219
 
210
- # Takes units of an asset from a source (an account or output) and retires them.
220
+ # Takes units of an asset from a source (an account or contract) and retires them.
211
221
  # @param [Hash] params Action parameters
212
222
  # @option params [String] :source_account_id Account ID specifying the account controlling the asset.
213
- # You must specify a source account ID, account alias, or output ID.
223
+ # You must specify a source account ID, account alias, or contract ID.
214
224
  # @option params [String] :source_account_alias Account alias specifying the account controlling the asset.
215
- # You must specify a source account ID, account alias, or output ID.
216
- # @option params [String] :source_output_id Output controlling the asset.
217
- # You must specify a source account ID, account alias, or output ID.
225
+ # You must specify a source account ID, account alias, or contract ID.
226
+ # @option params [String] :source_contract_id Contract holding the asset.
227
+ # You must specify a source account ID, account alias, or contract ID.
218
228
  # @option params [String] :asset_id Asset ID specifying the asset to be retired.
219
229
  # You must specify either an ID or an alias.
220
230
  # @option params [String] :asset_alias Asset alias specifying the asset to be retired.
221
231
  # You must specify either an ID or an alias.
222
232
  # @option params [Integer] :amount Amount of the asset to be retired.
223
- # @option params [Hash] :destination_reference_data Reference data to add to the receiving output.
224
- # @option params [Hash] :change_reference_data Reference data to add to the change output, if it is necessary.
233
+ # @option params [Hash] :reference_data Reference data to add to the receiving contract.
234
+ # @option params [Hash] :change_reference_data Reference data to add to the change contract, if it is necessary.
225
235
  # @return [Builder]
226
236
  def retire(params)
227
237
  add_action(params.merge(type: :retire))
228
238
  end
229
239
 
230
- # Moves units of an asset from a source (an account or output) to a destination account.
240
+ # Moves units of an asset from a source (an account or contract) to a destination account.
231
241
  #
232
242
  # @param [Hash] params Action parameters
233
243
  # @option params [String] :source_account_id Account ID specifying the account controlling the asset.
234
- # You must specify a source account ID, account alias, or output ID.
244
+ # You must specify a source account ID, account alias, or contract ID.
235
245
  # @option params [String] :source_account_alias Account alias specifying the account controlling the asset.
236
- # You must specify a source account ID, account alias, or output ID.
237
- # @option params [String] :source_output_id Output controlling the asset.
238
- # You must specify a source account ID, account alias, or output ID.
246
+ # You must specify a source account ID, account alias, or contract ID.
247
+ # @option params [String] :source_contract_id Contract holding the asset.
248
+ # You must specify a source account ID, account alias, or contract ID.
239
249
  # @option params [String] :asset_id Asset ID specifying the asset to be transferred.
240
250
  # You must specify either an ID or an alias.
241
251
  # @option params [String] :asset_alias Asset alias specifying the asset to be transferred.
@@ -245,8 +255,8 @@ module Chain
245
255
  # You must specify a destination account ID or alias.
246
256
  # @option params [String] :destination_account_alias Account alias specifying the account controlling the asset.
247
257
  # You must specify a destination account ID or alias.
248
- # @option params [Hash] :destination_reference_data Reference data to add to the receiving output.
249
- # @option params [Hash] :change_reference_data Reference data to add to the change output, if it is necessary.
258
+ # @option params [Hash] :reference_data Reference data to add to the receiving contract.
259
+ # @option params [Hash] :change_reference_data Reference data to add to the change contract, if it is necessary.
250
260
  # @return [Builder]
251
261
  def transfer(params)
252
262
  add_action(params.merge(type: :transfer))
@@ -0,0 +1,3 @@
1
+ module Sequence
2
+ VERSION = '1.0.0'
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequence-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chain Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-18 00:00:00.000000000 Z
11
+ date: 2017-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,20 +86,6 @@ dependencies:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: 1.2.0
89
- - !ruby/object:Gem::Dependency
90
- name: parallel_tests
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: 2.14.1
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: 2.14.1
103
89
  - !ruby/object:Gem::Dependency
104
90
  name: simplecov
105
91
  requirement: !ruby/object:Gem::Requirement
@@ -156,26 +142,25 @@ extra_rdoc_files: []
156
142
  files:
157
143
  - LICENSE
158
144
  - README.md
159
- - lib/chain.rb
160
- - lib/chain/account.rb
161
- - lib/chain/asset.rb
162
- - lib/chain/balance.rb
163
- - lib/chain/batch_response.rb
164
- - lib/chain/client.rb
165
- - lib/chain/client_module.rb
166
- - lib/chain/connection.rb
167
- - lib/chain/constants.rb
168
- - lib/chain/dev_utils.rb
169
- - lib/chain/errors.rb
170
- - lib/chain/key.rb
171
- - lib/chain/page.rb
172
- - lib/chain/query.rb
173
- - lib/chain/response_object.rb
174
- - lib/chain/stats.rb
175
- - lib/chain/transaction.rb
176
- - lib/chain/unspent_output.rb
177
- - lib/chain/version.rb
178
- homepage: https://sequence.chain.com
145
+ - lib/sequence.rb
146
+ - lib/sequence/account.rb
147
+ - lib/sequence/asset.rb
148
+ - lib/sequence/balance.rb
149
+ - lib/sequence/client.rb
150
+ - lib/sequence/client_module.rb
151
+ - lib/sequence/connection.rb
152
+ - lib/sequence/constants.rb
153
+ - lib/sequence/contract.rb
154
+ - lib/sequence/dev_utils.rb
155
+ - lib/sequence/errors.rb
156
+ - lib/sequence/key.rb
157
+ - lib/sequence/page.rb
158
+ - lib/sequence/query.rb
159
+ - lib/sequence/response_object.rb
160
+ - lib/sequence/stats.rb
161
+ - lib/sequence/transaction.rb
162
+ - lib/sequence/version.rb
163
+ homepage: https://dashboard.sequenceledger.com
179
164
  licenses:
180
165
  - Apache-2.0
181
166
  metadata: {}
data/lib/chain.rb DELETED
@@ -1,3 +0,0 @@
1
- require_relative './chain/client'
2
- require_relative './chain/constants'
3
- require_relative './chain/version'
@@ -1,21 +0,0 @@
1
- def ensure_key_sorting(h)
2
- sorted = h.keys.sort
3
- return h if sorted == h.keys
4
- sorted.reduce({}) { |memo, k| memo[k] = h[k]; memo }
5
- end
6
-
7
- module Chain
8
- class BatchResponse
9
- def initialize(successes: {}, errors: {}, response: nil)
10
- @successes = ensure_key_sorting(successes)
11
- @errors = ensure_key_sorting(errors)
12
- @response = response
13
- end
14
-
15
- def size
16
- successes.size + errors.size
17
- end
18
-
19
- attr_reader :successes, :errors, :response
20
- end
21
- end
data/lib/chain/version.rb DELETED
@@ -1,3 +0,0 @@
1
- module Chain
2
- VERSION = '0.0.1'
3
- end