1 line
2.4 KiB
JavaScript
1 line
2.4 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[123],{492:function(e,t,a){"use strict";a.r(t);var s=a(46),r=Object(s.a)({},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"polkadot-jsonrpc"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#polkadot-jsonrpc","aria-hidden":"true"}},[e._v("#")]),e._v(" @polkadot/jsonrpc")]),e._v(" "),a("p",[e._v("A definition of all the methods exposed in a general Polkadot client application. These are used not only to provide a comprehensive code-generated document of the available methods, but are also used in the API to auto-generate endpoints with the required type-checking.")]),e._v(" "),a("p",[e._v("For a list of currently exposed methods, see the "),a("router-link",{attrs:{to:"/type-jsonrpc/docs/METHODS_RPC.html"}},[e._v("method documentation")]),e._v(".")],1),e._v(" "),a("h2",{attrs:{id:"usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#usage","aria-hidden":"true"}},[e._v("#")]),e._v(" Usage")]),e._v(" "),a("p",[e._v("Installation -")]),e._v(" "),a("div",{staticClass:"language- line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("yarn add @polkadot/jsonrpc\n")])]),e._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[e._v("1")]),a("br")])]),a("h2",{attrs:{id:"adding-methods"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#adding-methods","aria-hidden":"true"}},[e._v("#")]),e._v(" Adding methods")]),e._v(" "),a("p",[e._v("As methods are added, simply adding the name, inputs & output will prepare it for use.")]),e._v(" "),a("ul",[a("li",[e._v("Add the method to the correct file in "),a("router-link",{attrs:{to:"/type-jsonrpc/src/rpc/"}},[e._v("src/rpc/")]),e._v(" (Input/Output types as cross-referenced from the canonical implementation and match one-to-one)")],1),e._v(" "),a("li",[e._v("Should a new type be required, add it to the type list, "),a("a",{attrs:{href:"src/types.js"}},[e._v("src/types.js")]),e._v(" (Required for TSLint type checking)")])]),e._v(" "),a("h2",{attrs:{id:"classes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#classes","aria-hidden":"true"}},[e._v("#")]),e._v(" Classes")]),e._v(" "),a("p",[a("router-link",{attrs:{to:"/type-jsonrpc/SUMMARY.html"}},[e._v("Classes")])],1)])},[],!1,null,null,null);t.default=r.exports}}]); |