sequence-sdk 2 → 2.1

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: 614284f5e022e060540fa982f0722f4be9f3ae39c8f2d408e150f11dc63e681e
4
- data.tar.gz: 5db7ca9947b08bb1d4c5dac4ff4d03cc73ca9f7b79c0f0bdfeaedbf9052fc954
3
+ metadata.gz: da2edb02eda3ac971bd102181b56b78339a16a30d12c7c06c123569a09180584
4
+ data.tar.gz: a8e9ffb7f528e3679f817ab2b06e1399ed90013d474601dcbb01f8e92e2a5cd1
5
5
  SHA512:
6
- metadata.gz: 39cc42ae768d039b4f2a3a5fb430beb0b8e3ed99b226d473d0816a0a08eed862aa82a7b7b946d19651909eac27c02acb1ac60fb83c072453c6483acd80ec7e30
7
- data.tar.gz: f73ca461c8507ef50e748f9329c5181755817782f0939e5f57e1ea25a0cd0919db543fd4dd3d1101825954237c1228663d36a280f91980e2d7fe6dded2636e34
6
+ metadata.gz: 807d33a14ca05d631003907294f6e2ca6f0618838615907853feb071f661a98268b26b5f70216670a8d36ac2c2ae32540cacd02ffba18461655c8729bf784df7
7
+ data.tar.gz: ea5d6ec64d2809b8a744efdf178b5ffde5721499f706652427c2dbe0e5ff556493b1fa327f09835d0150917e8bb1198950997f0c07b132002cb9b1df008257ab
data/README.md CHANGED
@@ -14,7 +14,7 @@ for the language's schedule for security and bug fixes.
14
14
  Add the following to your `Gemfile`:
15
15
 
16
16
  ```ruby
17
- gem 'sequence-sdk', '~> 2'
17
+ gem 'sequence-sdk', '~> 2.1'
18
18
  ```
19
19
 
20
20
  ### In your code
@@ -131,7 +131,6 @@ module Sequence
131
131
  connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
132
132
  end
133
133
  if ENV['SEQTLSCA']
134
- puts "setting ca_file #{ENV['SEQTLSCA']}"
135
134
  connection.ca_file = ENV['SEQTLSCA']
136
135
  end
137
136
 
@@ -135,6 +135,12 @@ module Sequence
135
135
  def token_tags
136
136
  @data['token_tags']
137
137
  end
138
+
139
+ # A snapshot of the transaction's tags at the time of action creation
140
+ # @return [Hash]
141
+ def transaction_tags
142
+ @data['transaction_tags']
143
+ end
138
144
  end
139
145
 
140
146
  class TranslateError < StandardError
@@ -31,6 +31,11 @@ module Sequence
31
31
  # @return [Array<Action>]
32
32
  attrib(:actions) { |raw| raw.map { |v| Action.new(v) } }
33
33
 
34
+ # @!attribute [r] tags
35
+ # User-specified key-value data embedded in the transaction.
36
+ # @return [Hash]
37
+ attrib :tags
38
+
34
39
  class ClientModule < Sequence::ClientModule
35
40
  # Build, sign, and submit a transaction.
36
41
  # @param [Builder] builder
@@ -76,22 +81,27 @@ module Sequence
76
81
  yield(self) if block
77
82
  end
78
83
 
84
+ # @private
79
85
  def actions
80
86
  @actions ||= []
81
87
  end
82
88
 
89
+ # @private
90
+ def transaction_tags
91
+ @transaction_tags || {}
92
+ end
93
+
94
+ # @private
83
95
  def to_h
84
- { actions: actions }
96
+ { actions: actions, transaction_tags: transaction_tags }
85
97
  end
86
98
 
99
+ # @private
87
100
  def to_json(opts = nil)
88
101
  to_h.to_json(opts)
89
102
  end
90
103
 
91
- # Add an action to a transaction builder.
92
- # @param [Hash] opts
93
- # Action parameters.
94
- # @return [Builder]
104
+ # @private
95
105
  def add_action(opts = {})
96
106
  if opts[:amount].nil?
97
107
  raise ArgumentError, ':amount must be provided'
@@ -100,6 +110,15 @@ module Sequence
100
110
  self
101
111
  end
102
112
 
113
+ # Add tags to the transaction
114
+ # @param [Hash] tags
115
+ # Transaction tags
116
+ # @return [Builder]
117
+ def transaction_tags=(tags)
118
+ @transaction_tags = tags
119
+ self
120
+ end
121
+
103
122
  # Issue new tokens to a destination account.
104
123
  # @param amount [Integer]
105
124
  # Amount of the flavor to be issued.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sequence
4
- VERSION = '2'
4
+ VERSION = '2.1'
5
5
  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: '2'
4
+ version: '2.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: 2018-04-18 00:00:00.000000000 Z
11
+ date: 2018-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler