From 6badba6d993e58a04ce799c7925568155384570a Mon Sep 17 00:00:00 2001 From: RiccardoM Date: Mon, 11 Dec 2023 15:52:22 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20414bd?= =?UTF-8?q?bfacda0c871c9ff4248bd1010fb0ad6bcf2=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 6 +++--- assets/js/{10.cb5cea59.js => 10.3f4125aa.js} | 2 +- assets/js/{11.5dd1cf74.js => 11.1e6a7cea.js} | 2 +- assets/js/{12.10b17887.js => 12.6edfadaa.js} | 2 +- assets/js/{13.8f016286.js => 13.76474fa4.js} | 2 +- assets/js/{8.af23f5a1.js => 8.fca474a6.js} | 2 +- assets/js/{9.b70cbdb0.js => 9.bbe92e24.js} | 2 +- assets/js/{app.9271dc8e.js => app.11deba59.js} | 4 ++-- custom-chains/overview.html | 6 +++--- index.html | 6 +++--- modules/overview.html | 6 +++--- modules/x/auth.html | 6 +++--- queries/overview.html | 6 +++--- transactions/overview.html | 6 +++--- wallet/overview.html | 6 +++--- 15 files changed, 32 insertions(+), 32 deletions(-) rename assets/js/{10.cb5cea59.js => 10.3f4125aa.js} (99%) rename assets/js/{11.5dd1cf74.js => 11.1e6a7cea.js} (99%) rename assets/js/{12.10b17887.js => 12.6edfadaa.js} (99%) rename assets/js/{13.8f016286.js => 13.76474fa4.js} (99%) rename assets/js/{8.af23f5a1.js => 8.fca474a6.js} (99%) rename assets/js/{9.b70cbdb0.js => 9.bbe92e24.js} (99%) rename assets/js/{app.9271dc8e.js => app.11deba59.js} (85%) diff --git a/404.html b/404.html index 6e73b314..fb8377c8 100644 --- a/404.html +++ b/404.html @@ -29,13 +29,13 @@ - + -

404

