@leocuvee/turtlecoin-utils 0.0.14
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.
- package/.github/workflows/ci.yml +27 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +7 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/turtlecoin-utils.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.travis.yml +11 -0
- package/CONTRIBUTING.md +3 -0
- package/LICENSE +674 -0
- package/README.md +203 -0
- package/config.json +7 -0
- package/docs/.nojekyll +0 -0
- package/docs/CNAME +1 -0
- package/docs/assets/css/main.css +2321 -0
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +1 -0
- package/docs/assets/js/search.js +3 -0
- package/docs/classes/address.html +964 -0
- package/docs/classes/addressprefix.html +431 -0
- package/docs/classes/block.html +965 -0
- package/docs/classes/blocktemplate.html +695 -0
- package/docs/classes/cryptonote.html +1137 -0
- package/docs/classes/ed25519.keypair.html +400 -0
- package/docs/classes/ed25519.keys.html +373 -0
- package/docs/classes/extranoncetag.extranoncedata.html +454 -0
- package/docs/classes/extranoncetag.extranoncepaymentid.html +453 -0
- package/docs/classes/extranoncetag.iextranonce.html +347 -0
- package/docs/classes/extratag.extramergedmining.html +494 -0
- package/docs/classes/extratag.extranonce.html +530 -0
- package/docs/classes/extratag.extrapadding.html +456 -0
- package/docs/classes/extratag.extrapublickey.html +460 -0
- package/docs/classes/extratag.iextratag.html +355 -0
- package/docs/classes/levinpacket.html +674 -0
- package/docs/classes/levinpayloads.handshake.html +731 -0
- package/docs/classes/levinpayloads.ilevinpayload.html +318 -0
- package/docs/classes/levinpayloads.liteblock.html +494 -0
- package/docs/classes/levinpayloads.missingtransactions.html +494 -0
- package/docs/classes/levinpayloads.newblock.html +540 -0
- package/docs/classes/levinpayloads.newtransactions.html +402 -0
- package/docs/classes/levinpayloads.peerentry.html +610 -0
- package/docs/classes/levinpayloads.ping.html +450 -0
- package/docs/classes/levinpayloads.rawblock.html +344 -0
- package/docs/classes/levinpayloads.requestchain.html +402 -0
- package/docs/classes/levinpayloads.requestgetobjects.html +448 -0
- package/docs/classes/levinpayloads.requesttxpool.html +402 -0
- package/docs/classes/levinpayloads.responsechain.html +494 -0
- package/docs/classes/levinpayloads.responsegetobjects.html +540 -0
- package/docs/classes/levinpayloads.timedsync.html +540 -0
- package/docs/classes/multisig.html +930 -0
- package/docs/classes/multisigmessage.html +694 -0
- package/docs/classes/parentblock.html +347 -0
- package/docs/classes/transaction.html +925 -0
- package/docs/classes/transactioninputs.coinbaseinput.html +390 -0
- package/docs/classes/transactioninputs.itransactioninput.html +321 -0
- package/docs/classes/transactioninputs.keyinput.html +459 -0
- package/docs/classes/transactionoutputs.itransactionoutput.html +317 -0
- package/docs/classes/transactionoutputs.keyoutput.html +422 -0
- package/docs/enums/extranoncetag.noncetagtype.html +246 -0
- package/docs/enums/extratag.extratagtype.html +280 -0
- package/docs/enums/levinprotocol.commandtype.html +391 -0
- package/docs/enums/transactioninputs.inputtype.html +246 -0
- package/docs/enums/transactionoutputs.outputtype.html +229 -0
- package/docs/globals.html +238 -0
- package/docs/index.html +271 -0
- package/docs/interfaces/interfaces.config.html +590 -0
- package/docs/interfaces/interfaces.daemonblocktemplateresponse.html +323 -0
- package/docs/interfaces/interfaces.generatedinput.html +304 -0
- package/docs/interfaces/interfaces.generatedoutput.html +285 -0
- package/docs/interfaces/interfaces.inputkeys.html +304 -0
- package/docs/interfaces/interfaces.ipreparedtransaction.html +268 -0
- package/docs/interfaces/interfaces.output.html +399 -0
- package/docs/interfaces/interfaces.preparedringsignature.html +377 -0
- package/docs/interfaces/interfaces.preparedtransaction.html +329 -0
- package/docs/interfaces/interfaces.randomoutput.html +285 -0
- package/docs/interfaces/interfaces.transactionrecipient.html +285 -0
- package/docs/interfaces/multisiginterfaces.partialkeyimage.html +277 -0
- package/docs/interfaces/multisiginterfaces.partialsigningkey.html +277 -0
- package/docs/modules/ed25519.html +195 -0
- package/docs/modules/extranoncetag.html +208 -0
- package/docs/modules/extratag.html +216 -0
- package/docs/modules/interfaces.html +231 -0
- package/docs/modules/levinpayloads.html +247 -0
- package/docs/modules/levinprotocol.html +191 -0
- package/docs/modules/multisiginterfaces.html +195 -0
- package/docs/modules/transactioninputs.html +208 -0
- package/docs/modules/transactionoutputs.html +204 -0
- package/index.d.ts +417 -0
- package/index.js +1508 -0
- package/lib/base58.js +220 -0
- package/lib/biginteger.js +1591 -0
- package/lib/blocktemplate.js +408 -0
- package/lib/crypto.js +19698 -0
- package/lib/mnemonic.js +1204 -0
- package/lib/nacl-fast-cn.js +608 -0
- package/lib/ringsigs.js +24262 -0
- package/lib/sha3.js +477 -0
- package/package.json +58 -0
- package/src/Address.ts +433 -0
- package/src/AddressPrefix.ts +117 -0
- package/src/Block.ts +556 -0
- package/src/BlockTemplate.ts +289 -0
- package/src/Common.ts +105 -0
- package/src/Config.ts +66 -0
- package/src/CryptoNote.ts +1072 -0
- package/src/LevinPacket.ts +366 -0
- package/src/Multisig.ts +600 -0
- package/src/MultisigMessage.ts +374 -0
- package/src/ParentBlock.ts +39 -0
- package/src/Transaction.ts +628 -0
- package/src/Types/ED25519.ts +187 -0
- package/src/Types/IExtraNonce.ts +225 -0
- package/src/Types/IExtraTag.ts +507 -0
- package/src/Types/ITransaction.ts +230 -0
- package/src/Types/ITransactionInput.ts +190 -0
- package/src/Types/ITransactionOutput.ts +108 -0
- package/src/Types/LevinPayloads.ts +1576 -0
- package/src/Types/MultisigInterfaces.ts +65 -0
- package/src/Types/PortableStorage.ts +289 -0
- package/src/Types.ts +36 -0
- package/src/index.ts +36 -0
- package/test/template.json +6 -0
- package/test/test.js +1457 -0
- package/tests/blocktemplate.json +6 -0
- package/tests/tests.js +215 -0
- package/tsconfig.json +15 -0
- package/tslint.json +36 -0
- package/typedoc.json +10 -0
- package/webpack.config.js +15 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="default no-js">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<title>TransactionOutputs | TurtleCoin-Utils</title>
|
|
7
|
+
<meta name="description" content="">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
<link rel="stylesheet" href="../assets/css/main.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<header>
|
|
13
|
+
<div class="tsd-page-toolbar">
|
|
14
|
+
<div class="container">
|
|
15
|
+
<div class="table-wrap">
|
|
16
|
+
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
|
|
17
|
+
<div class="field">
|
|
18
|
+
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
19
|
+
<input id="tsd-search-field" type="text" />
|
|
20
|
+
</div>
|
|
21
|
+
<ul class="results">
|
|
22
|
+
<li class="state loading">Preparing search index...</li>
|
|
23
|
+
<li class="state failure">The search index is not available</li>
|
|
24
|
+
</ul>
|
|
25
|
+
<a href="../index.html" class="title">TurtleCoin-Utils</a>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="table-cell" id="tsd-widgets">
|
|
28
|
+
<div id="tsd-filter">
|
|
29
|
+
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
30
|
+
<div class="tsd-filter-group">
|
|
31
|
+
<div class="tsd-select" id="tsd-filter-visibility">
|
|
32
|
+
<span class="tsd-select-label">All</span>
|
|
33
|
+
<ul class="tsd-select-list">
|
|
34
|
+
<li data-value="public">Public</li>
|
|
35
|
+
<li data-value="protected">Public/Protected</li>
|
|
36
|
+
<li data-value="private" class="selected">All</li>
|
|
37
|
+
</ul>
|
|
38
|
+
</div>
|
|
39
|
+
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
40
|
+
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="tsd-page-title">
|
|
49
|
+
<div class="container">
|
|
50
|
+
<ul class="tsd-breadcrumb">
|
|
51
|
+
<li>
|
|
52
|
+
<a href="../globals.html">Globals</a>
|
|
53
|
+
</li>
|
|
54
|
+
<li>
|
|
55
|
+
<a href="transactionoutputs.html">TransactionOutputs</a>
|
|
56
|
+
</li>
|
|
57
|
+
</ul>
|
|
58
|
+
<h1>Module TransactionOutputs</h1>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</header>
|
|
62
|
+
<div class="container container-main">
|
|
63
|
+
<div class="row">
|
|
64
|
+
<div class="col-8 col-content">
|
|
65
|
+
<section class="tsd-panel-group tsd-index-group">
|
|
66
|
+
<h2>Index</h2>
|
|
67
|
+
<section class="tsd-panel tsd-index-panel">
|
|
68
|
+
<div class="tsd-index-content">
|
|
69
|
+
<section class="tsd-index-section ">
|
|
70
|
+
<h3>Enumerations</h3>
|
|
71
|
+
<ul class="tsd-index-list">
|
|
72
|
+
<li class="tsd-kind-enum tsd-parent-kind-module"><a href="../enums/transactionoutputs.outputtype.html" class="tsd-kind-icon">Output<wbr>Type</a></li>
|
|
73
|
+
</ul>
|
|
74
|
+
</section>
|
|
75
|
+
<section class="tsd-index-section ">
|
|
76
|
+
<h3>Classes</h3>
|
|
77
|
+
<ul class="tsd-index-list">
|
|
78
|
+
<li class="tsd-kind-class tsd-parent-kind-module"><a href="../classes/transactionoutputs.itransactionoutput.html" class="tsd-kind-icon">ITransaction<wbr>Output</a></li>
|
|
79
|
+
<li class="tsd-kind-class tsd-parent-kind-module"><a href="../classes/transactionoutputs.keyoutput.html" class="tsd-kind-icon">Key<wbr>Output</a></li>
|
|
80
|
+
</ul>
|
|
81
|
+
</section>
|
|
82
|
+
</div>
|
|
83
|
+
</section>
|
|
84
|
+
</section>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
87
|
+
<nav class="tsd-navigation primary">
|
|
88
|
+
<ul>
|
|
89
|
+
<li class="globals ">
|
|
90
|
+
<a href="../globals.html"><em>Globals</em></a>
|
|
91
|
+
</li>
|
|
92
|
+
<li class=" tsd-kind-module">
|
|
93
|
+
<a href="ed25519.html">ED25519</a>
|
|
94
|
+
</li>
|
|
95
|
+
<li class=" tsd-kind-module">
|
|
96
|
+
<a href="extranoncetag.html">Extra<wbr>Nonce<wbr>Tag</a>
|
|
97
|
+
</li>
|
|
98
|
+
<li class=" tsd-kind-module">
|
|
99
|
+
<a href="extratag.html">Extra<wbr>Tag</a>
|
|
100
|
+
</li>
|
|
101
|
+
<li class=" tsd-kind-module">
|
|
102
|
+
<a href="interfaces.html">Interfaces</a>
|
|
103
|
+
</li>
|
|
104
|
+
<li class=" tsd-kind-module">
|
|
105
|
+
<a href="levinpayloads.html">Levin<wbr>Payloads</a>
|
|
106
|
+
</li>
|
|
107
|
+
<li class=" tsd-kind-module">
|
|
108
|
+
<a href="levinprotocol.html">Levin<wbr>Protocol</a>
|
|
109
|
+
</li>
|
|
110
|
+
<li class=" tsd-kind-module">
|
|
111
|
+
<a href="multisiginterfaces.html">Multisig<wbr>Interfaces</a>
|
|
112
|
+
</li>
|
|
113
|
+
<li class=" tsd-kind-module">
|
|
114
|
+
<a href="transactioninputs.html">Transaction<wbr>Inputs</a>
|
|
115
|
+
</li>
|
|
116
|
+
<li class="current tsd-kind-module">
|
|
117
|
+
<a href="transactionoutputs.html">Transaction<wbr>Outputs</a>
|
|
118
|
+
</li>
|
|
119
|
+
</ul>
|
|
120
|
+
</nav>
|
|
121
|
+
<nav class="tsd-navigation secondary menu-sticky">
|
|
122
|
+
<ul class="before-current">
|
|
123
|
+
<li class=" tsd-kind-enum tsd-parent-kind-module">
|
|
124
|
+
<a href="../enums/transactionoutputs.outputtype.html" class="tsd-kind-icon">Output<wbr>Type</a>
|
|
125
|
+
</li>
|
|
126
|
+
<li class=" tsd-kind-class tsd-parent-kind-module">
|
|
127
|
+
<a href="../classes/transactionoutputs.itransactionoutput.html" class="tsd-kind-icon">ITransaction<wbr>Output</a>
|
|
128
|
+
</li>
|
|
129
|
+
<li class=" tsd-kind-class tsd-parent-kind-module">
|
|
130
|
+
<a href="../classes/transactionoutputs.keyoutput.html" class="tsd-kind-icon">Key<wbr>Output</a>
|
|
131
|
+
</li>
|
|
132
|
+
</ul>
|
|
133
|
+
</nav>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
<footer class="with-border-bottom">
|
|
138
|
+
<div class="container">
|
|
139
|
+
<h2>Legend</h2>
|
|
140
|
+
<div class="tsd-legend-group">
|
|
141
|
+
<ul class="tsd-legend">
|
|
142
|
+
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
|
|
143
|
+
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
|
|
144
|
+
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
|
|
145
|
+
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
|
|
146
|
+
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
|
|
147
|
+
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
|
|
148
|
+
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
|
|
149
|
+
<li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li>
|
|
150
|
+
</ul>
|
|
151
|
+
<ul class="tsd-legend">
|
|
152
|
+
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
|
|
153
|
+
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
|
|
154
|
+
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
|
|
155
|
+
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
|
|
156
|
+
</ul>
|
|
157
|
+
<ul class="tsd-legend">
|
|
158
|
+
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
|
|
159
|
+
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
|
|
160
|
+
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
|
|
161
|
+
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
|
162
|
+
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
|
163
|
+
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
|
|
164
|
+
</ul>
|
|
165
|
+
<ul class="tsd-legend">
|
|
166
|
+
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
|
|
167
|
+
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
|
|
168
|
+
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
169
|
+
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
|
|
170
|
+
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
171
|
+
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
|
|
172
|
+
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
|
|
173
|
+
</ul>
|
|
174
|
+
<ul class="tsd-legend">
|
|
175
|
+
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
|
|
176
|
+
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
|
|
177
|
+
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
|
|
178
|
+
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
|
|
179
|
+
</ul>
|
|
180
|
+
<ul class="tsd-legend">
|
|
181
|
+
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
|
|
182
|
+
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
|
|
183
|
+
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
|
|
184
|
+
</ul>
|
|
185
|
+
<ul class="tsd-legend">
|
|
186
|
+
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
|
|
187
|
+
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
|
|
188
|
+
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
|
|
189
|
+
</ul>
|
|
190
|
+
<ul class="tsd-legend">
|
|
191
|
+
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
|
|
192
|
+
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
|
|
193
|
+
</ul>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</footer>
|
|
197
|
+
<div class="container tsd-generator">
|
|
198
|
+
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
|
199
|
+
</div>
|
|
200
|
+
<div class="overlay"></div>
|
|
201
|
+
<script src="../assets/js/main.js"></script>
|
|
202
|
+
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
|
|
203
|
+
</body>
|
|
204
|
+
</html>
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
// Copyright (c) 2018-2019, The TurtleCoin Developers
|
|
2
|
+
//
|
|
3
|
+
// Please see the included LICENSE file for more information.
|
|
4
|
+
|
|
5
|
+
export class CryptoNote {
|
|
6
|
+
constructor(config?: CryptoNoteOptions);
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new, random address seed.
|
|
10
|
+
*
|
|
11
|
+
* @param entropy Optional entropy to use, otherwise we will use our own.
|
|
12
|
+
* @param interations Amount of keccak iterations to use on our pseudo pbkdf2.
|
|
13
|
+
* Suggested to use a high amount if using poor entropy.
|
|
14
|
+
*/
|
|
15
|
+
public createNewSeed(
|
|
16
|
+
entropy?: string,
|
|
17
|
+
iterations?: number): string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new, random, deterministic address.
|
|
21
|
+
*
|
|
22
|
+
* @param entropy Optional entropy to use, otherwise we will use our own.
|
|
23
|
+
* @param lang The language to encode the mnemonic in. Defaults to english.
|
|
24
|
+
* @param addressPrefix The address prefix in decimal.
|
|
25
|
+
*/
|
|
26
|
+
public createNewAddress(
|
|
27
|
+
entropy?: string,
|
|
28
|
+
lang?: string,
|
|
29
|
+
addressPrefix?: string): Address;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Creates an address from the given seed.
|
|
33
|
+
*
|
|
34
|
+
* @param seed The seed to create this address from.
|
|
35
|
+
* @param lang The language to encode the mnemonic in. Defaults to english.
|
|
36
|
+
* @param addressPrefix The address prefix in decimal.
|
|
37
|
+
*/
|
|
38
|
+
public createAddressFromSeed(
|
|
39
|
+
seed: string,
|
|
40
|
+
lang?: string,
|
|
41
|
+
addressPrefix?: string): Address;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Creates an address from the given mnemonic seed.
|
|
45
|
+
*
|
|
46
|
+
* @param mnemnoic A valid 25 word mnemonic.
|
|
47
|
+
* @param lang The language the mnemonic is encoded in. Defaults to english.
|
|
48
|
+
* @param addressPrefix The address prefix in decimal.
|
|
49
|
+
*/
|
|
50
|
+
public createAddressFromMnemonic(
|
|
51
|
+
mnemonic: string,
|
|
52
|
+
lang?: string,
|
|
53
|
+
addressPrefix?: string): Address;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Creates an address from the given spend and view keys.
|
|
57
|
+
*
|
|
58
|
+
* @param privateSpendKey A valid, 64 char hex key.
|
|
59
|
+
* @param privateViewKey A valid, 64 char hex key.
|
|
60
|
+
* @param addressPrefix The address prefix in decimal.
|
|
61
|
+
*/
|
|
62
|
+
public createAddressFromKeys(
|
|
63
|
+
privateSpendKey: string,
|
|
64
|
+
privateViewKey: string,
|
|
65
|
+
addressPrefix?: string): Address;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Decodes the address prefix from the given address into a number of formats.
|
|
69
|
+
*/
|
|
70
|
+
public decodeAddressPrefix(address: string): DecodedAddressPrefix;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Decodes the given address or integrated address into public keys, prefix, and payment ID.
|
|
74
|
+
*/
|
|
75
|
+
public decodeAddress(
|
|
76
|
+
address: string,
|
|
77
|
+
addressPrefix?: string): DecodedAddress;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Encodes the raw address data into a conventional address, using base58 encoding.
|
|
81
|
+
*/
|
|
82
|
+
public encodeRawAddress(rawAddress: string): string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Creates a standard address from a public view and spend key, and an optional payment ID,
|
|
86
|
+
* for integrated addresses.
|
|
87
|
+
*/
|
|
88
|
+
public encodeAddress(
|
|
89
|
+
publicViewKey: string,
|
|
90
|
+
publicSpendKey: string,
|
|
91
|
+
paymentId?: string,
|
|
92
|
+
addressPrefix?: string): string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Creates an integrated address from a standard address and a paymentID.
|
|
96
|
+
*/
|
|
97
|
+
public createIntegratedAddress(
|
|
98
|
+
address: string,
|
|
99
|
+
paymentId: string,
|
|
100
|
+
addressPrefix?: string): string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Converts a private key to the corresponding public key.
|
|
104
|
+
*/
|
|
105
|
+
public privateKeyToPublicKey(privateKey: string): string;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Scans the given outputs, determining which of them belong to us.
|
|
109
|
+
*
|
|
110
|
+
* @param transactionPublicKey The public key stored in the tx_extra of this transaction
|
|
111
|
+
* @param outputs The outputs of this transaction
|
|
112
|
+
* @param privateViewKey The private view key of the wallet you wish to scan with
|
|
113
|
+
* @param publicSpendKey The public spend key of the wallet you wish to scan with
|
|
114
|
+
* @param privateSpendKey The private spend key of the wallet you wish to scan with.
|
|
115
|
+
* Optional. Required to aquire the necessary information for
|
|
116
|
+
* spending transactions.
|
|
117
|
+
*/
|
|
118
|
+
public scanTransactionOutputs(
|
|
119
|
+
transactionPublicKey: string,
|
|
120
|
+
outputs: Output[],
|
|
121
|
+
privateViewKey: string,
|
|
122
|
+
publicSpendKey: string,
|
|
123
|
+
privateSpendKey?: string): Output[];
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Scans a single transaction output to determine if it belongs to us.
|
|
127
|
+
*
|
|
128
|
+
* @param transactionPublicKey The public key stored in the tx_extra of this transaction
|
|
129
|
+
* @param output The output to scan
|
|
130
|
+
* @param privateViewKey The private view key of the wallet you wish to scan with
|
|
131
|
+
* @param privateSpendKey The private spend key of the wallet you wish to scan with.
|
|
132
|
+
* Optional. Required to aquire the neccessary information for
|
|
133
|
+
* spending transactions.
|
|
134
|
+
*
|
|
135
|
+
* @returns Returns true if the output is ours, and no private spend key is given.
|
|
136
|
+
* Returns false if the output is not ours.
|
|
137
|
+
* Returns the output if the output is ours, and a private spend key is given.
|
|
138
|
+
*/
|
|
139
|
+
public isOurTransactionOutput(
|
|
140
|
+
transactionPublicKey: string,
|
|
141
|
+
output: Output,
|
|
142
|
+
privateViewKey: string,
|
|
143
|
+
privateSpendKey?: string): Output | boolean;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Generates a key image for the given transaction data.
|
|
147
|
+
*
|
|
148
|
+
* @param transactionPublicKey The public key stored in the tx_extra of this transaction
|
|
149
|
+
* @param privateViewKey The private view key of the wallet this transaction belongs to
|
|
150
|
+
* @param publicSpendKey The public spend key of the wallet this transaction belongs to
|
|
151
|
+
* @param privateSpendKey The private spend key of the wallet this transaction belongs to
|
|
152
|
+
* @param outputIndex The index of this output in the transaction (0 based indexing)
|
|
153
|
+
*
|
|
154
|
+
* @returns Returns the [keyImage, privateEphemeral]
|
|
155
|
+
*/
|
|
156
|
+
public generateKeyImage(
|
|
157
|
+
transactionPublicKey: string,
|
|
158
|
+
privateViewKey: string,
|
|
159
|
+
publicSpendKey: string,
|
|
160
|
+
privateSpendKey: string,
|
|
161
|
+
outputIndex: number): [string, string];
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Generates a key image for the given transaction data, using a previously
|
|
165
|
+
* created derivation.
|
|
166
|
+
*
|
|
167
|
+
* @param publicSpendKey The public spend key of the wallet this transaction belongs to
|
|
168
|
+
* @param privateSpendKey The private spend key of the wallet this transaction belongs to
|
|
169
|
+
* @param outputIndex The index of this output in the transaction (0 based indexing)
|
|
170
|
+
* @param derivation The derivation of the private view key and the transaction public key
|
|
171
|
+
*
|
|
172
|
+
*
|
|
173
|
+
* @returns Returns the [keyImage, privateEphemeral]
|
|
174
|
+
*/
|
|
175
|
+
public generateKeyImagePrimitive(
|
|
176
|
+
publicSpendKey: string,
|
|
177
|
+
privateSpendKey: string,
|
|
178
|
+
outputIndex: number,
|
|
179
|
+
derivation: string): [string, string];
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Creates a valid transaction to be submitted to the network for sending.
|
|
183
|
+
*/
|
|
184
|
+
public createTransaction(
|
|
185
|
+
transfers: TxDestination[],
|
|
186
|
+
ourOutputs: Output[],
|
|
187
|
+
randomOuts: RandomOutput[][],
|
|
188
|
+
mixin: number,
|
|
189
|
+
feeAmount: number,
|
|
190
|
+
paymentId?: string,
|
|
191
|
+
unlockTime?: number): CreatedTransaction;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Creates a valid transaction to be submitted to the network for sending.
|
|
195
|
+
* Supports passed in user functions that are asynchronous.
|
|
196
|
+
*/
|
|
197
|
+
public createTransactionAsync(
|
|
198
|
+
transfers: TxDestination[],
|
|
199
|
+
ourOutputs: Output[],
|
|
200
|
+
randomOuts: RandomOutput[][],
|
|
201
|
+
mixin: number,
|
|
202
|
+
feeAmount: number,
|
|
203
|
+
paymentId?: string,
|
|
204
|
+
unlockTime?: number): Promise<CreatedTransaction>;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Converts an amount in atomic units, to a human friendly representation.
|
|
208
|
+
*/
|
|
209
|
+
public formatMoney(amount: number): string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Generates a key derivation from the transaction public key and the
|
|
213
|
+
* wallet private view key.
|
|
214
|
+
*/
|
|
215
|
+
public generateKeyDerivation(
|
|
216
|
+
transactionPublicKey: string,
|
|
217
|
+
privateViewKey: string): string;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Creates the corresponding public spend key of an output key, output index,
|
|
221
|
+
* and derivation. If the public spend key matches the users public spend key,
|
|
222
|
+
* the output belongs to them.
|
|
223
|
+
*/
|
|
224
|
+
public underivePublicKey(
|
|
225
|
+
derivation: string,
|
|
226
|
+
outputIndex: number,
|
|
227
|
+
outputKey: string): string;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Hashes the supplied data using the CN Fast Hash method
|
|
231
|
+
*/
|
|
232
|
+
public cnFastHash(data: string): string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Creates a BlockTemplate object based upon the JSON object returned by aLinkcolor
|
|
236
|
+
* getBlockTemplate call to the daemon or blockchain cache
|
|
237
|
+
*/
|
|
238
|
+
public blockTemplate(data: string): BlockTemplate;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface CryptoNoteOptions {
|
|
242
|
+
/**
|
|
243
|
+
* The amount of decimal places your coin has.
|
|
244
|
+
*/
|
|
245
|
+
coinUnitPlaces?: number;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* The hex/decimal address prefix of your coin.
|
|
249
|
+
*/
|
|
250
|
+
addressPrefix?: number;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* The amount of iterations to perform on pseudo pbkdf2.
|
|
254
|
+
*/
|
|
255
|
+
keccakIterations?: number;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* The default fee to use on a transaction when not specified.
|
|
259
|
+
*/
|
|
260
|
+
defaultNetworkFee?: number;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The major block number where merged mining was activated
|
|
264
|
+
*/
|
|
265
|
+
mmMiningBlockVersion?: number;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* A replacement function for the JS/C++ underivePublicKey.
|
|
269
|
+
*/
|
|
270
|
+
underivePublicKey?: (derivation: string,
|
|
271
|
+
outputIndex: number,
|
|
272
|
+
outputKey: string) => string;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* A replacement function for the JS/C++ derivePublicKey.
|
|
276
|
+
*/
|
|
277
|
+
derivePublicKey?: (derivation: string,
|
|
278
|
+
outputIndex: number,
|
|
279
|
+
publicKey: string) => string;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* A replacement function for the JS/C++ deriveSecretKey.
|
|
283
|
+
*/
|
|
284
|
+
deriveSecretKey?: (derivation: string,
|
|
285
|
+
outputIndex: number,
|
|
286
|
+
privateKey: string) => string;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* A replacement function for the JS/C++ generateKeyImage.
|
|
290
|
+
*/
|
|
291
|
+
generateKeyImage?: (transactionPublicKey: string,
|
|
292
|
+
privateViewKey: string,
|
|
293
|
+
publicSpendKey: string,
|
|
294
|
+
privateSpendKey: string,
|
|
295
|
+
outputIndex: number) => string;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* A replacement function for the JS/C++ secretKeyToPublicKey.
|
|
299
|
+
*/
|
|
300
|
+
secretKeyToPublicKey?: (privateKey: string) => string;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* A replacement function for the JS/C++ cnFastHash.
|
|
304
|
+
*/
|
|
305
|
+
cnFastHash?: (input: string) => string;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* A replacement function for the JS/C++ generateRingSignatures.
|
|
309
|
+
*/
|
|
310
|
+
generateRingSignatures?: (transactionPrefixHash: string,
|
|
311
|
+
keyImage: string,
|
|
312
|
+
inputKeys: string[],
|
|
313
|
+
privateKey: string,
|
|
314
|
+
realIndex: number) => string[];
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* A replacement function for the JS/C++ generateKeyDerivation.
|
|
318
|
+
*/
|
|
319
|
+
generateKeyDerivation?: (transactionPublicKey: string,
|
|
320
|
+
privateViewKey: string) => string;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export interface Output {
|
|
324
|
+
key: string;
|
|
325
|
+
input: Input;
|
|
326
|
+
keyImage: string;
|
|
327
|
+
index: number;
|
|
328
|
+
globalIndex: number;
|
|
329
|
+
amount: number;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface Input {
|
|
333
|
+
privateEphemeral: string;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export interface Address {
|
|
337
|
+
spend: Keys;
|
|
338
|
+
view: Keys;
|
|
339
|
+
address: string;
|
|
340
|
+
mnemonic: string;
|
|
341
|
+
seed: string;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface Keys {
|
|
345
|
+
privateKey: string;
|
|
346
|
+
publicKey: string;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export interface DecodedAddressPrefix {
|
|
350
|
+
prefix: string;
|
|
351
|
+
base58: string;
|
|
352
|
+
decimal: number;
|
|
353
|
+
hexadecimal: string;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export interface DecodedAddress {
|
|
357
|
+
publicViewKey: string;
|
|
358
|
+
publicSpendKey: string;
|
|
359
|
+
paymentId: string;
|
|
360
|
+
encodedPrefix: string;
|
|
361
|
+
prefix: number;
|
|
362
|
+
rawAddress: string;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export interface TxDestination {
|
|
366
|
+
amount: number;
|
|
367
|
+
keys: DecodedAddress;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export interface Wallet {
|
|
371
|
+
view: Keys;
|
|
372
|
+
spend: Keys;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export interface RandomOutput {
|
|
376
|
+
key: string;
|
|
377
|
+
globalIndex: number;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export interface CreatedTransaction {
|
|
381
|
+
transaction: Transaction;
|
|
382
|
+
rawTransaction: string;
|
|
383
|
+
hash: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export interface Transaction {
|
|
387
|
+
unlockTime: number;
|
|
388
|
+
version: number;
|
|
389
|
+
extra: string;
|
|
390
|
+
transactionKeys: Keys;
|
|
391
|
+
vin: Vin[];
|
|
392
|
+
vout: Vout[];
|
|
393
|
+
signatures: string[][];
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export interface Vin {
|
|
397
|
+
type: string;
|
|
398
|
+
amount: number;
|
|
399
|
+
keyImage: string;
|
|
400
|
+
keyOffsets: number[];
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export interface Vout {
|
|
404
|
+
amount: number;
|
|
405
|
+
target: Target;
|
|
406
|
+
type: string;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export interface Target {
|
|
410
|
+
data: string;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export interface BlockTemplate {
|
|
414
|
+
blob: string;
|
|
415
|
+
block: object;
|
|
416
|
+
blockTemplate: string;
|
|
417
|
+
}
|