OSDN Git Service

update doc
[bytom/bytom-node-sdk.git] / docs / module-AssetsApi.html
1 <!DOCTYPE html>
2
3 <html lang="en">
4 <head>
5         <meta charset="utf-8">
6         <meta name="viewport" content="width=device-width">
7         <title>Bytom Node.js SDK Module: AssetsApi</title>
8
9         <!--[if lt IE 9]>
10         <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11         <![endif]-->
12         <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
13
14         <link type="text/css" rel="stylesheet" href="styles/site.cosmo.css">
15
16 </head>
17
18 <body>
19
20 <div class="navbar navbar-default navbar-fixed-top ">
21 <div class="container">
22         <div class="navbar-header">
23                 <a class="navbar-brand" href="index.html">Bytom Node.js SDK</a>
24                 <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
25                         <span class="icon-bar"></span>
26                         <span class="icon-bar"></span>
27                         <span class="icon-bar"></span>
28         </button>
29         </div>
30         <div class="navbar-collapse collapse" id="topNavigation">
31                 <ul class="nav navbar-nav">
32                         
33                         <li class="dropdown">
34                                 <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a>
35                                 <ul class="dropdown-menu ">
36                                         <li><a href="module-AccessTokensApi.html">AccessTokensApi</a></li><li><a href="module-AccountsApi.html">AccountsApi</a></li><li><a href="module-AssetsApi.html">AssetsApi</a></li><li><a href="module-BalancesApi.html">BalancesApi</a></li><li><a href="module-KeysApi.html">KeysApi</a></li><li><a href="module-TransactionsApi.html">TransactionsApi</a></li><li><a href="module-UnspentOutputsApi.html">UnspentOutputsApi</a></li>
37                                 </ul>
38                         </li>
39                         
40                         <li class="dropdown">
41                                 <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
42                                 <ul class="dropdown-menu ">
43                                         <li><a href="global.html">Global</a></li>
44                                 </ul>
45                         </li>
46                         
47                 </ul>
48         
49             <div class="col-sm-3 col-md-3">
50                 <form class="navbar-form" role="search">
51                     <div class="input-group">
52                         <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
53                         <div class="input-group-btn">
54                             <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
55                         </div>
56                     </div>
57                 </form>
58             </div>
59         
60         </div>
61
62 </div>
63 </div>
64
65
66 <div class="container" id="toc-content">
67 <div class="row">
68
69         
70         <div class="col-md-8">
71         
72                 <div id="main">
73                         
74
75         <h1 class="page-title">Module: AssetsApi</h1>
76 <section>
77
78 <header>
79     
80 </header>
81
82
83 <article>
84     <div class="container-overview">
85     
86         
87             <div class="description"><p>API for interacting with <a href="global.html#Asset">assets</a>.</p></div>
88         
89
90         
91 <dl class="details">
92     
93
94         
95
96         
97
98         
99
100     
101
102     
103
104     
105
106     
107
108         
109
110         
111
112         
113
114         
115
116         
117
118
119
120         
121
122         
123
124         
125
126         
127 </dl>
128
129
130         
131     
132     </div>
133
134     
135
136     
137
138     
139
140     
141
142     
143
144     
145
146     
147         <h3 class="subsection-title">Methods</h3>
148
149         <dl>
150             
151 <hr>
152 <dt>
153     <h4 class="name" id="~create"><span class="type-signature">&lt;inner> </span>create(xpubs, quorum, alias, definition)</h4>
154     
155     
156 </dt>
157 <dd>
158
159     
160     <div class="description">
161         <p>Create a new asset.</p>
162     </div>
163     
164
165     
166
167     
168
169     
170     
171         <h5>Parameters:</h5>
172         
173
174 <table class="params table table-striped">
175     <thead>
176     <tr>
177         
178         <th>Name</th>
179         
180
181         <th>Type</th>
182
183         
184
185         
186
187         <th class="last">Description</th>
188     </tr>
189     </thead>
190
191     <tbody>
192     
193
194         <tr>
195             
196                 <td class="name"><code>xpubs</code></td>
197             
198
199             <td class="type">
200             
201                 
202 <span class="param-type"><a href="module-AssetsApi.html#~xpubs">module:AssetsApi~xpubs</a></span>
203
204
205
206             
207             </td>
208
209             
210
211             
212
213             <td class="description last"><p>Keys for asseet creation.</p></td>
214         </tr>
215
216     
217
218         <tr>
219             
220                 <td class="name"><code>quorum</code></td>
221             
222
223             <td class="type">
224             
225                 
226 <span class="param-type"><a href="module-AssetsApi.html#~quorum">module:AssetsApi~quorum</a></span>
227
228
229
230             
231             </td>
232
233             
234
235             
236
237             <td class="description last"><p>The number of keys required to sign transactions for the account.</p></td>
238         </tr>
239
240     
241
242         <tr>
243             
244                 <td class="name"><code>alias</code></td>
245             
246
247             <td class="type">
248             
249                 
250 <span class="param-type"><a href="module-AssetsApi.html#~alias">module:AssetsApi~alias</a></span>
251
252
253
254             
255             </td>
256
257             
258
259             
260
261             <td class="description last"><p>Asset alias.</p></td>
262         </tr>
263
264     
265
266         <tr>
267             
268                 <td class="name"><code>definition</code></td>
269             
270
271             <td class="type">
272             
273                 
274 <span class="param-type"><a href="module-AssetsApi.html#~definition">module:AssetsApi~definition</a></span>
275
276
277
278             
279             </td>
280
281             
282
283             
284
285             <td class="description last"><p>Asset definition.</p></td>
286         </tr>
287
288     
289     </tbody>
290 </table>
291
292     
293
294     
295 <dl class="details">
296     
297
298         
299
300         
301
302         
303
304     
305
306     
307
308     
309
310     
311
312         
313
314         
315
316         
317
318         
319
320         
321
322
323
324         
325
326         
327
328         
329
330         
331 </dl>
332
333
334     
335
336     
337
338     
339
340     
341
342     
343
344     
345     <h5>Returns:</h5>
346     
347             
348 <div class="param-desc">
349     <p>Newly created asset.</p>
350 </div>
351
352
353
354 <dl>
355     <dt>
356         Type
357     </dt>
358     <dd>
359         
360 <span class="param-type">Promise.&lt;<a href="global.html#Asset">Asset</a>></span>
361
362
363
364     </dd>
365 </dl>
366
367
368         
369
370     
371 </dd>
372
373         
374             
375 <hr>
376 <dt>
377     <h4 class="name" id="~getById"><span class="type-signature">&lt;inner> </span>getById(id)</h4>
378     
379     
380 </dt>
381 <dd>
382
383     
384     <div class="description">
385         <p>Get asset by the asset id.</p>
386     </div>
387     
388
389     
390
391     
392
393     
394     
395         <h5>Parameters:</h5>
396         
397
398 <table class="params table table-striped">
399     <thead>
400     <tr>
401         
402         <th>Name</th>
403         
404
405         <th>Type</th>
406
407         
408
409         
410
411         <th class="last">Description</th>
412     </tr>
413     </thead>
414
415     <tbody>
416     
417
418         <tr>
419             
420                 <td class="name"><code>id</code></td>
421             
422
423             <td class="type">
424             
425                 
426 <span class="param-type"><a href="module-AssetsApi.html#~id">module:AssetsApi~id</a></span>
427
428
429
430             
431             </td>
432
433             
434
435             
436
437             <td class="description last"><p>Asset id.</p></td>
438         </tr>
439
440     
441     </tbody>
442 </table>
443
444     
445
446     
447 <dl class="details">
448     
449
450         
451
452         
453
454         
455
456     
457
458     
459
460     
461
462     
463
464         
465
466         
467
468         
469
470         
471
472         
473
474
475
476         
477
478         
479
480         
481
482         
483 </dl>
484
485
486     
487
488     
489
490     
491
492     
493
494     
495
496     
497     <h5>Returns:</h5>
498     
499             
500 <div class="param-desc">
501     <p>target asset.</p>
502 </div>
503
504
505
506 <dl>
507     <dt>
508         Type
509     </dt>
510     <dd>
511         
512 <span class="param-type">Promise.&lt;<a href="global.html#Asset">Asset</a>></span>
513
514
515
516     </dd>
517 </dl>
518
519
520         
521
522     
523 </dd>
524
525         
526             
527 <hr>
528 <dt>
529     <h4 class="name" id="~list"><span class="type-signature">&lt;inner> </span>list()</h4>
530     
531     
532 </dt>
533 <dd>
534
535     
536     <div class="description">
537         <p>List all assets in one Bytom node.</p>
538     </div>
539     
540
541     
542
543     
544
545     
546     
547
548     
549 <dl class="details">
550     
551
552         
553
554         
555
556         
557
558     
559
560     
561
562     
563
564     
565
566         
567
568         
569
570         
571
572         
573
574         
575
576
577
578         
579
580         
581
582         
583
584         
585 </dl>
586
587
588     
589
590     
591
592     
593
594     
595
596     
597
598     
599     <h5>Returns:</h5>
600     
601             
602 <div class="param-desc">
603     <p>target assets.</p>
604 </div>
605
606
607
608 <dl>
609     <dt>
610         Type
611     </dt>
612     <dd>
613         
614 <span class="param-type">Promise.&lt;Array.&lt;<a href="global.html#Asset">Asset</a>>></span>
615
616
617
618     </dd>
619 </dl>
620
621
622         
623
624     
625 </dd>
626
627         
628             
629 <hr>
630 <dt>
631     <h4 class="name" id="~updateAlias"><span class="type-signature">&lt;inner> </span>updateAlias(id, newAlias)</h4>
632     
633     
634 </dt>
635 <dd>
636
637     
638     <div class="description">
639         <p>Update asset alias.</p>
640     </div>
641     
642
643     
644
645     
646
647     
648     
649         <h5>Parameters:</h5>
650         
651
652 <table class="params table table-striped">
653     <thead>
654     <tr>
655         
656         <th>Name</th>
657         
658
659         <th>Type</th>
660
661         
662
663         
664
665         <th class="last">Description</th>
666     </tr>
667     </thead>
668
669     <tbody>
670     
671
672         <tr>
673             
674                 <td class="name"><code>id</code></td>
675             
676
677             <td class="type">
678             
679                 
680 <span class="param-type"><a href="module-AssetsApi.html#~id">module:AssetsApi~id</a></span>
681
682
683
684             
685             </td>
686
687             
688
689             
690
691             <td class="description last"><p>Asset id.</p></td>
692         </tr>
693
694     
695
696         <tr>
697             
698                 <td class="name"><code>newAlias</code></td>
699             
700
701             <td class="type">
702             
703                 
704 <span class="param-type">String</span>
705
706
707
708             
709             </td>
710
711             
712
713             
714
715             <td class="description last"><p>new alias.</p></td>
716         </tr>
717
718     
719     </tbody>
720 </table>
721
722     
723
724     
725 <dl class="details">
726     
727
728         
729
730         
731
732         
733
734     
735
736     
737
738     
739
740     
741
742         
743
744         
745
746         
747
748         
749
750         
751
752
753
754         
755
756         
757
758         
759
760         
761 </dl>
762
763
764     
765
766     
767
768     
769
770     
771
772     
773
774     
775
776     
777 </dd>
778
779         </dl>
780     
781
782     
783         <h3 class="subsection-title">Type Definitions</h3>
784
785         <dl>
786                 
787 <hr>
788 <dt class="name" id="~alias">
789     <h4 id="~alias">alias</h4>
790
791     
792 </dt>
793 <dd>
794     
795     <div class="description">
796         <p>User specified, unique identifier.</p>
797     </div>
798     
799
800     
801         <h5>Type:</h5>
802         <ul>
803             <li>
804                 
805 <span class="param-type">String</span>
806
807
808
809             </li>
810         </ul>
811     
812
813     
814 <dl class="details">
815     
816
817         
818
819         
820
821         
822
823     
824
825     
826
827     
828
829     
830
831         
832
833         
834
835         
836
837         
838
839         
840
841
842
843         
844
845         
846
847         
848
849         
850 </dl>
851
852
853     
854 </dd>
855
856             
857                 
858 <hr>
859 <dt class="name" id="~definition">
860     <h4 id="~definition">definition</h4>
861
862     
863 </dt>
864 <dd>
865     
866     <div class="description">
867         <p>User-specified, asset attributes accross Bytom blockchain network.</p>
868     </div>
869     
870
871     
872         <h5>Type:</h5>
873         <ul>
874             <li>
875                 
876 <span class="param-type">Object</span>
877
878
879
880             </li>
881         </ul>
882     
883
884     
885 <dl class="details">
886     
887
888         
889
890         
891
892         
893
894     
895
896     
897
898     
899
900     
901
902         
903
904         
905
906         
907
908         
909
910         
911
912
913
914         
915
916         
917
918         
919
920         
921 </dl>
922
923
924     
925 </dd>
926
927             
928                 
929 <hr>
930 <dt class="name" id="~id">
931     <h4 id="~id">id</h4>
932
933     
934 </dt>
935 <dd>
936     
937     <div class="description">
938         <p>Unique account identifier in one Bytom node.</p>
939     </div>
940     
941
942     
943         <h5>Type:</h5>
944         <ul>
945             <li>
946                 
947 <span class="param-type">String</span>
948
949
950
951             </li>
952         </ul>
953     
954
955     
956 <dl class="details">
957     
958
959         
960
961         
962
963         
964
965     
966
967     
968
969     
970
971     
972
973         
974
975         
976
977         
978
979         
980
981         
982
983
984
985         
986
987         
988
989         
990
991         
992 </dl>
993
994
995     
996 </dd>
997
998             
999                 
1000 <hr>
1001 <dt class="name" id="~quorum">
1002     <h4 id="~quorum">quorum</h4>
1003
1004     
1005 </dt>
1006 <dd>
1007     
1008     <div class="description">
1009         <p>The number of signatures required to issue new units of the asset.</p>
1010     </div>
1011     
1012
1013     
1014         <h5>Type:</h5>
1015         <ul>
1016             <li>
1017                 
1018 <span class="param-type">Number</span>
1019
1020
1021
1022             </li>
1023         </ul>
1024     
1025
1026     
1027 <dl class="details">
1028     
1029
1030         
1031
1032         
1033
1034         
1035
1036     
1037
1038     
1039
1040     
1041
1042     
1043
1044         
1045
1046         
1047
1048         
1049
1050         
1051
1052         
1053
1054
1055
1056         
1057
1058         
1059
1060         
1061
1062         
1063 </dl>
1064
1065
1066     
1067 </dd>
1068
1069             
1070                 
1071 <hr>
1072 <dt class="name" id="~xpubs">
1073     <h4 id="~xpubs">xpubs</h4>
1074
1075     
1076 </dt>
1077 <dd>
1078     
1079     <div class="description">
1080         <p>The list of keys used to issue units of the asset.</p>
1081     </div>
1082     
1083
1084     
1085         <h5>Type:</h5>
1086         <ul>
1087             <li>
1088                 
1089 <span class="param-type">Array.&lt;String></span>
1090
1091
1092
1093             </li>
1094         </ul>
1095     
1096
1097     
1098 <dl class="details">
1099     
1100
1101         
1102
1103         
1104
1105         
1106
1107     
1108
1109     
1110
1111     
1112
1113     
1114
1115         
1116
1117         
1118
1119         
1120
1121         
1122
1123         
1124
1125
1126
1127         
1128
1129         
1130
1131         
1132
1133         
1134 </dl>
1135
1136
1137     
1138 </dd>
1139
1140             </dl>
1141     
1142
1143     
1144 </article>
1145
1146 </section>
1147
1148
1149
1150
1151                 </div>
1152         </div>
1153
1154         <div class="clearfix"></div>
1155
1156         
1157                 <div class="col-md-3">
1158                         <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
1159                 </div>
1160         
1161
1162 </div>
1163 </div>
1164
1165
1166     <div class="modal fade" id="searchResults">
1167       <div class="modal-dialog">
1168         <div class="modal-content">
1169           <div class="modal-header">
1170             <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
1171             <h4 class="modal-title">Search results</h4>
1172           </div>
1173           <div class="modal-body"></div>
1174           <div class="modal-footer">
1175             <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1176           </div>
1177         </div><!-- /.modal-content -->
1178       </div><!-- /.modal-dialog -->
1179     </div>
1180
1181
1182 <footer>
1183
1184
1185 <span class="jsdoc-message">
1186         Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
1187         
1188                 on 2018-05-24T14:05:00+08:00
1189         
1190         using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
1191 </span>
1192 </footer>
1193
1194 <script src="scripts/docstrap.lib.js"></script>
1195 <script src="scripts/toc.js"></script>
1196
1197     <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
1198
1199
1200 <script>
1201 $( function () {
1202         $( "[id*='$']" ).each( function () {
1203                 var $this = $( this );
1204
1205                 $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
1206         } );
1207
1208         $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
1209                 var $this = $( this );
1210
1211                 var example = $this.find( "code" );
1212                 exampleText = example.html();
1213                 var lang = /{@lang (.*?)}/.exec( exampleText );
1214                 if ( lang && lang[1] ) {
1215                         exampleText = exampleText.replace( lang[0], "" );
1216                         example.html( exampleText );
1217                         lang = lang[1];
1218                 } else {
1219                         var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
1220                         lang = langClassMatch ? langClassMatch[1] : "javascript";
1221                 }
1222
1223                 if ( lang ) {
1224
1225                         $this
1226                         .addClass( "sunlight-highlight-" + lang )
1227                         .addClass( "linenums" )
1228                         .html( example.html() );
1229
1230                 }
1231         } );
1232
1233         Sunlight.highlightAll( {
1234                 lineNumbers : true,
1235                 showMenu : true,
1236                 enableDoclinks : true
1237         } );
1238
1239         $.catchAnchorLinks( {
1240         navbarOffset: 10
1241         } );
1242         $( "#toc" ).toc( {
1243                 anchorName  : function ( i, heading, prefix ) {
1244                         return $( heading ).attr( "id" ) || ( prefix + i );
1245                 },
1246                 selectors   : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
1247                 showAndHide : false,
1248                 smoothScrolling: true
1249         } );
1250
1251         $( "#main span[id^='toc']" ).addClass( "toc-shim" );
1252         $( '.dropdown-toggle' ).dropdown();
1253
1254     $( "table" ).each( function () {
1255       var $this = $( this );
1256       $this.addClass('table');
1257     } );
1258
1259 } );
1260 </script>
1261
1262
1263
1264 <!--Navigation and Symbol Display-->
1265
1266
1267 <!--Google Analytics-->
1268
1269
1270
1271     <script type="text/javascript">
1272         $(document).ready(function() {
1273             SearcherDisplay.init();
1274         });
1275     </script>
1276
1277
1278 </body>
1279 </html>