UNPKG

ontology-ts-sdk

Version:

Comprehensive TypeScript library for the Ontology blockchain.

373 lines 20.2 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>ontology-ts-sdk</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="assets/css/main.css"> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="assets/js/search.js" data-base="."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="index.html" class="title">ontology-ts-sdk</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="globals.html">Globals</a> </li> </ul> <h1> ontology-ts-sdk</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <div class="tsd-panel tsd-typography"> <p><h1 align="center">TypeScript SDK For Ontology blockchain </h1></p> <h4 align="center">Version V0.9.0 </h4> <h2 id="overview">Overview</h2> <p>The project is a comprehensive TypeScript library for the Ontology blockchain. Currently, it supports local wallet management, digital identity management, digital asset management, deployment, and envoke for Smart Contract. In the future there will also be support for more functions and applications.</p> <h2 id="getting-started">Getting started</h2> <ul> <li>进入 <a href="https://ontio.github.io/documentation/ontology_ts_sdk_zh.html">中文版</a>.</li> <li>Enter <a href="https://ontio.github.io/documentation/ontology_ts_sdk_en.html">English Version</a>.</li> </ul> <h2 id="installation">Installation</h2> <h4 id="download">Download</h4> <pre><code>git <span class="hljs-keyword">clone</span> <span class="hljs-title">'https</span>://github.com/ontio/ontology-ts-sdk.git' </code></pre><h4 id="install">Install</h4> <pre><code><span class="hljs-built_in">npm</span> install <span class="hljs-string">'ontology-ts-sdk'</span> </code></pre><h4 id="compile">Compile</h4> <p>Get into the &#39;ontology-ts-sdk&#39; directory and run:</p> <pre><code>npm <span class="hljs-built_in">run</span> build:dev // <span class="hljs-literal">or</span> npm <span class="hljs-built_in">run</span> build:prod </code></pre><p>You will get the packaged code under &#39;/lib&#39;</p> <h4 id="test">Test</h4> <p>Test code of the project is in directory &#39;/test&#39;. Run:</p> <pre><code>npm <span class="hljs-keyword">run</span><span class="bash"> <span class="hljs-built_in">test</span></span> </code></pre><h4 id="import">Import</h4> <p>Modules library export by &#39;ontology-ts-sdk&#39;</p> <pre><code><span class="hljs-keyword">import</span> {Wallet} <span class="hljs-keyword">from</span> <span class="hljs-string">'ontology-ts-sdk'</span>; <span class="hljs-keyword">var</span> wallet = Wallet.create(<span class="hljs-string">'test'</span>); </code></pre><h4 id="require">Require</h4> <pre><code><span class="hljs-attribute">var Ont</span> = require(<span class="hljs-string">'ontology-ts-sdk'</span>); <span class="hljs-attribute">var wallet</span> = Ont.Wallet.create(<span class="hljs-string">'test'</span>); </code></pre><h4 id="web-require">Web require</h4> <p>The browser.js file under the &#39;/lib&#39; folder need referenced to the page:</p> <pre><code><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"./lib/browser.js"</span>&gt;</span><span class="undefined"></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span> </code></pre><p>The use of the code is required under the global namespace of Ont.</p> <pre><code><span class="hljs-attribute">var wallet</span> = Ont.Wallet.create(<span class="hljs-string">'test'</span>); </code></pre><h1 id="contributing">Contributing</h1> <p>Please open a pull request with signed-off commits. We appreciate your help! You can also send your codes as emails to the developer mailing list. You&#39;re welcomed to join the Ontology mailing list or developer forum.</p> <p>Please provide detailed submission information when you want to contribute code for this project. The format is as follows:</p> <p>Header line: explain the commit in one line (use the imperative).</p> <p>Body of commit message is a few lines of text, explaining things in more detail, possibly giving some background about the issue being fixed, etc.</p> <p>The body of the commit message can be several paragraphs, and please do proper word-wrap and keep columns shorter than about 74 characters or so. That way &quot;git log&quot; will show things nicely even when it&#39;s indented.</p> <p>Make sure you explain your solution and why you&#39;re doing what you&#39;re doing, as opposed to describing what you&#39;re doing. Reviewers and your future self can read the patch, but might not understand why a particular solution was implemented.</p> <p>Reported-by: whoever-reported-it Signed-off-by: Your Name <a href="mailto:youremail@yourhost.com">youremail@yourhost.com</a></p> <h2 id="community">Community</h2> <h2 id="site">Site</h2> <ul> <li><a href="https://ont.io/">https://ont.io/</a></li> </ul> <h2 id="license">License</h2> <p>The Ontology library (i.e. all code outside of the cmd directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the License file</p> </div> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="globals.html"><em>Globals</em></a> </li> <li class="label tsd-is-external"> <span>Internals</span> </li> <li class=" tsd-kind-external-module"> <a href="modules/_account_.html">"account"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_claim_attestnotifyevent_.html">"claim/attest<wbr>Notify<wbr>Event"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_claim_claim_.html">"claim/claim"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_claim_claimproof_.html">"claim/claim<wbr>Proof"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_claim_index_.html">"claim/index"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_claim_message_.html">"claim/message"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_common_bigint_.html">"common/big<wbr>Int"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_common_fixed64_.html">"common/fixed64"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_consts_.html">"consts"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_crypto_curvelabel_.html">"crypto/<wbr>Curve<wbr>Label"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_crypto_key_.html">"crypto/<wbr>Key"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_crypto_keytype_.html">"crypto/<wbr>Key<wbr>Type"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_crypto_privatekey_.html">"crypto/<wbr>Private<wbr>Key"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_crypto_privatekeyfactory_.html">"crypto/<wbr>Private<wbr>Key<wbr>Factory"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_crypto_publickey_.html">"crypto/<wbr>Public<wbr>Key"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_crypto_signature_.html">"crypto/<wbr>Signature"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_crypto_signaturescheme_.html">"crypto/<wbr>Signature<wbr>Scheme"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_crypto_address_.html">"crypto/address"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_crypto_index_.html">"crypto/index"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_error_.html">"error"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_identity_.html">"identity"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_index_.html">"index"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_merkle_.html">"merkle"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_network_rest_restclient_.html">"network/rest/rest<wbr>Client"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_network_rest_urlconsts_.html">"network/rest/url<wbr>Consts"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_network_rpc_rpcclient_.html">"network/rpc/rpc<wbr>Client"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_network_websocket_websocketclient_.html">"network/websocket/websocket<wbr>Client"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_network_websocket_websocketsender_.html">"network/websocket/websocket<wbr>Sender"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_scrypt_.html">"scrypt"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_sdk_index_.html">"sdk/index"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_abi_abifunction_.html">"smartcontract/abi/abi<wbr>Function"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_abi_abiinfo_.html">"smartcontract/abi/abi<wbr>Info"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_abi_nativevmparamsbuilder_.html">"smartcontract/abi/native<wbr>VmParams<wbr>Builder"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_abi_parameter_.html">"smartcontract/abi/parameter"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_abi_struct_.html">"smartcontract/abi/struct"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_data_attestclaim_.html">"smartcontract/data/attest<wbr>Claim"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_data_idcontract_abi_.html">"smartcontract/data/id<wbr>Contract.abi"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_nativevm_authcontracttxbuilder_.html">"smartcontract/nativevm/auth<wbr>Contract<wbr>TxBuilder"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_nativevm_ontassettxbuilder_.html">"smartcontract/nativevm/ont<wbr>Asset<wbr>TxBuilder"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_nativevm_ontidcontracttxbuilder_.html">"smartcontract/nativevm/ontid<wbr>Contract<wbr>TxBuilder"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_smartcontract_neovm_attestclaimtxbuilder_.html">"smartcontract/neovm/attest<wbr>Claim<wbr>TxBuilder"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_transaction_ddo_.html">"transaction/ddo"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_transaction_opcode_.html">"transaction/opcode"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_transaction_payload_deploycode_.html">"transaction/payload/deploy<wbr>Code"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_transaction_payload_invokecode_.html">"transaction/payload/invoke<wbr>Code"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_transaction_payload_payload_.html">"transaction/payload/payload"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_transaction_scriptbuilder_.html">"transaction/script<wbr>Builder"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_transaction_transaction_.html">"transaction/transaction"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_transaction_transactionbuilder_.html">"transaction/transaction<wbr>Builder"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_transaction_txsignature_.html">"transaction/tx<wbr>Signature"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_utils_.html">"utils"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_wallet_.html">"wallet"</a> </li> <li class="label tsd-is-external"> <span>Externals</span> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="modules/_network_websocket_websocketbuilder_.html">"network/websocket/websocket<wbr>Builder"</a> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="modules/_smartcontract_nativevm_token_.html">"smartcontract/nativevm/token"</a> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="modules/_transaction_program_.html">"transaction/program"</a> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="modules/_transaction_txattribute_.html">"transaction/tx<wbr>Attribute"</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> </ul> </nav> </div> </div> </div> <footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li> <li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li> <li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li> <li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li> <li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> <li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li> <li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li> </ul> </div> </div> </footer> <div class="container tsd-generator"> <p>Generated using <a href="http://typedoc.org/" target="_blank">TypeDoc</a></p> </div> <div class="overlay"></div> <script src="assets/js/main.js"></script> <script>if (location.protocol == 'file:') document.write('<script src="assets/js/search.js"><' + '/script>');</script> </body> </html>