sequence-sdk 2 → 2.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 +1 -1
- data/lib/sequence/http_wrapper.rb +0 -1
- data/lib/sequence/response_object.rb +6 -0
- data/lib/sequence/transaction.rb +24 -5
- data/lib/sequence/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da2edb02eda3ac971bd102181b56b78339a16a30d12c7c06c123569a09180584
|
4
|
+
data.tar.gz: a8e9ffb7f528e3679f817ab2b06e1399ed90013d474601dcbb01f8e92e2a5cd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 807d33a14ca05d631003907294f6e2ca6f0618838615907853feb071f661a98268b26b5f70216670a8d36ac2c2ae32540cacd02ffba18461655c8729bf784df7
|
7
|
+
data.tar.gz: ea5d6ec64d2809b8a744efdf178b5ffde5721499f706652427c2dbe0e5ff556493b1fa327f09835d0150917e8bb1198950997f0c07b132002cb9b1df008257ab
|
data/README.md
CHANGED
@@ -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
|
data/lib/sequence/transaction.rb
CHANGED
@@ -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
|
-
#
|
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.
|
data/lib/sequence/version.rb
CHANGED
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-
|
11
|
+
date: 2018-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|