tezos_client 1.4.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile.lock +100 -92
- data/lib/tezos_client/version.rb +1 -1
- data/lib/tezos_client.rb +34 -14
- data/tezos_client.gemspec +5 -5
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0710a2763a47abefbb6eae49ea155d4c25a286b285d36811c8bb283095589959
|
4
|
+
data.tar.gz: 418d5d18d291c6bd0bb9f0435b9020646094fbe82f83bca54af25d19f062c107
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd86a0c6682019234cb89aba9f31a430f5d9431c5ad2df68b3d9d730ae0182a47f4a5b88c7710fb8d47eb1ab2d12fcd3b6403907d6fc9ed5dcd054ca2e210b33
|
7
|
+
data.tar.gz: d4f3d711a84ef597390f3bd7650b464f3838830f3bdcbdf5d38f71d05f9a3dc34193bee4e5e8e7f580f05b62aed1778b12f9a0a2d095484db605b220149007d3
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.1.4
|
data/Gemfile.lock
CHANGED
@@ -1,174 +1,182 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tezos_client (
|
4
|
+
tezos_client (2.0.0)
|
5
5
|
active_interaction (>= 3.8)
|
6
|
-
activesupport (
|
6
|
+
activesupport (>= 6.0)
|
7
7
|
base58 (~> 0.2.3)
|
8
8
|
bip_mnemonic (~> 0.0.2)
|
9
|
-
httparty (~> 0.
|
10
|
-
money-tree (~> 0.
|
11
|
-
rbnacl (~>
|
12
|
-
rest-client (~> 2.
|
9
|
+
httparty (~> 0.21.0)
|
10
|
+
money-tree (~> 0.11.2)
|
11
|
+
rbnacl (~> 7.1)
|
12
|
+
rest-client (~> 2.1)
|
13
13
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
actionpack (
|
18
|
-
actionview (=
|
19
|
-
activesupport (=
|
20
|
-
rack (~> 2.0, >= 2.0
|
17
|
+
actionpack (7.0.4.3)
|
18
|
+
actionview (= 7.0.4.3)
|
19
|
+
activesupport (= 7.0.4.3)
|
20
|
+
rack (~> 2.0, >= 2.2.0)
|
21
21
|
rack-test (>= 0.6.3)
|
22
22
|
rails-dom-testing (~> 2.0)
|
23
23
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
24
|
-
actionview (
|
25
|
-
activesupport (=
|
24
|
+
actionview (7.0.4.3)
|
25
|
+
activesupport (= 7.0.4.3)
|
26
26
|
builder (~> 3.1)
|
27
27
|
erubi (~> 1.4)
|
28
28
|
rails-dom-testing (~> 2.0)
|
29
29
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
30
|
-
active_interaction (
|
31
|
-
activemodel (>= 5, < 8)
|
32
|
-
activesupport (>= 5, < 8)
|
33
|
-
activemodel (
|
34
|
-
activesupport (=
|
35
|
-
activesupport (
|
30
|
+
active_interaction (5.2.0)
|
31
|
+
activemodel (>= 5.2, < 8)
|
32
|
+
activesupport (>= 5.2, < 8)
|
33
|
+
activemodel (7.0.4.3)
|
34
|
+
activesupport (= 7.0.4.3)
|
35
|
+
activesupport (7.0.4.3)
|
36
36
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
37
|
-
i18n (>=
|
38
|
-
minitest (
|
39
|
-
tzinfo (~>
|
40
|
-
|
41
|
-
|
42
|
-
public_suffix (>= 2.0.2, < 5.0)
|
37
|
+
i18n (>= 1.6, < 2)
|
38
|
+
minitest (>= 5.1)
|
39
|
+
tzinfo (~> 2.0)
|
40
|
+
addressable (2.8.4)
|
41
|
+
public_suffix (>= 2.0.2, < 6.0)
|
43
42
|
ast (2.4.2)
|
44
43
|
base58 (0.2.3)
|
44
|
+
bech32 (1.3.0)
|
45
|
+
thor (>= 1.1.0)
|
45
46
|
bip_mnemonic (0.0.4)
|
46
47
|
builder (3.2.4)
|
47
48
|
coderay (1.1.3)
|
48
|
-
concurrent-ruby (1.
|
49
|
+
concurrent-ruby (1.2.2)
|
49
50
|
crack (0.4.5)
|
50
51
|
rexml
|
51
52
|
crass (1.0.6)
|
52
53
|
diff-lcs (1.5.0)
|
53
54
|
domain_name (0.5.20190701)
|
54
55
|
unf (>= 0.0.5, < 1.0.0)
|
55
|
-
erubi (1.
|
56
|
+
erubi (1.12.0)
|
56
57
|
ffi (1.15.5)
|
57
58
|
hashdiff (1.0.1)
|
58
|
-
http-
|
59
|
+
http-accept (1.7.0)
|
60
|
+
http-cookie (1.0.5)
|
59
61
|
domain_name (~> 0.5)
|
60
|
-
httparty (0.
|
61
|
-
|
62
|
+
httparty (0.21.0)
|
63
|
+
mini_mime (>= 1.0.0)
|
62
64
|
multi_xml (>= 0.5.2)
|
63
|
-
i18n (1.
|
65
|
+
i18n (1.12.0)
|
64
66
|
concurrent-ruby (~> 1.0)
|
65
|
-
|
67
|
+
json (2.6.3)
|
68
|
+
loofah (2.20.0)
|
66
69
|
crass (~> 1.0.2)
|
67
70
|
nokogiri (>= 1.5.9)
|
68
71
|
method_source (1.0.0)
|
69
72
|
mime-types (3.4.1)
|
70
73
|
mime-types-data (~> 3.2015)
|
71
|
-
mime-types-data (3.
|
72
|
-
|
73
|
-
|
74
|
-
|
74
|
+
mime-types-data (3.2023.0218.1)
|
75
|
+
mini_mime (1.1.2)
|
76
|
+
minitest (5.18.0)
|
77
|
+
money-tree (0.11.2)
|
78
|
+
bech32 (~> 1.3)
|
79
|
+
openssl (~> 3.1)
|
75
80
|
multi_xml (0.6.0)
|
76
81
|
netrc (0.11.0)
|
77
|
-
nokogiri (1.
|
82
|
+
nokogiri (1.14.3-x86_64-darwin)
|
78
83
|
racc (~> 1.4)
|
79
|
-
|
80
|
-
|
84
|
+
openssl (3.1.0)
|
85
|
+
parallel (1.23.0)
|
86
|
+
parser (3.2.2.0)
|
81
87
|
ast (~> 2.4.1)
|
82
|
-
pry (0.14.
|
88
|
+
pry (0.14.2)
|
83
89
|
coderay (~> 1.1)
|
84
90
|
method_source (~> 1.0)
|
85
|
-
public_suffix (
|
86
|
-
racc (1.6.
|
87
|
-
rack (2.2.
|
88
|
-
rack-test (
|
89
|
-
rack (>= 1.
|
91
|
+
public_suffix (5.0.1)
|
92
|
+
racc (1.6.2)
|
93
|
+
rack (2.2.6.4)
|
94
|
+
rack-test (2.1.0)
|
95
|
+
rack (>= 1.3)
|
90
96
|
rails-dom-testing (2.0.3)
|
91
97
|
activesupport (>= 4.2.0)
|
92
98
|
nokogiri (>= 1.6)
|
93
|
-
rails-html-sanitizer (1.
|
94
|
-
loofah (~> 2.
|
95
|
-
railties (
|
96
|
-
actionpack (=
|
97
|
-
activesupport (=
|
99
|
+
rails-html-sanitizer (1.5.0)
|
100
|
+
loofah (~> 2.19, >= 2.19.1)
|
101
|
+
railties (7.0.4.3)
|
102
|
+
actionpack (= 7.0.4.3)
|
103
|
+
activesupport (= 7.0.4.3)
|
98
104
|
method_source
|
99
|
-
rake (>=
|
100
|
-
thor (
|
105
|
+
rake (>= 12.2)
|
106
|
+
thor (~> 1.0)
|
107
|
+
zeitwerk (~> 2.5)
|
101
108
|
rainbow (3.1.1)
|
102
109
|
rake (13.0.6)
|
103
|
-
rbnacl (
|
110
|
+
rbnacl (7.1.1)
|
104
111
|
ffi
|
105
|
-
regexp_parser (2.
|
106
|
-
rest-client (2.0
|
112
|
+
regexp_parser (2.8.0)
|
113
|
+
rest-client (2.1.0)
|
114
|
+
http-accept (>= 1.7.0, < 2.0)
|
107
115
|
http-cookie (>= 1.0.2, < 2.0)
|
108
116
|
mime-types (>= 1.16, < 4.0)
|
109
117
|
netrc (~> 0.8)
|
110
118
|
rexml (3.2.5)
|
111
|
-
rspec (3.
|
112
|
-
rspec-core (~> 3.
|
113
|
-
rspec-expectations (~> 3.
|
114
|
-
rspec-mocks (~> 3.
|
115
|
-
rspec-core (3.
|
116
|
-
rspec-support (~> 3.
|
117
|
-
rspec-expectations (3.
|
119
|
+
rspec (3.12.0)
|
120
|
+
rspec-core (~> 3.12.0)
|
121
|
+
rspec-expectations (~> 3.12.0)
|
122
|
+
rspec-mocks (~> 3.12.0)
|
123
|
+
rspec-core (3.12.2)
|
124
|
+
rspec-support (~> 3.12.0)
|
125
|
+
rspec-expectations (3.12.3)
|
118
126
|
diff-lcs (>= 1.2.0, < 2.0)
|
119
|
-
rspec-support (~> 3.
|
120
|
-
rspec-mocks (3.
|
127
|
+
rspec-support (~> 3.12.0)
|
128
|
+
rspec-mocks (3.12.5)
|
121
129
|
diff-lcs (>= 1.2.0, < 2.0)
|
122
|
-
rspec-support (~> 3.
|
123
|
-
rspec-support (3.
|
124
|
-
rubocop (1.
|
130
|
+
rspec-support (~> 3.12.0)
|
131
|
+
rspec-support (3.12.0)
|
132
|
+
rubocop (1.50.2)
|
133
|
+
json (~> 2.3)
|
125
134
|
parallel (~> 1.10)
|
126
|
-
parser (>= 3.
|
135
|
+
parser (>= 3.2.0.0)
|
127
136
|
rainbow (>= 2.2.2, < 4.0)
|
128
137
|
regexp_parser (>= 1.8, < 3.0)
|
129
|
-
rexml
|
130
|
-
rubocop-ast (>= 1.
|
138
|
+
rexml (>= 3.2.5, < 4.0)
|
139
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
131
140
|
ruby-progressbar (~> 1.7)
|
132
|
-
unicode-display_width (>=
|
133
|
-
rubocop-ast (1.
|
134
|
-
parser (>= 3.
|
135
|
-
rubocop-minitest (0.
|
136
|
-
rubocop (>=
|
137
|
-
rubocop-packaging (0.5.
|
138
|
-
rubocop (>=
|
139
|
-
rubocop-performance (1.
|
141
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
142
|
+
rubocop-ast (1.28.0)
|
143
|
+
parser (>= 3.2.1.0)
|
144
|
+
rubocop-minitest (0.30.0)
|
145
|
+
rubocop (>= 1.39, < 2.0)
|
146
|
+
rubocop-packaging (0.5.2)
|
147
|
+
rubocop (>= 1.33, < 2.0)
|
148
|
+
rubocop-performance (1.17.1)
|
140
149
|
rubocop (>= 1.7.0, < 2.0)
|
141
150
|
rubocop-ast (>= 0.4.0)
|
142
|
-
rubocop-rails (2.
|
151
|
+
rubocop-rails (2.19.1)
|
143
152
|
activesupport (>= 4.2.0)
|
144
153
|
rack (>= 1.1)
|
145
|
-
rubocop (>= 1.
|
146
|
-
rubocop-rails_config (1.
|
154
|
+
rubocop (>= 1.33.0, < 2.0)
|
155
|
+
rubocop-rails_config (1.12.1)
|
147
156
|
railties (>= 5.0)
|
148
|
-
rubocop (>= 1.
|
157
|
+
rubocop (>= 1.39.0)
|
149
158
|
rubocop-ast (>= 1.0.1)
|
150
|
-
rubocop-minitest (~> 0.
|
159
|
+
rubocop-minitest (~> 0.22)
|
151
160
|
rubocop-packaging (~> 0.5)
|
152
161
|
rubocop-performance (~> 1.11)
|
153
162
|
rubocop-rails (~> 2.0)
|
154
|
-
ruby-progressbar (1.
|
163
|
+
ruby-progressbar (1.13.0)
|
155
164
|
thor (1.2.1)
|
156
|
-
|
157
|
-
|
158
|
-
thread_safe (~> 0.1)
|
165
|
+
tzinfo (2.0.6)
|
166
|
+
concurrent-ruby (~> 1.0)
|
159
167
|
unf (0.1.4)
|
160
168
|
unf_ext
|
161
|
-
unf_ext (0.0.8)
|
162
|
-
unicode-display_width (2.
|
169
|
+
unf_ext (0.0.8.2)
|
170
|
+
unicode-display_width (2.4.2)
|
163
171
|
vcr (4.0.0)
|
164
|
-
webmock (3.
|
172
|
+
webmock (3.18.1)
|
165
173
|
addressable (>= 2.8.0)
|
166
174
|
crack (>= 0.3.2)
|
167
175
|
hashdiff (>= 0.4.0, < 2.0.0)
|
168
|
-
zeitwerk (2.
|
176
|
+
zeitwerk (2.6.7)
|
169
177
|
|
170
178
|
PLATFORMS
|
171
|
-
x86_64-darwin-
|
179
|
+
x86_64-darwin-22
|
172
180
|
|
173
181
|
DEPENDENCIES
|
174
182
|
bundler (~> 2.1)
|
@@ -181,4 +189,4 @@ DEPENDENCIES
|
|
181
189
|
webmock
|
182
190
|
|
183
191
|
BUNDLED WITH
|
184
|
-
2.
|
192
|
+
2.3.26
|
data/lib/tezos_client/version.rb
CHANGED
data/lib/tezos_client.rb
CHANGED
@@ -166,23 +166,23 @@ class TezosClient
|
|
166
166
|
broadcast_operation(operation: operation, dry_run: dry_run)
|
167
167
|
end
|
168
168
|
|
169
|
-
def
|
170
|
-
|
171
|
-
contract_address: args[:to],
|
172
|
-
entrypoint: entrypoint
|
173
|
-
)
|
169
|
+
def build_transaction(dry_run: false, entrypoint:, params:, params_type:, **args)
|
170
|
+
transfer_args = transfer_args(dry_run: dry_run, entrypoint: entrypoint, params: params, params_type:params_type, **args)
|
174
171
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
params_type: params_type
|
172
|
+
transaction = TransactionOperation.new(
|
173
|
+
rpc_interface: rpc_interface,
|
174
|
+
**transfer_args
|
179
175
|
)
|
180
176
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
177
|
+
transaction.rpc_operation_args
|
178
|
+
end
|
179
|
+
|
180
|
+
def call_contract(dry_run: false, entrypoint:, params:, params_type:, **args)
|
181
|
+
transfer_args = transfer_args(dry_run: dry_run,
|
182
|
+
entrypoint: entrypoint,
|
183
|
+
params: params,
|
184
|
+
params_type:params_type,
|
185
|
+
**args)
|
186
186
|
|
187
187
|
transfer(transfer_args)
|
188
188
|
end
|
@@ -266,6 +266,26 @@ class TezosClient
|
|
266
266
|
end
|
267
267
|
|
268
268
|
private
|
269
|
+
def transfer_args(dry_run: false, entrypoint:, params:, params_type:, **args)
|
270
|
+
_entrypoint = select_entrypoint(
|
271
|
+
contract_address: args[:to],
|
272
|
+
entrypoint: entrypoint
|
273
|
+
)
|
274
|
+
|
275
|
+
json_params = micheline_params(
|
276
|
+
params: params,
|
277
|
+
entrypoint: _entrypoint,
|
278
|
+
params_type: params_type
|
279
|
+
)
|
280
|
+
|
281
|
+
args.merge(
|
282
|
+
entrypoint: _entrypoint,
|
283
|
+
parameters: json_params,
|
284
|
+
dry_run: dry_run
|
285
|
+
)
|
286
|
+
end
|
287
|
+
|
288
|
+
|
269
289
|
def broadcast_operation(operation:, dry_run:)
|
270
290
|
res = if dry_run
|
271
291
|
operation.simulate
|
data/tezos_client.gemspec
CHANGED
@@ -43,10 +43,10 @@ Gem::Specification.new do |spec|
|
|
43
43
|
|
44
44
|
spec.add_dependency "active_interaction", ">= 3.8"
|
45
45
|
spec.add_dependency "base58", "~> 0.2.3"
|
46
|
-
spec.add_dependency "httparty", "~> 0.
|
47
|
-
spec.add_dependency "rbnacl", "~>
|
48
|
-
spec.add_dependency "rest-client", "~>2.
|
49
|
-
spec.add_dependency "activesupport", "
|
50
|
-
spec.add_dependency "money-tree", "~> 0.
|
46
|
+
spec.add_dependency "httparty", "~> 0.21.0"
|
47
|
+
spec.add_dependency "rbnacl", "~> 7.1"
|
48
|
+
spec.add_dependency "rest-client", "~> 2.1"
|
49
|
+
spec.add_dependency "activesupport", ">= 6.0"
|
50
|
+
spec.add_dependency "money-tree", "~> 0.11.2"
|
51
51
|
spec.add_dependency "bip_mnemonic", "~> 0.0.2"
|
52
52
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tezos_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Michard
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -144,70 +144,70 @@ dependencies:
|
|
144
144
|
requirements:
|
145
145
|
- - "~>"
|
146
146
|
- !ruby/object:Gem::Version
|
147
|
-
version: 0.
|
147
|
+
version: 0.21.0
|
148
148
|
type: :runtime
|
149
149
|
prerelease: false
|
150
150
|
version_requirements: !ruby/object:Gem::Requirement
|
151
151
|
requirements:
|
152
152
|
- - "~>"
|
153
153
|
- !ruby/object:Gem::Version
|
154
|
-
version: 0.
|
154
|
+
version: 0.21.0
|
155
155
|
- !ruby/object:Gem::Dependency
|
156
156
|
name: rbnacl
|
157
157
|
requirement: !ruby/object:Gem::Requirement
|
158
158
|
requirements:
|
159
159
|
- - "~>"
|
160
160
|
- !ruby/object:Gem::Version
|
161
|
-
version:
|
161
|
+
version: '7.1'
|
162
162
|
type: :runtime
|
163
163
|
prerelease: false
|
164
164
|
version_requirements: !ruby/object:Gem::Requirement
|
165
165
|
requirements:
|
166
166
|
- - "~>"
|
167
167
|
- !ruby/object:Gem::Version
|
168
|
-
version:
|
168
|
+
version: '7.1'
|
169
169
|
- !ruby/object:Gem::Dependency
|
170
170
|
name: rest-client
|
171
171
|
requirement: !ruby/object:Gem::Requirement
|
172
172
|
requirements:
|
173
173
|
- - "~>"
|
174
174
|
- !ruby/object:Gem::Version
|
175
|
-
version: 2.
|
175
|
+
version: '2.1'
|
176
176
|
type: :runtime
|
177
177
|
prerelease: false
|
178
178
|
version_requirements: !ruby/object:Gem::Requirement
|
179
179
|
requirements:
|
180
180
|
- - "~>"
|
181
181
|
- !ruby/object:Gem::Version
|
182
|
-
version: 2.
|
182
|
+
version: '2.1'
|
183
183
|
- !ruby/object:Gem::Dependency
|
184
184
|
name: activesupport
|
185
185
|
requirement: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- - "
|
187
|
+
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version: 6.0
|
189
|
+
version: '6.0'
|
190
190
|
type: :runtime
|
191
191
|
prerelease: false
|
192
192
|
version_requirements: !ruby/object:Gem::Requirement
|
193
193
|
requirements:
|
194
|
-
- - "
|
194
|
+
- - ">="
|
195
195
|
- !ruby/object:Gem::Version
|
196
|
-
version: 6.0
|
196
|
+
version: '6.0'
|
197
197
|
- !ruby/object:Gem::Dependency
|
198
198
|
name: money-tree
|
199
199
|
requirement: !ruby/object:Gem::Requirement
|
200
200
|
requirements:
|
201
201
|
- - "~>"
|
202
202
|
- !ruby/object:Gem::Version
|
203
|
-
version: 0.
|
203
|
+
version: 0.11.2
|
204
204
|
type: :runtime
|
205
205
|
prerelease: false
|
206
206
|
version_requirements: !ruby/object:Gem::Requirement
|
207
207
|
requirements:
|
208
208
|
- - "~>"
|
209
209
|
- !ruby/object:Gem::Version
|
210
|
-
version: 0.
|
210
|
+
version: 0.11.2
|
211
211
|
- !ruby/object:Gem::Dependency
|
212
212
|
name: bip_mnemonic
|
213
213
|
requirement: !ruby/object:Gem::Requirement
|
@@ -335,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
335
|
- !ruby/object:Gem::Version
|
336
336
|
version: '0'
|
337
337
|
requirements: []
|
338
|
-
rubygems_version: 3.
|
338
|
+
rubygems_version: 3.3.26
|
339
339
|
signing_key:
|
340
340
|
specification_version: 4
|
341
341
|
summary: Wrapper to the tezos client.
|