keoken 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardoc/checksums +8 -0
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -39
- data/doc/Bitcoin/Script.html +190 -0
- data/doc/Keoken/Backend/BitcoinRuby/Transaction.html +760 -0
- data/doc/Keoken/Backend/BitcoinRuby.html +115 -0
- data/doc/Keoken/Backend.html +115 -0
- data/doc/Keoken/Bitprim/Transaction.html +354 -0
- data/doc/Keoken/Bitprim.html +115 -0
- data/doc/Keoken/IdNotFound.html +202 -0
- data/doc/Keoken/NameNotFound.html +202 -0
- data/doc/Keoken/Token.html +732 -0
- data/doc/Keoken.html +180 -0
- data/doc/_index.html +210 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +162 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +162 -0
- data/doc/js/app.js +292 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +171 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/keoken/backend/bitcoin_ruby/transaction.rb +117 -11
- data/lib/keoken/bitprim/transaction.rb +57 -7
- data/lib/keoken/errors/id_not_found.rb +1 -1
- data/lib/keoken/errors/name_not_found.rb +1 -1
- data/lib/keoken/errors/output_not_found.rb +8 -0
- data/lib/keoken/token.rb +18 -0
- data/lib/keoken/version.rb +2 -2
- data/spec/keoken_spec.rb +50 -68
- metadata +31 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 137b36288406a58a378b99d8abce324c28a52bf5098cfaa9c3b5fd1255a2c643
|
4
|
+
data.tar.gz: b0958bb6a60e39612fa622509fa9d672107fee8896f22de7616ebc55befb8279
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1cbf689f6e7fa097c0b5282daa271afe8c29b2bf1ed2c37d19221b478845dfa817b52a1bd4134ace440135da98ce2f305856625a32f8148a674dd3e68198a9e
|
7
|
+
data.tar.gz: d5415668619f6372b9a806a861380375ad68e909bcfb28f2a7b60a77447279ff12d5f71d72b5d2d1a2499e79a47cb9020be518bdd12bfb48c4fde10961ee26bd
|
data/.yardoc/checksums
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
lib/keoken.rb 537b2d6442b484c3024f7c6a3f903fec095025a5
|
2
|
+
lib/keoken/token.rb 1204d627b643384052f696df698aeb110786f0ed
|
3
|
+
lib/keoken/version.rb 31037dd2940f59d125e4d2a39a5c6f3f0b799138
|
4
|
+
lib/keoken/bitprim/transaction.rb 4eaa63ae0a2346d5847944516b07b670f0faab3c
|
5
|
+
lib/keoken/errors/id_not_found.rb 45dfceaab128e711ab1f277b82d09cc48170ab5b
|
6
|
+
lib/keoken/errors/name_not_found.rb 301c119c6dc84db6f063897a65a4a4c1ceb0a230
|
7
|
+
lib/keoken/extensions/bitcoin/script.rb 16430adf292ff593b004914854759677653cd751
|
8
|
+
lib/keoken/backend/bitcoin_ruby/transaction.rb d16b0fc2ef333153f704cf351b64fb2f1bf237fe
|
data/.yardoc/complete
ADDED
File without changes
|
Binary file
|
Binary file
|
data/.yardoc/proxy_types
ADDED
Binary file
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Keoken [![Build Status](https://travis-ci.org/bitex-la/keoken-ruby.svg?branch=master)](https://travis-ci.org/bitex-la/keoken-ruby)
|
1
|
+
# Keoken [![Build Status](https://travis-ci.org/bitex-la/keoken-ruby.svg?branch=master)](https://travis-ci.org/bitex-la/keoken-ruby) [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](https://www.rubydoc.info/github/bitex-la/keoken-ruby/master)
|
2
2
|
|
3
3
|
Creates BCH tokens and send money between them for the Keoken protocol.
|
4
4
|
|
@@ -34,54 +34,28 @@ Or install it yourself as:
|
|
34
34
|
# the change address, the address who owns the recipient token and the script.
|
35
35
|
|
36
36
|
Bitcoin.network = :testnet3
|
37
|
-
token = Keoken::Token.new(name:
|
37
|
+
token = Keoken::Token.new(name: "test-keoken-bitex")
|
38
38
|
token.create(1_000_000)
|
39
|
-
|
40
|
-
input_script = '76a9147bb97684cc43e2f8ea0ed1d50dddce3ebf80063888ac'
|
41
|
-
position = 0
|
39
|
+
key = Bitcoin::Key.from_base58("cShKfHoHVf6iYKZym18ip1MJFQFxJwbcLxW53MQikxdDsGd2ofBU")
|
42
40
|
script = token.hex
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
@transaction_token = Keoken::Backend::BitcoinRuby::Transaction.create(tx_id,
|
47
|
-
position,
|
48
|
-
input_script,
|
49
|
-
input_amount,
|
50
|
-
output_amount,
|
51
|
-
key,
|
52
|
-
script)
|
53
|
-
transaction = Keoken::Bitprim::Transaction.new(@transaction_token.raw)
|
54
|
-
transaction.send_tx
|
41
|
+
@transaction_token = Keoken::Backend::BitcoinRuby::Transaction.build_for_creation(key.addr, key, script)
|
42
|
+
transaction = Keoken::Bitprim::Transaction.new
|
43
|
+
transaction.send_tx(@transaction_token.raw)
|
55
44
|
```
|
56
45
|
|
57
46
|
### Send token money and send transaction to the blockchain
|
58
47
|
|
59
48
|
```ruby
|
60
49
|
Bitcoin.network = :testnet3
|
61
|
-
|
62
|
-
|
63
|
-
token = Keoken::Token.new(id:
|
50
|
+
bitprim_transaction = Keoken::Bitprim::Transaction.new
|
51
|
+
assets = bitprim_transaction.assets_by_address('mro9aqn4xCzXVS7jRFFuzT2ERKonvPdSDA')
|
52
|
+
token = Keoken::Token.new(id: assets.first['asset_id'])
|
64
53
|
token.send_amount(500_000)
|
65
|
-
|
66
|
-
input_script = '76a9147bb97684cc43e2f8ea0ed1d50dddce3ebf80063888ac'
|
67
|
-
position = 0
|
54
|
+
key = Bitcoin::Key.from_base58('cShKfHoHVf6iKKZym18ip1MJFQFxJwbcLxW53MQikxdDsGd2oxBU')
|
68
55
|
script = token.hex
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
output_address = 'mnTd41YZ1e1YqsaPNJh3wkeSUrFvp1guzi'
|
73
|
-
key = Bitcoin::Key.from_base58("cShKfHoHVf6iKKZym18ip1MJFQFxJwbcLxW53MQikxdDsGd2oxBU")
|
74
|
-
@transaction_token = Keoken::Backend::BitcoinRuby::Transaction.send_amount(tx_id,
|
75
|
-
position,
|
76
|
-
input_script,
|
77
|
-
input_amount,
|
78
|
-
output_amount,
|
79
|
-
output_amount_address,
|
80
|
-
output_address,
|
81
|
-
key,
|
82
|
-
script)
|
83
|
-
transaction = Keoken::Bitprim::Transaction.new(@transaction_token.raw)
|
84
|
-
transaction.send_tx
|
56
|
+
@transaction_token = Keoken::Backend::BitcoinRuby::Transaction.build_for_send_amount(key.addr, 'mnTd41YZ1e1YqsaPNJh3wkeSUrFvp1guzi', key, script)
|
57
|
+
transaction = Keoken::Bitprim::Transaction.new
|
58
|
+
transaction.send_tx(@transaction_token.raw)
|
85
59
|
```
|
86
60
|
|
87
61
|
## Contributing
|
@@ -0,0 +1,190 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Bitcoin::Script
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.18
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Bitcoin::Script";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (S)</a> »
|
40
|
+
<span class='title'>Bitcoin</span>
|
41
|
+
»
|
42
|
+
<span class="title">Script</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Bitcoin::Script
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Bitcoin::Script</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/keoken/extensions/bitcoin/script.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<h2>
|
111
|
+
Class Method Summary
|
112
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
113
|
+
</h2>
|
114
|
+
|
115
|
+
<ul class="summary">
|
116
|
+
|
117
|
+
<li class="public ">
|
118
|
+
<span class="summary_signature">
|
119
|
+
|
120
|
+
<a href="#to_custom_script-class_method" title="to_custom_script (class method)">.<strong>to_custom_script</strong>(data = nil) ⇒ Object </a>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</span>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
|
139
|
+
</ul>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<div id="class_method_details" class="method_details_list">
|
145
|
+
<h2>Class Method Details</h2>
|
146
|
+
|
147
|
+
|
148
|
+
<div class="method_details first">
|
149
|
+
<h3 class="signature first" id="to_custom_script-class_method">
|
150
|
+
|
151
|
+
.<strong>to_custom_script</strong>(data = nil) ⇒ <tt>Object</tt>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
</h3><table class="source_code">
|
158
|
+
<tr>
|
159
|
+
<td>
|
160
|
+
<pre class="lines">
|
161
|
+
|
162
|
+
|
163
|
+
2
|
164
|
+
3
|
165
|
+
4</pre>
|
166
|
+
</td>
|
167
|
+
<td>
|
168
|
+
<pre class="code"><span class="info file"># File 'lib/keoken/extensions/bitcoin/script.rb', line 2</span>
|
169
|
+
|
170
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_custom_script'>to_custom_script</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
171
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_data'>data</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_pack'>pack</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>H*</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
172
|
+
<span class='kw'>end</span></pre>
|
173
|
+
</td>
|
174
|
+
</tr>
|
175
|
+
</table>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
</div>
|
179
|
+
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<div id="footer">
|
183
|
+
Generated on Thu Jan 31 18:12:23 2019 by
|
184
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
185
|
+
0.9.18 (ruby-2.3.3).
|
186
|
+
</div>
|
187
|
+
|
188
|
+
</div>
|
189
|
+
</body>
|
190
|
+
</html>
|