That's a Four-Oh-Four.
+ - + diff --git a/assets/js/10.cb5cea59.js b/assets/js/10.3f4125aa.js similarity index 99% rename from assets/js/10.cb5cea59.js rename to assets/js/10.3f4125aa.js index 96f59325..c96db285 100644 --- a/assets/js/10.cb5cea59.js +++ b/assets/js/10.3f4125aa.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{283:function(t,s,a){"use strict";a.r(s);var n=a(1),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"auth-custom-operations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#auth-custom-operations"}},[t._v("#")]),t._v(" Auth custom operations")]),t._v(" "),s("p",[t._v("In order to implement frequent operations that are performed on the "),s("code",[t._v("x/auth")]),t._v(" module, Alan.dart comes with a couple of utility methods related to such module.")]),t._v(" "),s("h2",{attrs:{id:"query-the-details-of-an-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#query-the-details-of-an-account"}},[t._v("#")]),t._v(" Query the details of an account")]),t._v(" "),s("p",[t._v("The first utility class that Alan.dart has related to the "),s("code",[t._v("x/auth")]),t._v(" module is the "),s("code",[t._v("AuthQuerier")]),t._v(" class. This is a simple wrapper around the "),s("code",[t._v("auth.QueryClient")]),t._v(" class that allows to query the details of an account more easily.")]),t._v(" "),s("p",[t._v("By default, Cosmos returns the accounts as instances of the "),s("code",[t._v("Any")]),t._v(". Such instances should then be de-serialized by reading the "),s("code",[t._v("typeUrl")]),t._v(" property and decide what account implementation they are referring to.")]),t._v(" "),s("p",[t._v("In order to avoid having you re-write this logic every time, we implemented the "),s("code",[t._v("AuthQuerier.getAccountData")]),t._v(" method that simply returns an "),s("code",[t._v("AccountI")]),t._v(" instance. This is an interface that is implemented by all the classes representing an account and contains all the getters to access common data.")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/alan.dart'")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" querier "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AuthQuerier")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("channel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" account "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" querier"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAccountData")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br")])]),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("Querying a custom account")]),t._v(" "),s("p",[t._v("If you are trying to query the chain for an account that is implemented using a custom type, you should first "),s("a",{attrs:{href:"#working-with-custom-account-implementations"}},[t._v("register your account type")]),t._v(" in order to avoid any error such as:")]),t._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Account of type XXXXX cannot be deserialized properly.\nPlease register this type using Codec.registerAccountImpl\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br")])])]),t._v(" "),s("h2",{attrs:{id:"working-with-custom-account-implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#working-with-custom-account-implementations"}},[t._v("#")]),t._v(" Working with custom account implementations")]),t._v(" "),s("p",[t._v("If the blockchain you are working with has some custom "),s("code",[t._v("AccountI")]),t._v(" implementations that you might want to work with (eg. query from the chain), you must register those types using the "),s("code",[t._v("Codec.registerAccountImpl")]),t._v(" method.")]),t._v(" "),s("p",[t._v("Such method takes as input an "),s("code",[t._v("AccountImpl")]),t._v(" instance, which must contain a "),s("code",[t._v("typeUrl")]),t._v(" of the account implementation as well as a reference to a static method that can be called to deserialize such account instance from an "),s("code",[t._v("Any")]),t._v(".")]),t._v(" "),s("p",[t._v("Note that when you want to register a custom account type, it must implement the "),s("code",[t._v("AccountI")]),t._v(" interface. The easiest way to do this is to create a wrapper around an already existing Proto message that represents an account:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// IBCAccount is a wrapper around an [ibc.IBCAccount] Proto message that allows to ")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// implement the [AccountI] interface properly.")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IBCAccount")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AccountI")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("ibc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("IBCAccount")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Int64")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),t._v(" accountNumber "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("accountNumber"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Any")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),t._v(" pubKey "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pubKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Int64")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),t._v(" sequence "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sequence"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IBCAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("ibc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("IBCAccount")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" account "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IBCAccount")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fromAny")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Any")]),t._v(" any"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" account "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("ibc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("IBCAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fromBuffer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("any"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IBCAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br"),s("span",{staticClass:"line-number"},[t._v("7")]),s("br"),s("span",{staticClass:"line-number"},[t._v("8")]),s("br"),s("span",{staticClass:"line-number"},[t._v("9")]),s("br"),s("span",{staticClass:"line-number"},[t._v("10")]),s("br"),s("span",{staticClass:"line-number"},[t._v("11")]),s("br"),s("span",{staticClass:"line-number"},[t._v("12")]),s("br"),s("span",{staticClass:"line-number"},[t._v("13")]),s("br"),s("span",{staticClass:"line-number"},[t._v("14")]),s("br"),s("span",{staticClass:"line-number"},[t._v("15")]),s("br"),s("span",{staticClass:"line-number"},[t._v("16")]),s("br"),s("span",{staticClass:"line-number"},[t._v("17")]),s("br"),s("span",{staticClass:"line-number"},[t._v("18")]),s("br"),s("span",{staticClass:"line-number"},[t._v("19")]),s("br"),s("span",{staticClass:"line-number"},[t._v("20")]),s("br"),s("span",{staticClass:"line-number"},[t._v("21")]),s("br"),s("span",{staticClass:"line-number"},[t._v("22")]),s("br"),s("span",{staticClass:"line-number"},[t._v("23")]),s("br"),s("span",{staticClass:"line-number"},[t._v("24")]),s("br"),s("span",{staticClass:"line-number"},[t._v("25")]),s("br"),s("span",{staticClass:"line-number"},[t._v("26")]),s("br"),s("span",{staticClass:"line-number"},[t._v("27")]),s("br"),s("span",{staticClass:"line-number"},[t._v("28")]),s("br"),s("span",{staticClass:"line-number"},[t._v("29")]),s("br"),s("span",{staticClass:"line-number"},[t._v("30")]),s("br"),s("span",{staticClass:"line-number"},[t._v("31")]),s("br"),s("span",{staticClass:"line-number"},[t._v("32")]),s("br")])]),s("p",[t._v("Once you have created your custom class, you can now register it as an "),s("code",[t._v("AccountI")]),t._v(" implementation:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" implementation "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AccountImpl")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'IBCAccount'")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IBCAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fromAny"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Codec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("registerAccountImpl")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("implementation"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br")])]),s("p",[t._v("From this point onwards, you will be able to deserialize the account properly:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Codec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("deserializeAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("any"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("Querying a custom account")]),t._v(" "),s("p",[t._v("Since this method is also called when "),s("a",{attrs:{href:"#query-the-details-of-an-account"}},[t._v("querying an account")]),t._v(", you should call it before querying the details of an account that is represented by a custom type in order to avoid any error.")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{288:function(t,s,a){"use strict";a.r(s);var n=a(1),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"auth-custom-operations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#auth-custom-operations"}},[t._v("#")]),t._v(" Auth custom operations")]),t._v(" "),s("p",[t._v("In order to implement frequent operations that are performed on the "),s("code",[t._v("x/auth")]),t._v(" module, Alan.dart comes with a couple of utility methods related to such module.")]),t._v(" "),s("h2",{attrs:{id:"query-the-details-of-an-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#query-the-details-of-an-account"}},[t._v("#")]),t._v(" Query the details of an account")]),t._v(" "),s("p",[t._v("The first utility class that Alan.dart has related to the "),s("code",[t._v("x/auth")]),t._v(" module is the "),s("code",[t._v("AuthQuerier")]),t._v(" class. This is a simple wrapper around the "),s("code",[t._v("auth.QueryClient")]),t._v(" class that allows to query the details of an account more easily.")]),t._v(" "),s("p",[t._v("By default, Cosmos returns the accounts as instances of the "),s("code",[t._v("Any")]),t._v(". Such instances should then be de-serialized by reading the "),s("code",[t._v("typeUrl")]),t._v(" property and decide what account implementation they are referring to.")]),t._v(" "),s("p",[t._v("In order to avoid having you re-write this logic every time, we implemented the "),s("code",[t._v("AuthQuerier.getAccountData")]),t._v(" method that simply returns an "),s("code",[t._v("AccountI")]),t._v(" instance. This is an interface that is implemented by all the classes representing an account and contains all the getters to access common data.")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/alan.dart'")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" querier "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AuthQuerier")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("channel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" account "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" querier"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAccountData")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br")])]),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("Querying a custom account")]),t._v(" "),s("p",[t._v("If you are trying to query the chain for an account that is implemented using a custom type, you should first "),s("a",{attrs:{href:"#working-with-custom-account-implementations"}},[t._v("register your account type")]),t._v(" in order to avoid any error such as:")]),t._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Account of type XXXXX cannot be deserialized properly.\nPlease register this type using Codec.registerAccountImpl\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br")])])]),t._v(" "),s("h2",{attrs:{id:"working-with-custom-account-implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#working-with-custom-account-implementations"}},[t._v("#")]),t._v(" Working with custom account implementations")]),t._v(" "),s("p",[t._v("If the blockchain you are working with has some custom "),s("code",[t._v("AccountI")]),t._v(" implementations that you might want to work with (eg. query from the chain), you must register those types using the "),s("code",[t._v("Codec.registerAccountImpl")]),t._v(" method.")]),t._v(" "),s("p",[t._v("Such method takes as input an "),s("code",[t._v("AccountImpl")]),t._v(" instance, which must contain a "),s("code",[t._v("typeUrl")]),t._v(" of the account implementation as well as a reference to a static method that can be called to deserialize such account instance from an "),s("code",[t._v("Any")]),t._v(".")]),t._v(" "),s("p",[t._v("Note that when you want to register a custom account type, it must implement the "),s("code",[t._v("AccountI")]),t._v(" interface. The easiest way to do this is to create a wrapper around an already existing Proto message that represents an account:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// IBCAccount is a wrapper around an [ibc.IBCAccount] Proto message that allows to ")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// implement the [AccountI] interface properly.")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IBCAccount")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AccountI")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("ibc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("IBCAccount")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Int64")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),t._v(" accountNumber "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("accountNumber"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Any")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),t._v(" pubKey "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pubKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Int64")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),t._v(" sequence "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sequence"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IBCAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("ibc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("IBCAccount")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" account "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IBCAccount")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fromAny")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Any")]),t._v(" any"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" account "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("ibc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("IBCAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fromBuffer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("any"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IBCAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br"),s("span",{staticClass:"line-number"},[t._v("7")]),s("br"),s("span",{staticClass:"line-number"},[t._v("8")]),s("br"),s("span",{staticClass:"line-number"},[t._v("9")]),s("br"),s("span",{staticClass:"line-number"},[t._v("10")]),s("br"),s("span",{staticClass:"line-number"},[t._v("11")]),s("br"),s("span",{staticClass:"line-number"},[t._v("12")]),s("br"),s("span",{staticClass:"line-number"},[t._v("13")]),s("br"),s("span",{staticClass:"line-number"},[t._v("14")]),s("br"),s("span",{staticClass:"line-number"},[t._v("15")]),s("br"),s("span",{staticClass:"line-number"},[t._v("16")]),s("br"),s("span",{staticClass:"line-number"},[t._v("17")]),s("br"),s("span",{staticClass:"line-number"},[t._v("18")]),s("br"),s("span",{staticClass:"line-number"},[t._v("19")]),s("br"),s("span",{staticClass:"line-number"},[t._v("20")]),s("br"),s("span",{staticClass:"line-number"},[t._v("21")]),s("br"),s("span",{staticClass:"line-number"},[t._v("22")]),s("br"),s("span",{staticClass:"line-number"},[t._v("23")]),s("br"),s("span",{staticClass:"line-number"},[t._v("24")]),s("br"),s("span",{staticClass:"line-number"},[t._v("25")]),s("br"),s("span",{staticClass:"line-number"},[t._v("26")]),s("br"),s("span",{staticClass:"line-number"},[t._v("27")]),s("br"),s("span",{staticClass:"line-number"},[t._v("28")]),s("br"),s("span",{staticClass:"line-number"},[t._v("29")]),s("br"),s("span",{staticClass:"line-number"},[t._v("30")]),s("br"),s("span",{staticClass:"line-number"},[t._v("31")]),s("br"),s("span",{staticClass:"line-number"},[t._v("32")]),s("br")])]),s("p",[t._v("Once you have created your custom class, you can now register it as an "),s("code",[t._v("AccountI")]),t._v(" implementation:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" implementation "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AccountImpl")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'IBCAccount'")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IBCAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fromAny"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Codec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("registerAccountImpl")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("implementation"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br")])]),s("p",[t._v("From this point onwards, you will be able to deserialize the account properly:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Codec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("deserializeAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("any"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("Querying a custom account")]),t._v(" "),s("p",[t._v("Since this method is also called when "),s("a",{attrs:{href:"#query-the-details-of-an-account"}},[t._v("querying an account")]),t._v(", you should call it before querying the details of an account that is represented by a custom type in order to avoid any error.")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/11.5dd1cf74.js b/assets/js/11.1e6a7cea.js similarity index 99% rename from assets/js/11.5dd1cf74.js rename to assets/js/11.1e6a7cea.js index f40e4543..0d77e51a 100644 --- a/assets/js/11.5dd1cf74.js +++ b/assets/js/11.1e6a7cea.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{284:function(t,s,a){"use strict";a.r(s);var n=a(1),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"queries"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#queries"}},[t._v("#")]),t._v(" Queries")]),t._v(" "),s("p",[t._v("Starting with "),s("code",[t._v("v0.40.x")]),t._v(", Cosmos has added the support to "),s("a",{attrs:{href:"https://grpc.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("gRPC"),s("OutboundLink")],1),t._v(" queries and declared that REST APIs will be outdated in future versions. For this reason, Alan.dart now only uses gRPC queries in order to get the data from the chain whenever possible. Below you can find instructions on how to use this new and more efficient way of querying your chain.")]),t._v(" "),s("h2",{attrs:{id:"_1-get-the-modules-to-use"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-get-the-modules-to-use"}},[t._v("#")]),t._v(" 1. Get the modules to use")]),t._v(" "),s("h3",{attrs:{id:"a-using-standard-cosmos-modules"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#a-using-standard-cosmos-modules"}},[t._v("#")]),t._v(" A. Using standard Cosmos modules")]),t._v(" "),s("p",[t._v("If you are building an application that wants to query only default Cosmos modules (eg. "),s("code",[t._v("x/bank")]),t._v(", "),s("code",[t._v("x/staking")]),t._v(", "),s("code",[t._v("x/slashing")]),t._v(", etc) you can simply use the "),s("code",[t._v("QueryClient")]),t._v(" that are already contained inside Alan.dart.")]),t._v(" "),s("p",[t._v("To do this, you can simply import the different already built-in modules:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/auth/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/bank/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" bank"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/slashing/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" slashing"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br")])]),s("p",[t._v("As you can see, the pattern used to import a module is the following:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos//v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("module name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("If you want to see all the supported modules, please visit the "),s("RouterLink",{attrs:{to:"/modules/overview.html"}},[t._v("modules page")])],1),t._v(" "),s("h3",{attrs:{id:"b-using-custom-modules"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#b-using-custom-modules"}},[t._v("#")]),t._v(" B. Using custom modules")]),t._v(" "),s("p",[t._v("If you want to use Alan.dart to work on a custom chain, then you will need to generate the gRPC clients starting from your custom Protobuf files. If you want to know how to do this, please reference the "),s("RouterLink",{attrs:{to:"/custom-chains/overview.html"}},[t._v("custom chains")]),t._v(" page.")],1),t._v(" "),s("h2",{attrs:{id:"_2-build-the-query-clients"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-build-the-query-clients"}},[t._v("#")]),t._v(" 2. Build the query clients")]),t._v(" "),s("p",[t._v("Once you have imported the module that you would like to use, you now need to build a "),s("code",[t._v("QueryClient")]),t._v(" instance. To do this you have to:")]),t._v(" "),s("ol",[s("li",[t._v("create a "),s("code",[t._v("ClientChannel")]),t._v(" connection towards a gRPC endpoint;")]),t._v(" "),s("li",[t._v("build the "),s("code",[t._v("QueryClient")]),t._v(" instance.")])]),t._v(" "),s("p",[t._v("In order to create a "),s("code",[t._v("ClientChannel")]),t._v(" connection, the esiest way is to use an already existing "),s("code",[t._v("NetworkInfo")]),t._v(" object:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" networkInfo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NetworkInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fromSingleHost")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n bech32Prefix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'cosmos'")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n host"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'localhost'")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" channel "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" networkInfo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("gRPCChannel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br")])]),s("p",[t._v("Once you have created a "),s("code",[t._v("ClientChannel")]),t._v(", you can use it to create the "),s("code",[t._v("QueryClient")]),t._v(" instances:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" authClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("QueryClient")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("channel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" bankClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bank"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("QueryClient")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("channel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" stakingClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("staking"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("QueryClient")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("channel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br")])]),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("Reuse the same channel")]),t._v(" "),s("p",[t._v("If you want to improve the efficiency of your application, you should reuse the same channel when creating different query clients. This will make sure that your application keeps alive only the bare minimum number of gRPC connections towards your node, instead of opening a lot of them.")])]),t._v(" "),s("h2",{attrs:{id:"_3-query-the-data"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-query-the-data"}},[t._v("#")]),t._v(" 3. Query the data")]),t._v(" "),s("p",[t._v("Once you have your "),s("code",[t._v("QueryClient")]),t._v(" instance ready, you can now start querying the data. To do this, simply call the different "),s("code",[t._v("QueryClient")]),t._v(" methods with the proper parameters:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/staking/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" staking"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create the pagination data")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" pagination "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PageRequest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("limit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100.")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offset "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Query the gRPC")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" response "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" stakingClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("validators")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("staking"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("QueryValidatorsRequest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("status "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" status\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pagination "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" pagination"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get the validators")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" validators "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" response"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("validators"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br"),s("span",{staticClass:"line-number"},[t._v("7")]),s("br"),s("span",{staticClass:"line-number"},[t._v("8")]),s("br"),s("span",{staticClass:"line-number"},[t._v("9")]),s("br"),s("span",{staticClass:"line-number"},[t._v("10")]),s("br"),s("span",{staticClass:"line-number"},[t._v("11")]),s("br"),s("span",{staticClass:"line-number"},[t._v("12")]),s("br"),s("span",{staticClass:"line-number"},[t._v("13")]),s("br"),s("span",{staticClass:"line-number"},[t._v("14")]),s("br"),s("span",{staticClass:"line-number"},[t._v("15")]),s("br"),s("span",{staticClass:"line-number"},[t._v("16")]),s("br")])]),s("h3",{attrs:{id:"common-data"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#common-data"}},[t._v("#")]),t._v(" Common data")]),t._v(" "),s("p",[t._v("A lot of the different "),s("code",[t._v("QueryClient")]),t._v(" methods accept common parameters. Following you can find some examples and how to use them properly.")]),t._v(" "),s("h4",{attrs:{id:"pagination"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#pagination"}},[t._v("#")]),t._v(" Pagination")]),t._v(" "),s("p",[t._v("Most of the methods that return a list of objects accept a pagination object that describes the number of results that should be returned and the offset from which to start counting such limit. To build this object you can use the following code:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" pagination "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PageRequest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("limit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" limit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offset "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" offset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br")])]),s("p",[t._v("Where "),s("code",[t._v("limit")]),t._v(" and "),s("code",[t._v("offset")]),t._v(" are "),s("code",[t._v("int")]),t._v(" objects.")]),t._v(" "),s("p",[t._v("As an example, to query the second page of 200 items, you can use the following pagination:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" pagination "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PageRequest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("limit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("200.")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Return only 200 items")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offset "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("200.")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Skip the first 200 items (first page)")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br")])]),s("p",[t._v("In general, the formula to compute the "),s("code",[t._v("offset")]),t._v(" given a non-zero page number (starting from 1) should be")]),t._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("offset = (page - 1) * limit\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("h4",{attrs:{id:"height"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#height"}},[t._v("#")]),t._v(" Height")]),t._v(" "),s("p",[t._v("All queries support specifying a block height to query for. This is done using gRPC headers, and in particular the custom one named "),s("code",[t._v("x-cosmos-block-height")]),t._v(". To use this properly, you need to include this header inside a "),s("code",[t._v("CallOptions")]),t._v(" object. To make this simpler, Alan.dart provides you with a helper method to build it simply:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" heightOption "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GrpcHeaders")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("height")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Once you created the header, you can use it simply by passing it to the query client method that you want to use:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" response "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" stakingClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("validators")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("request"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" heightOption"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{285:function(t,s,a){"use strict";a.r(s);var n=a(1),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"queries"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#queries"}},[t._v("#")]),t._v(" Queries")]),t._v(" "),s("p",[t._v("Starting with "),s("code",[t._v("v0.40.x")]),t._v(", Cosmos has added the support to "),s("a",{attrs:{href:"https://grpc.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("gRPC"),s("OutboundLink")],1),t._v(" queries and declared that REST APIs will be outdated in future versions. For this reason, Alan.dart now only uses gRPC queries in order to get the data from the chain whenever possible. Below you can find instructions on how to use this new and more efficient way of querying your chain.")]),t._v(" "),s("h2",{attrs:{id:"_1-get-the-modules-to-use"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-get-the-modules-to-use"}},[t._v("#")]),t._v(" 1. Get the modules to use")]),t._v(" "),s("h3",{attrs:{id:"a-using-standard-cosmos-modules"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#a-using-standard-cosmos-modules"}},[t._v("#")]),t._v(" A. Using standard Cosmos modules")]),t._v(" "),s("p",[t._v("If you are building an application that wants to query only default Cosmos modules (eg. "),s("code",[t._v("x/bank")]),t._v(", "),s("code",[t._v("x/staking")]),t._v(", "),s("code",[t._v("x/slashing")]),t._v(", etc) you can simply use the "),s("code",[t._v("QueryClient")]),t._v(" that are already contained inside Alan.dart.")]),t._v(" "),s("p",[t._v("To do this, you can simply import the different already built-in modules:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/auth/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/bank/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" bank"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/slashing/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" slashing"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br")])]),s("p",[t._v("As you can see, the pattern used to import a module is the following:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos//v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("module name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("If you want to see all the supported modules, please visit the "),s("RouterLink",{attrs:{to:"/modules/overview.html"}},[t._v("modules page")])],1),t._v(" "),s("h3",{attrs:{id:"b-using-custom-modules"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#b-using-custom-modules"}},[t._v("#")]),t._v(" B. Using custom modules")]),t._v(" "),s("p",[t._v("If you want to use Alan.dart to work on a custom chain, then you will need to generate the gRPC clients starting from your custom Protobuf files. If you want to know how to do this, please reference the "),s("RouterLink",{attrs:{to:"/custom-chains/overview.html"}},[t._v("custom chains")]),t._v(" page.")],1),t._v(" "),s("h2",{attrs:{id:"_2-build-the-query-clients"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-build-the-query-clients"}},[t._v("#")]),t._v(" 2. Build the query clients")]),t._v(" "),s("p",[t._v("Once you have imported the module that you would like to use, you now need to build a "),s("code",[t._v("QueryClient")]),t._v(" instance. To do this you have to:")]),t._v(" "),s("ol",[s("li",[t._v("create a "),s("code",[t._v("ClientChannel")]),t._v(" connection towards a gRPC endpoint;")]),t._v(" "),s("li",[t._v("build the "),s("code",[t._v("QueryClient")]),t._v(" instance.")])]),t._v(" "),s("p",[t._v("In order to create a "),s("code",[t._v("ClientChannel")]),t._v(" connection, the esiest way is to use an already existing "),s("code",[t._v("NetworkInfo")]),t._v(" object:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" networkInfo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NetworkInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fromSingleHost")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n bech32Prefix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'cosmos'")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n host"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'localhost'")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" channel "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" networkInfo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("gRPCChannel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br")])]),s("p",[t._v("Once you have created a "),s("code",[t._v("ClientChannel")]),t._v(", you can use it to create the "),s("code",[t._v("QueryClient")]),t._v(" instances:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" authClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("QueryClient")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("channel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" bankClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bank"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("QueryClient")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("channel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" stakingClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("staking"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("QueryClient")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("channel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br")])]),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("Reuse the same channel")]),t._v(" "),s("p",[t._v("If you want to improve the efficiency of your application, you should reuse the same channel when creating different query clients. This will make sure that your application keeps alive only the bare minimum number of gRPC connections towards your node, instead of opening a lot of them.")])]),t._v(" "),s("h2",{attrs:{id:"_3-query-the-data"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-query-the-data"}},[t._v("#")]),t._v(" 3. Query the data")]),t._v(" "),s("p",[t._v("Once you have your "),s("code",[t._v("QueryClient")]),t._v(" instance ready, you can now start querying the data. To do this, simply call the different "),s("code",[t._v("QueryClient")]),t._v(" methods with the proper parameters:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/staking/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" staking"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create the pagination data")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" pagination "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PageRequest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("limit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100.")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offset "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Query the gRPC")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" response "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" stakingClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("validators")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("staking"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("QueryValidatorsRequest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("status "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" status\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pagination "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" pagination"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get the validators")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" validators "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" response"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("validators"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br"),s("span",{staticClass:"line-number"},[t._v("7")]),s("br"),s("span",{staticClass:"line-number"},[t._v("8")]),s("br"),s("span",{staticClass:"line-number"},[t._v("9")]),s("br"),s("span",{staticClass:"line-number"},[t._v("10")]),s("br"),s("span",{staticClass:"line-number"},[t._v("11")]),s("br"),s("span",{staticClass:"line-number"},[t._v("12")]),s("br"),s("span",{staticClass:"line-number"},[t._v("13")]),s("br"),s("span",{staticClass:"line-number"},[t._v("14")]),s("br"),s("span",{staticClass:"line-number"},[t._v("15")]),s("br"),s("span",{staticClass:"line-number"},[t._v("16")]),s("br")])]),s("h3",{attrs:{id:"common-data"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#common-data"}},[t._v("#")]),t._v(" Common data")]),t._v(" "),s("p",[t._v("A lot of the different "),s("code",[t._v("QueryClient")]),t._v(" methods accept common parameters. Following you can find some examples and how to use them properly.")]),t._v(" "),s("h4",{attrs:{id:"pagination"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#pagination"}},[t._v("#")]),t._v(" Pagination")]),t._v(" "),s("p",[t._v("Most of the methods that return a list of objects accept a pagination object that describes the number of results that should be returned and the offset from which to start counting such limit. To build this object you can use the following code:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" pagination "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PageRequest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("limit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" limit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offset "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" offset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br")])]),s("p",[t._v("Where "),s("code",[t._v("limit")]),t._v(" and "),s("code",[t._v("offset")]),t._v(" are "),s("code",[t._v("int")]),t._v(" objects.")]),t._v(" "),s("p",[t._v("As an example, to query the second page of 200 items, you can use the following pagination:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" pagination "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PageRequest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("limit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("200.")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Return only 200 items")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offset "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("200.")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toInt64")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Skip the first 200 items (first page)")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br")])]),s("p",[t._v("In general, the formula to compute the "),s("code",[t._v("offset")]),t._v(" given a non-zero page number (starting from 1) should be")]),t._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("offset = (page - 1) * limit\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("h4",{attrs:{id:"height"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#height"}},[t._v("#")]),t._v(" Height")]),t._v(" "),s("p",[t._v("All queries support specifying a block height to query for. This is done using gRPC headers, and in particular the custom one named "),s("code",[t._v("x-cosmos-block-height")]),t._v(". To use this properly, you need to include this header inside a "),s("code",[t._v("CallOptions")]),t._v(" object. To make this simpler, Alan.dart provides you with a helper method to build it simply:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" heightOption "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GrpcHeaders")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("height")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Once you created the header, you can use it simply by passing it to the query client method that you want to use:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" response "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" stakingClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("validators")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("request"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" heightOption"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/12.10b17887.js b/assets/js/12.6edfadaa.js similarity index 99% rename from assets/js/12.10b17887.js rename to assets/js/12.6edfadaa.js index 3248216d..f4f7f63d 100644 --- a/assets/js/12.10b17887.js +++ b/assets/js/12.6edfadaa.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{285:function(s,t,a){"use strict";a.r(t);var n=a(1),e=Object(n.a)({},(function(){var s=this,t=s._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[t("h1",{attrs:{id:"performing-a-transaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#performing-a-transaction"}},[s._v("#")]),s._v(" Performing a transaction")]),s._v(" "),t("p",[s._v("In order to perform a transaction, three steps must be done:")]),s._v(" "),t("ol",[t("li",[s._v("create the transaction;")]),s._v(" "),t("li",[s._v("sign the transaction;")]),s._v(" "),t("li",[s._v("send the transaction.")])]),s._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[s._v("Wallet required")]),s._v(" "),t("p",[s._v("In order to perform transactions, you need to have a wallet. If you want to learn how to get one, please refer to the "),t("RouterLink",{attrs:{to:"/wallet/overview.html"}},[s._v("Wallet documentation")]),s._v(".")],1)]),s._v(" "),t("h2",{attrs:{id:"_1-get-the-modules-to-use"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-get-the-modules-to-use"}},[s._v("#")]),s._v(" 1. Get the modules to use")]),s._v(" "),t("p",[s._v("When you want to create a transaction, you are required to specify a list of messages that should be included inside such transaction. Those messages can be either default Cosmos messages (already included inside Alan.dart), or custom messages. Following you can find instructions on how to use both.")]),s._v(" "),t("h3",{attrs:{id:"a-using-standard-cosmos-modules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#a-using-standard-cosmos-modules"}},[s._v("#")]),s._v(" A. Using standard Cosmos modules")]),s._v(" "),t("p",[s._v("If you want to use messages included inside default Cosmos modules (eg. "),t("code",[s._v("x/bank")]),s._v(", "),t("code",[s._v("x/staking")]),s._v(", "),t("code",[s._v("x/slashing")]),s._v(", etc), you can simply use the various messages classes that are already contained inside Alan.dart.")]),s._v(" "),t("p",[s._v("To do this, you can simply import the different already built-in modules:")]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'package:alan/proto/cosmos/auth/v1beta1/export.dart'")])]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("as")]),s._v(" auth"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'package:alan/proto/cosmos/bank/v1beta1/export.dart'")])]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("as")]),s._v(" bank"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'package:alan/proto/cosmos/slashing/v1beta1/export.dart'")])]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("as")]),s._v(" slashing"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br")])]),t("p",[s._v("As you can see, the pattern used to import a module is the following:")]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'package:alan/proto/cosmos//v1beta1/export.dart'")])]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("as")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token generics"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("module name"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br")])]),t("p",[s._v("If you want to see all the supported modules, please visit the "),t("RouterLink",{attrs:{to:"/modules/overview.html"}},[s._v("modules page")])],1),s._v(" "),t("h3",{attrs:{id:"b-using-custom-modules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#b-using-custom-modules"}},[s._v("#")]),s._v(" B. Using custom modules")]),s._v(" "),t("p",[s._v("If you want to build a transaction that includes custom messages, then you will need to generate the messages classes starting from your custom Protobuf files. If you want to know how to do this, please reference the "),t("RouterLink",{attrs:{to:"/custom-chains/overview.html"}},[s._v("custom chains")]),s._v(" page.")],1),s._v(" "),t("h2",{attrs:{id:"_2-create-and-sign-the-transaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-and-sign-the-transaction"}},[s._v("#")]),s._v(" 2. Create and sign the transaction")]),s._v(" "),t("p",[s._v("To create and sign a transaction properly, you can use the "),t("code",[s._v("TxSigner")]),s._v(" class, providing it with a list of messages and a wallet, as well as an optional memo and optional fees.")]),s._v(" "),t("p",[s._v("You can also provide an optional "),t("code",[s._v("TxConfig")]),s._v(" that will be used to serialize and sign the transaction according to custom logics.")]),s._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[s._v("Example message")]),s._v(" "),t("p",[s._v("The following example uses the "),t("code",[s._v("bank.MsgSend")]),s._v(" message, but remember that you can use any kind of message that you want. Please visit the "),t("RouterLink",{attrs:{to:"/modules/overview.html"}},[s._v("modules page")]),s._v(" to see all the messages included in Alan.dart, or the "),t("RouterLink",{attrs:{to:"/custom-chains/overview.html"}},[s._v("custom chain page")]),s._v(" to know how to generate custom ones.")],1)]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'package:alan/alan.dart'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("void")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("main")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("async")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Build the network info that will be used to get the ")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// account data used to sign the transaction")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" networkInfo "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("NetworkInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("fromSingleHost")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n bech32Hrp"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'cosmos'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n host"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://localhost'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Create a wallet - Make sure you use your mnemonic phrase here")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" mnemonic "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'roast'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'stomach'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'welcome'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'please'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'gauge'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'funny'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'coconut'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'baby'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'bird'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'announce'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'bind'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'jacket'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'title'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'vibrant'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'tomorrow'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'indoor'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'bitter'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'initial'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'ill'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'analyst'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'thought'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'strike'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'answer'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'cotton'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" wallet "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Wallet")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("derive")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("mnemonic"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" networkInfo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Create your message")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" message "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[t("span",{pre:!0,attrs:{class:"token namespace"}},[s._v("bank"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")])]),s._v("MsgSend")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("fromAddress "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" wallet"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("bech32Address\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("toAddress "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'cosmos1cx7mec8x567xh8f4x7490ndx7xey8lnr9du2qy'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n message"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("amount"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("add")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Coin")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("denom "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'uatom'")])]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("amount "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'100'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Compose the transaction fees")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" fee "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Fee")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n fee"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("gasLimit "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("200000.")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("toInt64")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n fee"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("amount"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("add")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Coin")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("amount "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'100'")])]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("denom "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'uatom'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Build the signer")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" signer "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("TxSigner")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("fromNetworkInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("networkInfo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Create and sign the transaction")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" signedTx "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("await")]),s._v(" signer"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("createAndSign")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n wallet"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("message"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n memo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'Optional memo'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Optional")]),s._v("\n fee"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" fee"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Optional (Default is 200000 gas and empty amount)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br"),t("span",{staticClass:"line-number"},[s._v("8")]),t("br"),t("span",{staticClass:"line-number"},[s._v("9")]),t("br"),t("span",{staticClass:"line-number"},[s._v("10")]),t("br"),t("span",{staticClass:"line-number"},[s._v("11")]),t("br"),t("span",{staticClass:"line-number"},[s._v("12")]),t("br"),t("span",{staticClass:"line-number"},[s._v("13")]),t("br"),t("span",{staticClass:"line-number"},[s._v("14")]),t("br"),t("span",{staticClass:"line-number"},[s._v("15")]),t("br"),t("span",{staticClass:"line-number"},[s._v("16")]),t("br"),t("span",{staticClass:"line-number"},[s._v("17")]),t("br"),t("span",{staticClass:"line-number"},[s._v("18")]),t("br"),t("span",{staticClass:"line-number"},[s._v("19")]),t("br"),t("span",{staticClass:"line-number"},[s._v("20")]),t("br"),t("span",{staticClass:"line-number"},[s._v("21")]),t("br"),t("span",{staticClass:"line-number"},[s._v("22")]),t("br"),t("span",{staticClass:"line-number"},[s._v("23")]),t("br"),t("span",{staticClass:"line-number"},[s._v("24")]),t("br"),t("span",{staticClass:"line-number"},[s._v("25")]),t("br"),t("span",{staticClass:"line-number"},[s._v("26")]),t("br"),t("span",{staticClass:"line-number"},[s._v("27")]),t("br"),t("span",{staticClass:"line-number"},[s._v("28")]),t("br"),t("span",{staticClass:"line-number"},[s._v("29")]),t("br"),t("span",{staticClass:"line-number"},[s._v("30")]),t("br"),t("span",{staticClass:"line-number"},[s._v("31")]),t("br"),t("span",{staticClass:"line-number"},[s._v("32")]),t("br"),t("span",{staticClass:"line-number"},[s._v("33")]),t("br"),t("span",{staticClass:"line-number"},[s._v("34")]),t("br"),t("span",{staticClass:"line-number"},[s._v("35")]),t("br"),t("span",{staticClass:"line-number"},[s._v("36")]),t("br"),t("span",{staticClass:"line-number"},[s._v("37")]),t("br"),t("span",{staticClass:"line-number"},[s._v("38")]),t("br"),t("span",{staticClass:"line-number"},[s._v("39")]),t("br"),t("span",{staticClass:"line-number"},[s._v("40")]),t("br"),t("span",{staticClass:"line-number"},[s._v("41")]),t("br"),t("span",{staticClass:"line-number"},[s._v("42")]),t("br"),t("span",{staticClass:"line-number"},[s._v("43")]),t("br"),t("span",{staticClass:"line-number"},[s._v("44")]),t("br"),t("span",{staticClass:"line-number"},[s._v("45")]),t("br"),t("span",{staticClass:"line-number"},[s._v("46")]),t("br"),t("span",{staticClass:"line-number"},[s._v("47")]),t("br"),t("span",{staticClass:"line-number"},[s._v("48")]),t("br"),t("span",{staticClass:"line-number"},[s._v("49")]),t("br")])]),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[s._v("Host requirements")]),s._v(" "),t("p",[s._v("When creating a "),t("code",[s._v("NetworkInfo")]),s._v(" you need to specify a "),t("code",[s._v("host")]),s._v(" value. This must be the address of a full node that has the following requirements:")]),s._v(" "),t("ol",[t("li",[s._v("REST APIs enabled."),t("br"),s._v("\nThese can be enabled by setting "),t("code",[s._v("enable = true")]),s._v(" under the "),t("code",[s._v("[api]")]),s._v(" section of the "),t("code",[s._v("app.toml")]),s._v(" file.")]),s._v(" "),t("li",[s._v("gRPC APIs enabled."),t("br"),s._v("\nThese can be enabled by setting "),t("code",[s._v("enable = true")]),s._v(" under the "),t("code",[s._v("[grpc]")]),s._v(" section of the "),t("code",[s._v("app.toml")]),s._v(" file.")]),s._v(" "),t("li",[s._v("REST APIs and gRPC APIs ports opened to allow external connections.")])])]),s._v(" "),t("h2",{attrs:{id:"_3-send-the-signed-transaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-send-the-signed-transaction"}},[s._v("#")]),s._v(" 3. Send the signed transaction")]),s._v(" "),t("p",[s._v("Once you signed the transaction, you are now ready to send it to the chain. To do this you can use the "),t("code",[s._v("TxSender")]),s._v(" helper class, giving it the signed transaction and a wallet. You can also specify the send mode that you would like to use.")]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("void")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("main")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("async")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// [...] Transaction creation process")]),s._v("\n \n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" sender "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("TxSender")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("fromNetworkInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("networkInfo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" result "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("await")]),s._v(" sender"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("broadcastTx")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n signedTx"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n mode"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("BroadcastMode")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("BROADCAST_MODE_ASYNC"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Optional (Default: BroadcastMode.BROADCAST_MODE_SYNC)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br"),t("span",{staticClass:"line-number"},[s._v("8")]),t("br"),t("span",{staticClass:"line-number"},[s._v("9")]),t("br")])]),t("h3",{attrs:{id:"send-modes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#send-modes"}},[s._v("#")]),s._v(" Send modes")]),s._v(" "),t("p",[s._v("The following broadcast modes are available:")]),s._v(" "),t("ul",[t("li",[t("code",[s._v("BroadcastMode.BROADCAST_MODE_ASYNC")]),t("br"),s._v("\nFastest, returns immediately before performing any check on the transaction.")]),s._v(" "),t("li",[t("code",[s._v("BroadcastMode.BROADCAST_MODE_SYNC")]),t("br"),s._v("\nMost common, returns after performing some fast checks on the transaction.")]),s._v(" "),t("li",[t("code",[s._v("BroadcastMode.BROADCAST_MODE_BLOCK")]),s._v("\nSlowest, returns after the block has been approved (5-6 seconds).")])]),s._v(" "),t("h2",{attrs:{id:"supported-messages"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supported-messages"}},[s._v("#")]),s._v(" Supported messages")]),s._v(" "),t("p",[s._v("In order to see a list of supported messages that are built into Alan.dart, please see the "),t("RouterLink",{attrs:{to:"/modules/overview.html"}},[s._v("modules page")]),s._v(".")],1),s._v(" "),t("p",[s._v("If you want to use a custom message type instead, visit the "),t("RouterLink",{attrs:{to:"/custom-chains/overview.html"}},[s._v("custom chains page")]),s._v(".")],1)])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{286:function(s,t,a){"use strict";a.r(t);var n=a(1),e=Object(n.a)({},(function(){var s=this,t=s._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[t("h1",{attrs:{id:"performing-a-transaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#performing-a-transaction"}},[s._v("#")]),s._v(" Performing a transaction")]),s._v(" "),t("p",[s._v("In order to perform a transaction, three steps must be done:")]),s._v(" "),t("ol",[t("li",[s._v("create the transaction;")]),s._v(" "),t("li",[s._v("sign the transaction;")]),s._v(" "),t("li",[s._v("send the transaction.")])]),s._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[s._v("Wallet required")]),s._v(" "),t("p",[s._v("In order to perform transactions, you need to have a wallet. If you want to learn how to get one, please refer to the "),t("RouterLink",{attrs:{to:"/wallet/overview.html"}},[s._v("Wallet documentation")]),s._v(".")],1)]),s._v(" "),t("h2",{attrs:{id:"_1-get-the-modules-to-use"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-get-the-modules-to-use"}},[s._v("#")]),s._v(" 1. Get the modules to use")]),s._v(" "),t("p",[s._v("When you want to create a transaction, you are required to specify a list of messages that should be included inside such transaction. Those messages can be either default Cosmos messages (already included inside Alan.dart), or custom messages. Following you can find instructions on how to use both.")]),s._v(" "),t("h3",{attrs:{id:"a-using-standard-cosmos-modules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#a-using-standard-cosmos-modules"}},[s._v("#")]),s._v(" A. Using standard Cosmos modules")]),s._v(" "),t("p",[s._v("If you want to use messages included inside default Cosmos modules (eg. "),t("code",[s._v("x/bank")]),s._v(", "),t("code",[s._v("x/staking")]),s._v(", "),t("code",[s._v("x/slashing")]),s._v(", etc), you can simply use the various messages classes that are already contained inside Alan.dart.")]),s._v(" "),t("p",[s._v("To do this, you can simply import the different already built-in modules:")]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'package:alan/proto/cosmos/auth/v1beta1/export.dart'")])]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("as")]),s._v(" auth"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'package:alan/proto/cosmos/bank/v1beta1/export.dart'")])]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("as")]),s._v(" bank"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'package:alan/proto/cosmos/slashing/v1beta1/export.dart'")])]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("as")]),s._v(" slashing"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br")])]),t("p",[s._v("As you can see, the pattern used to import a module is the following:")]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'package:alan/proto/cosmos//v1beta1/export.dart'")])]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("as")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token generics"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("module name"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br")])]),t("p",[s._v("If you want to see all the supported modules, please visit the "),t("RouterLink",{attrs:{to:"/modules/overview.html"}},[s._v("modules page")])],1),s._v(" "),t("h3",{attrs:{id:"b-using-custom-modules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#b-using-custom-modules"}},[s._v("#")]),s._v(" B. Using custom modules")]),s._v(" "),t("p",[s._v("If you want to build a transaction that includes custom messages, then you will need to generate the messages classes starting from your custom Protobuf files. If you want to know how to do this, please reference the "),t("RouterLink",{attrs:{to:"/custom-chains/overview.html"}},[s._v("custom chains")]),s._v(" page.")],1),s._v(" "),t("h2",{attrs:{id:"_2-create-and-sign-the-transaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-and-sign-the-transaction"}},[s._v("#")]),s._v(" 2. Create and sign the transaction")]),s._v(" "),t("p",[s._v("To create and sign a transaction properly, you can use the "),t("code",[s._v("TxSigner")]),s._v(" class, providing it with a list of messages and a wallet, as well as an optional memo and optional fees.")]),s._v(" "),t("p",[s._v("You can also provide an optional "),t("code",[s._v("TxConfig")]),s._v(" that will be used to serialize and sign the transaction according to custom logics.")]),s._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[s._v("Example message")]),s._v(" "),t("p",[s._v("The following example uses the "),t("code",[s._v("bank.MsgSend")]),s._v(" message, but remember that you can use any kind of message that you want. Please visit the "),t("RouterLink",{attrs:{to:"/modules/overview.html"}},[s._v("modules page")]),s._v(" to see all the messages included in Alan.dart, or the "),t("RouterLink",{attrs:{to:"/custom-chains/overview.html"}},[s._v("custom chain page")]),s._v(" to know how to generate custom ones.")],1)]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'package:alan/alan.dart'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("void")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("main")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("async")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Build the network info that will be used to get the ")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// account data used to sign the transaction")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" networkInfo "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("NetworkInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("fromSingleHost")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n bech32Hrp"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'cosmos'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n host"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://localhost'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Create a wallet - Make sure you use your mnemonic phrase here")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" mnemonic "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'roast'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'stomach'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'welcome'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'please'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'gauge'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'funny'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'coconut'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'baby'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'bird'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'announce'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'bind'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'jacket'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'title'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'vibrant'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'tomorrow'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'indoor'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'bitter'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'initial'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'ill'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'analyst'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'thought'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'strike'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'answer'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'cotton'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" wallet "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Wallet")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("derive")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("mnemonic"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" networkInfo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Create your message")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" message "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[t("span",{pre:!0,attrs:{class:"token namespace"}},[s._v("bank"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")])]),s._v("MsgSend")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("fromAddress "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" wallet"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("bech32Address\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("toAddress "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'cosmos1cx7mec8x567xh8f4x7490ndx7xey8lnr9du2qy'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n message"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("amount"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("add")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Coin")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("denom "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'uatom'")])]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("amount "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'100'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Compose the transaction fees")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" fee "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Fee")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n fee"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("gasLimit "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("200000.")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("toInt64")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n fee"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("amount"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("add")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Coin")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("amount "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'100'")])]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("denom "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'uatom'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Build the signer")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" signer "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("TxSigner")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("fromNetworkInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("networkInfo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Create and sign the transaction")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" signedTx "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("await")]),s._v(" signer"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("createAndSign")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n wallet"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("message"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n memo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'Optional memo'")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Optional")]),s._v("\n fee"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" fee"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Optional (Default is 200000 gas and empty amount)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br"),t("span",{staticClass:"line-number"},[s._v("8")]),t("br"),t("span",{staticClass:"line-number"},[s._v("9")]),t("br"),t("span",{staticClass:"line-number"},[s._v("10")]),t("br"),t("span",{staticClass:"line-number"},[s._v("11")]),t("br"),t("span",{staticClass:"line-number"},[s._v("12")]),t("br"),t("span",{staticClass:"line-number"},[s._v("13")]),t("br"),t("span",{staticClass:"line-number"},[s._v("14")]),t("br"),t("span",{staticClass:"line-number"},[s._v("15")]),t("br"),t("span",{staticClass:"line-number"},[s._v("16")]),t("br"),t("span",{staticClass:"line-number"},[s._v("17")]),t("br"),t("span",{staticClass:"line-number"},[s._v("18")]),t("br"),t("span",{staticClass:"line-number"},[s._v("19")]),t("br"),t("span",{staticClass:"line-number"},[s._v("20")]),t("br"),t("span",{staticClass:"line-number"},[s._v("21")]),t("br"),t("span",{staticClass:"line-number"},[s._v("22")]),t("br"),t("span",{staticClass:"line-number"},[s._v("23")]),t("br"),t("span",{staticClass:"line-number"},[s._v("24")]),t("br"),t("span",{staticClass:"line-number"},[s._v("25")]),t("br"),t("span",{staticClass:"line-number"},[s._v("26")]),t("br"),t("span",{staticClass:"line-number"},[s._v("27")]),t("br"),t("span",{staticClass:"line-number"},[s._v("28")]),t("br"),t("span",{staticClass:"line-number"},[s._v("29")]),t("br"),t("span",{staticClass:"line-number"},[s._v("30")]),t("br"),t("span",{staticClass:"line-number"},[s._v("31")]),t("br"),t("span",{staticClass:"line-number"},[s._v("32")]),t("br"),t("span",{staticClass:"line-number"},[s._v("33")]),t("br"),t("span",{staticClass:"line-number"},[s._v("34")]),t("br"),t("span",{staticClass:"line-number"},[s._v("35")]),t("br"),t("span",{staticClass:"line-number"},[s._v("36")]),t("br"),t("span",{staticClass:"line-number"},[s._v("37")]),t("br"),t("span",{staticClass:"line-number"},[s._v("38")]),t("br"),t("span",{staticClass:"line-number"},[s._v("39")]),t("br"),t("span",{staticClass:"line-number"},[s._v("40")]),t("br"),t("span",{staticClass:"line-number"},[s._v("41")]),t("br"),t("span",{staticClass:"line-number"},[s._v("42")]),t("br"),t("span",{staticClass:"line-number"},[s._v("43")]),t("br"),t("span",{staticClass:"line-number"},[s._v("44")]),t("br"),t("span",{staticClass:"line-number"},[s._v("45")]),t("br"),t("span",{staticClass:"line-number"},[s._v("46")]),t("br"),t("span",{staticClass:"line-number"},[s._v("47")]),t("br"),t("span",{staticClass:"line-number"},[s._v("48")]),t("br"),t("span",{staticClass:"line-number"},[s._v("49")]),t("br")])]),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[s._v("Host requirements")]),s._v(" "),t("p",[s._v("When creating a "),t("code",[s._v("NetworkInfo")]),s._v(" you need to specify a "),t("code",[s._v("host")]),s._v(" value. This must be the address of a full node that has the following requirements:")]),s._v(" "),t("ol",[t("li",[s._v("REST APIs enabled."),t("br"),s._v("\nThese can be enabled by setting "),t("code",[s._v("enable = true")]),s._v(" under the "),t("code",[s._v("[api]")]),s._v(" section of the "),t("code",[s._v("app.toml")]),s._v(" file.")]),s._v(" "),t("li",[s._v("gRPC APIs enabled."),t("br"),s._v("\nThese can be enabled by setting "),t("code",[s._v("enable = true")]),s._v(" under the "),t("code",[s._v("[grpc]")]),s._v(" section of the "),t("code",[s._v("app.toml")]),s._v(" file.")]),s._v(" "),t("li",[s._v("REST APIs and gRPC APIs ports opened to allow external connections.")])])]),s._v(" "),t("h2",{attrs:{id:"_3-send-the-signed-transaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-send-the-signed-transaction"}},[s._v("#")]),s._v(" 3. Send the signed transaction")]),s._v(" "),t("p",[s._v("Once you signed the transaction, you are now ready to send it to the chain. To do this you can use the "),t("code",[s._v("TxSender")]),s._v(" helper class, giving it the signed transaction and a wallet. You can also specify the send mode that you would like to use.")]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("void")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("main")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("async")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// [...] Transaction creation process")]),s._v("\n \n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" sender "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("TxSender")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("fromNetworkInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("networkInfo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" result "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("await")]),s._v(" sender"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("broadcastTx")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n signedTx"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n mode"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("BroadcastMode")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("BROADCAST_MODE_ASYNC"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Optional (Default: BroadcastMode.BROADCAST_MODE_SYNC)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br"),t("span",{staticClass:"line-number"},[s._v("8")]),t("br"),t("span",{staticClass:"line-number"},[s._v("9")]),t("br")])]),t("h3",{attrs:{id:"send-modes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#send-modes"}},[s._v("#")]),s._v(" Send modes")]),s._v(" "),t("p",[s._v("The following broadcast modes are available:")]),s._v(" "),t("ul",[t("li",[t("code",[s._v("BroadcastMode.BROADCAST_MODE_ASYNC")]),t("br"),s._v("\nFastest, returns immediately before performing any check on the transaction.")]),s._v(" "),t("li",[t("code",[s._v("BroadcastMode.BROADCAST_MODE_SYNC")]),t("br"),s._v("\nMost common, returns after performing some fast checks on the transaction.")]),s._v(" "),t("li",[t("code",[s._v("BroadcastMode.BROADCAST_MODE_BLOCK")]),s._v("\nSlowest, returns after the block has been approved (5-6 seconds).")])]),s._v(" "),t("h2",{attrs:{id:"supported-messages"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supported-messages"}},[s._v("#")]),s._v(" Supported messages")]),s._v(" "),t("p",[s._v("In order to see a list of supported messages that are built into Alan.dart, please see the "),t("RouterLink",{attrs:{to:"/modules/overview.html"}},[s._v("modules page")]),s._v(".")],1),s._v(" "),t("p",[s._v("If you want to use a custom message type instead, visit the "),t("RouterLink",{attrs:{to:"/custom-chains/overview.html"}},[s._v("custom chains page")]),s._v(".")],1)])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/13.8f016286.js b/assets/js/13.76474fa4.js similarity index 99% rename from assets/js/13.8f016286.js rename to assets/js/13.76474fa4.js index 39a33a72..be8086dd 100644 --- a/assets/js/13.8f016286.js +++ b/assets/js/13.76474fa4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{288:function(s,t,a){"use strict";a.r(t);var n=a(1),e=Object(n.a)({},(function(){var s=this,t=s._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[t("h1",{attrs:{id:"creating-a-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-a-wallet"}},[s._v("#")]),s._v(" Creating a wallet")]),s._v(" "),t("p",[s._v("While using Alan.dart, a wallet represents the private identity of a user. It contains everything necessary to create, sign and broadcast a transaction to che chain.")]),s._v(" "),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[s._v("Security alert")]),s._v(" "),t("p",[s._v("Since wallets are extremely delicate, you should "),t("strong",[s._v("never")]),s._v(" store them anywhere. As a precaution method, if you try to serialize a Wallet or print its info, you will not be able to see the private key associated with it.")]),s._v(" "),t("p",[s._v("If you want to save the wallet of a user, save instead the mnemonic phrase using an encrypted store. For Flutter, "),t("a",{attrs:{href:"https://pub.dev/packages/flutter_secure_storage",target:"_blank",rel:"noopener noreferrer"}},[s._v("flutter_secure_storage"),t("OutboundLink")],1),s._v(" exists.")]),s._v(" "),t("p",[t("strong",[s._v("Never")]),s._v(", ever, store the mnemonic phrase in an unencrypted place.")])]),s._v(" "),t("h2",{attrs:{id:"create-a-wallet-from-a-mnemonic"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-a-wallet-from-a-mnemonic"}},[s._v("#")]),s._v(" Create a wallet from a mnemonic")]),s._v(" "),t("p",[s._v("In order to create a wallet, you are required to provide:")]),s._v(" "),t("ol",[t("li",[s._v("a mnemonic phrase;")]),s._v(" "),t("li",[s._v("a "),t("code",[s._v("NetworkInfo")]),s._v(" object;")]),s._v(" "),t("li",[s._v("optionally, a derivation path.")])]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"package:alan/alan.dart"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" networkInfo "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("NetworkInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("fromSingleHost")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n bech32Hrp"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cosmos"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" \n hosrt"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"http://localhost"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" mnemonic "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"final"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"random"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"flame"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cinnamon"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"grunt"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"hazard"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"easily"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"mutual"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"resist"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pond"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"solution"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"define"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"knife"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"female"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"tongue"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"crime"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"atom"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"jaguar"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"alert"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"library"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"best"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"forum"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lesson"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"rigid"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" wallet "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Wallet")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("derive")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n mnemonic"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" \n networkInfo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n derivationPath"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("\"m/44'/118'/0'/0/0\"")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Optional - Default m/44'/118'/0'/0/0")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br"),t("span",{staticClass:"line-number"},[s._v("8")]),t("br"),t("span",{staticClass:"line-number"},[s._v("9")]),t("br"),t("span",{staticClass:"line-number"},[s._v("10")]),t("br"),t("span",{staticClass:"line-number"},[s._v("11")]),t("br"),t("span",{staticClass:"line-number"},[s._v("12")]),t("br"),t("span",{staticClass:"line-number"},[s._v("13")]),t("br"),t("span",{staticClass:"line-number"},[s._v("14")]),t("br"),t("span",{staticClass:"line-number"},[s._v("15")]),t("br"),t("span",{staticClass:"line-number"},[s._v("16")]),t("br"),t("span",{staticClass:"line-number"},[s._v("17")]),t("br"),t("span",{staticClass:"line-number"},[s._v("18")]),t("br"),t("span",{staticClass:"line-number"},[s._v("19")]),t("br"),t("span",{staticClass:"line-number"},[s._v("20")]),t("br"),t("span",{staticClass:"line-number"},[s._v("21")]),t("br"),t("span",{staticClass:"line-number"},[s._v("22")]),t("br"),t("span",{staticClass:"line-number"},[s._v("23")]),t("br"),t("span",{staticClass:"line-number"},[s._v("24")]),t("br"),t("span",{staticClass:"line-number"},[s._v("25")]),t("br"),t("span",{staticClass:"line-number"},[s._v("26")]),t("br"),t("span",{staticClass:"line-number"},[s._v("27")]),t("br"),t("span",{staticClass:"line-number"},[s._v("28")]),t("br"),t("span",{staticClass:"line-number"},[s._v("29")]),t("br"),t("span",{staticClass:"line-number"},[s._v("30")]),t("br"),t("span",{staticClass:"line-number"},[s._v("31")]),t("br"),t("span",{staticClass:"line-number"},[s._v("32")]),t("br"),t("span",{staticClass:"line-number"},[s._v("33")]),t("br"),t("span",{staticClass:"line-number"},[s._v("34")]),t("br"),t("span",{staticClass:"line-number"},[s._v("35")]),t("br"),t("span",{staticClass:"line-number"},[s._v("36")]),t("br"),t("span",{staticClass:"line-number"},[s._v("37")]),t("br"),t("span",{staticClass:"line-number"},[s._v("38")]),t("br")])]),t("h2",{attrs:{id:"generate-a-random-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#generate-a-random-wallet"}},[s._v("#")]),s._v(" Generate a random wallet")]),s._v(" "),t("p",[s._v("If you don't have any mnemonic phrase, or you want to get a fresh new wallet, you can use the "),t("code",[s._v("Wallet.random")]),s._v(" method. You only have to provide it with a "),t("code",[s._v("NetworkInfo")]),s._v(" object.")]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"package:alan/alan.dart"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" networkInfo "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("NetworkInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("fromSingleHost")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n bech32Hrp"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cosmos"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" \n hosrt"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"http://localhost"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" wallet "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Wallet")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("random")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n networkInfo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n derivationPath"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("\"m/44'/118'/0'/0/0\"")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Optional - Default m/44'/118'/0'/0/0")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br"),t("span",{staticClass:"line-number"},[s._v("8")]),t("br"),t("span",{staticClass:"line-number"},[s._v("9")]),t("br"),t("span",{staticClass:"line-number"},[s._v("10")]),t("br"),t("span",{staticClass:"line-number"},[s._v("11")]),t("br")])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{287:function(s,t,a){"use strict";a.r(t);var n=a(1),e=Object(n.a)({},(function(){var s=this,t=s._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[t("h1",{attrs:{id:"creating-a-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-a-wallet"}},[s._v("#")]),s._v(" Creating a wallet")]),s._v(" "),t("p",[s._v("While using Alan.dart, a wallet represents the private identity of a user. It contains everything necessary to create, sign and broadcast a transaction to che chain.")]),s._v(" "),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[s._v("Security alert")]),s._v(" "),t("p",[s._v("Since wallets are extremely delicate, you should "),t("strong",[s._v("never")]),s._v(" store them anywhere. As a precaution method, if you try to serialize a Wallet or print its info, you will not be able to see the private key associated with it.")]),s._v(" "),t("p",[s._v("If you want to save the wallet of a user, save instead the mnemonic phrase using an encrypted store. For Flutter, "),t("a",{attrs:{href:"https://pub.dev/packages/flutter_secure_storage",target:"_blank",rel:"noopener noreferrer"}},[s._v("flutter_secure_storage"),t("OutboundLink")],1),s._v(" exists.")]),s._v(" "),t("p",[t("strong",[s._v("Never")]),s._v(", ever, store the mnemonic phrase in an unencrypted place.")])]),s._v(" "),t("h2",{attrs:{id:"create-a-wallet-from-a-mnemonic"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-a-wallet-from-a-mnemonic"}},[s._v("#")]),s._v(" Create a wallet from a mnemonic")]),s._v(" "),t("p",[s._v("In order to create a wallet, you are required to provide:")]),s._v(" "),t("ol",[t("li",[s._v("a mnemonic phrase;")]),s._v(" "),t("li",[s._v("a "),t("code",[s._v("NetworkInfo")]),s._v(" object;")]),s._v(" "),t("li",[s._v("optionally, a derivation path.")])]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"package:alan/alan.dart"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" networkInfo "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("NetworkInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("fromSingleHost")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n bech32Hrp"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cosmos"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" \n hosrt"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"http://localhost"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" mnemonic "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"final"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"random"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"flame"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cinnamon"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"grunt"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"hazard"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"easily"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"mutual"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"resist"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pond"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"solution"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"define"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"knife"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"female"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"tongue"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"crime"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"atom"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"jaguar"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"alert"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"library"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"best"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"forum"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lesson"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"rigid"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" wallet "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Wallet")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("derive")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n mnemonic"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" \n networkInfo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n derivationPath"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("\"m/44'/118'/0'/0/0\"")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Optional - Default m/44'/118'/0'/0/0")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br"),t("span",{staticClass:"line-number"},[s._v("8")]),t("br"),t("span",{staticClass:"line-number"},[s._v("9")]),t("br"),t("span",{staticClass:"line-number"},[s._v("10")]),t("br"),t("span",{staticClass:"line-number"},[s._v("11")]),t("br"),t("span",{staticClass:"line-number"},[s._v("12")]),t("br"),t("span",{staticClass:"line-number"},[s._v("13")]),t("br"),t("span",{staticClass:"line-number"},[s._v("14")]),t("br"),t("span",{staticClass:"line-number"},[s._v("15")]),t("br"),t("span",{staticClass:"line-number"},[s._v("16")]),t("br"),t("span",{staticClass:"line-number"},[s._v("17")]),t("br"),t("span",{staticClass:"line-number"},[s._v("18")]),t("br"),t("span",{staticClass:"line-number"},[s._v("19")]),t("br"),t("span",{staticClass:"line-number"},[s._v("20")]),t("br"),t("span",{staticClass:"line-number"},[s._v("21")]),t("br"),t("span",{staticClass:"line-number"},[s._v("22")]),t("br"),t("span",{staticClass:"line-number"},[s._v("23")]),t("br"),t("span",{staticClass:"line-number"},[s._v("24")]),t("br"),t("span",{staticClass:"line-number"},[s._v("25")]),t("br"),t("span",{staticClass:"line-number"},[s._v("26")]),t("br"),t("span",{staticClass:"line-number"},[s._v("27")]),t("br"),t("span",{staticClass:"line-number"},[s._v("28")]),t("br"),t("span",{staticClass:"line-number"},[s._v("29")]),t("br"),t("span",{staticClass:"line-number"},[s._v("30")]),t("br"),t("span",{staticClass:"line-number"},[s._v("31")]),t("br"),t("span",{staticClass:"line-number"},[s._v("32")]),t("br"),t("span",{staticClass:"line-number"},[s._v("33")]),t("br"),t("span",{staticClass:"line-number"},[s._v("34")]),t("br"),t("span",{staticClass:"line-number"},[s._v("35")]),t("br"),t("span",{staticClass:"line-number"},[s._v("36")]),t("br"),t("span",{staticClass:"line-number"},[s._v("37")]),t("br"),t("span",{staticClass:"line-number"},[s._v("38")]),t("br")])]),t("h2",{attrs:{id:"generate-a-random-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#generate-a-random-wallet"}},[s._v("#")]),s._v(" Generate a random wallet")]),s._v(" "),t("p",[s._v("If you don't have any mnemonic phrase, or you want to get a fresh new wallet, you can use the "),t("code",[s._v("Wallet.random")]),s._v(" method. You only have to provide it with a "),t("code",[s._v("NetworkInfo")]),s._v(" object.")]),s._v(" "),t("div",{staticClass:"language-dart line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-dart"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"package:alan/alan.dart"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" networkInfo "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("NetworkInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("fromSingleHost")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n bech32Hrp"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cosmos"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" \n hosrt"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v('"http://localhost"')])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" wallet "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Wallet")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("random")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n networkInfo"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n derivationPath"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string-literal"}},[t("span",{pre:!0,attrs:{class:"token string"}},[s._v("\"m/44'/118'/0'/0/0\"")])]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Optional - Default m/44'/118'/0'/0/0")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br"),t("span",{staticClass:"line-number"},[s._v("8")]),t("br"),t("span",{staticClass:"line-number"},[s._v("9")]),t("br"),t("span",{staticClass:"line-number"},[s._v("10")]),t("br"),t("span",{staticClass:"line-number"},[s._v("11")]),t("br")])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/8.af23f5a1.js b/assets/js/8.fca474a6.js similarity index 99% rename from assets/js/8.af23f5a1.js rename to assets/js/8.fca474a6.js index 4cd93a9a..0f3afaa9 100644 --- a/assets/js/8.af23f5a1.js +++ b/assets/js/8.fca474a6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{287:function(t,s,e){"use strict";e.r(s);var a=e(1),r=Object(a.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"working-with-custom-chains"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#working-with-custom-chains"}},[t._v("#")]),t._v(" Working with custom chains")]),t._v(" "),s("p",[t._v("Given Alan.dart now works primarily based on Protobuf, in order to use it with a custom chain you will need to generate the proper files. This will make sure you are able to create transactions containing custom messages or to query the chain for custom modules. Following, you can find how to do this.")]),t._v(" "),s("h2",{attrs:{id:"generating-custom-protobuf-implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#generating-custom-protobuf-implementations"}},[t._v("#")]),t._v(" Generating custom Protobuf implementations")]),t._v(" "),s("h3",{attrs:{id:"_1-get-the-proto-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-get-the-proto-files"}},[t._v("#")]),t._v(" 1. Get the "),s("code",[t._v(".proto")]),t._v(" files")]),t._v(" "),s("p",[t._v("The first thing you have to do is to get the "),s("code",[t._v(".proto")]),t._v(" files necessary to compile everything. Most custom chains include those files into two separate folders: "),s("code",[t._v("proto")]),t._v(" and "),s("code",[t._v("third_party")]),t._v(":")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("inside the "),s("code",[t._v("proto")]),t._v(" folder you can usually find the various "),s("code",[t._v(".proto")]),t._v(" files that are used to generate custom messages, queriers, etc;")])]),t._v(" "),s("li",[s("p",[t._v("inside the "),s("code",[t._v("third_party")]),t._v(", instead, you can find all the other "),s("code",[t._v(".proto")]),t._v(" files that are taken from third party projects (such as Protobuf, Google, Cosmos, etc) and are still required to compile the custom ones.")])])]),t._v(" "),s("p",[t._v("That being said, what you want to do is get those two folders ("),s("code",[t._v("proto")]),t._v(" and "),s("code",[t._v("third_party")]),t._v(") and put them into your project root folder. As an example, this is the folder structure of Alan.dart's root folder:")]),t._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Alan.dart\n├── proto\n│ └── cosmos\n│ ├── auth\n│ ├── bank\n│ ├── base\n│ ├── capability\n│ ├── crisis\n│ ├── crypto\n│ ├── distribution\n│ ├── evidence\n│ ├── genutil\n│ ├── gov\n│ ├── mint\n│ ├── params\n│ ├── slashing\n│ ├── staking\n│ ├── tx\n│ ├── upgrade\n│ └── vesting\n│\n├── third_party\n│ └── proto\n│ ├── confio\n│ ├── cosmos_proto\n│ ├── gogoproto\n│ ├── google\n│ └── tendermint\n├── ...\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br"),s("span",{staticClass:"line-number"},[t._v("7")]),s("br"),s("span",{staticClass:"line-number"},[t._v("8")]),s("br"),s("span",{staticClass:"line-number"},[t._v("9")]),s("br"),s("span",{staticClass:"line-number"},[t._v("10")]),s("br"),s("span",{staticClass:"line-number"},[t._v("11")]),s("br"),s("span",{staticClass:"line-number"},[t._v("12")]),s("br"),s("span",{staticClass:"line-number"},[t._v("13")]),s("br"),s("span",{staticClass:"line-number"},[t._v("14")]),s("br"),s("span",{staticClass:"line-number"},[t._v("15")]),s("br"),s("span",{staticClass:"line-number"},[t._v("16")]),s("br"),s("span",{staticClass:"line-number"},[t._v("17")]),s("br"),s("span",{staticClass:"line-number"},[t._v("18")]),s("br"),s("span",{staticClass:"line-number"},[t._v("19")]),s("br"),s("span",{staticClass:"line-number"},[t._v("20")]),s("br"),s("span",{staticClass:"line-number"},[t._v("21")]),s("br"),s("span",{staticClass:"line-number"},[t._v("22")]),s("br"),s("span",{staticClass:"line-number"},[t._v("23")]),s("br"),s("span",{staticClass:"line-number"},[t._v("24")]),s("br"),s("span",{staticClass:"line-number"},[t._v("25")]),s("br"),s("span",{staticClass:"line-number"},[t._v("26")]),s("br"),s("span",{staticClass:"line-number"},[t._v("27")]),s("br"),s("span",{staticClass:"line-number"},[t._v("28")]),s("br"),s("span",{staticClass:"line-number"},[t._v("29")]),s("br")])]),s("p",[t._v("As you can see, the "),s("code",[t._v("proto")]),t._v(" folder contains all the Cosmos-related "),s("code",[t._v(".proto")]),t._v(" files, while the "),s("code",[t._v("third_party")]),t._v(" contains all the "),s("code",[t._v(".proto")]),t._v(" files needed in other to compile the Cosmos ones properly.")]),t._v(" "),s("h3",{attrs:{id:"_2-generate-the-dart-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-generate-the-dart-files"}},[t._v("#")]),t._v(" 2. Generate the "),s("code",[t._v(".dart")]),t._v(" files.")]),t._v(" "),s("p",[t._v("Now that you have your "),s("code",[t._v(".proto")]),t._v(" files ready, it's time to generate the "),s("code",[t._v(".dart")]),t._v(" files that will contain the classes that you will be able to use with Dart.")]),t._v(" "),s("p",[t._v("To do so, the first thing you have to do is to have "),s("code",[t._v("protoc")]),t._v(" installed on your machine, as well as the Dart plugin for Protobuf. If you don't have them installed, you can get them here:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/protocolbuffers/protobuf#protocol-compiler-installation",target:"_blank",rel:"noopener noreferrer"}},[t._v("Protobuf compiler ("),s("code",[t._v("protoc")]),t._v(")"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://pub.dev/packages/protoc_plugin",target:"_blank",rel:"noopener noreferrer"}},[t._v("Dart "),s("code",[t._v("protoc")]),t._v(" plugin"),s("OutboundLink")],1)])]),t._v(" "),s("p",[t._v("Once you have them installed, you can now generate your Dart files running the following script:")]),t._v(" "),s("div",{staticClass:"language-shell line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Define variables")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("OUT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("lib/proto\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("PROTO")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("proto\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("THIRD_PARTY")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("third_party\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Generate the third party Protobuf implementations")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("PROTOC")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"protoc --dart_out=grpc:'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$OUT")]),t._v(" -I"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$THIRD_PARTY")]),t._v('/proto"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("proto_dirs")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$THIRD_PARTY")]),t._v('/proto"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-path")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-prune")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-o")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'*.proto'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-print0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("xargs")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-n1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sort")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uniq")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token for-or-select variable"}},[t._v("dir")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$proto_dirs")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("do")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$PROTOC")]),t._v(" -I"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$THIRD_PARTY")]),t._v("/proto "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("${dir}")]),t._v('"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-maxdepth")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'*.proto'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("done")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Generate the Cosmos Protobuf implementation")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("proto_dirs")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$PROTO")]),t._v('"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-path")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-prune")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-o")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'*.proto'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-print0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("xargs")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-n1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sort")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uniq")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token for-or-select variable"}},[t._v("dir")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$proto_dirs")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("do")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$PROTOC")]),t._v(" -I"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$PROTO")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--gocosmos_out")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("plugins"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("interfacetype+grpc,"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\nMgoogle/protobuf/any.proto"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("github.com/cosmos/cosmos-sdk/codec/types:. "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("${dir}")]),t._v('"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-maxdepth")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'*.proto'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("done")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Remove all .pbserver.dart files as they are unnecessary")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$OUT")]),t._v('"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"*.pbserver.dart"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-type")]),t._v(" f "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-delete")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br"),s("span",{staticClass:"line-number"},[t._v("7")]),s("br"),s("span",{staticClass:"line-number"},[t._v("8")]),s("br"),s("span",{staticClass:"line-number"},[t._v("9")]),s("br"),s("span",{staticClass:"line-number"},[t._v("10")]),s("br"),s("span",{staticClass:"line-number"},[t._v("11")]),s("br"),s("span",{staticClass:"line-number"},[t._v("12")]),s("br"),s("span",{staticClass:"line-number"},[t._v("13")]),s("br"),s("span",{staticClass:"line-number"},[t._v("14")]),s("br"),s("span",{staticClass:"line-number"},[t._v("15")]),s("br"),s("span",{staticClass:"line-number"},[t._v("16")]),s("br"),s("span",{staticClass:"line-number"},[t._v("17")]),s("br"),s("span",{staticClass:"line-number"},[t._v("18")]),s("br"),s("span",{staticClass:"line-number"},[t._v("19")]),s("br"),s("span",{staticClass:"line-number"},[t._v("20")]),s("br"),s("span",{staticClass:"line-number"},[t._v("21")]),s("br"),s("span",{staticClass:"line-number"},[t._v("22")]),s("br"),s("span",{staticClass:"line-number"},[t._v("23")]),s("br")])]),s("p",[t._v("As you can see, this script uses three variables:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("OUT")]),t._v(", which represents the folder inside which all the "),s("code",[t._v(".dart")]),t._v(" files will be put once generated;")]),t._v(" "),s("li",[s("code",[t._v("PROTO")]),t._v(", which is the path to the "),s("code",[t._v(".proto")]),t._v(" files that should be used to generate your custom types;")]),t._v(" "),s("li",[s("code",[t._v("THIRD_PARTY")]),t._v(", which is the folder inside which you have placed third parties' "),s("code",[t._v(".proto")]),t._v(" files.")])]),t._v(" "),s("h2",{attrs:{id:"build-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#build-errors"}},[t._v("#")]),t._v(" Build errors")]),t._v(" "),s("p",[t._v("It might happen that, after you have generated all your files, some errors pop up while building the project. The most commons are the ones like the following:")]),t._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Error when reading 'lib/proto/google/protobuf/timestamp.pb.dart': No such file or directory\nimport '../../google/protobuf/timestamp.pb.dart' as $3;\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br")])]),s("p",[t._v("Such errors appear if you did not include all the required "),s("code",[t._v(".proto")]),t._v(" files inside the "),s("code",[t._v("third_party")]),t._v(" folder. In the example above, we can see that it was not possible to build the project because the "),s("code",[t._v("../google/protobuf/timestamp.pb.dart")]),t._v(" file does not exist.")]),t._v(" "),s("p",[t._v("To solve this problem, the easiest way is to simply download the get "),s("code",[t._v(".proto")]),t._v(" file and put into the appropriate folder. In this case, we should download the "),s("code",[t._v("timestamp.proto")]),t._v(" file and put inside the "),s("code",[t._v("third_party/proto/google/protobuf")]),t._v(" folder:")]),t._v(" "),s("div",{staticClass:"language-shell line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" https://raw.githubusercontent.com/protocolbuffers/protobuf/master/src/google/protobuf/timestamp.proto "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" third_party/proto/google/protobuf/timestamp.proto\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Once we have done so, we can simply re-run our generation script and make sure that everything builds properly.")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("Common missing files")]),t._v(" "),s("p",[t._v("The most common missing files are the ones associated with two external dependencies that are highly used inside Cosmos: Protobuf and the Google APIs. If you are missing one or more files from either of those two projects, you can find all the files here:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/protocolbuffers/protobuf/tree/master/src/google/protobuf",target:"_blank",rel:"noopener noreferrer"}},[t._v("Protobuf"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/googleapis/googleapis",target:"_blank",rel:"noopener noreferrer"}},[t._v("Google APIs"),s("OutboundLink")],1)])])])])}),[],!1,null,null,null);s.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{283:function(t,s,e){"use strict";e.r(s);var a=e(1),r=Object(a.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"working-with-custom-chains"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#working-with-custom-chains"}},[t._v("#")]),t._v(" Working with custom chains")]),t._v(" "),s("p",[t._v("Given Alan.dart now works primarily based on Protobuf, in order to use it with a custom chain you will need to generate the proper files. This will make sure you are able to create transactions containing custom messages or to query the chain for custom modules. Following, you can find how to do this.")]),t._v(" "),s("h2",{attrs:{id:"generating-custom-protobuf-implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#generating-custom-protobuf-implementations"}},[t._v("#")]),t._v(" Generating custom Protobuf implementations")]),t._v(" "),s("h3",{attrs:{id:"_1-get-the-proto-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-get-the-proto-files"}},[t._v("#")]),t._v(" 1. Get the "),s("code",[t._v(".proto")]),t._v(" files")]),t._v(" "),s("p",[t._v("The first thing you have to do is to get the "),s("code",[t._v(".proto")]),t._v(" files necessary to compile everything. Most custom chains include those files into two separate folders: "),s("code",[t._v("proto")]),t._v(" and "),s("code",[t._v("third_party")]),t._v(":")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("inside the "),s("code",[t._v("proto")]),t._v(" folder you can usually find the various "),s("code",[t._v(".proto")]),t._v(" files that are used to generate custom messages, queriers, etc;")])]),t._v(" "),s("li",[s("p",[t._v("inside the "),s("code",[t._v("third_party")]),t._v(", instead, you can find all the other "),s("code",[t._v(".proto")]),t._v(" files that are taken from third party projects (such as Protobuf, Google, Cosmos, etc) and are still required to compile the custom ones.")])])]),t._v(" "),s("p",[t._v("That being said, what you want to do is get those two folders ("),s("code",[t._v("proto")]),t._v(" and "),s("code",[t._v("third_party")]),t._v(") and put them into your project root folder. As an example, this is the folder structure of Alan.dart's root folder:")]),t._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Alan.dart\n├── proto\n│ └── cosmos\n│ ├── auth\n│ ├── bank\n│ ├── base\n│ ├── capability\n│ ├── crisis\n│ ├── crypto\n│ ├── distribution\n│ ├── evidence\n│ ├── genutil\n│ ├── gov\n│ ├── mint\n│ ├── params\n│ ├── slashing\n│ ├── staking\n│ ├── tx\n│ ├── upgrade\n│ └── vesting\n│\n├── third_party\n│ └── proto\n│ ├── confio\n│ ├── cosmos_proto\n│ ├── gogoproto\n│ ├── google\n│ └── tendermint\n├── ...\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br"),s("span",{staticClass:"line-number"},[t._v("7")]),s("br"),s("span",{staticClass:"line-number"},[t._v("8")]),s("br"),s("span",{staticClass:"line-number"},[t._v("9")]),s("br"),s("span",{staticClass:"line-number"},[t._v("10")]),s("br"),s("span",{staticClass:"line-number"},[t._v("11")]),s("br"),s("span",{staticClass:"line-number"},[t._v("12")]),s("br"),s("span",{staticClass:"line-number"},[t._v("13")]),s("br"),s("span",{staticClass:"line-number"},[t._v("14")]),s("br"),s("span",{staticClass:"line-number"},[t._v("15")]),s("br"),s("span",{staticClass:"line-number"},[t._v("16")]),s("br"),s("span",{staticClass:"line-number"},[t._v("17")]),s("br"),s("span",{staticClass:"line-number"},[t._v("18")]),s("br"),s("span",{staticClass:"line-number"},[t._v("19")]),s("br"),s("span",{staticClass:"line-number"},[t._v("20")]),s("br"),s("span",{staticClass:"line-number"},[t._v("21")]),s("br"),s("span",{staticClass:"line-number"},[t._v("22")]),s("br"),s("span",{staticClass:"line-number"},[t._v("23")]),s("br"),s("span",{staticClass:"line-number"},[t._v("24")]),s("br"),s("span",{staticClass:"line-number"},[t._v("25")]),s("br"),s("span",{staticClass:"line-number"},[t._v("26")]),s("br"),s("span",{staticClass:"line-number"},[t._v("27")]),s("br"),s("span",{staticClass:"line-number"},[t._v("28")]),s("br"),s("span",{staticClass:"line-number"},[t._v("29")]),s("br")])]),s("p",[t._v("As you can see, the "),s("code",[t._v("proto")]),t._v(" folder contains all the Cosmos-related "),s("code",[t._v(".proto")]),t._v(" files, while the "),s("code",[t._v("third_party")]),t._v(" contains all the "),s("code",[t._v(".proto")]),t._v(" files needed in other to compile the Cosmos ones properly.")]),t._v(" "),s("h3",{attrs:{id:"_2-generate-the-dart-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-generate-the-dart-files"}},[t._v("#")]),t._v(" 2. Generate the "),s("code",[t._v(".dart")]),t._v(" files.")]),t._v(" "),s("p",[t._v("Now that you have your "),s("code",[t._v(".proto")]),t._v(" files ready, it's time to generate the "),s("code",[t._v(".dart")]),t._v(" files that will contain the classes that you will be able to use with Dart.")]),t._v(" "),s("p",[t._v("To do so, the first thing you have to do is to have "),s("code",[t._v("protoc")]),t._v(" installed on your machine, as well as the Dart plugin for Protobuf. If you don't have them installed, you can get them here:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/protocolbuffers/protobuf#protocol-compiler-installation",target:"_blank",rel:"noopener noreferrer"}},[t._v("Protobuf compiler ("),s("code",[t._v("protoc")]),t._v(")"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://pub.dev/packages/protoc_plugin",target:"_blank",rel:"noopener noreferrer"}},[t._v("Dart "),s("code",[t._v("protoc")]),t._v(" plugin"),s("OutboundLink")],1)])]),t._v(" "),s("p",[t._v("Once you have them installed, you can now generate your Dart files running the following script:")]),t._v(" "),s("div",{staticClass:"language-shell line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Define variables")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("OUT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("lib/proto\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("PROTO")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("proto\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("THIRD_PARTY")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("third_party\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Generate the third party Protobuf implementations")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("PROTOC")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"protoc --dart_out=grpc:'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$OUT")]),t._v(" -I"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$THIRD_PARTY")]),t._v('/proto"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("proto_dirs")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$THIRD_PARTY")]),t._v('/proto"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-path")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-prune")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-o")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'*.proto'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-print0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("xargs")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-n1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sort")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uniq")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token for-or-select variable"}},[t._v("dir")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$proto_dirs")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("do")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$PROTOC")]),t._v(" -I"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$THIRD_PARTY")]),t._v("/proto "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("${dir}")]),t._v('"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-maxdepth")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'*.proto'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("done")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Generate the Cosmos Protobuf implementation")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("proto_dirs")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$PROTO")]),t._v('"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-path")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-prune")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-o")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'*.proto'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-print0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("xargs")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-n1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sort")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uniq")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token for-or-select variable"}},[t._v("dir")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$proto_dirs")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("do")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$PROTOC")]),t._v(" -I"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$PROTO")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--gocosmos_out")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("plugins"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("interfacetype+grpc,"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\nMgoogle/protobuf/any.proto"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("github.com/cosmos/cosmos-sdk/codec/types:. "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("${dir}")]),t._v('"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-maxdepth")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'*.proto'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("done")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Remove all .pbserver.dart files as they are unnecessary")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$OUT")]),t._v('"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"*.pbserver.dart"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-type")]),t._v(" f "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-delete")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br"),s("span",{staticClass:"line-number"},[t._v("7")]),s("br"),s("span",{staticClass:"line-number"},[t._v("8")]),s("br"),s("span",{staticClass:"line-number"},[t._v("9")]),s("br"),s("span",{staticClass:"line-number"},[t._v("10")]),s("br"),s("span",{staticClass:"line-number"},[t._v("11")]),s("br"),s("span",{staticClass:"line-number"},[t._v("12")]),s("br"),s("span",{staticClass:"line-number"},[t._v("13")]),s("br"),s("span",{staticClass:"line-number"},[t._v("14")]),s("br"),s("span",{staticClass:"line-number"},[t._v("15")]),s("br"),s("span",{staticClass:"line-number"},[t._v("16")]),s("br"),s("span",{staticClass:"line-number"},[t._v("17")]),s("br"),s("span",{staticClass:"line-number"},[t._v("18")]),s("br"),s("span",{staticClass:"line-number"},[t._v("19")]),s("br"),s("span",{staticClass:"line-number"},[t._v("20")]),s("br"),s("span",{staticClass:"line-number"},[t._v("21")]),s("br"),s("span",{staticClass:"line-number"},[t._v("22")]),s("br"),s("span",{staticClass:"line-number"},[t._v("23")]),s("br")])]),s("p",[t._v("As you can see, this script uses three variables:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("OUT")]),t._v(", which represents the folder inside which all the "),s("code",[t._v(".dart")]),t._v(" files will be put once generated;")]),t._v(" "),s("li",[s("code",[t._v("PROTO")]),t._v(", which is the path to the "),s("code",[t._v(".proto")]),t._v(" files that should be used to generate your custom types;")]),t._v(" "),s("li",[s("code",[t._v("THIRD_PARTY")]),t._v(", which is the folder inside which you have placed third parties' "),s("code",[t._v(".proto")]),t._v(" files.")])]),t._v(" "),s("h2",{attrs:{id:"build-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#build-errors"}},[t._v("#")]),t._v(" Build errors")]),t._v(" "),s("p",[t._v("It might happen that, after you have generated all your files, some errors pop up while building the project. The most commons are the ones like the following:")]),t._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Error when reading 'lib/proto/google/protobuf/timestamp.pb.dart': No such file or directory\nimport '../../google/protobuf/timestamp.pb.dart' as $3;\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br")])]),s("p",[t._v("Such errors appear if you did not include all the required "),s("code",[t._v(".proto")]),t._v(" files inside the "),s("code",[t._v("third_party")]),t._v(" folder. In the example above, we can see that it was not possible to build the project because the "),s("code",[t._v("../google/protobuf/timestamp.pb.dart")]),t._v(" file does not exist.")]),t._v(" "),s("p",[t._v("To solve this problem, the easiest way is to simply download the get "),s("code",[t._v(".proto")]),t._v(" file and put into the appropriate folder. In this case, we should download the "),s("code",[t._v("timestamp.proto")]),t._v(" file and put inside the "),s("code",[t._v("third_party/proto/google/protobuf")]),t._v(" folder:")]),t._v(" "),s("div",{staticClass:"language-shell line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" https://raw.githubusercontent.com/protocolbuffers/protobuf/master/src/google/protobuf/timestamp.proto "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" third_party/proto/google/protobuf/timestamp.proto\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Once we have done so, we can simply re-run our generation script and make sure that everything builds properly.")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("Common missing files")]),t._v(" "),s("p",[t._v("The most common missing files are the ones associated with two external dependencies that are highly used inside Cosmos: Protobuf and the Google APIs. If you are missing one or more files from either of those two projects, you can find all the files here:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/protocolbuffers/protobuf/tree/master/src/google/protobuf",target:"_blank",rel:"noopener noreferrer"}},[t._v("Protobuf"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/googleapis/googleapis",target:"_blank",rel:"noopener noreferrer"}},[t._v("Google APIs"),s("OutboundLink")],1)])])])])}),[],!1,null,null,null);s.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/9.b70cbdb0.js b/assets/js/9.bbe92e24.js similarity index 99% rename from assets/js/9.b70cbdb0.js rename to assets/js/9.bbe92e24.js index 60e5889d..b3a30f92 100644 --- a/assets/js/9.b70cbdb0.js +++ b/assets/js/9.bbe92e24.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{286:function(t,s,a){"use strict";a.r(s);var r=a(1),e=Object(r.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"cosmos-modules"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#cosmos-modules"}},[t._v("#")]),t._v(" Cosmos modules")]),t._v(" "),s("p",[t._v("Following you can find a list of all the modules that are included inside Alan.dart, and their associated messages and queries included.")]),t._v(" "),s("p",[t._v("Please note that, instead of re-writing the documentation from scratch, if nothing custom has been implemented for the module we will simply link the included messages and querier methods with the Proto files definitions from which they are generated. Such files contain an extended documentation that can be used to properly comprehend everything.")]),t._v(" "),s("h2",{attrs:{id:"included-modules"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#included-modules"}},[t._v("#")]),t._v(" Included modules")]),t._v(" "),s("h3",{attrs:{id:"auth"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#auth"}},[t._v("#")]),t._v(" Auth")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/auth/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/auth/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("Custom x/auth implementations")]),t._v(" "),s("p",[t._v("Alan.dart comes with a couple of custom implementations for the the "),s("code",[t._v("x/auth")]),t._v(" module. Particularly, if you want to deserialize a custom account type of query the details of an account easily you should check out the "),s("RouterLink",{attrs:{to:"/modules/x/auth.html"}},[s("code",[t._v("x/auth")]),t._v(" documentation page")]),t._v(".")],1)]),t._v(" "),s("h3",{attrs:{id:"bank"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bank"}},[t._v("#")]),t._v(" Bank")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/bank/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" bank"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/bank/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/bank/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"crisis"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#crisis"}},[t._v("#")]),t._v(" Crisis")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/crisis/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" crisis"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/crisis/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"distribution"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#distribution"}},[t._v("#")]),t._v(" Distribution")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/distribution/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" distr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/distribution/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/distribution/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"distribution-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#distribution-2"}},[t._v("#")]),t._v(" Distribution")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/gov/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" gov"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/gov/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/gov/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"mint"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mint"}},[t._v("#")]),t._v(" Mint")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/mint/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" mint"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/mint/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"params"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#params"}},[t._v("#")]),t._v(" Params")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/params/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" params"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/params/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"slashing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#slashing"}},[t._v("#")]),t._v(" Slashing")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/slashing/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" slashing"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/slashing/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/slashing/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"staking"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#staking"}},[t._v("#")]),t._v(" Staking")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/staking/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" staking"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/staking/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/staking/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"upgrade"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#upgrade"}},[t._v("#")]),t._v(" Upgrade")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/upgrade/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" upgrade"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/upgrade/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{284:function(t,s,a){"use strict";a.r(s);var r=a(1),e=Object(r.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"cosmos-modules"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#cosmos-modules"}},[t._v("#")]),t._v(" Cosmos modules")]),t._v(" "),s("p",[t._v("Following you can find a list of all the modules that are included inside Alan.dart, and their associated messages and queries included.")]),t._v(" "),s("p",[t._v("Please note that, instead of re-writing the documentation from scratch, if nothing custom has been implemented for the module we will simply link the included messages and querier methods with the Proto files definitions from which they are generated. Such files contain an extended documentation that can be used to properly comprehend everything.")]),t._v(" "),s("h2",{attrs:{id:"included-modules"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#included-modules"}},[t._v("#")]),t._v(" Included modules")]),t._v(" "),s("h3",{attrs:{id:"auth"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#auth"}},[t._v("#")]),t._v(" Auth")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/auth/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/auth/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("Custom x/auth implementations")]),t._v(" "),s("p",[t._v("Alan.dart comes with a couple of custom implementations for the the "),s("code",[t._v("x/auth")]),t._v(" module. Particularly, if you want to deserialize a custom account type of query the details of an account easily you should check out the "),s("RouterLink",{attrs:{to:"/modules/x/auth.html"}},[s("code",[t._v("x/auth")]),t._v(" documentation page")]),t._v(".")],1)]),t._v(" "),s("h3",{attrs:{id:"bank"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bank"}},[t._v("#")]),t._v(" Bank")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/bank/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" bank"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/bank/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/bank/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"crisis"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#crisis"}},[t._v("#")]),t._v(" Crisis")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/crisis/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" crisis"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/crisis/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"distribution"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#distribution"}},[t._v("#")]),t._v(" Distribution")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/distribution/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" distr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/distribution/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/distribution/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"distribution-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#distribution-2"}},[t._v("#")]),t._v(" Distribution")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/gov/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" gov"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/gov/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/gov/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"mint"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mint"}},[t._v("#")]),t._v(" Mint")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/mint/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" mint"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/mint/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"params"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#params"}},[t._v("#")]),t._v(" Params")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/params/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" params"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/params/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"slashing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#slashing"}},[t._v("#")]),t._v(" Slashing")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/slashing/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" slashing"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/slashing/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/slashing/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"staking"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#staking"}},[t._v("#")]),t._v(" Staking")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/staking/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" staking"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/staking/v1beta1/tx.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Messages"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/staking/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])]),t._v(" "),s("h3",{attrs:{id:"upgrade"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#upgrade"}},[t._v("#")]),t._v(" Upgrade")]),t._v(" "),s("p",[t._v("Import:")]),t._v(" "),s("div",{staticClass:"language-dart line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-dart"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-literal"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:alan/proto/cosmos/upgrade/v1beta1/export.dart'")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("as")]),t._v(" upgrade"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("Documentation:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/proto/cosmos/upgrade/v1beta1/query.proto",target:"_blank",rel:"noopener noreferrer"}},[t._v("Querier"),s("OutboundLink")],1)])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/app.9271dc8e.js b/assets/js/app.11deba59.js similarity index 85% rename from assets/js/app.9271dc8e.js rename to assets/js/app.11deba59.js index 31674816..0bb0d844 100644 --- a/assets/js/app.9271dc8e.js +++ b/assets/js/app.11deba59.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var r,a,s=e[0],c=e[1],u=e[2],f=0,p=[];f
'};function o(t,e,n){return tn?n:t}function i(t){return 100*(-1+t)}n.configure=function(t){var e,n;for(e in t)void 0!==(n=t[e])&&t.hasOwnProperty(e)&&(r[e]=n);return this},n.status=null,n.set=function(t){var e=n.isStarted();t=o(t,r.minimum,1),n.status=1===t?null:t;var c=n.render(!e),u=c.querySelector(r.barSelector),l=r.speed,f=r.easing;return c.offsetWidth,a((function(e){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(u,function(t,e,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+i(t)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+i(t)+"%,0)"}:{"margin-left":i(t)+"%"}).transition="all "+e+"ms "+n,o}(t,l,f)),1===t?(s(c,{transition:"none",opacity:1}),c.offsetWidth,setTimeout((function(){s(c,{transition:"all "+l+"ms linear",opacity:0}),setTimeout((function(){n.remove(),e()}),l)}),l)):setTimeout(e,l)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var t=function(){setTimeout((function(){n.status&&(n.trickle(),t())}),r.trickleSpeed)};return r.trickle&&t(),this},n.done=function(t){return t||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(t){var e=n.status;return e?("number"!=typeof t&&(t=(1-e)*o(Math.random()*e,.1,.95)),e=o(e+t,0,.994),n.set(e)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},t=0,e=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===e&&n.start(),t++,e++,r.always((function(){0==--e?(t=0,n.done()):n.set((t-e)/t)})),this):this},n.render=function(t){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var e=document.createElement("div");e.id="nprogress",e.innerHTML=r.template;var o,a=e.querySelector(r.barSelector),c=t?"-100":i(n.status||0),l=document.querySelector(r.parent);return s(a,{transition:"all 0 linear",transform:"translate3d("+c+"%,0,0)"}),r.showSpinner||(o=e.querySelector(r.spinnerSelector))&&p(o),l!=document.body&&u(l,"nprogress-custom-parent"),l.appendChild(e),e},n.remove=function(){l(document.documentElement,"nprogress-busy"),l(document.querySelector(r.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&p(t)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var a=function(){var t=[];function e(){var n=t.shift();n&&n(e)}return function(n){t.push(n),1==t.length&&e()}}(),s=function(){var t=["Webkit","O","Moz","ms"],e={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(t,e){return e.toUpperCase()})),e[n]||(e[n]=function(e){var n=document.body.style;if(e in n)return e;for(var r,o=t.length,i=e.charAt(0).toUpperCase()+e.slice(1);o--;)if((r=t[o]+i)in n)return r;return e}(n))}function r(t,e,r){e=n(e),t.style[e]=r}return function(t,e){var n,o,i=arguments;if(2==i.length)for(n in e)void 0!==(o=e[n])&&e.hasOwnProperty(n)&&r(t,n,o);else r(t,i[1],i[2])}}();function c(t,e){return("string"==typeof t?t:f(t)).indexOf(" "+e+" ")>=0}function u(t,e){var n=f(t),r=n+e;c(n,e)||(t.className=r.substring(1))}function l(t,e){var n,r=f(t);c(t,e)&&(n=r.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))}function f(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function p(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return n})?r.call(e,n,e,t):r)||(t.exports=o)},function(t,e,n){var r=n(4),o=n(46).f,i=n(13),a=n(105),s=n(32),c=n(62),u=n(121);t.exports=function(t,e){var n,l,f,p,d,h=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[h]||s(h,{}):(r[h]||{}).prototype)for(l in e){if(p=e[l],f=t.dontCallGetSet?(d=o(n,l))&&d.value:n[l],!u(v?l:h+(m?".":"#")+l,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;c(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),a(n,l,p,t)}}},function(t,e,n){var r=n(25),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},function(t,e,n){var r=n(2);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(47),o=n(48);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(4),o=n(0),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},function(t,e,n){var r=n(0),o=n(101),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a function")}},function(t,e,n){var r=n(4),o=n(57),i=n(8),a=n(59),s=n(55),c=n(54),u=r.Symbol,l=o("wks"),f=c?u.for||u:u&&u.withoutSetter||a;t.exports=function(t){return i(l,t)||(l[t]=s&&i(u,t)?u[t]:f("Symbol."+t)),l[t]}},function(t,e,n){var r=n(4),o=n(32),i=r["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=i},function(t,e,n){var r=n(4),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},function(t,e,n){var r=n(48),o=Object;t.exports=function(t){return o(r(t))}},function(t,e,n){var r=n(9),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not an object")}},function(t,e,n){var r=n(118);t.exports=function(t){return r(t.length)}},function(t,e,n){var r=n(144),o=n(11),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(t){return o(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=c},function(t,e,n){var r=n(10)(n(7),"Map");t.exports=r},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(164),o=n(171),i=n(173),a=n(174),s=n(175);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var r=n(5),o=n(43),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||(a.test(t)||!i.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var r=n(12),o=n(11);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},function(t,e){t.exports=function(t){return t}},function(t,e,n){"use strict";var r=n(23),o=n(33),i=n(35),a=n(125),s=n(127);r({target:"Array",proto:!0,arity:1,forced:n(2)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=o(this),n=i(e),r=arguments.length;s(n+r);for(var c=0;c0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},function(t,e,n){var r=n(58),o=n(31);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.29.0",mode:r?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(t,e){t.exports=!1},function(t,e,n){var r=n(3),o=0,i=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},function(t,e,n){var r=n(6),o=n(2),i=n(103);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,e){t.exports={}},function(t,e,n){var r=n(8),o=n(112),i=n(46),a=n(16);t.exports=function(t,e,n){for(var s=o(e),c=a.f,u=i.f,l=0;ll))return!1;var p=c.get(t),d=c.get(e);if(p&&d)return p==e&&d==t;var h=-1,v=!0,m=2&n?new r:void 0;for(c.set(t,e),c.set(e,t);++h-1&&t%1==0&&t=0&&Math.floor(e)===e&&isFinite(t)}function v(t){return a(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function m(t){return null==t?"":Array.isArray(t)||p(t)&&t.toString===f?JSON.stringify(t,null,2):String(t)}function y(t){var e=parseFloat(t);return isNaN(e)?t:e}function g(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(r,1)}}var w=Object.prototype.hasOwnProperty;function x(t,e){return w.call(t,e)}function O(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var $=/-(\w)/g,C=O((function(t){return t.replace($,(function(t,e){return e?e.toUpperCase():""}))})),k=O((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),S=/\B([A-Z])/g,j=O((function(t){return t.replace(S,"-$1").toLowerCase()}));var E=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function T(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function A(t,e){for(var n in e)t[n]=e[n];return t}function P(t){for(var e={},n=0;n0,Y=J&&J.indexOf("edge/")>0;J&&J.indexOf("android");var Z=J&&/iphone|ipad|ipod|ios/.test(J);J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J);var tt,et=J&&J.match(/firefox\/(\d+)/),nt={}.watch,rt=!1;if(K)try{var ot={};Object.defineProperty(ot,"passive",{get:function(){rt=!0}}),window.addEventListener("test-passive",null,ot)}catch(t){}var it=function(){return void 0===tt&&(tt=!K&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),tt},at=K&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function st(t){return"function"==typeof t&&/native code/.test(t.toString())}var ct,ut="undefined"!=typeof Symbol&&st(Symbol)&&"undefined"!=typeof Reflect&&st(Reflect.ownKeys);ct="undefined"!=typeof Set&&st(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var lt=null;function ft(t){void 0===t&&(t=null),t||lt&<._scope.off(),lt=t,t&&t._scope.on()}var pt=function(){function t(t,e,n,r,o,i,a,s){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),dt=function(t){void 0===t&&(t="");var e=new pt;return e.text=t,e.isComment=!0,e};function ht(t){return new pt(void 0,void 0,void 0,String(t))}function vt(t){var e=new pt(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var mt=0,yt=[],gt=function(){function t(){this._pending=!1,this.id=mt++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,yt.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));for(var n=0,r=e.length;n0&&(Jt((u=t(u,"".concat(n||"","_").concat(r)))[0])&&Jt(f)&&(p[l]=ht(f.text+u[0].text),u.shift()),p.push.apply(p,u)):c(u)?Jt(f)?p[l]=ht(f.text+u):""!==u&&p.push(ht(u)):Jt(u)&&Jt(f)?p[l]=ht(f.text+u.text):(s(e._isVList)&&a(u.tag)&&i(u.key)&&a(n)&&(u.key="__vlist".concat(n,"_").concat(r,"__")),p.push(u)));return p}(t):void 0}function Jt(t){return a(t)&&a(t.text)&&!1===t.isComment}function Xt(t,e){var n,r,i,s,c=null;if(o(t)||"string"==typeof t)for(c=new Array(t.length),n=0,r=t.length;n0,s=e?!!e.$stable:!a,c=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&o&&o!==r&&c===o.$key&&!a&&!o.$hasNormal)return o;for(var u in i={},e)e[u]&&"$"!==u[0]&&(i[u]=ve(t,n,u,e[u]))}else i={};for(var l in n)l in i||(i[l]=me(n,l));return e&&Object.isExtensible(e)&&(e._normalized=i),H(i,"$stable",s),H(i,"$key",c),H(i,"$hasNormal",a),i}function ve(t,e,n,r){var i=function(){var e=lt;ft(t);var n=arguments.length?r.apply(null,arguments):r({}),i=(n=n&&"object"==typeof n&&!o(n)?[n]:Kt(n))&&n[0];return ft(e),n&&(!i||1===n.length&&i.isComment&&!de(i))?void 0:n};return r.proxy&&Object.defineProperty(e,n,{get:i,enumerable:!0,configurable:!0}),i}function me(t,e){return function(){return t[e]}}function ye(t){return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};H(e,"_v_attr_proxy",!0),ge(e,t.$attrs,r,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||ge(t._listenersProxy={},t.$listeners,r,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||_e(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:E(t.$emit,t),expose:function(e){e&&Object.keys(e).forEach((function(n){return zt(t,e,n)}))}}}function ge(t,e,n,r,o){var i=!1;for(var a in e)a in t?e[a]!==n[a]&&(i=!0):(i=!0,be(t,a,r,o));for(var a in t)a in e||(i=!0,delete t[a]);return i}function be(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function _e(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var we=null;function xe(t,e){return(t.__esModule||ut&&"Module"===t[Symbol.toStringTag])&&(t=t.default),l(t)?e.extend(t):t}function Oe(t){if(o(t))for(var e=0;edocument.createEvent("Event").timeStamp&&(cn=function(){return un.now()})}var ln=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function fn(){var t,e;for(sn=cn(),on=!0,tn.sort(ln),an=0;anan&&tn[n].id>t.id;)n--;tn.splice(n+1,0,t)}else tn.push(t);rn||(rn=!0,De(fn))}}function dn(t,e){if(t){for(var n=Object.create(null),r=ut?Reflect.ownKeys(t):Object.keys(t),o=0;o-1)if(i&&!x(o,"default"))a=!1;else if(""===a||a===j(t)){var c=Rn(String,o.type);(c<0||s-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!d(t)&&t.test(e)}function Xn(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var a=n[i];if(a){var s=a.name;s&&!e(s)&&Qn(n,i,r,o)}}}function Qn(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,_(n,e)}Wn.prototype._init=function(t){var e=this;e._uid=Vn++,e._isVue=!0,e.__v_skip=!0,e._scope=new Ft(!0),e._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=En(Hn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ke(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,o=n&&n.context;t.$slots=fe(e._renderChildren,o),t.$scopedSlots=n?he(t.$parent,n.data.scopedSlots,t.$slots):r,t._c=function(e,n,r,o){return $e(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return $e(t,e,n,r,o,!0)};var i=n&&n.data;At(t,"$attrs",i&&i.attrs||r,null,!0),At(t,"$listeners",e._parentListeners||r,null,!0)}(e),Ze(e,"beforeCreate",void 0,!1),function(t){var e=dn(t.$options.inject,t);e&&(St(!1),Object.keys(e).forEach((function(n){At(t,n,e[n])})),St(!0))}(e),Dn(e),function(t){var e=t.$options.provide;if(e){var n=u(e)?e.call(t):e;if(!l(n))return;for(var r=Bt(t),o=ut?Reflect.ownKeys(n):Object.keys(n),i=0;i1?T(n):n;for(var r=T(arguments,1),o='event handler for "'.concat(t,'"'),i=0,a=n.length;iparseInt(this.max)&&Qn(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Qn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Xn(t,(function(t){return Jn(e,t)}))})),this.$watch("exclude",(function(e){Xn(t,(function(t){return!Jn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Oe(t),n=e&&e.componentOptions;if(n){var r=Kn(n),o=this.include,i=this.exclude;if(o&&(!r||!Jn(o,r))||i&&r&&Jn(i,r))return e;var a=this.cache,s=this.keys,c=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;a[c]?(e.componentInstance=a[c].componentInstance,_(s,c),s.push(c)):(this.vnodeToCache=e,this.keyToCache=c),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return B}};Object.defineProperty(t,"config",e),t.util={warn:xn,extend:A,mergeOptions:En,defineReactive:At},t.set=Pt,t.delete=Lt,t.nextTick=De,t.observable=function(t){return Tt(t),t},t.options=Object.create(null),U.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,A(t.options.components,Zn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=T(arguments,1);return n.unshift(this),u(t.install)?t.install.apply(t,n):u(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=En(this.options,t),this}}(t),Gn(t),function(t){U.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&p(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&u(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Wn),Object.defineProperty(Wn.prototype,"$isServer",{get:it}),Object.defineProperty(Wn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Wn,"FunctionalRenderContext",{value:hn}),Wn.version="2.7.14";var tr=g("style,class"),er=g("input,textarea,option,select,progress"),nr=g("contenteditable,draggable,spellcheck"),rr=g("events,caret,typing,plaintext-only"),or=g("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),ir="http://www.w3.org/1999/xlink",ar=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},sr=function(t){return ar(t)?t.slice(6,t.length):""},cr=function(t){return null==t||!1===t};function ur(t){for(var e=t.data,n=t,r=t;a(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=lr(r.data,e));for(;a(n=n.parent);)n&&n.data&&(e=lr(e,n.data));return function(t,e){if(a(t)||a(e))return fr(t,pr(e));return""}(e.staticClass,e.class)}function lr(t,e){return{staticClass:fr(t.staticClass,e.staticClass),class:a(t.class)?[t.class,e.class]:e.class}}function fr(t,e){return t?e?t+" "+e:t:e||""}function pr(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r-1?Nr(t,e,n):or(e)?cr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):nr(e)?t.setAttribute(e,function(t,e){return cr(e)||"false"===e?"false":"contenteditable"===t&&rr(e)?e:"true"}(e,n)):ar(e)?cr(n)?t.removeAttributeNS(ir,sr(e)):t.setAttributeNS(ir,e,n):Nr(t,e,n)}function Nr(t,e,n){if(cr(n))t.removeAttribute(e);else{if(X&&!Q&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Ir={create:Mr,update:Mr};function Dr(t,e){var n=e.elm,r=e.data,o=t.data;if(!(i(r.staticClass)&&i(r.class)&&(i(o)||i(o.staticClass)&&i(o.class)))){var s=ur(e),c=n._transitionClasses;a(c)&&(s=fr(s,pr(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var zr,Ur={create:Dr,update:Dr};function Fr(t,e,n){var r=zr;return function o(){var i=e.apply(null,arguments);null!==i&&Vr(t,o,n,r)}}var Br=Te&&!(et&&Number(et[1])<=53);function qr(t,e,n,r){if(Br){var o=sn,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}zr.addEventListener(t,e,rt?{capture:n,passive:r}:n)}function Vr(t,e,n,r){(r||zr).removeEventListener(t,e._wrapper||e,n)}function Hr(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};zr=e.elm||t.elm,function(t){if(a(t.__r)){var e=X?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}a(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),Ht(n,r,qr,Vr,Fr,e.context),zr=void 0}}var Wr,Gr={create:Hr,update:Hr,destroy:function(t){return Hr(t,Or)}};function Kr(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,r,o=e.elm,c=t.data.domProps||{},u=e.data.domProps||{};for(n in(a(u.__ob__)||s(u._v_attr_proxy))&&(u=e.data.domProps=A({},u)),c)n in u||(o[n]="");for(n in u){if(r=u[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===c[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=r;var l=i(r)?"":String(r);Jr(o,l)&&(o.value=l)}else if("innerHTML"===n&&vr(o.tagName)&&i(o.innerHTML)){(Wr=Wr||document.createElement("div")).innerHTML="".concat(r,"");for(var f=Wr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;f.firstChild;)o.appendChild(f.firstChild)}else if(r!==c[n])try{o[n]=r}catch(t){}}}}function Jr(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(a(r)){if(r.number)return y(n)!==y(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Xr={create:Kr,update:Kr},Qr=O((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Yr(t){var e=Zr(t.style);return t.staticStyle?A(t.staticStyle,e):e}function Zr(t){return Array.isArray(t)?P(t):"string"==typeof t?Qr(t):t}var to,eo=/^--/,no=/\s*!important$/,ro=function(t,e,n){if(eo.test(e))t.style.setProperty(e,n);else if(no.test(n))t.style.setProperty(j(e),n.replace(no,""),"important");else{var r=io(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(co).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function lo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(co).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function fo(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&A(e,po(t.name||"v")),A(e,t),e}return"string"==typeof t?po(t):void 0}}var po=O((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),ho=K&&!Q,vo="transition",mo="transitionend",yo="animation",go="animationend";ho&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(vo="WebkitTransition",mo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(yo="WebkitAnimation",go="webkitAnimationEnd"));var bo=K?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function _o(t){bo((function(){bo(t)}))}function wo(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),uo(t,e))}function xo(t,e){t._transitionClasses&&_(t._transitionClasses,e),lo(t,e)}function Oo(t,e,n){var r=Co(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s="transition"===o?mo:go,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout((function(){c0&&(n="transition",l=a,f=i.length):"animation"===e?u>0&&(n="animation",l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?"transition":"animation":null)?"transition"===n?i.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:"transition"===n&&$o.test(r[vo+"Property"])}}function ko(t,e){for(;t.length1}function Po(t,e){!0!==e.data.show&&jo(e)}var Lo=function(t){var e,n,r={},u=t.modules,l=t.nodeOps;for(e=0;e<$r.length;++e)for(r[$r[e]]=[],n=0;nh?_(t,i(n[y+1])?null:n[y+1].elm,n,d,y,r):d>y&&x(e,f,h)}(f,v,y,n,u):a(y)?(a(t.text)&&l.setTextContent(f,""),_(f,null,y,0,y.length-1,n)):a(v)?x(v,0,v.length-1):a(t.text)&&l.setTextContent(f,""):t.text!==e.text&&l.setTextContent(f,e.text),a(h)&&a(d=h.hook)&&a(d=d.postpatch)&&d(t,e)}}}function k(t,e,n){if(s(n)&&a(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==i&&(a.selected=i);else if(N(Do(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function Io(t,e){return e.every((function(e){return!N(e,t)}))}function Do(t){return"_value"in t?t._value:t.value}function zo(t){t.target.composing=!0}function Uo(t){t.target.composing&&(t.target.composing=!1,Fo(t.target,"input"))}function Fo(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Bo(t){return!t.componentInstance||t.data&&t.data.transition?t:Bo(t.componentInstance._vnode)}var qo={model:Mo,show:{bind:function(t,e,n){var r=e.value,o=(n=Bo(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,jo(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=Bo(n)).data&&n.data.transition?(n.data.show=!0,r?jo(n,(function(){t.style.display=t.__vOriginalDisplay})):Eo(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},Vo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ho(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ho(Oe(e.children)):t}function Wo(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[C(r)]=o[r];return e}function Go(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Ko=function(t){return t.tag||de(t)},Jo=function(t){return"show"===t.name},Xo={name:"transition",props:Vo,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Ko)).length){0;var r=this.mode;0;var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=Ho(o);if(!i)return o;if(this._leaving)return Go(t,o);var a="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?a+"comment":a+i.tag:c(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var s=(i.data||(i.data={})).transition=Wo(this),u=this._vnode,l=Ho(u);if(i.data.directives&&i.data.directives.some(Jo)&&(i.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,l)&&!de(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},s);if("out-in"===r)return this._leaving=!0,Wt(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Go(t,o);if("in-out"===r){if(de(i))return u;var p,d=function(){p()};Wt(s,"afterEnter",d),Wt(s,"enterCancelled",d),Wt(f,"delayLeave",(function(t){p=t}))}}return o}}},Qo=A({tag:String,moveClass:String},Vo);function Yo(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Zo(t){t.data.newPos=t.elm.getBoundingClientRect()}function ti(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(o,"px)"),i.transitionDuration="0s"}}delete Qo.mode;var ei={Transition:Xo,TransitionGroup:{props:Qo,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Xe(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=Wo(this),s=0;s-1?yr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:yr[t]=/HTMLUnknownElement/.test(e.toString())},A(Wn.options.directives,qo),A(Wn.options.components,ei),Wn.prototype.__patch__=K?Lo:L,Wn.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=dt),Ze(t,"beforeMount"),r=function(){t._update(t._render(),n)},new Ve(t,r,L,{before:function(){t._isMounted&&!t._isDestroyed&&Ze(t,"beforeUpdate")}},!0),n=!1;var o=t._preWatchers;if(o)for(var i=0;i=0&&(e=t.slice(r),t=t.slice(0,r));var o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(o.path||""),u=e&&e.path||"/",l=c.path?xi(c.path,u,n||o.append):u,f=function(t,e,n){void 0===e&&(e={});var r,o=n||ui;try{r=o(t||"")}catch(t){r={}}for(var i in e){var a=e[i];r[i]=Array.isArray(a)?a.map(ci):ci(a)}return r}(c.query,o.query,r&&r.options.parseQuery),p=o.hash||c.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:l,query:f,hash:p}}var qi,Vi=function(){},Hi={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,this.append),i=o.location,a=o.route,s=o.href,c={},u=n.options.linkActiveClass,l=n.options.linkExactActiveClass,f=null==u?"router-link-active":u,p=null==l?"router-link-exact-active":l,d=null==this.activeClass?f:this.activeClass,h=null==this.exactActiveClass?p:this.exactActiveClass,v=a.redirectedFrom?pi(null,Bi(a.redirectedFrom),null,n):a;c[h]=yi(r,v,this.exactPath),c[d]=this.exact||this.exactPath?c[h]:function(t,e){return 0===t.path.replace(fi,"/").indexOf(e.path.replace(fi,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,v);var m=c[h]?this.ariaCurrentValue:null,y=function(t){Wi(t)&&(e.replace?n.replace(i,Vi):n.push(i,Vi))},g={click:Wi};Array.isArray(this.event)?this.event.forEach((function(t){g[t]=y})):g[this.event]=y;var b={class:c},_=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:a,navigate:y,isActive:c[d],isExactActive:c[h]});if(_){if(1===_.length)return _[0];if(_.length>1||!_.length)return 0===_.length?t():t("span",{},_)}if("a"===this.tag)b.on=g,b.attrs={href:s,"aria-current":m};else{var w=function t(e){var n;if(e)for(var r=0;r-1&&(s.params[p]=n.params[p]);return s.path=Fi(l.path,s.params),c(l,s,a)}if(s.path){s.params={};for(var d=0;d-1}function Oa(t,e){return xa(t)&&t._isRouter&&(null==e||t.type===e)}function $a(t,e,n){var r=function(o){o>=t.length?n():t[o]?e(t[o],(function(){r(o+1)})):r(o+1)};r(0)}function Ca(t){return function(e,n,r){var o=!1,i=0,a=null;ka(t,(function(t,e,n,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var c,u=Ea((function(e){var o;((o=e).__esModule||ja&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:qi.extend(e),n.components[s]=e,--i<=0&&r()})),l=Ea((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=xa(t)?t:new Error(e),r(a))}));try{c=t(u,l)}catch(t){l(t)}if(c)if("function"==typeof c.then)c.then(u,l);else{var f=c.component;f&&"function"==typeof f.then&&f.then(u,l)}}})),o||r()}}function ka(t,e){return Sa(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Sa(t){return Array.prototype.concat.apply([],t)}var ja="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ea(t){var e=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var Ta=function(t,e){this.router=t,this.base=function(t){if(!t)if(Gi){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=hi,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Aa(t,e,n,r){var o=ka(t,(function(t,r,o,i){var a=function(t,e){"function"!=typeof t&&(t=qi.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return n(t,r,o,i)})):n(a,r,o,i)}));return Sa(r?o.reverse():o)}function Pa(t,e){if(e)return function(){return t.apply(e,arguments)}}Ta.prototype.listen=function(t){this.cb=t},Ta.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Ta.prototype.onError=function(t){this.errorCbs.push(t)},Ta.prototype.transitionTo=function(t,e,n){var r,o=this;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var i=this.current;this.confirmTransition(r,(function(){o.updateRoute(r),e&&e(r),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(r,i)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(r)})))}),(function(t){n&&n(t),t&&!o.ready&&(Oa(t,ya.redirected)&&i===hi||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},Ta.prototype.confirmTransition=function(t,e,n){var r=this,o=this.current;this.pending=t;var i,a,s=function(t){!Oa(t)&&xa(t)&&(r.errorCbs.length?r.errorCbs.forEach((function(e){e(t)})):console.error(t)),n&&n(t)},c=t.matched.length-1,u=o.matched.length-1;if(yi(t,o)&&c===u&&t.matched[c]===o.matched[u])return this.ensureURL(),t.hash&&ia(this.router,o,t,!1),s(((a=_a(i=o,t,ya.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",a));var l=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,r=ha&&n;r&&this.listeners.push(oa());var o=function(){var n=t.current,o=Ma(t.base);t.current===hi&&o===t._startLocation||t.transitionTo(o,(function(t){r&&ia(e,t,n,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){va(Oi(r.base+t.fullPath)),ia(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){ma(Oi(r.base+t.fullPath)),ia(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(Ma(this.base)!==this.current.fullPath){var e=Oi(this.base+this.current.fullPath);t?va(e):ma(e)}},e.prototype.getCurrentLocation=function(){return Ma(this.base)},e}(Ta);function Ma(t){var e=window.location.pathname,n=e.toLowerCase(),r=t.toLowerCase();return!t||n!==r&&0!==n.indexOf(Oi(r+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Ra=function(t){function e(e,n,r){t.call(this,e,n),r&&function(t){var e=Ma(t);if(!/^\/#/.test(e))return window.location.replace(Oi(t+"/#"+e)),!0}(this.base)||Na()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=ha&&e;n&&this.listeners.push(oa());var r=function(){var e=t.current;Na()&&t.transitionTo(Ia(),(function(r){n&&ia(t.router,r,e,!0),ha||Ua(r.fullPath)}))},o=ha?"popstate":"hashchange";window.addEventListener(o,r),this.listeners.push((function(){window.removeEventListener(o,r)}))}},e.prototype.push=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){za(t.fullPath),ia(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){Ua(t.fullPath),ia(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Ia()!==e&&(t?za(e):Ua(e))},e.prototype.getCurrentLocation=function(){return Ia()},e}(Ta);function Na(){var t=Ia();return"/"===t.charAt(0)||(Ua("/"+t),!1)}function Ia(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Da(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function za(t){ha?va(Da(t)):window.location.hash=t}function Ua(t){ha?ma(Da(t)):window.location.replace(Da(t))}var Fa=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){var t=e.current;e.index=n,e.updateRoute(r),e.router.afterHooks.forEach((function(e){e&&e(r,t)}))}),(function(t){Oa(t,ya.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Ta),Ba=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Xi(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ha&&!1!==t.fallback,this.fallback&&(e="hash"),Gi||(e="abstract"),this.mode=e,e){case"history":this.history=new La(this,t.base);break;case"hash":this.history=new Ra(this,t.base,this.fallback);break;case"abstract":this.history=new Fa(this,t.base);break;default:0}},qa={currentRoute:{configurable:!0}};Ba.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},qa.currentRoute.get=function(){return this.history&&this.history.current},Ba.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var n=this.history;if(n instanceof La||n instanceof Ra){var r=function(t){n.setupListeners(),function(t){var r=n.current,o=e.options.scrollBehavior;ha&&o&&"fullPath"in t&&ia(e,t,r,!1)}(t)};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Ba.prototype.beforeEach=function(t){return Ha(this.beforeHooks,t)},Ba.prototype.beforeResolve=function(t){return Ha(this.resolveHooks,t)},Ba.prototype.afterEach=function(t){return Ha(this.afterHooks,t)},Ba.prototype.onReady=function(t,e){this.history.onReady(t,e)},Ba.prototype.onError=function(t){this.history.onError(t)},Ba.prototype.push=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.push(t,e,n)}));this.history.push(t,e,n)},Ba.prototype.replace=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.replace(t,e,n)}));this.history.replace(t,e,n)},Ba.prototype.go=function(t){this.history.go(t)},Ba.prototype.back=function(){this.go(-1)},Ba.prototype.forward=function(){this.go(1)},Ba.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Ba.prototype.resolve=function(t,e,n){var r=Bi(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?Oi(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}},Ba.prototype.getRoutes=function(){return this.matcher.getRoutes()},Ba.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==hi&&this.history.transitionTo(this.history.getCurrentLocation())},Ba.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==hi&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Ba.prototype,qa);var Va=Ba;function Ha(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Ba.install=function t(e){if(!t.installed||qi!==e){t.installed=!0,qi=e;var n=function(t){return void 0!==t},r=function(t,e){var r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed:function(){r(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",_i),e.component("RouterLink",Hi);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Ba.version="3.6.5",Ba.isNavigationFailure=Oa,Ba.NavigationFailureType=ya,Ba.START_LOCATION=hi,Gi&&window.Vue&&window.Vue.use(Ba);n(96);n(45),n(64);var Wa={NotFound:()=>n.e(6).then(n.bind(null,279)),Layout:()=>Promise.all([n.e(0),n.e(2)]).then(n.bind(null,278))},Ga={"v-0b31104e":()=>n.e(7).then(n.bind(null,282)),"v-81902300":()=>n.e(10).then(n.bind(null,283)),"v-24584d6c":()=>n.e(11).then(n.bind(null,284)),"v-aad7dbfc":()=>n.e(12).then(n.bind(null,285)),"v-1867e38c":()=>n.e(9).then(n.bind(null,286)),"v-10e3165a":()=>n.e(8).then(n.bind(null,287)),"v-0571dfc2":()=>n.e(13).then(n.bind(null,288))};function Ka(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const Ja=/-(\w)/g,Xa=Ka(t=>t.replace(Ja,(t,e)=>e?e.toUpperCase():"")),Qa=/\B([A-Z])/g,Ya=Ka(t=>t.replace(Qa,"-$1").toLowerCase()),Za=Ka(t=>t.charAt(0).toUpperCase()+t.slice(1));function ts(t,e){if(!e)return;if(t(e))return t(e);return e.includes("-")?t(Za(Xa(e))):t(Za(e))||t(Ya(e))}const es=Object.assign({},Wa,Ga),ns=t=>es[t],rs=t=>Ga[t],os=t=>Wa[t],is=t=>Wn.component(t);function as(t){return ts(rs,t)}function ss(t){return ts(os,t)}function cs(t){return ts(ns,t)}function us(t){return ts(is,t)}function ls(...t){return Promise.all(t.filter(t=>t).map(async t=>{if(!us(t)&&cs(t)){const e=await cs(t)();Wn.component(t,e.default)}}))}function fs(t,e){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[t]=e)}var ps=n(89),ds=n.n(ps),hs=n(90),vs=n.n(hs),ms={created(){if(this.siteMeta=this.$site.headTags.filter(([t])=>"meta"===t).map(([t,e])=>e),this.$ssrContext){const e=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(t=e)?t.map(t=>{let e="{e+=` ${n}="${vs()(t[n])}"`}),e+">"}).join("\n "):"",this.$ssrContext.canonicalLink=gs(this.$canonicalUrl)}var t},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const t=this.getMergedMetaTags();this.currentMetaTags=bs(t,this.currentMetaTags)},getMergedMetaTags(){const t=this.$page.frontmatter.meta||[];return ds()([{name:"description",content:this.$description}],t,this.siteMeta,_s)},updateCanonicalLink(){ys(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",gs(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){bs(null,this.currentMetaTags),ys()}};function ys(){const t=document.querySelector("link[rel='canonical']");t&&t.remove()}function gs(t=""){return t?``:""}function bs(t,e){if(e&&[...e].filter(t=>t.parentNode===document.head).forEach(t=>document.head.removeChild(t)),t)return t.map(t=>{const e=document.createElement("meta");return Object.keys(t).forEach(n=>{e.setAttribute(n,t[n])}),document.head.appendChild(e),e})}function _s(t){for(const e of["name","property","itemprop"])if(t.hasOwnProperty(e))return t[e]+e;return JSON.stringify(t)}var ws=n(91),xs={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:n.n(ws)()((function(){this.setActiveHash()}),300),setActiveHash(){const t=[].slice.call(document.querySelectorAll(".sidebar-link")),e=[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(t=>t.hash===e.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),o=window.innerHeight+n;for(let t=0;t=i.parentElement.offsetTop+10&&(!a||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},Os=n(22),$s=n.n(Os),Cs=[ms,xs,{mounted(){$s.a.configure({showSpinner:!1}),this.$router.beforeEach((t,e,n)=>{t.path===e.path||Wn.component(t.name)||$s.a.start(),n()}),this.$router.afterEach(()=>{$s.a.done(),this.isSidebarOpen=!1})}}],ks={name:"GlobalLayout",computed:{layout(){const t=this.getLayout();return fs("layout",t),Wn.component(t)}},methods:{getLayout(){if(this.$page.path){const t=this.$page.frontmatter.layout;return t&&(this.$vuepress.getLayoutAsyncComponent(t)||this.$vuepress.getVueComponent(t))?t:"Layout"}return"NotFound"}}},Ss=n(1),js=Object(Ss.a)(ks,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(t,e,n){switch(e){case"components":t[e]||(t[e]={}),Object.assign(t[e],n);break;case"mixins":t[e]||(t[e]=[]),t[e].push(...n);break;default:throw new Error("Unknown option name.")}}(js,"mixins",Cs);const Es=[{name:"v-0b31104e",path:"/",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-0b31104e").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-81902300",path:"/modules/x/auth.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-81902300").then(n)}},{name:"v-24584d6c",path:"/queries/overview.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-24584d6c").then(n)}},{name:"v-aad7dbfc",path:"/transactions/overview.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-aad7dbfc").then(n)}},{name:"v-1867e38c",path:"/modules/overview.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-1867e38c").then(n)}},{name:"v-10e3165a",path:"/custom-chains/overview.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-10e3165a").then(n)}},{name:"v-0571dfc2",path:"/wallet/overview.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-0571dfc2").then(n)}},{path:"*",component:js}],Ts={title:"Alan.dart",description:"Documentation for the Alan.dart SDK",base:"/alan.dart/",headTags:[["link",{rel:"icon",href:"/alan.dart/assets/logo.png"}],["link",{rel:"apple-touch-icon",sizes:"57x57",href:"/alan.dart/assets/pwa/apple-icon-57x57.png"}],["link",{rel:"apple-touch-icon",sizes:"60x60",href:"/alan.dart/assets/pwa/apple-icon-60x60.png"}],["link",{rel:"apple-touch-icon",sizes:"72x72",href:"/alan.dart/assets/pwa/apple-icon-72x72.png"}],["link",{rel:"apple-touch-icon",sizes:"76x76",href:"/alan.dart/assets/pwa/apple-icon-76x76.png"}],["link",{rel:"apple-touch-icon",sizes:"114x114",href:"/alan.dart/assets/pwa/apple-icon-114x114.png"}],["link",{rel:"apple-touch-icon",sizes:"120x120",href:"/alan.dart/assets/pwa/apple-icon-120x120.png"}],["link",{rel:"apple-touch-icon",sizes:"144x144",href:"/alan.dart/assets/pwa/apple-icon-144x144.png"}],["link",{rel:"apple-touch-icon",sizes:"152x152",href:"/alan.dart/assets/pwa/apple-icon-152x152.png"}],["link",{rel:"apple-touch-icon",sizes:"180x180",href:"/alan.dart/assets/pwa/apple-icon-180x180.png"}],["link",{rel:"icon",type:"image/png",sizes:"192x192",href:"/alan.dart/assets/pwa/android-icon-192x192.png"}],["link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/alan.dart/assets/pwa/favicon-32x32.png"}],["link",{rel:"icon",type:"image/png",sizes:"96x96",href:"/alan.dart/assets/pwa/favicon-96x96.png"}],["link",{rel:"icon",type:"image/png",sizes:"16x16",href:"/alan.dart/assets/pwa/favicon-16x16.png"}],["link",{rel:"manifest",href:"/alan.dart/assets/pwa/manifest.json"}],["meta",{name:"msapplication-TileColor",content:"#ffffff"}],["meta",{name:"msapplication-TileImage",content:"/ms-icon-144x144.png"}],["meta",{name:"theme-color",content:"#ffffff"}],["meta",{property:"og:title",content:"Alan.dart documentation"}],["meta",{property:"og:description",content:"Learn how to use the Alan.dart SDK"}],["meta",{roperty:"og:type",content:"website"}],["meta",{property:"og:locale",content:"en_US"}]],pages:[{frontmatter:{},regularPath:"/",relativePath:"README.md",key:"v-0b31104e",path:"/",headers:[{level:2,title:"Getting started",slug:"getting-started"}],lastUpdated:"5/17/2023, 3:00:54 PM",lastUpdatedTimestamp:1684335654e3},{title:"Auth custom operations",frontmatter:{},regularPath:"/modules/x/auth.html",relativePath:"modules/x/auth.md",key:"v-81902300",path:"/modules/x/auth.html",headers:[{level:2,title:"Query the details of an account",slug:"query-the-details-of-an-account"},{level:2,title:"Working with custom account implementations",slug:"working-with-custom-account-implementations"}],lastUpdated:"5/17/2023, 3:00:54 PM",lastUpdatedTimestamp:1684335654e3},{title:"Queries",frontmatter:{},regularPath:"/queries/overview.html",relativePath:"queries/overview.md",key:"v-24584d6c",path:"/queries/overview.html",headers:[{level:2,title:"1. Get the modules to use",slug:"_1-get-the-modules-to-use"},{level:3,title:"A. Using standard Cosmos modules",slug:"a-using-standard-cosmos-modules"},{level:3,title:"B. Using custom modules",slug:"b-using-custom-modules"},{level:2,title:"2. Build the query clients",slug:"_2-build-the-query-clients"},{level:2,title:"3. Query the data",slug:"_3-query-the-data"},{level:3,title:"Common data",slug:"common-data"}],lastUpdated:"5/17/2023, 3:00:54 PM",lastUpdatedTimestamp:1684335654e3},{title:"Performing a transaction",frontmatter:{},regularPath:"/transactions/overview.html",relativePath:"transactions/overview.md",key:"v-aad7dbfc",path:"/transactions/overview.html",headers:[{level:2,title:"1. Get the modules to use",slug:"_1-get-the-modules-to-use"},{level:3,title:"A. Using standard Cosmos modules",slug:"a-using-standard-cosmos-modules"},{level:3,title:"B. Using custom modules",slug:"b-using-custom-modules"},{level:2,title:"2. Create and sign the transaction",slug:"_2-create-and-sign-the-transaction"},{level:2,title:"3. Send the signed transaction",slug:"_3-send-the-signed-transaction"},{level:3,title:"Send modes",slug:"send-modes"},{level:2,title:"Supported messages",slug:"supported-messages"}],lastUpdated:"5/17/2023, 3:00:54 PM",lastUpdatedTimestamp:1684335654e3},{title:"Cosmos modules",frontmatter:{},regularPath:"/modules/overview.html",relativePath:"modules/overview.md",key:"v-1867e38c",path:"/modules/overview.html",headers:[{level:2,title:"Included modules",slug:"included-modules"},{level:3,title:"Auth",slug:"auth"},{level:3,title:"Bank",slug:"bank"},{level:3,title:"Crisis",slug:"crisis"},{level:3,title:"Distribution",slug:"distribution"},{level:3,title:"Distribution",slug:"distribution-2"},{level:3,title:"Mint",slug:"mint"},{level:3,title:"Params",slug:"params"},{level:3,title:"Slashing",slug:"slashing"},{level:3,title:"Staking",slug:"staking"},{level:3,title:"Upgrade",slug:"upgrade"}],lastUpdated:"5/17/2023, 3:00:54 PM",lastUpdatedTimestamp:1684335654e3},{title:"Working with custom chains",frontmatter:{},regularPath:"/custom-chains/overview.html",relativePath:"custom-chains/overview.md",key:"v-10e3165a",path:"/custom-chains/overview.html",headers:[{level:2,title:"Generating custom Protobuf implementations",slug:"generating-custom-protobuf-implementations"},{level:3,title:"1. Get the .proto files",slug:"_1-get-the-proto-files"},{level:3,title:"2. Generate the .dart files.",slug:"_2-generate-the-dart-files"},{level:2,title:"Build errors",slug:"build-errors"}],lastUpdated:"5/17/2023, 3:00:54 PM",lastUpdatedTimestamp:1684335654e3},{title:"Creating a wallet",frontmatter:{},regularPath:"/wallet/overview.html",relativePath:"wallet/overview.md",key:"v-0571dfc2",path:"/wallet/overview.html",headers:[{level:2,title:"Create a wallet from a mnemonic",slug:"create-a-wallet-from-a-mnemonic"},{level:2,title:"Generate a random wallet",slug:"generate-a-random-wallet"}],lastUpdated:"5/17/2023, 3:00:54 PM",lastUpdatedTimestamp:1684335654e3}],themeConfig:{repo:"alan-sdk/alan.dart",editLinks:!0,docsDir:"docs",docsBranch:"master",editLinkText:"Edit this page on Github",lastUpdated:!0,logo:"/assets/logo.png",nav:[],sidebarDepth:2,sidebar:[["wallet/overview","Creating a wallet"],["transactions/overview","Performing a transaction"],["queries/overview","Querying the chain"],["modules/overview","Supported Cosmos modules"],["custom-chains/overview","Working with custom chains"]]}};n(235);Wn.component("Badge",()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,289))),Wn.component("CodeBlock",()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,280))),Wn.component("CodeGroup",()=>Promise.all([n.e(0),n.e(5)]).then(n.bind(null,281)));n(236);var As=n(92),Ps=n.n(As);Object.prototype.hasOwnProperty;var Ls={name:"TabBar",props:{tabs:Array},inject:["rootTabs"],computed:{barStyle:{get(){let t={},e=0,n=0;const r=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height",o="width"===r?"x":"y",i=t=>t.toLowerCase().replace(/( |^)[a-z]/g,t=>t.toUpperCase());this.tabs.every((t,o)=>{let a=((t,e)=>{const n=((t,e)=>{for(let n=0;n!==t.length;++n)if(e(t[n]))return n;return-1})(t,e);return-1!==n?t[n]:void 0})(this.$parent.$refs.tabs||[],e=>e.id.replace("tab-","")===t.paneName);return!!a&&(t.active?(n=a["client"+i(r)],"width"===r&&this.tabs.length>1&&(n-=0===o||o===this.tabs.length-1?20:40),!1):(e+=a["client"+i(r)],!0))}),"width"===r&&0!==e&&(e+=20);const a=`translate${i(o)}(${e}px)`;return t[r]=n+"px",t.transform=a,t.msTransform=a,t.webkitTransform=a,t}}}},Ms=Object(Ss.a)(Ls,(function(){return(0,this._self._c)("div",{staticClass:"el-tabs__active-bar",class:"is-"+this.rootTabs.tabPosition,style:this.barStyle})}),[],!1,null,null,null).exports,Rs=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n0},t.prototype.connect_=function(){Ns&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Us?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){Ns&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;zs.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),Bs=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),tc="undefined"!=typeof WeakMap?new WeakMap:new Rs,ec=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Fs.getInstance(),r=new Zs(e,n,this);tc.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){ec.prototype[t]=function(){var e;return(e=tc.get(this))[t].apply(e,arguments)}}));var nc=void 0!==Is.ResizeObserver?Is.ResizeObserver:ec;const rc="undefined"==typeof window,oc=function(t){for(let e of t){const t=e.target.__resizeListeners__||[];t.length&&t.forEach(t=>{t()})}};function ic(){}const ac=t=>t.toLowerCase().replace(/( |^)[a-z]/g,t=>t.toUpperCase());var sc={name:"TabNav",components:{TabBar:Ms},inject:["rootTabs"],props:{panes:Array,currentName:String,editable:Boolean,onTabClick:{type:Function,default:ic},onTabRemove:{type:Function,default:ic},type:String,stretch:Boolean},data:()=>({scrollable:!1,navOffset:0,isFocus:!1,focusable:!0}),computed:{navStyle(){return{transform:`translate${-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"X":"Y"}(-${this.navOffset}px)`}},sizeName(){return-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height"}},methods:{scrollPrev(){const t=this.$refs.navScroll["offset"+ac(this.sizeName)],e=this.navOffset;if(!e)return;let n=e>t?e-t:0;this.navOffset=n},scrollNext(){const t=this.$refs.nav["offset"+ac(this.sizeName)],e=this.$refs.navScroll["offset"+ac(this.sizeName)],n=this.navOffset;if(t-n<=e)return;let r=t-n>2*e?n+e:t-e;this.navOffset=r},scrollToActiveTab(){if(!this.scrollable)return;const t=this.$refs.nav,e=this.$el.querySelector(".is-active");if(!e)return;const n=this.$refs.navScroll,r=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=t.offsetWidth-o.width,a=this.navOffset;let s=a;r.lefto.right&&(s=a+r.right-o.right),s=Math.max(s,0),this.navOffset=Math.min(s,i)},update(){if(!this.$refs.nav)return;const t=this.sizeName,e=this.$refs.nav["offset"+ac(t)],n=this.$refs.navScroll["offset"+ac(t)],r=this.navOffset;if(n0&&(this.navOffset=0)},changeTab(t){const e=t.keyCode;let n,r,o;-1!==[37,38,39,40].indexOf(e)&&(o=t.currentTarget.querySelectorAll("[role=tab]"),r=Array.prototype.indexOf.call(o,t.target),n=37===e||38===e?0===r?o.length-1:r-1:r{this.focusable=!0},50)},windowBlurHandler(){this.focusable=!1},windowFocusHandler(){setTimeout(()=>{this.focusable=!0},50)}},updated(){this.update()},render(t){const{type:e,panes:n,editable:r,stretch:o,onTabClick:i,onTabRemove:a,navStyle:s,scrollable:c,scrollNext:u,scrollPrev:l,changeTab:f,setFocus:p,removeFocus:d}=this,h=c?[t("span",{class:["el-tabs__nav-prev",c.prev?"":"is-disabled"],on:{click:l}},["<"]),t("span",{class:["el-tabs__nav-next",c.next?"":"is-disabled"],on:{click:u}},[">"])]:null,v=this._l(n,(e,n)=>{let o=e.name||e.index||n;const s=e.isClosable||r;e.index=""+n;const c=s?t("span",{class:"el-icon-close",on:{click:t=>{a(e,t)}}}):null,u=e.$slots.label||e.label,l=e.active?0:-1;return t("div",{class:{"el-tabs__item":!0,["is-"+this.rootTabs.tabPosition]:!0,"is-active":e.active,"is-disabled":e.disabled,"is-closable":s,"is-focus":this.isFocus},attrs:{id:"tab-"+o,"aria-controls":"pane-"+o,role:"tab","aria-selected":e.active,tabindex:l},key:"tab-"+o,ref:"tabs",refInFor:!0,on:{focus:()=>{p()},blur:()=>{d()},click:t=>{d(),i(e,o,t)},keydown:t=>{!s||46!==t.keyCode&&8!==t.keyCode||a(e,t)}}},[u,c])});return t("div",{class:["el-tabs__nav-wrap",c?"is-scrollable":"","is-"+this.rootTabs.tabPosition]},[h,t("div",{class:["el-tabs__nav-scroll"],ref:"navScroll"},[t("div",{class:["el-tabs__nav","is-"+this.rootTabs.tabPosition,o&&-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"is-stretch":""],ref:"nav",style:s,attrs:{role:"tablist"},on:{keydown:f}},[e?null:t("tab-bar",{attrs:{tabs:n}}),v])])])},mounted(){var t,e;t=this.$el,e=this.update,rc||(t.__resizeListeners__||(t.__resizeListeners__=[],t.__ro__=new nc(oc),t.__ro__.observe(t)),t.__resizeListeners__.push(e)),document.addEventListener("visibilitychange",this.visibilityChangeHandler),window.addEventListener("blur",this.windowBlurHandler),window.addEventListener("focus",this.windowFocusHandler),setTimeout(()=>{this.scrollToActiveTab()},0)},beforeDestroy(){var t,e;this.$el&&this.update&&(t=this.$el,e=this.update,t&&t.__resizeListeners__&&(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||t.__ro__.disconnect())),document.removeEventListener("visibilitychange",this.visibilityChangeHandler),window.removeEventListener("blur",this.windowBlurHandler),window.removeEventListener("focus",this.windowFocusHandler)}},cc={name:"ElTabs",components:{TabNav:Object(Ss.a)(sc,void 0,void 0,!1,null,null,null).exports},props:{type:String,activeName:String,closable:Boolean,addable:Boolean,value:{},editable:Boolean,tabPosition:{type:String,default:"top"},beforeLeave:Function,stretch:Boolean},provide(){return{rootTabs:this}},data(){return{currentName:this.value||this.activeName,panes:[]}},watch:{activeName(t){this.setCurrentName(t)},value(t){this.setCurrentName(t)},currentName(t){this.$refs.nav&&this.$nextTick(()=>{this.$refs.nav.$nextTick(t=>{this.$refs.nav.scrollToActiveTab()})})}},methods:{calcPaneInstances(t=!1){if(this.$slots.default){const e=this.$slots.default.filter(t=>t.tag&&t.componentOptions&&"ElTabPane"===t.componentOptions.Ctor.options.name).map(({componentInstance:t})=>t),n=!(e.length===this.panes.length&&e.every((t,e)=>t===this.panes[e]));(t||n)&&(this.panes=e)}else 0!==this.panes.length&&(this.panes=[])},handleTabClick(t,e,n){t.disabled||(this.setCurrentName(e),this.$emit("tab-click",t,n))},handleTabRemove(t,e){t.disabled||(e.stopPropagation(),this.$emit("edit",t.name,"remove"),this.$emit("tab-remove",t.name))},handleTabAdd(){this.$emit("edit",null,"add"),this.$emit("tab-add")},setCurrentName(t){const e=()=>{this.currentName=t,this.$emit("input",t)};if(this.currentName!==t&&this.beforeLeave){const n=this.beforeLeave(t,this.currentName);n&&n.then?n.then(()=>{e(),this.$refs.nav&&this.$refs.nav.removeFocus()},()=>{}):!1!==n&&e()}else e()}},render(t){let{type:e,handleTabClick:n,handleTabRemove:r,handleTabAdd:o,currentName:i,panes:a,editable:s,addable:c,tabPosition:u,stretch:l}=this;const f=s||c?t("span",{class:"el-tabs__new-tab",on:{click:o,keydown:t=>{13===t.keyCode&&o()}},attrs:{tabindex:"0"}},[t("i",{class:"el-icon-plus"})]):null,p={props:{currentName:i,onTabClick:n,onTabRemove:r,editable:s,type:e,panes:a,stretch:l},ref:"nav"},d=t("div",{class:["el-tabs__header","is-"+u]},[f,t("tab-nav",Ps()([{},p]))]),h=t("div",{class:"el-tabs__content"},[this.$slots.default]);return t("div",{class:{"el-tabs":!0,"el-tabs--card":"card"===e,["el-tabs--"+u]:!0,"el-tabs--border-card":"border-card"===e}},["bottom"!==u?[d,h]:[h,d]])},created(){this.currentName||this.setCurrentName("0"),this.$on("tab-nav-update",this.calcPaneInstances.bind(null,!0))},mounted(){this.calcPaneInstances()},updated(){this.calcPaneInstances()}},uc=Object(Ss.a)(cc,void 0,void 0,!1,null,null,null).exports,lc={name:"ElTabPane",componentName:"ElTabPane",props:{label:String,labelContent:Function,name:String,closable:Boolean,disabled:Boolean,lazy:Boolean},data:()=>({index:null,loaded:!1}),computed:{isClosable(){return this.closable||this.$parent.closable},active(){const t=this.$parent.currentName===(this.name||this.index);return t&&(this.loaded=!0),t},paneName(){return this.name||this.index}},updated(){this.$parent.$emit("tab-nav-update")}},fc=Object(Ss.a)(lc,(function(){var t=this,e=t._self._c;return!t.lazy||t.loaded||t.active?e("div",{directives:[{name:"show",rawName:"v-show",value:t.active,expression:"active"}],staticClass:"el-tab-pane",attrs:{role:"tabpanel","aria-hidden":!t.active,id:"pane-"+t.paneName,"aria-labelledby":"tab-"+t.paneName}},[t._t("default")],2):t._e()}),[],!1,null,null,null).exports,pc=(n(237),[{},({Vue:t})=>{t.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},function(t){const{Vue:e}=t;e.component("Tabs",uc),e.component("Tab",fc)}]),dc=[];class hc extends class{constructor(){this.store=new Wn({data:{state:{}}})}$get(t){return this.store.state[t]}$set(t,e){Wn.set(this.store.state,t,e)}$emit(...t){this.store.$emit(...t)}$on(...t){this.store.$on(...t)}}{}Object.assign(hc.prototype,{getPageAsyncComponent:as,getLayoutAsyncComponent:ss,getAsyncComponent:cs,getVueComponent:us});var vc={install(t){const e=new hc;t.$vuepress=e,t.prototype.$vuepress=e}};function mc(t,e){const n=e.toLowerCase();return t.options.routes.some(t=>t.path.toLowerCase()===n)}var yc={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(t){const e=this.pageKey||this.$parent.$page.key;return fs("pageKey",e),Wn.component(e)||Wn.component(e,as(e)),Wn.component(e)?t(e):t("")}},gc={functional:!0,props:{slotKey:String,required:!0},render:(t,{props:e,slots:n})=>t("div",{class:["content__"+e.slotKey]},n()[e.slotKey])},bc={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},_c=(n(238),n(239),Object(Ss.a)(bc,(function(){var t=this._self._c;return t("span",[t("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[t("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),this._v(" "),t("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),this._v(" "),t("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),wc={functional:!0,render(t,{parent:e,children:n}){if(e._isMounted)return n;e.$once("hook:mounted",()=>{e.$forceUpdate()})}};Wn.config.productionTip=!1,Wn.use(Va),Wn.use(vc),Wn.mixin(function(t,e,n=Wn){!function(t){t.locales&&Object.keys(t.locales).forEach(e=>{t.locales[e].path=e});Object.freeze(t)}(e),n.$vuepress.$set("siteData",e);const r=new(t(n.$vuepress.$get("siteData"))),o=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(r)),i={};return Object.keys(o).reduce((t,e)=>(e.startsWith("$")&&(t[e]=o[e].get),t),i),{computed:i}}(t=>class{setPage(t){this.__page=t}get $site(){return t}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:t={}}=this.$site;let e,n;for(const r in t)"/"===r?n=t[r]:0===this.$page.path.indexOf(r)&&(e=t[r]);return e||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:t}=this.$page.frontmatter;return"string"==typeof t&&t}get $title(){const t=this.$page,{metaTitle:e}=this.$page.frontmatter;if("string"==typeof e)return e;const n=this.$siteTitle,r=t.frontmatter.home?null:t.frontmatter.title||t.title;return n?r?r+" | "+n:n:r||"VuePress"}get $description(){const t=function(t){if(t){const e=t.filter(t=>"description"===t.name)[0];if(e)return e.content}}(this.$page.frontmatter.meta);return t||(this.$page.frontmatter.description||this.$localeConfig.description||this.$site.description||"")}get $lang(){return this.$page.frontmatter.lang||this.$localeConfig.lang||"en-US"}get $localePath(){return this.$localeConfig.path||"/"}get $themeLocaleConfig(){return(this.$site.themeConfig.locales||{})[this.$localePath]||{}}get $page(){return this.__page?this.__page:function(t,e){for(let n=0;nn||(t.hash?!Wn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(t.hash)}:{x:0,y:0})});!function(t){t.beforeEach((e,n,r)=>{if(mc(t,e.path))r();else if(/(\/|\.html)$/.test(e.path))if(/\/$/.test(e.path)){const n=e.path.replace(/\/$/,"")+".html";mc(t,n)?r(n):r()}else r();else{const n=e.path+"/",o=e.path+".html";mc(t,o)?r(o):mc(t,n)?r(n):r()}})}(n);const r={};try{await Promise.all(pc.filter(t=>"function"==typeof t).map(e=>e({Vue:Wn,options:r,router:n,siteData:Ts,isServer:t})))}catch(t){console.error(t)}return{app:new Wn(Object.assign(r,{router:n,render:t=>t("div",{attrs:{id:"app"}},[t("RouterView",{ref:"layout"}),t("div",{class:"global-ui"},dc.map(e=>t(e)))])})),router:n}}(!1).then(({app:t,router:e})=>{e.onReady(()=>{t.$mount("#app")})})}]); \ No newline at end of file +var r=Object.freeze({}),o=Array.isArray;function i(t){return null==t}function a(t){return null!=t}function s(t){return!0===t}function c(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function u(t){return"function"==typeof t}function l(t){return null!==t&&"object"==typeof t}var f=Object.prototype.toString;function p(t){return"[object Object]"===f.call(t)}function d(t){return"[object RegExp]"===f.call(t)}function h(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function v(t){return a(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function m(t){return null==t?"":Array.isArray(t)||p(t)&&t.toString===f?JSON.stringify(t,null,2):String(t)}function y(t){var e=parseFloat(t);return isNaN(e)?t:e}function g(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(r,1)}}var w=Object.prototype.hasOwnProperty;function x(t,e){return w.call(t,e)}function O(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var $=/-(\w)/g,C=O((function(t){return t.replace($,(function(t,e){return e?e.toUpperCase():""}))})),k=O((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),S=/\B([A-Z])/g,j=O((function(t){return t.replace(S,"-$1").toLowerCase()}));var E=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function T(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function A(t,e){for(var n in e)t[n]=e[n];return t}function P(t){for(var e={},n=0;n0,Y=J&&J.indexOf("edge/")>0;J&&J.indexOf("android");var Z=J&&/iphone|ipad|ipod|ios/.test(J);J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J);var tt,et=J&&J.match(/firefox\/(\d+)/),nt={}.watch,rt=!1;if(K)try{var ot={};Object.defineProperty(ot,"passive",{get:function(){rt=!0}}),window.addEventListener("test-passive",null,ot)}catch(t){}var it=function(){return void 0===tt&&(tt=!K&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),tt},at=K&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function st(t){return"function"==typeof t&&/native code/.test(t.toString())}var ct,ut="undefined"!=typeof Symbol&&st(Symbol)&&"undefined"!=typeof Reflect&&st(Reflect.ownKeys);ct="undefined"!=typeof Set&&st(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var lt=null;function ft(t){void 0===t&&(t=null),t||lt&<._scope.off(),lt=t,t&&t._scope.on()}var pt=function(){function t(t,e,n,r,o,i,a,s){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),dt=function(t){void 0===t&&(t="");var e=new pt;return e.text=t,e.isComment=!0,e};function ht(t){return new pt(void 0,void 0,void 0,String(t))}function vt(t){var e=new pt(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var mt=0,yt=[],gt=function(){function t(){this._pending=!1,this.id=mt++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,yt.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));for(var n=0,r=e.length;n0&&(Jt((u=t(u,"".concat(n||"","_").concat(r)))[0])&&Jt(f)&&(p[l]=ht(f.text+u[0].text),u.shift()),p.push.apply(p,u)):c(u)?Jt(f)?p[l]=ht(f.text+u):""!==u&&p.push(ht(u)):Jt(u)&&Jt(f)?p[l]=ht(f.text+u.text):(s(e._isVList)&&a(u.tag)&&i(u.key)&&a(n)&&(u.key="__vlist".concat(n,"_").concat(r,"__")),p.push(u)));return p}(t):void 0}function Jt(t){return a(t)&&a(t.text)&&!1===t.isComment}function Xt(t,e){var n,r,i,s,c=null;if(o(t)||"string"==typeof t)for(c=new Array(t.length),n=0,r=t.length;n0,s=e?!!e.$stable:!a,c=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&o&&o!==r&&c===o.$key&&!a&&!o.$hasNormal)return o;for(var u in i={},e)e[u]&&"$"!==u[0]&&(i[u]=ve(t,n,u,e[u]))}else i={};for(var l in n)l in i||(i[l]=me(n,l));return e&&Object.isExtensible(e)&&(e._normalized=i),H(i,"$stable",s),H(i,"$key",c),H(i,"$hasNormal",a),i}function ve(t,e,n,r){var i=function(){var e=lt;ft(t);var n=arguments.length?r.apply(null,arguments):r({}),i=(n=n&&"object"==typeof n&&!o(n)?[n]:Kt(n))&&n[0];return ft(e),n&&(!i||1===n.length&&i.isComment&&!de(i))?void 0:n};return r.proxy&&Object.defineProperty(e,n,{get:i,enumerable:!0,configurable:!0}),i}function me(t,e){return function(){return t[e]}}function ye(t){return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};H(e,"_v_attr_proxy",!0),ge(e,t.$attrs,r,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||ge(t._listenersProxy={},t.$listeners,r,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||_e(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:E(t.$emit,t),expose:function(e){e&&Object.keys(e).forEach((function(n){return zt(t,e,n)}))}}}function ge(t,e,n,r,o){var i=!1;for(var a in e)a in t?e[a]!==n[a]&&(i=!0):(i=!0,be(t,a,r,o));for(var a in t)a in e||(i=!0,delete t[a]);return i}function be(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function _e(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var we=null;function xe(t,e){return(t.__esModule||ut&&"Module"===t[Symbol.toStringTag])&&(t=t.default),l(t)?e.extend(t):t}function Oe(t){if(o(t))for(var e=0;edocument.createEvent("Event").timeStamp&&(cn=function(){return un.now()})}var ln=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function fn(){var t,e;for(sn=cn(),on=!0,tn.sort(ln),an=0;anan&&tn[n].id>t.id;)n--;tn.splice(n+1,0,t)}else tn.push(t);rn||(rn=!0,De(fn))}}function dn(t,e){if(t){for(var n=Object.create(null),r=ut?Reflect.ownKeys(t):Object.keys(t),o=0;o-1)if(i&&!x(o,"default"))a=!1;else if(""===a||a===j(t)){var c=Rn(String,o.type);(c<0||s-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!d(t)&&t.test(e)}function Xn(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var a=n[i];if(a){var s=a.name;s&&!e(s)&&Qn(n,i,r,o)}}}function Qn(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,_(n,e)}Wn.prototype._init=function(t){var e=this;e._uid=Vn++,e._isVue=!0,e.__v_skip=!0,e._scope=new Ft(!0),e._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=En(Hn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ke(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,o=n&&n.context;t.$slots=fe(e._renderChildren,o),t.$scopedSlots=n?he(t.$parent,n.data.scopedSlots,t.$slots):r,t._c=function(e,n,r,o){return $e(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return $e(t,e,n,r,o,!0)};var i=n&&n.data;At(t,"$attrs",i&&i.attrs||r,null,!0),At(t,"$listeners",e._parentListeners||r,null,!0)}(e),Ze(e,"beforeCreate",void 0,!1),function(t){var e=dn(t.$options.inject,t);e&&(St(!1),Object.keys(e).forEach((function(n){At(t,n,e[n])})),St(!0))}(e),Dn(e),function(t){var e=t.$options.provide;if(e){var n=u(e)?e.call(t):e;if(!l(n))return;for(var r=Bt(t),o=ut?Reflect.ownKeys(n):Object.keys(n),i=0;i1?T(n):n;for(var r=T(arguments,1),o='event handler for "'.concat(t,'"'),i=0,a=n.length;iparseInt(this.max)&&Qn(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Qn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Xn(t,(function(t){return Jn(e,t)}))})),this.$watch("exclude",(function(e){Xn(t,(function(t){return!Jn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Oe(t),n=e&&e.componentOptions;if(n){var r=Kn(n),o=this.include,i=this.exclude;if(o&&(!r||!Jn(o,r))||i&&r&&Jn(i,r))return e;var a=this.cache,s=this.keys,c=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;a[c]?(e.componentInstance=a[c].componentInstance,_(s,c),s.push(c)):(this.vnodeToCache=e,this.keyToCache=c),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return B}};Object.defineProperty(t,"config",e),t.util={warn:xn,extend:A,mergeOptions:En,defineReactive:At},t.set=Pt,t.delete=Lt,t.nextTick=De,t.observable=function(t){return Tt(t),t},t.options=Object.create(null),U.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,A(t.options.components,Zn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=T(arguments,1);return n.unshift(this),u(t.install)?t.install.apply(t,n):u(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=En(this.options,t),this}}(t),Gn(t),function(t){U.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&p(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&u(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Wn),Object.defineProperty(Wn.prototype,"$isServer",{get:it}),Object.defineProperty(Wn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Wn,"FunctionalRenderContext",{value:hn}),Wn.version="2.7.14";var tr=g("style,class"),er=g("input,textarea,option,select,progress"),nr=g("contenteditable,draggable,spellcheck"),rr=g("events,caret,typing,plaintext-only"),or=g("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),ir="http://www.w3.org/1999/xlink",ar=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},sr=function(t){return ar(t)?t.slice(6,t.length):""},cr=function(t){return null==t||!1===t};function ur(t){for(var e=t.data,n=t,r=t;a(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=lr(r.data,e));for(;a(n=n.parent);)n&&n.data&&(e=lr(e,n.data));return function(t,e){if(a(t)||a(e))return fr(t,pr(e));return""}(e.staticClass,e.class)}function lr(t,e){return{staticClass:fr(t.staticClass,e.staticClass),class:a(t.class)?[t.class,e.class]:e.class}}function fr(t,e){return t?e?t+" "+e:t:e||""}function pr(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r-1?Nr(t,e,n):or(e)?cr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):nr(e)?t.setAttribute(e,function(t,e){return cr(e)||"false"===e?"false":"contenteditable"===t&&rr(e)?e:"true"}(e,n)):ar(e)?cr(n)?t.removeAttributeNS(ir,sr(e)):t.setAttributeNS(ir,e,n):Nr(t,e,n)}function Nr(t,e,n){if(cr(n))t.removeAttribute(e);else{if(X&&!Q&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Ir={create:Mr,update:Mr};function Dr(t,e){var n=e.elm,r=e.data,o=t.data;if(!(i(r.staticClass)&&i(r.class)&&(i(o)||i(o.staticClass)&&i(o.class)))){var s=ur(e),c=n._transitionClasses;a(c)&&(s=fr(s,pr(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var zr,Ur={create:Dr,update:Dr};function Fr(t,e,n){var r=zr;return function o(){var i=e.apply(null,arguments);null!==i&&Vr(t,o,n,r)}}var Br=Te&&!(et&&Number(et[1])<=53);function qr(t,e,n,r){if(Br){var o=sn,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}zr.addEventListener(t,e,rt?{capture:n,passive:r}:n)}function Vr(t,e,n,r){(r||zr).removeEventListener(t,e._wrapper||e,n)}function Hr(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};zr=e.elm||t.elm,function(t){if(a(t.__r)){var e=X?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}a(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),Ht(n,r,qr,Vr,Fr,e.context),zr=void 0}}var Wr,Gr={create:Hr,update:Hr,destroy:function(t){return Hr(t,Or)}};function Kr(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,r,o=e.elm,c=t.data.domProps||{},u=e.data.domProps||{};for(n in(a(u.__ob__)||s(u._v_attr_proxy))&&(u=e.data.domProps=A({},u)),c)n in u||(o[n]="");for(n in u){if(r=u[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===c[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=r;var l=i(r)?"":String(r);Jr(o,l)&&(o.value=l)}else if("innerHTML"===n&&vr(o.tagName)&&i(o.innerHTML)){(Wr=Wr||document.createElement("div")).innerHTML="".concat(r,"");for(var f=Wr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;f.firstChild;)o.appendChild(f.firstChild)}else if(r!==c[n])try{o[n]=r}catch(t){}}}}function Jr(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(a(r)){if(r.number)return y(n)!==y(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Xr={create:Kr,update:Kr},Qr=O((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Yr(t){var e=Zr(t.style);return t.staticStyle?A(t.staticStyle,e):e}function Zr(t){return Array.isArray(t)?P(t):"string"==typeof t?Qr(t):t}var to,eo=/^--/,no=/\s*!important$/,ro=function(t,e,n){if(eo.test(e))t.style.setProperty(e,n);else if(no.test(n))t.style.setProperty(j(e),n.replace(no,""),"important");else{var r=io(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(co).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function lo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(co).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function fo(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&A(e,po(t.name||"v")),A(e,t),e}return"string"==typeof t?po(t):void 0}}var po=O((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),ho=K&&!Q,vo="transition",mo="transitionend",yo="animation",go="animationend";ho&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(vo="WebkitTransition",mo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(yo="WebkitAnimation",go="webkitAnimationEnd"));var bo=K?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function _o(t){bo((function(){bo(t)}))}function wo(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),uo(t,e))}function xo(t,e){t._transitionClasses&&_(t._transitionClasses,e),lo(t,e)}function Oo(t,e,n){var r=Co(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s="transition"===o?mo:go,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout((function(){c0&&(n="transition",l=a,f=i.length):"animation"===e?u>0&&(n="animation",l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?"transition":"animation":null)?"transition"===n?i.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:"transition"===n&&$o.test(r[vo+"Property"])}}function ko(t,e){for(;t.length1}function Po(t,e){!0!==e.data.show&&jo(e)}var Lo=function(t){var e,n,r={},u=t.modules,l=t.nodeOps;for(e=0;e<$r.length;++e)for(r[$r[e]]=[],n=0;nh?_(t,i(n[y+1])?null:n[y+1].elm,n,d,y,r):d>y&&x(e,f,h)}(f,v,y,n,u):a(y)?(a(t.text)&&l.setTextContent(f,""),_(f,null,y,0,y.length-1,n)):a(v)?x(v,0,v.length-1):a(t.text)&&l.setTextContent(f,""):t.text!==e.text&&l.setTextContent(f,e.text),a(h)&&a(d=h.hook)&&a(d=d.postpatch)&&d(t,e)}}}function k(t,e,n){if(s(n)&&a(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==i&&(a.selected=i);else if(N(Do(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function Io(t,e){return e.every((function(e){return!N(e,t)}))}function Do(t){return"_value"in t?t._value:t.value}function zo(t){t.target.composing=!0}function Uo(t){t.target.composing&&(t.target.composing=!1,Fo(t.target,"input"))}function Fo(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Bo(t){return!t.componentInstance||t.data&&t.data.transition?t:Bo(t.componentInstance._vnode)}var qo={model:Mo,show:{bind:function(t,e,n){var r=e.value,o=(n=Bo(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,jo(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=Bo(n)).data&&n.data.transition?(n.data.show=!0,r?jo(n,(function(){t.style.display=t.__vOriginalDisplay})):Eo(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},Vo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ho(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ho(Oe(e.children)):t}function Wo(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[C(r)]=o[r];return e}function Go(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Ko=function(t){return t.tag||de(t)},Jo=function(t){return"show"===t.name},Xo={name:"transition",props:Vo,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Ko)).length){0;var r=this.mode;0;var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=Ho(o);if(!i)return o;if(this._leaving)return Go(t,o);var a="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?a+"comment":a+i.tag:c(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var s=(i.data||(i.data={})).transition=Wo(this),u=this._vnode,l=Ho(u);if(i.data.directives&&i.data.directives.some(Jo)&&(i.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,l)&&!de(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},s);if("out-in"===r)return this._leaving=!0,Wt(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Go(t,o);if("in-out"===r){if(de(i))return u;var p,d=function(){p()};Wt(s,"afterEnter",d),Wt(s,"enterCancelled",d),Wt(f,"delayLeave",(function(t){p=t}))}}return o}}},Qo=A({tag:String,moveClass:String},Vo);function Yo(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Zo(t){t.data.newPos=t.elm.getBoundingClientRect()}function ti(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(o,"px)"),i.transitionDuration="0s"}}delete Qo.mode;var ei={Transition:Xo,TransitionGroup:{props:Qo,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Xe(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=Wo(this),s=0;s-1?yr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:yr[t]=/HTMLUnknownElement/.test(e.toString())},A(Wn.options.directives,qo),A(Wn.options.components,ei),Wn.prototype.__patch__=K?Lo:L,Wn.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=dt),Ze(t,"beforeMount"),r=function(){t._update(t._render(),n)},new Ve(t,r,L,{before:function(){t._isMounted&&!t._isDestroyed&&Ze(t,"beforeUpdate")}},!0),n=!1;var o=t._preWatchers;if(o)for(var i=0;i=0&&(e=t.slice(r),t=t.slice(0,r));var o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(o.path||""),u=e&&e.path||"/",l=c.path?xi(c.path,u,n||o.append):u,f=function(t,e,n){void 0===e&&(e={});var r,o=n||ui;try{r=o(t||"")}catch(t){r={}}for(var i in e){var a=e[i];r[i]=Array.isArray(a)?a.map(ci):ci(a)}return r}(c.query,o.query,r&&r.options.parseQuery),p=o.hash||c.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:l,query:f,hash:p}}var qi,Vi=function(){},Hi={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,this.append),i=o.location,a=o.route,s=o.href,c={},u=n.options.linkActiveClass,l=n.options.linkExactActiveClass,f=null==u?"router-link-active":u,p=null==l?"router-link-exact-active":l,d=null==this.activeClass?f:this.activeClass,h=null==this.exactActiveClass?p:this.exactActiveClass,v=a.redirectedFrom?pi(null,Bi(a.redirectedFrom),null,n):a;c[h]=yi(r,v,this.exactPath),c[d]=this.exact||this.exactPath?c[h]:function(t,e){return 0===t.path.replace(fi,"/").indexOf(e.path.replace(fi,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,v);var m=c[h]?this.ariaCurrentValue:null,y=function(t){Wi(t)&&(e.replace?n.replace(i,Vi):n.push(i,Vi))},g={click:Wi};Array.isArray(this.event)?this.event.forEach((function(t){g[t]=y})):g[this.event]=y;var b={class:c},_=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:a,navigate:y,isActive:c[d],isExactActive:c[h]});if(_){if(1===_.length)return _[0];if(_.length>1||!_.length)return 0===_.length?t():t("span",{},_)}if("a"===this.tag)b.on=g,b.attrs={href:s,"aria-current":m};else{var w=function t(e){var n;if(e)for(var r=0;r-1&&(s.params[p]=n.params[p]);return s.path=Fi(l.path,s.params),c(l,s,a)}if(s.path){s.params={};for(var d=0;d-1}function Oa(t,e){return xa(t)&&t._isRouter&&(null==e||t.type===e)}function $a(t,e,n){var r=function(o){o>=t.length?n():t[o]?e(t[o],(function(){r(o+1)})):r(o+1)};r(0)}function Ca(t){return function(e,n,r){var o=!1,i=0,a=null;ka(t,(function(t,e,n,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var c,u=Ea((function(e){var o;((o=e).__esModule||ja&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:qi.extend(e),n.components[s]=e,--i<=0&&r()})),l=Ea((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=xa(t)?t:new Error(e),r(a))}));try{c=t(u,l)}catch(t){l(t)}if(c)if("function"==typeof c.then)c.then(u,l);else{var f=c.component;f&&"function"==typeof f.then&&f.then(u,l)}}})),o||r()}}function ka(t,e){return Sa(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Sa(t){return Array.prototype.concat.apply([],t)}var ja="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ea(t){var e=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var Ta=function(t,e){this.router=t,this.base=function(t){if(!t)if(Gi){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=hi,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Aa(t,e,n,r){var o=ka(t,(function(t,r,o,i){var a=function(t,e){"function"!=typeof t&&(t=qi.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return n(t,r,o,i)})):n(a,r,o,i)}));return Sa(r?o.reverse():o)}function Pa(t,e){if(e)return function(){return t.apply(e,arguments)}}Ta.prototype.listen=function(t){this.cb=t},Ta.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Ta.prototype.onError=function(t){this.errorCbs.push(t)},Ta.prototype.transitionTo=function(t,e,n){var r,o=this;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var i=this.current;this.confirmTransition(r,(function(){o.updateRoute(r),e&&e(r),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(r,i)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(r)})))}),(function(t){n&&n(t),t&&!o.ready&&(Oa(t,ya.redirected)&&i===hi||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},Ta.prototype.confirmTransition=function(t,e,n){var r=this,o=this.current;this.pending=t;var i,a,s=function(t){!Oa(t)&&xa(t)&&(r.errorCbs.length?r.errorCbs.forEach((function(e){e(t)})):console.error(t)),n&&n(t)},c=t.matched.length-1,u=o.matched.length-1;if(yi(t,o)&&c===u&&t.matched[c]===o.matched[u])return this.ensureURL(),t.hash&&ia(this.router,o,t,!1),s(((a=_a(i=o,t,ya.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",a));var l=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,r=ha&&n;r&&this.listeners.push(oa());var o=function(){var n=t.current,o=Ma(t.base);t.current===hi&&o===t._startLocation||t.transitionTo(o,(function(t){r&&ia(e,t,n,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){va(Oi(r.base+t.fullPath)),ia(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){ma(Oi(r.base+t.fullPath)),ia(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(Ma(this.base)!==this.current.fullPath){var e=Oi(this.base+this.current.fullPath);t?va(e):ma(e)}},e.prototype.getCurrentLocation=function(){return Ma(this.base)},e}(Ta);function Ma(t){var e=window.location.pathname,n=e.toLowerCase(),r=t.toLowerCase();return!t||n!==r&&0!==n.indexOf(Oi(r+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Ra=function(t){function e(e,n,r){t.call(this,e,n),r&&function(t){var e=Ma(t);if(!/^\/#/.test(e))return window.location.replace(Oi(t+"/#"+e)),!0}(this.base)||Na()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=ha&&e;n&&this.listeners.push(oa());var r=function(){var e=t.current;Na()&&t.transitionTo(Ia(),(function(r){n&&ia(t.router,r,e,!0),ha||Ua(r.fullPath)}))},o=ha?"popstate":"hashchange";window.addEventListener(o,r),this.listeners.push((function(){window.removeEventListener(o,r)}))}},e.prototype.push=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){za(t.fullPath),ia(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){Ua(t.fullPath),ia(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Ia()!==e&&(t?za(e):Ua(e))},e.prototype.getCurrentLocation=function(){return Ia()},e}(Ta);function Na(){var t=Ia();return"/"===t.charAt(0)||(Ua("/"+t),!1)}function Ia(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Da(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function za(t){ha?va(Da(t)):window.location.hash=t}function Ua(t){ha?ma(Da(t)):window.location.replace(Da(t))}var Fa=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){var t=e.current;e.index=n,e.updateRoute(r),e.router.afterHooks.forEach((function(e){e&&e(r,t)}))}),(function(t){Oa(t,ya.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Ta),Ba=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Xi(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ha&&!1!==t.fallback,this.fallback&&(e="hash"),Gi||(e="abstract"),this.mode=e,e){case"history":this.history=new La(this,t.base);break;case"hash":this.history=new Ra(this,t.base,this.fallback);break;case"abstract":this.history=new Fa(this,t.base);break;default:0}},qa={currentRoute:{configurable:!0}};Ba.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},qa.currentRoute.get=function(){return this.history&&this.history.current},Ba.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var n=this.history;if(n instanceof La||n instanceof Ra){var r=function(t){n.setupListeners(),function(t){var r=n.current,o=e.options.scrollBehavior;ha&&o&&"fullPath"in t&&ia(e,t,r,!1)}(t)};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Ba.prototype.beforeEach=function(t){return Ha(this.beforeHooks,t)},Ba.prototype.beforeResolve=function(t){return Ha(this.resolveHooks,t)},Ba.prototype.afterEach=function(t){return Ha(this.afterHooks,t)},Ba.prototype.onReady=function(t,e){this.history.onReady(t,e)},Ba.prototype.onError=function(t){this.history.onError(t)},Ba.prototype.push=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.push(t,e,n)}));this.history.push(t,e,n)},Ba.prototype.replace=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.replace(t,e,n)}));this.history.replace(t,e,n)},Ba.prototype.go=function(t){this.history.go(t)},Ba.prototype.back=function(){this.go(-1)},Ba.prototype.forward=function(){this.go(1)},Ba.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Ba.prototype.resolve=function(t,e,n){var r=Bi(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?Oi(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}},Ba.prototype.getRoutes=function(){return this.matcher.getRoutes()},Ba.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==hi&&this.history.transitionTo(this.history.getCurrentLocation())},Ba.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==hi&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Ba.prototype,qa);var Va=Ba;function Ha(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Ba.install=function t(e){if(!t.installed||qi!==e){t.installed=!0,qi=e;var n=function(t){return void 0!==t},r=function(t,e){var r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed:function(){r(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",_i),e.component("RouterLink",Hi);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Ba.version="3.6.5",Ba.isNavigationFailure=Oa,Ba.NavigationFailureType=ya,Ba.START_LOCATION=hi,Gi&&window.Vue&&window.Vue.use(Ba);n(96);n(45),n(64);var Wa={NotFound:()=>n.e(6).then(n.bind(null,279)),Layout:()=>Promise.all([n.e(0),n.e(2)]).then(n.bind(null,278))},Ga={"v-0b31104e":()=>n.e(7).then(n.bind(null,282)),"v-10e3165a":()=>n.e(8).then(n.bind(null,283)),"v-1867e38c":()=>n.e(9).then(n.bind(null,284)),"v-24584d6c":()=>n.e(11).then(n.bind(null,285)),"v-aad7dbfc":()=>n.e(12).then(n.bind(null,286)),"v-0571dfc2":()=>n.e(13).then(n.bind(null,287)),"v-81902300":()=>n.e(10).then(n.bind(null,288))};function Ka(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const Ja=/-(\w)/g,Xa=Ka(t=>t.replace(Ja,(t,e)=>e?e.toUpperCase():"")),Qa=/\B([A-Z])/g,Ya=Ka(t=>t.replace(Qa,"-$1").toLowerCase()),Za=Ka(t=>t.charAt(0).toUpperCase()+t.slice(1));function ts(t,e){if(!e)return;if(t(e))return t(e);return e.includes("-")?t(Za(Xa(e))):t(Za(e))||t(Ya(e))}const es=Object.assign({},Wa,Ga),ns=t=>es[t],rs=t=>Ga[t],os=t=>Wa[t],is=t=>Wn.component(t);function as(t){return ts(rs,t)}function ss(t){return ts(os,t)}function cs(t){return ts(ns,t)}function us(t){return ts(is,t)}function ls(...t){return Promise.all(t.filter(t=>t).map(async t=>{if(!us(t)&&cs(t)){const e=await cs(t)();Wn.component(t,e.default)}}))}function fs(t,e){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[t]=e)}var ps=n(89),ds=n.n(ps),hs=n(90),vs=n.n(hs),ms={created(){if(this.siteMeta=this.$site.headTags.filter(([t])=>"meta"===t).map(([t,e])=>e),this.$ssrContext){const e=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(t=e)?t.map(t=>{let e="{e+=` ${n}="${vs()(t[n])}"`}),e+">"}).join("\n "):"",this.$ssrContext.canonicalLink=gs(this.$canonicalUrl)}var t},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const t=this.getMergedMetaTags();this.currentMetaTags=bs(t,this.currentMetaTags)},getMergedMetaTags(){const t=this.$page.frontmatter.meta||[];return ds()([{name:"description",content:this.$description}],t,this.siteMeta,_s)},updateCanonicalLink(){ys(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",gs(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){bs(null,this.currentMetaTags),ys()}};function ys(){const t=document.querySelector("link[rel='canonical']");t&&t.remove()}function gs(t=""){return t?``:""}function bs(t,e){if(e&&[...e].filter(t=>t.parentNode===document.head).forEach(t=>document.head.removeChild(t)),t)return t.map(t=>{const e=document.createElement("meta");return Object.keys(t).forEach(n=>{e.setAttribute(n,t[n])}),document.head.appendChild(e),e})}function _s(t){for(const e of["name","property","itemprop"])if(t.hasOwnProperty(e))return t[e]+e;return JSON.stringify(t)}var ws=n(91),xs={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:n.n(ws)()((function(){this.setActiveHash()}),300),setActiveHash(){const t=[].slice.call(document.querySelectorAll(".sidebar-link")),e=[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(t=>t.hash===e.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),o=window.innerHeight+n;for(let t=0;t=i.parentElement.offsetTop+10&&(!a||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},Os=n(22),$s=n.n(Os),Cs=[ms,xs,{mounted(){$s.a.configure({showSpinner:!1}),this.$router.beforeEach((t,e,n)=>{t.path===e.path||Wn.component(t.name)||$s.a.start(),n()}),this.$router.afterEach(()=>{$s.a.done(),this.isSidebarOpen=!1})}}],ks={name:"GlobalLayout",computed:{layout(){const t=this.getLayout();return fs("layout",t),Wn.component(t)}},methods:{getLayout(){if(this.$page.path){const t=this.$page.frontmatter.layout;return t&&(this.$vuepress.getLayoutAsyncComponent(t)||this.$vuepress.getVueComponent(t))?t:"Layout"}return"NotFound"}}},Ss=n(1),js=Object(Ss.a)(ks,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(t,e,n){switch(e){case"components":t[e]||(t[e]={}),Object.assign(t[e],n);break;case"mixins":t[e]||(t[e]=[]),t[e].push(...n);break;default:throw new Error("Unknown option name.")}}(js,"mixins",Cs);const Es=[{name:"v-0b31104e",path:"/",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-0b31104e").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-10e3165a",path:"/custom-chains/overview.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-10e3165a").then(n)}},{name:"v-1867e38c",path:"/modules/overview.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-1867e38c").then(n)}},{name:"v-24584d6c",path:"/queries/overview.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-24584d6c").then(n)}},{name:"v-aad7dbfc",path:"/transactions/overview.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-aad7dbfc").then(n)}},{name:"v-0571dfc2",path:"/wallet/overview.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-0571dfc2").then(n)}},{name:"v-81902300",path:"/modules/x/auth.html",component:js,beforeEnter:(t,e,n)=>{ls("Layout","v-81902300").then(n)}},{path:"*",component:js}],Ts={title:"Alan.dart",description:"Documentation for the Alan.dart SDK",base:"/alan.dart/",headTags:[["link",{rel:"icon",href:"/alan.dart/assets/logo.png"}],["link",{rel:"apple-touch-icon",sizes:"57x57",href:"/alan.dart/assets/pwa/apple-icon-57x57.png"}],["link",{rel:"apple-touch-icon",sizes:"60x60",href:"/alan.dart/assets/pwa/apple-icon-60x60.png"}],["link",{rel:"apple-touch-icon",sizes:"72x72",href:"/alan.dart/assets/pwa/apple-icon-72x72.png"}],["link",{rel:"apple-touch-icon",sizes:"76x76",href:"/alan.dart/assets/pwa/apple-icon-76x76.png"}],["link",{rel:"apple-touch-icon",sizes:"114x114",href:"/alan.dart/assets/pwa/apple-icon-114x114.png"}],["link",{rel:"apple-touch-icon",sizes:"120x120",href:"/alan.dart/assets/pwa/apple-icon-120x120.png"}],["link",{rel:"apple-touch-icon",sizes:"144x144",href:"/alan.dart/assets/pwa/apple-icon-144x144.png"}],["link",{rel:"apple-touch-icon",sizes:"152x152",href:"/alan.dart/assets/pwa/apple-icon-152x152.png"}],["link",{rel:"apple-touch-icon",sizes:"180x180",href:"/alan.dart/assets/pwa/apple-icon-180x180.png"}],["link",{rel:"icon",type:"image/png",sizes:"192x192",href:"/alan.dart/assets/pwa/android-icon-192x192.png"}],["link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/alan.dart/assets/pwa/favicon-32x32.png"}],["link",{rel:"icon",type:"image/png",sizes:"96x96",href:"/alan.dart/assets/pwa/favicon-96x96.png"}],["link",{rel:"icon",type:"image/png",sizes:"16x16",href:"/alan.dart/assets/pwa/favicon-16x16.png"}],["link",{rel:"manifest",href:"/alan.dart/assets/pwa/manifest.json"}],["meta",{name:"msapplication-TileColor",content:"#ffffff"}],["meta",{name:"msapplication-TileImage",content:"/ms-icon-144x144.png"}],["meta",{name:"theme-color",content:"#ffffff"}],["meta",{property:"og:title",content:"Alan.dart documentation"}],["meta",{property:"og:description",content:"Learn how to use the Alan.dart SDK"}],["meta",{roperty:"og:type",content:"website"}],["meta",{property:"og:locale",content:"en_US"}]],pages:[{frontmatter:{},regularPath:"/",relativePath:"README.md",key:"v-0b31104e",path:"/",headers:[{level:2,title:"Getting started",slug:"getting-started"}],lastUpdated:"12/11/2023, 3:51:22 PM",lastUpdatedTimestamp:1702309882e3},{title:"Working with custom chains",frontmatter:{},regularPath:"/custom-chains/overview.html",relativePath:"custom-chains/overview.md",key:"v-10e3165a",path:"/custom-chains/overview.html",headers:[{level:2,title:"Generating custom Protobuf implementations",slug:"generating-custom-protobuf-implementations"},{level:3,title:"1. Get the .proto files",slug:"_1-get-the-proto-files"},{level:3,title:"2. Generate the .dart files.",slug:"_2-generate-the-dart-files"},{level:2,title:"Build errors",slug:"build-errors"}],lastUpdated:"12/11/2023, 3:51:22 PM",lastUpdatedTimestamp:1702309882e3},{title:"Cosmos modules",frontmatter:{},regularPath:"/modules/overview.html",relativePath:"modules/overview.md",key:"v-1867e38c",path:"/modules/overview.html",headers:[{level:2,title:"Included modules",slug:"included-modules"},{level:3,title:"Auth",slug:"auth"},{level:3,title:"Bank",slug:"bank"},{level:3,title:"Crisis",slug:"crisis"},{level:3,title:"Distribution",slug:"distribution"},{level:3,title:"Distribution",slug:"distribution-2"},{level:3,title:"Mint",slug:"mint"},{level:3,title:"Params",slug:"params"},{level:3,title:"Slashing",slug:"slashing"},{level:3,title:"Staking",slug:"staking"},{level:3,title:"Upgrade",slug:"upgrade"}],lastUpdated:"12/11/2023, 3:51:22 PM",lastUpdatedTimestamp:1702309882e3},{title:"Queries",frontmatter:{},regularPath:"/queries/overview.html",relativePath:"queries/overview.md",key:"v-24584d6c",path:"/queries/overview.html",headers:[{level:2,title:"1. Get the modules to use",slug:"_1-get-the-modules-to-use"},{level:3,title:"A. Using standard Cosmos modules",slug:"a-using-standard-cosmos-modules"},{level:3,title:"B. Using custom modules",slug:"b-using-custom-modules"},{level:2,title:"2. Build the query clients",slug:"_2-build-the-query-clients"},{level:2,title:"3. Query the data",slug:"_3-query-the-data"},{level:3,title:"Common data",slug:"common-data"}],lastUpdated:"12/11/2023, 3:51:22 PM",lastUpdatedTimestamp:1702309882e3},{title:"Performing a transaction",frontmatter:{},regularPath:"/transactions/overview.html",relativePath:"transactions/overview.md",key:"v-aad7dbfc",path:"/transactions/overview.html",headers:[{level:2,title:"1. Get the modules to use",slug:"_1-get-the-modules-to-use"},{level:3,title:"A. Using standard Cosmos modules",slug:"a-using-standard-cosmos-modules"},{level:3,title:"B. Using custom modules",slug:"b-using-custom-modules"},{level:2,title:"2. Create and sign the transaction",slug:"_2-create-and-sign-the-transaction"},{level:2,title:"3. Send the signed transaction",slug:"_3-send-the-signed-transaction"},{level:3,title:"Send modes",slug:"send-modes"},{level:2,title:"Supported messages",slug:"supported-messages"}],lastUpdated:"12/11/2023, 3:51:22 PM",lastUpdatedTimestamp:1702309882e3},{title:"Creating a wallet",frontmatter:{},regularPath:"/wallet/overview.html",relativePath:"wallet/overview.md",key:"v-0571dfc2",path:"/wallet/overview.html",headers:[{level:2,title:"Create a wallet from a mnemonic",slug:"create-a-wallet-from-a-mnemonic"},{level:2,title:"Generate a random wallet",slug:"generate-a-random-wallet"}],lastUpdated:"12/11/2023, 3:51:22 PM",lastUpdatedTimestamp:1702309882e3},{title:"Auth custom operations",frontmatter:{},regularPath:"/modules/x/auth.html",relativePath:"modules/x/auth.md",key:"v-81902300",path:"/modules/x/auth.html",headers:[{level:2,title:"Query the details of an account",slug:"query-the-details-of-an-account"},{level:2,title:"Working with custom account implementations",slug:"working-with-custom-account-implementations"}],lastUpdated:"12/11/2023, 3:51:22 PM",lastUpdatedTimestamp:1702309882e3}],themeConfig:{repo:"alan-sdk/alan.dart",editLinks:!0,docsDir:"docs",docsBranch:"master",editLinkText:"Edit this page on Github",lastUpdated:!0,logo:"/assets/logo.png",nav:[],sidebarDepth:2,sidebar:[["wallet/overview","Creating a wallet"],["transactions/overview","Performing a transaction"],["queries/overview","Querying the chain"],["modules/overview","Supported Cosmos modules"],["custom-chains/overview","Working with custom chains"]]}};n(235);Wn.component("Badge",()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,289))),Wn.component("CodeBlock",()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,280))),Wn.component("CodeGroup",()=>Promise.all([n.e(0),n.e(5)]).then(n.bind(null,281)));n(236);var As=n(92),Ps=n.n(As);Object.prototype.hasOwnProperty;var Ls={name:"TabBar",props:{tabs:Array},inject:["rootTabs"],computed:{barStyle:{get(){let t={},e=0,n=0;const r=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height",o="width"===r?"x":"y",i=t=>t.toLowerCase().replace(/( |^)[a-z]/g,t=>t.toUpperCase());this.tabs.every((t,o)=>{let a=((t,e)=>{const n=((t,e)=>{for(let n=0;n!==t.length;++n)if(e(t[n]))return n;return-1})(t,e);return-1!==n?t[n]:void 0})(this.$parent.$refs.tabs||[],e=>e.id.replace("tab-","")===t.paneName);return!!a&&(t.active?(n=a["client"+i(r)],"width"===r&&this.tabs.length>1&&(n-=0===o||o===this.tabs.length-1?20:40),!1):(e+=a["client"+i(r)],!0))}),"width"===r&&0!==e&&(e+=20);const a=`translate${i(o)}(${e}px)`;return t[r]=n+"px",t.transform=a,t.msTransform=a,t.webkitTransform=a,t}}}},Ms=Object(Ss.a)(Ls,(function(){return(0,this._self._c)("div",{staticClass:"el-tabs__active-bar",class:"is-"+this.rootTabs.tabPosition,style:this.barStyle})}),[],!1,null,null,null).exports,Rs=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n0},t.prototype.connect_=function(){Ns&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Us?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){Ns&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;zs.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),Bs=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),tc="undefined"!=typeof WeakMap?new WeakMap:new Rs,ec=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Fs.getInstance(),r=new Zs(e,n,this);tc.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){ec.prototype[t]=function(){var e;return(e=tc.get(this))[t].apply(e,arguments)}}));var nc=void 0!==Is.ResizeObserver?Is.ResizeObserver:ec;const rc="undefined"==typeof window,oc=function(t){for(let e of t){const t=e.target.__resizeListeners__||[];t.length&&t.forEach(t=>{t()})}};function ic(){}const ac=t=>t.toLowerCase().replace(/( |^)[a-z]/g,t=>t.toUpperCase());var sc={name:"TabNav",components:{TabBar:Ms},inject:["rootTabs"],props:{panes:Array,currentName:String,editable:Boolean,onTabClick:{type:Function,default:ic},onTabRemove:{type:Function,default:ic},type:String,stretch:Boolean},data:()=>({scrollable:!1,navOffset:0,isFocus:!1,focusable:!0}),computed:{navStyle(){return{transform:`translate${-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"X":"Y"}(-${this.navOffset}px)`}},sizeName(){return-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height"}},methods:{scrollPrev(){const t=this.$refs.navScroll["offset"+ac(this.sizeName)],e=this.navOffset;if(!e)return;let n=e>t?e-t:0;this.navOffset=n},scrollNext(){const t=this.$refs.nav["offset"+ac(this.sizeName)],e=this.$refs.navScroll["offset"+ac(this.sizeName)],n=this.navOffset;if(t-n<=e)return;let r=t-n>2*e?n+e:t-e;this.navOffset=r},scrollToActiveTab(){if(!this.scrollable)return;const t=this.$refs.nav,e=this.$el.querySelector(".is-active");if(!e)return;const n=this.$refs.navScroll,r=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=t.offsetWidth-o.width,a=this.navOffset;let s=a;r.lefto.right&&(s=a+r.right-o.right),s=Math.max(s,0),this.navOffset=Math.min(s,i)},update(){if(!this.$refs.nav)return;const t=this.sizeName,e=this.$refs.nav["offset"+ac(t)],n=this.$refs.navScroll["offset"+ac(t)],r=this.navOffset;if(n0&&(this.navOffset=0)},changeTab(t){const e=t.keyCode;let n,r,o;-1!==[37,38,39,40].indexOf(e)&&(o=t.currentTarget.querySelectorAll("[role=tab]"),r=Array.prototype.indexOf.call(o,t.target),n=37===e||38===e?0===r?o.length-1:r-1:r{this.focusable=!0},50)},windowBlurHandler(){this.focusable=!1},windowFocusHandler(){setTimeout(()=>{this.focusable=!0},50)}},updated(){this.update()},render(t){const{type:e,panes:n,editable:r,stretch:o,onTabClick:i,onTabRemove:a,navStyle:s,scrollable:c,scrollNext:u,scrollPrev:l,changeTab:f,setFocus:p,removeFocus:d}=this,h=c?[t("span",{class:["el-tabs__nav-prev",c.prev?"":"is-disabled"],on:{click:l}},["<"]),t("span",{class:["el-tabs__nav-next",c.next?"":"is-disabled"],on:{click:u}},[">"])]:null,v=this._l(n,(e,n)=>{let o=e.name||e.index||n;const s=e.isClosable||r;e.index=""+n;const c=s?t("span",{class:"el-icon-close",on:{click:t=>{a(e,t)}}}):null,u=e.$slots.label||e.label,l=e.active?0:-1;return t("div",{class:{"el-tabs__item":!0,["is-"+this.rootTabs.tabPosition]:!0,"is-active":e.active,"is-disabled":e.disabled,"is-closable":s,"is-focus":this.isFocus},attrs:{id:"tab-"+o,"aria-controls":"pane-"+o,role:"tab","aria-selected":e.active,tabindex:l},key:"tab-"+o,ref:"tabs",refInFor:!0,on:{focus:()=>{p()},blur:()=>{d()},click:t=>{d(),i(e,o,t)},keydown:t=>{!s||46!==t.keyCode&&8!==t.keyCode||a(e,t)}}},[u,c])});return t("div",{class:["el-tabs__nav-wrap",c?"is-scrollable":"","is-"+this.rootTabs.tabPosition]},[h,t("div",{class:["el-tabs__nav-scroll"],ref:"navScroll"},[t("div",{class:["el-tabs__nav","is-"+this.rootTabs.tabPosition,o&&-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"is-stretch":""],ref:"nav",style:s,attrs:{role:"tablist"},on:{keydown:f}},[e?null:t("tab-bar",{attrs:{tabs:n}}),v])])])},mounted(){var t,e;t=this.$el,e=this.update,rc||(t.__resizeListeners__||(t.__resizeListeners__=[],t.__ro__=new nc(oc),t.__ro__.observe(t)),t.__resizeListeners__.push(e)),document.addEventListener("visibilitychange",this.visibilityChangeHandler),window.addEventListener("blur",this.windowBlurHandler),window.addEventListener("focus",this.windowFocusHandler),setTimeout(()=>{this.scrollToActiveTab()},0)},beforeDestroy(){var t,e;this.$el&&this.update&&(t=this.$el,e=this.update,t&&t.__resizeListeners__&&(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||t.__ro__.disconnect())),document.removeEventListener("visibilitychange",this.visibilityChangeHandler),window.removeEventListener("blur",this.windowBlurHandler),window.removeEventListener("focus",this.windowFocusHandler)}},cc={name:"ElTabs",components:{TabNav:Object(Ss.a)(sc,void 0,void 0,!1,null,null,null).exports},props:{type:String,activeName:String,closable:Boolean,addable:Boolean,value:{},editable:Boolean,tabPosition:{type:String,default:"top"},beforeLeave:Function,stretch:Boolean},provide(){return{rootTabs:this}},data(){return{currentName:this.value||this.activeName,panes:[]}},watch:{activeName(t){this.setCurrentName(t)},value(t){this.setCurrentName(t)},currentName(t){this.$refs.nav&&this.$nextTick(()=>{this.$refs.nav.$nextTick(t=>{this.$refs.nav.scrollToActiveTab()})})}},methods:{calcPaneInstances(t=!1){if(this.$slots.default){const e=this.$slots.default.filter(t=>t.tag&&t.componentOptions&&"ElTabPane"===t.componentOptions.Ctor.options.name).map(({componentInstance:t})=>t),n=!(e.length===this.panes.length&&e.every((t,e)=>t===this.panes[e]));(t||n)&&(this.panes=e)}else 0!==this.panes.length&&(this.panes=[])},handleTabClick(t,e,n){t.disabled||(this.setCurrentName(e),this.$emit("tab-click",t,n))},handleTabRemove(t,e){t.disabled||(e.stopPropagation(),this.$emit("edit",t.name,"remove"),this.$emit("tab-remove",t.name))},handleTabAdd(){this.$emit("edit",null,"add"),this.$emit("tab-add")},setCurrentName(t){const e=()=>{this.currentName=t,this.$emit("input",t)};if(this.currentName!==t&&this.beforeLeave){const n=this.beforeLeave(t,this.currentName);n&&n.then?n.then(()=>{e(),this.$refs.nav&&this.$refs.nav.removeFocus()},()=>{}):!1!==n&&e()}else e()}},render(t){let{type:e,handleTabClick:n,handleTabRemove:r,handleTabAdd:o,currentName:i,panes:a,editable:s,addable:c,tabPosition:u,stretch:l}=this;const f=s||c?t("span",{class:"el-tabs__new-tab",on:{click:o,keydown:t=>{13===t.keyCode&&o()}},attrs:{tabindex:"0"}},[t("i",{class:"el-icon-plus"})]):null,p={props:{currentName:i,onTabClick:n,onTabRemove:r,editable:s,type:e,panes:a,stretch:l},ref:"nav"},d=t("div",{class:["el-tabs__header","is-"+u]},[f,t("tab-nav",Ps()([{},p]))]),h=t("div",{class:"el-tabs__content"},[this.$slots.default]);return t("div",{class:{"el-tabs":!0,"el-tabs--card":"card"===e,["el-tabs--"+u]:!0,"el-tabs--border-card":"border-card"===e}},["bottom"!==u?[d,h]:[h,d]])},created(){this.currentName||this.setCurrentName("0"),this.$on("tab-nav-update",this.calcPaneInstances.bind(null,!0))},mounted(){this.calcPaneInstances()},updated(){this.calcPaneInstances()}},uc=Object(Ss.a)(cc,void 0,void 0,!1,null,null,null).exports,lc={name:"ElTabPane",componentName:"ElTabPane",props:{label:String,labelContent:Function,name:String,closable:Boolean,disabled:Boolean,lazy:Boolean},data:()=>({index:null,loaded:!1}),computed:{isClosable(){return this.closable||this.$parent.closable},active(){const t=this.$parent.currentName===(this.name||this.index);return t&&(this.loaded=!0),t},paneName(){return this.name||this.index}},updated(){this.$parent.$emit("tab-nav-update")}},fc=Object(Ss.a)(lc,(function(){var t=this,e=t._self._c;return!t.lazy||t.loaded||t.active?e("div",{directives:[{name:"show",rawName:"v-show",value:t.active,expression:"active"}],staticClass:"el-tab-pane",attrs:{role:"tabpanel","aria-hidden":!t.active,id:"pane-"+t.paneName,"aria-labelledby":"tab-"+t.paneName}},[t._t("default")],2):t._e()}),[],!1,null,null,null).exports,pc=(n(237),[{},({Vue:t})=>{t.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},function(t){const{Vue:e}=t;e.component("Tabs",uc),e.component("Tab",fc)}]),dc=[];class hc extends class{constructor(){this.store=new Wn({data:{state:{}}})}$get(t){return this.store.state[t]}$set(t,e){Wn.set(this.store.state,t,e)}$emit(...t){this.store.$emit(...t)}$on(...t){this.store.$on(...t)}}{}Object.assign(hc.prototype,{getPageAsyncComponent:as,getLayoutAsyncComponent:ss,getAsyncComponent:cs,getVueComponent:us});var vc={install(t){const e=new hc;t.$vuepress=e,t.prototype.$vuepress=e}};function mc(t,e){const n=e.toLowerCase();return t.options.routes.some(t=>t.path.toLowerCase()===n)}var yc={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(t){const e=this.pageKey||this.$parent.$page.key;return fs("pageKey",e),Wn.component(e)||Wn.component(e,as(e)),Wn.component(e)?t(e):t("")}},gc={functional:!0,props:{slotKey:String,required:!0},render:(t,{props:e,slots:n})=>t("div",{class:["content__"+e.slotKey]},n()[e.slotKey])},bc={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},_c=(n(238),n(239),Object(Ss.a)(bc,(function(){var t=this._self._c;return t("span",[t("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[t("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),this._v(" "),t("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),this._v(" "),t("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),wc={functional:!0,render(t,{parent:e,children:n}){if(e._isMounted)return n;e.$once("hook:mounted",()=>{e.$forceUpdate()})}};Wn.config.productionTip=!1,Wn.use(Va),Wn.use(vc),Wn.mixin(function(t,e,n=Wn){!function(t){t.locales&&Object.keys(t.locales).forEach(e=>{t.locales[e].path=e});Object.freeze(t)}(e),n.$vuepress.$set("siteData",e);const r=new(t(n.$vuepress.$get("siteData"))),o=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(r)),i={};return Object.keys(o).reduce((t,e)=>(e.startsWith("$")&&(t[e]=o[e].get),t),i),{computed:i}}(t=>class{setPage(t){this.__page=t}get $site(){return t}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:t={}}=this.$site;let e,n;for(const r in t)"/"===r?n=t[r]:0===this.$page.path.indexOf(r)&&(e=t[r]);return e||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:t}=this.$page.frontmatter;return"string"==typeof t&&t}get $title(){const t=this.$page,{metaTitle:e}=this.$page.frontmatter;if("string"==typeof e)return e;const n=this.$siteTitle,r=t.frontmatter.home?null:t.frontmatter.title||t.title;return n?r?r+" | "+n:n:r||"VuePress"}get $description(){const t=function(t){if(t){const e=t.filter(t=>"description"===t.name)[0];if(e)return e.content}}(this.$page.frontmatter.meta);return t||(this.$page.frontmatter.description||this.$localeConfig.description||this.$site.description||"")}get $lang(){return this.$page.frontmatter.lang||this.$localeConfig.lang||"en-US"}get $localePath(){return this.$localeConfig.path||"/"}get $themeLocaleConfig(){return(this.$site.themeConfig.locales||{})[this.$localePath]||{}}get $page(){return this.__page?this.__page:function(t,e){for(let n=0;nn||(t.hash?!Wn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(t.hash)}:{x:0,y:0})});!function(t){t.beforeEach((e,n,r)=>{if(mc(t,e.path))r();else if(/(\/|\.html)$/.test(e.path))if(/\/$/.test(e.path)){const n=e.path.replace(/\/$/,"")+".html";mc(t,n)?r(n):r()}else r();else{const n=e.path+"/",o=e.path+".html";mc(t,o)?r(o):mc(t,n)?r(n):r()}})}(n);const r={};try{await Promise.all(pc.filter(t=>"function"==typeof t).map(e=>e({Vue:Wn,options:r,router:n,siteData:Ts,isServer:t})))}catch(t){console.error(t)}return{app:new Wn(Object.assign(r,{router:n,render:t=>t("div",{attrs:{id:"app"}},[t("RouterView",{ref:"layout"}),t("div",{class:"global-ui"},dc.map(e=>t(e)))])})),router:n}}(!1).then(({app:t,router:e})=>{e.onReady(()=>{t.$mount("#app")})})}]); \ No newline at end of file diff --git a/custom-chains/overview.html b/custom-chains/overview.html index 9fb75935..7b2004c4 100644 --- a/custom-chains/overview.html +++ b/custom-chains/overview.html @@ -29,7 +29,7 @@ - + @@ -92,11 +92,11 @@
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

As you can see, this script uses three variables:

# Build errors

It might happen that, after you have generated all your files, some errors pop up while building the project. The most commons are the ones like the following:

Error when reading 'lib/proto/google/protobuf/timestamp.pb.dart': No such file or directory
 import '../../google/protobuf/timestamp.pb.dart' as $3;
 
1
2

Such errors appear if you did not include all the required .proto files inside the third_party folder. In the example above, we can see that it was not possible to build the project because the ../google/protobuf/timestamp.pb.dart file does not exist.

To solve this problem, the easiest way is to simply download the get .proto file and put into the appropriate folder. In this case, we should download the timestamp.proto file and put inside the third_party/proto/google/protobuf folder:

curl https://raw.githubusercontent.com/protocolbuffers/protobuf/master/src/google/protobuf/timestamp.proto > third_party/proto/google/protobuf/timestamp.proto
-
1

Once we have done so, we can simply re-run our generation script and make sure that everything builds properly.

Common missing files

The most common missing files are the ones associated with two external dependencies that are highly used inside Cosmos: Protobuf and the Google APIs. If you are missing one or more files from either of those two projects, you can find all the files here:

Once we have done so, we can simply re-run our generation script and make sure that everything builds properly.

Common missing files

The most common missing files are the ones associated with two external dependencies that are highly used inside Cosmos: Protobuf and the Google APIs. If you are missing one or more files from either of those two projects, you can find all the files here:

- + diff --git a/index.html b/index.html index 95209ed7..55ec1192 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@ - + @@ -38,7 +38,7 @@ (opens new window)
Alan.dart logo

Alan.dart is a pure Dart package allowing you to easily integrate your Dart-based project with any Cosmos (opens new window)-based blockchain.

It contains a set of utility methods and classes allowing you to easily

  • create an HD Wallet
  • create a transaction
  • sign a transaction
  • broadcast a transaction
  • ...and many more!

Being it in pure Dart means that you can use it inside your Dart Web (opens new window) projects -as well as Flutter (opens new window) ones.

Note

Alan.dart is an evolution of Sacco.dart (opens new window) which I personally worked on. Due to the fact that Sacco.dart is no longer maintained by Commercio.network and I no longer work there, I decided to start this new project to support future mobile apps development for Cosmos-based chains.

# Getting started

  1. Managing a wallet
  2. Performing transactions
  3. Querying the chain
  4. Working with custom chains
- +as well as Flutter (opens new window) ones.

Note

Alan.dart is an evolution of Sacco.dart (opens new window) which I personally worked on. Due to the fact that Sacco.dart is no longer maintained by Commercio.network and I no longer work there, I decided to start this new project to support future mobile apps development for Cosmos-based chains.

# Getting started

  1. Managing a wallet
  2. Performing transactions
  3. Querying the chain
  4. Working with custom chains
+ diff --git a/modules/overview.html b/modules/overview.html index e367df89..888fcba0 100644 --- a/modules/overview.html +++ b/modules/overview.html @@ -29,7 +29,7 @@ - + @@ -47,7 +47,7 @@
1

Documentation:

# Slashing

Import:

import 'package:alan/proto/cosmos/slashing/v1beta1/export.dart' as slashing;
 
1

Documentation:

# Staking

Import:

import 'package:alan/proto/cosmos/staking/v1beta1/export.dart' as staking;
 
1

Documentation:

# Upgrade

Import:

import 'package:alan/proto/cosmos/upgrade/v1beta1/export.dart' as upgrade;
-
1

Documentation:

Documentation:

- + diff --git a/modules/x/auth.html b/modules/x/auth.html index e0aa7fd1..e8178cb7 100644 --- a/modules/x/auth.html +++ b/modules/x/auth.html @@ -29,7 +29,7 @@ - + @@ -78,7 +78,7 @@
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

Once you have created your custom class, you can now register it as an AccountI implementation:

final implementation = AccountImpl('IBCAccount', IBCAccount.fromAny);
 Codec.registerAccountImpl(implementation);
 
1
2

From this point onwards, you will be able to deserialize the account properly:

Codec.deserializeAccount(any);
-
1

Querying a custom account

Since this method is also called when querying an account, you should call it before querying the details of an account that is represented by a custom type in order to avoid any error.

- +
1

Querying a custom account

Since this method is also called when querying an account, you should call it before querying the details of an account that is represented by a custom type in order to avoid any error.

+ diff --git a/queries/overview.html b/queries/overview.html index 498d75b5..3f96182f 100644 --- a/queries/overview.html +++ b/queries/overview.html @@ -29,7 +29,7 @@ - + @@ -76,7 +76,7 @@
1
2
3

In general, the formula to compute the offset given a non-zero page number (starting from 1) should be

offset = (page - 1) * limit
 
1

# Height

All queries support specifying a block height to query for. This is done using gRPC headers, and in particular the custom one named x-cosmos-block-height. To use this properly, you need to include this header inside a CallOptions object. To make this simpler, Alan.dart provides you with a helper method to build it simply:

final heightOption = GrpcHeaders.height(100);
 
1

Once you created the header, you can use it simply by passing it to the query client method that you want to use:

final response = await stakingClient.validators(request, heightOption);
-
1
- + diff --git a/transactions/overview.html b/transactions/overview.html index c42460e0..eaa2cefa 100644 --- a/transactions/overview.html +++ b/transactions/overview.html @@ -29,7 +29,7 @@ - + @@ -105,7 +105,7 @@
1
2
3
4
5
6
7
8
9

# Send modes

The following broadcast modes are available:

# Supported messages

In order to see a list of supported messages that are built into Alan.dart, please see the modules page.

If you want to use a custom message type instead, visit the custom chains page.

- + diff --git a/wallet/overview.html b/wallet/overview.html index 8e7810ce..d4da7a04 100644 --- a/wallet/overview.html +++ b/wallet/overview.html @@ -29,7 +29,7 @@ - + @@ -86,11 +86,11 @@ networkInfo, derivationPath: "m/44'/118'/0'/0/0", // Optional - Default m/44'/118'/0'/0/0 ); -
1
2
3
4
5
6
7
8
9
10
11
- +