keoken 0.0.4 → 0.1.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
  SHA256:
3
- metadata.gz: ba894b4d1eb45706769ec0d108bd4c536e251df656b2fdc3c9e3afa00b579b23
4
- data.tar.gz: a7c8394f8b7318b7c5a7c212f62daafcc2e8d315ca9709a3c84a9c43772698d0
3
+ metadata.gz: 137b36288406a58a378b99d8abce324c28a52bf5098cfaa9c3b5fd1255a2c643
4
+ data.tar.gz: b0958bb6a60e39612fa622509fa9d672107fee8896f22de7616ebc55befb8279
5
5
  SHA512:
6
- metadata.gz: adea9c7e45ea15ca0f534aebd211438b332b46399d76ee43ad14a876707784bdabc763a87df80ef0d9e5f7966db3e627e24413a5d2e676f6e9550499dd051217
7
- data.tar.gz: 5e07c420dd1807e7f836e66df385fabf3217632c7f4c0aff3d62b2557045bc69c294c7ef946d3063a6fc44cd03fac8099e8f1d56c4182cd3ba2022cc0d3b0dca
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
Binary file
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- keoken (0.0.3)
4
+ keoken (0.0.4)
5
5
  bitcoin-ruby (~> 0.0.18)
6
6
 
7
7
  GEM
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: 'test-keoken')
37
+ token = Keoken::Token.new(name: "test-keoken-bitex")
38
38
  token.create(1_000_000)
39
- tx_id = 'aa699dc5ddf598a50dc2cb2cb2729629cb9d2d865df38e4367d13f81ef55f96e'
40
- input_script = '76a9147bb97684cc43e2f8ea0ed1d50dddce3ebf80063888ac'
41
- position = 0
39
+ key = Bitcoin::Key.from_base58("cShKfHoHVf6iYKZym18ip1MJFQFxJwbcLxW53MQikxdDsGd2ofBU")
42
40
  script = token.hex
43
- input_amount = 5_0000_0000
44
- output_amount = 4_9991_0000
45
- key = Bitcoin::Key.from_base58("cShKfHoHVf6iKKZym18ip1MJFQFxJwbcLxW53MQikxdDsGd2oxBU")
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
- transaction = Keoken::Bitprim::Transaction.new
62
- data = transaction.get_assets_by_address('mro9aqn4xCzXVS7jRFFuzT2ERKonvPdSDAs')
63
- token = Keoken::Token.new(id: data[0]['asset_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
- tx_id = 'aa699dc5ddf598a50dc2cb2cb2729629cb9d2d865df38e4367d13f81ef55f96e'
66
- input_script = '76a9147bb97684cc43e2f8ea0ed1d50dddce3ebf80063888ac'
67
- position = 0
54
+ key = Bitcoin::Key.from_base58('cShKfHoHVf6iKKZym18ip1MJFQFxJwbcLxW53MQikxdDsGd2oxBU')
68
55
  script = token.hex
69
- input_amount = 5_0000_0000
70
- output_amount = 4_9991_0000
71
- output_amount_address = 20_000
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
+ &mdash; 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> &raquo;
40
+ <span class='title'>Bitcoin</span>
41
+ &raquo;
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) &#x21d2; 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) &#x21d2; <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'>&quot;</span><span class='tstring_content'>H*</span><span class='tstring_end'>&quot;</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>