{"_id":"trustlessjs","_rev":"66-ccf1b06331369924b42b06a9bf79e996","name":"trustlessjs","dist-tags":{"latest":"0.7.4-alpha.5","alpha":"1.2.4-alpha.12","beta":"1.2.3-beta.1"},"versions":{"0.17.5":{"name":"trustlessjs","version":"0.17.5","description":"CosmWasm SDK + Encryption for the Trustless Hub","author":{"name":"Ethan Frey","email":"ethanfrey@users.noreply.github.com"},"contributors":[{"name":"Enigma","email":"info@enigma.co","url":"https://github.com/enigmampc"},{"name":"TRST Labs"}],"license":"Apache-2.0","main":"build/index.js","types":"types/index.d.ts","repository":{"type":"git","url":"https://github.com/trstlabs/TrustlessJS/blob/master/packages/sdk"},"publishConfig":{"access":"public"},"scripts":{"docs":"shx rm -rf docs && typedoc --options typedoc.js","format":"prettier --write --loglevel warn \"./src/**/*.ts\"","lint":"eslint --max-warnings 0 \"**/*.{js,ts}\"","lint-fix":"eslint --max-warnings 0 \"**/*.{js,ts}\" --fix","move-types":"shx rm -rf ./types/* && shx mv build/types/* ./types && rm -rf ./types/testdata && shx rm -f ./types/*.spec.d.ts","format-types":"prettier --write --loglevel warn \"./types/**/*.d.ts\"","build":"shx rm -rf ./build && tsc && npm run move-types && npm run format-types && cp ./src/ProtoDefs.js ./build","build-or-skip":"[ -n \"$SKIP_BUILD\" ] || npm run build","test-node":"node jasmine-testrunner.js","test-firefox":"npm run pack-web && karma start --single-run --browsers Firefox","test-chrome":"npm run pack-web && karma start --single-run --browsers ChromeHeadlessInsecure","test":"npm run build-or-skip && npm run test-node","pack-web":"npm run build-or-skip && webpack --mode development --config webpack.web.config.js"},"dependencies":{"@iov/crypto":"2.1.0","@iov/encoding":"2.1.0","@iov/utils":"2.0.2","axios":"0.21.1","curve25519-js":"0.0.4","fast-deep-equal":"3.1.1","js-crypto-hkdf":"0.7.3","miscreant":"0.3.2","pako":"1.0.11","secure-random":"1.1.2","protobufjs":"^6.11.2"},"devDependencies":{"@types/node-localstorage":"1.3.0","@types/pako":"1.0.1","@types/q":"1.5.4","readonly-date":"1.0.0"},"keywords":["trustless","hub","trst"],"gitHead":"9e1edbbb03143a8f507519c5daa0bb6899d8462f","_id":"trustlessjs@0.17.5","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-z3Mm4+9+zXxNYqlf/RwmZQUjX+PEPxmjab2z3UCqBtAVhJy/7h7iko0aK1ggA2NIMEXqb4LfMvb1U8suDny2tQ==","shasum":"7eb00819b07a5a275d1b8b1f7938502545530bc9","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.17.5.tgz","fileCount":19,"unpackedSize":34255,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJP02ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqfbQ//TAgJ8L9iXpAzPokczJ6ceaef4R1BKXVx72N/L34bvfA6JtnJ\r\n7rlvf0GCGTFKLkB4WuUUq/XAw4GqEfXANKoAIZUm7ALF2t32ORwNsDohwO6C\r\nR/Equ3c+5ZfLzgV2F3I7IgDbJqoNVCQcSpc6/lJYC5ATntJDBDiZxfUhkVZl\r\n+vxv45X3dJaXBe42iiqDsusuu1GeWDeeDTQI6dcDvpyteKifh2bvkvgHNOUs\r\n2pyzeZOy1Tg5HMA00xygYSVQH0MKLIEm0r8WdXFBkwIG43snlFFh+OVRyjxZ\r\ndtpN79tH7UJwc9nw2Jy27hga7OX+KZ3lWCM4U3ITnjUFRdHHhXflJLXdIK9T\r\nAqmR8pd7oHzqyjEbCc8VXdpffbi4D2LU5aCgF8MCkK9hdRai8TNaangzQ2SV\r\nSRa4iB1bMnfOocWmI802SJBbpYTPk1EzR+pc4JCBmHyaaJv3jmqrSh+2A9ox\r\nOq8yRd4oEe7sXtNibanJA2aLDffR+CFMnqT2chgvzPMj/+YYo+BjQ7f1ZUL1\r\nLdlmgjxvGE/47Oaymx36Fy+jFhRLqI7a7DkPBmjT3IzGEKlVCdubXkf6LVar\r\nhjflPDjuYXuYS1Mk9L3S/3hlbLANbDQ+tTdPHkSR3Z0eOW85tGEESz2EPGop\r\n0yCdZTuiw5hFsif3mA9BYKq7o0F+QcSvkE4=\r\n=phan\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDa9nmMc2h2WhA1F624YXQj0T0Iee1PpDg1+x5VIbxPVAIgRg3MfFXZK8fvZSmi9ccxDQ++6xF0Z8fYSoZPPobxfpI="}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.17.5_1646591286178_0.7481856999097398"},"_hasShrinkwrap":false},"0.17.6":{"name":"trustlessjs","version":"0.17.6","description":"CosmWasm SDK + Encryption for the Trustless Hub","author":{"name":"Ethan Frey","email":"ethanfrey@users.noreply.github.com"},"contributors":[{"name":"Enigma","email":"info@enigma.co","url":"https://github.com/enigmampc"},{"name":"TRST Labs"}],"license":"Apache-2.0","main":"build/index.js","types":"types/index.d.ts","repository":{"type":"git","url":"https://github.com/trstlabs/TrustlessJS/blob/master/packages/sdk"},"publishConfig":{"access":"public"},"scripts":{"docs":"shx rm -rf docs && typedoc --options typedoc.js","format":"prettier --write --loglevel warn \"./src/**/*.ts\"","lint":"eslint --max-warnings 0 \"**/*.{js,ts}\"","lint-fix":"eslint --max-warnings 0 \"**/*.{js,ts}\" --fix","move-types":"shx rm -rf ./types/* && shx mv build/types/* ./types && rm -rf ./types/testdata && shx rm -f ./types/*.spec.d.ts","format-types":"prettier --write --loglevel warn \"./types/**/*.d.ts\"","build":"shx rm -rf ./build && tsc && npm run move-types && npm run format-types && cp ./src/ProtoDefs.js ./build","build-or-skip":"[ -n \"$SKIP_BUILD\" ] || npm run build","test-node":"node jasmine-testrunner.js","test-firefox":"npm run pack-web && karma start --single-run --browsers Firefox","test-chrome":"npm run pack-web && karma start --single-run --browsers ChromeHeadlessInsecure","test":"npm run build-or-skip && npm run test-node","pack-web":"npm run build-or-skip && webpack --mode development --config webpack.web.config.js"},"dependencies":{"@iov/crypto":"2.1.0","@iov/encoding":"2.1.0","@iov/utils":"2.0.2","axios":"0.21.1","curve25519-js":"0.0.4","fast-deep-equal":"3.1.1","js-crypto-hkdf":"0.7.3","miscreant":"0.3.2","pako":"1.0.11","secure-random":"1.1.2","protobufjs":"^6.11.2"},"devDependencies":{"@types/node-localstorage":"1.3.0","@types/pako":"1.0.1","@types/q":"1.5.4","readonly-date":"1.0.0"},"keywords":["trustless","hub","trst"],"gitHead":"9e1edbbb03143a8f507519c5daa0bb6899d8462f","_id":"trustlessjs@0.17.6","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-h7jx/cAi1TUYBtat6kzGfparat9EJ7FRwjGOUVLFCYG04DcTEeHoSkm4ZYb//Vk3XdI1ZlpzZHg5XmSlGCI5HA==","shasum":"2bd4cb58213ab527b6ad3a54deb5085b6b16b7d0","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.17.6.tgz","fileCount":19,"unpackedSize":34281,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM0BfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7VQ//UO4TREy62Gf75x0zRaTQwuzdLOqPccKNOUINKkAqmnRVCnzu\r\nFUj6hCH81jA2sojm2B+jAfXOhcv5MbElN0yJgM8in6PSyhv+GSZ5bTnUPXKZ\r\na/ObvkxZJOU2qIWQSj//kosCM8/r7kJQ5M8rW7YYomNuz5IDonmozOT53XFK\r\neC4lypeXTkxUIWCc7Q5p0GMwO2gH2xTzC04RJZUgk/OcNuOyYcjZVD+5ctnN\r\nvY1zEsay98ohomBhsE5WE0FiRqYdf+KfMTLUQswu0ka5lv3Fi1LHbalZZNXq\r\nRZjtqpdvh+W+6lMeiM5jCklhfuQeoTyJr3mWW4vxf+7FvoIJlgnefXDnuY26\r\n13IYFyeP2Em+8agbDP+IyR3xgRJb3SpKa5exu9qbOwLd127jMXuEZx3IeNXl\r\nnsut/P6eETAnuDa7uBEHFwjSd5GXJgRIAZ65wU6YWnw16xqzSIX7qmxA4b0c\r\n41IHTQ8ebLUzOhNA36TUCucFZh7gW/NPWSkw0eqAcUDLvWvvyM5vWaWbRXoY\r\nTzRjWIHt22VLqCP24fzIlaE6pFmTA9nVUipZLrcIZDQy6nDP03lqvmQovHMO\r\ndiddWP2pZD/iiLlSEs8PKCzahxRpqH53VrNZgP74MgOgChsw4mkuzbd0PMR7\r\nKQkCQQQIsPqGEH0g53PekmURmyqnx0y0R3A=\r\n=SQs7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7XKx8ZGLb4c7h/cPh2FWbN8IKNXJnm1qUaewaC3kl1gIhALReB0sIG+docwJF+HaI31J4j0xs6Dsm75v4vasZ+lMc"}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.17.6_1647525982988_0.8460071170987955"},"_hasShrinkwrap":false},"0.17.7":{"name":"trustlessjs","version":"0.17.7","description":"CosmWasm SDK + Encryption for the Trustless Hub","author":{"name":"Ethan Frey","email":"ethanfrey@users.noreply.github.com"},"contributors":[{"name":"Enigma","email":"info@enigma.co","url":"https://github.com/enigmampc"},{"name":"TRST Labs"}],"license":"Apache-2.0","main":"build/index.js","types":"types/index.d.ts","repository":{"type":"git","url":"https://github.com/trstlabs/TrustlessJS/blob/master/packages/sdk"},"publishConfig":{"access":"public"},"scripts":{"docs":"shx rm -rf docs && typedoc --options typedoc.js","format":"prettier --write --loglevel warn \"./src/**/*.ts\"","lint":"eslint --max-warnings 0 \"**/*.{js,ts}\"","lint-fix":"eslint --max-warnings 0 \"**/*.{js,ts}\" --fix","move-types":"shx rm -rf ./types/* && shx mv build/types/* ./types && rm -rf ./types/testdata && shx rm -f ./types/*.spec.d.ts","format-types":"prettier --write --loglevel warn \"./types/**/*.d.ts\"","build":"shx rm -rf ./build && tsc && npm run move-types && npm run format-types && cp ./src/ProtoDefs.js ./build","build-or-skip":"[ -n \"$SKIP_BUILD\" ] || npm run build","test-node":"node jasmine-testrunner.js","test-firefox":"npm run pack-web && karma start --single-run --browsers Firefox","test-chrome":"npm run pack-web && karma start --single-run --browsers ChromeHeadlessInsecure","test":"npm run build-or-skip && npm run test-node","pack-web":"npm run build-or-skip && webpack --mode development --config webpack.web.config.js"},"dependencies":{"@iov/crypto":"2.1.0","@iov/encoding":"2.1.0","@iov/utils":"2.0.2","axios":"0.21.1","curve25519-js":"0.0.4","fast-deep-equal":"3.1.1","js-crypto-hkdf":"0.7.3","miscreant":"0.3.2","pako":"1.0.11","secure-random":"1.1.2","protobufjs":"^6.11.2"},"devDependencies":{"@types/node-localstorage":"1.3.0","@types/pako":"1.0.1","@types/q":"1.5.4","readonly-date":"1.0.0"},"keywords":["trustless","hub","trst"],"gitHead":"26c525ce874697f0ea7c4d50ace07966498d0265","_id":"trustlessjs@0.17.7","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-5p1BFKUJ7l4N50ndX3BFdT0O/10Jsr6AGAKi+KUcxb8fg4x5kiKeWaA+cgDwHdhlzl7/c1yYHcN8A9N/gy7GHw==","shasum":"de05d99b88deb1bea8105bca127bed95050403d2","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.17.7.tgz","fileCount":80,"unpackedSize":2026621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM1UeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobMxAAlscDas09O9ubgjZ2bxV2n9+JVm2GTbtMytOeOMVHZvjw1JO6\r\n3bZDPfwqywf9KkWZtSECLFWo1gl8/1+PVnG7Yy8vTYOyE25j61BVQnYh2iB6\r\nKY6fZcncpajYr+AC/6EhDTwLZplUHaFbnVWGyN7H7bkV3e/OMq6EZnX+l+di\r\njzbZg2bPFYd3FZdpVnmM5YLbQnhMoAIs9lWIwa/kuDSQ24zSNYSVvYV0XSXk\r\nbSBH+22VdHrXBXl+NylBdNwUWc6mO/JnhB9N++pl4Db4zK04ZdM/Uk3mYBjp\r\nWVipDH+spjYHqITLQSTTJJcvA7LQAb04/lhaytVFHTxbOimbAOSiohd/TUQ2\r\n1KLC3YShhM/tYsZIy4jzKmp3gF9CDYQBZZSd6+Xtdh93qve8vL2Vlxeo6FsD\r\n7X3g6F+yCcbfsROFktMNu7HN7R7cA1IV2jQW8oVgmvFgLe8uogRgqekLjkjr\r\nrB7Rai9VBIjJIguhnJP6HCXZeKeHd5+beo9y5ECOIpgzyMEORb92ulYKGd91\r\n9/YnJkv18/7kjJ9nOmO5mq4M+qeT0heAn9sQMU7p435jXolTxHEt5h+vJpu8\r\ntuaeXNvR2jHpOyENbheK82mTrCt2CfZPM7AP5ygoeMK3E3HYsAJksXKsxjxu\r\nEunGkL3H3akOcYKkqVBNXSifQA5CxSLEohI=\r\n=qJJZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGTa7yDtjRKiFFAFPNKO3ZNQEdJAsnW+CbJoQA20jERlAiEAuUR3xWJPGXOVlCPFkcjPVmxGcQnd6uK3lDvmGtPA3pc="}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.17.7_1647531293933_0.689498954095829"},"_hasShrinkwrap":false},"1.2.0-alpha.7":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.7","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"secret-4\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Secret TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"388652eb604469562759d06f5e86e0bea94dfffa","_id":"trustlessjs@1.2.0-alpha.7","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-pKjEzEvLdDINCamsPX0c1l4JHyM9H1O9Uw4OqQA4mAJOykJRAXK8h2S7//b13l1qMFL4kx3NfaKjAQntacmpLw==","shasum":"970440c32693503c5993087d2160d10707915b9e","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.7.tgz","fileCount":699,"unpackedSize":19503652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiO1rZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpvYA//bWr13mIQrl35iMs/Oa7b2uzRjSYgWM3zjU3hOulTSW22nbJ3\r\nUbU6GQlGFu7Ww6DGzv4OZvu73ti/5hAjGKUZdA4Xzpe4AhwkUR/sBqx/1b6I\r\ndkLHJSJ3oEZ/yQU1m/s2QC/VqbXU4xcBJltq9QFIHa1RroG44u10uavIP+mm\r\n2Xl6vzz5MakiWDQirOHIO/9r+Y7PAEqktw1dVtmlAOYBlZbFzISJnKSNG3ZZ\r\nFBwohs9VMCZWGkKniDhBvH8mgdtEwyo827U2yYfd/Ed1nLYSu69fSjT6z1lN\r\nuCpPsGFqpbLqi9QNgQfmrA3X21J0cgyX6TDhO1ptgbIN97WYh3A4teuUDnNE\r\n3Jd735VOwHPnH4w3+lt50p7ivM2BgU/CCqC/9UZGHjgXLkrLpePg6GLNEERD\r\n8g2l5bD0kl6YnWy4wTvjA5oBTZaQJ47Nm3kPnDmlauarwpmdRRdqpKBGWLgw\r\nOn5aqhbwl2QOvV/8ezPPYj/hojA5Z/WKJw3yAOC+05rS6SxvQUJWlVxudNGM\r\n1LSviZpqDqW41uxRJY7h3DzONahI45l0+P7HrSy9SpznFfEVc1fdeKsaOYKT\r\nbaqnY3j9GoZdZ+8UIKLgojFZFvQcTLLnotOsZw5W0yGtAEKMfs00DrelWXn8\r\nFxgNI2zk55qxuMXqWLQSkyfPdFyA3DfEaCU=\r\n=0gAA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNkfNsaVNCYkTIhh8O0D0XtmRNOJ6iri4mTgAWAurNswIhAKNTogNSihmjYLBs6DHD2L8NWiCOu+x0b6cmOHn0Vba8"}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.7_1648057049307_0.41817169612591787"},"_hasShrinkwrap":false},"1.2.0-alpha.9":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.9","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"secret-4\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Secret TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"2b8fae7003fc7635bd08052a699fd2dc0a613646","_id":"trustlessjs@1.2.0-alpha.9","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-m/f8nKoeF44PfWln2bjuESx+flWQYbs9gHd8QhUkJ+vmSS3bckmoZAgWTTcZq85cxggT6gBo7d/6BSYW+niYmQ==","shasum":"e5a7bd957316599112069b443e943542f559cb16","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.9.tgz","fileCount":699,"unpackedSize":19503870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPF/MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOew//QKNwCB/Q1Ba4YgNPkuYJpWg2Vf2cvAx1d1gdIFNGpDmcd6HN\r\nRqMetzbxEQnnY+Gk54A6KDo6hJXBMeVQHWFWe3oBOVUX5VPfE3lsJPLDrN82\r\nqL7LMbT/c90U8bkKNydjd+RvWxCNaCq4A+gAVu9W/DHYXxXJKdrWu7NPY+xK\r\n04TgmtmhBa4aX/W6Ifm5ABcSt0xUmajnhsFCsTptQuxStbfkyVg4tgxvN8qz\r\nujesiz18lz/WyV65r9OdLqzV7kiYlaEMx3v78Bd2vVec8FDECYLtaFK7s1AL\r\nY3UabR0Tdbd9e+lnKOwYlHzy9hW2r0h49RUoAebgWHTJKhfG/zM+F//0YQlE\r\npXaZ57K1Z0uKLY9NGeMZcBEFm8FNyDv+2I/SDCK9k5enNdOSzb8g1rlRXeC4\r\nR8h7ngF3oVUiTE0OSkwRn0vPCS8fC+0uF9/c92QCwwQ9kEIKtEVFlLsmrcCs\r\n6Zgfrr7kHW16kVkqcBgZnOpcgT7SRuxIM0RpRFppzI6Q1rUHmIXBWiqoHOQf\r\nO2OJdXjd87mn+eIuqUZQoa5YKVaH4MElzkMqIV4E6g4WWaB//UMUJP9yWvKK\r\nZ0ZZZMzLk6/X/hC39v/3Qlw4mcnTlLYEoR1s0k+2JMS1hOIk3eogtAQAqGW+\r\nvqa73i7AUFNMuIkwHkTmpzh4Li+uFN4vGLA=\r\n=zakP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH5mh6KITSZSnFXaN0PPk61fSbAbDyrtzoK/CZhHNbbeAiANTjZV+dBf9VDgxE3dIj7al0GOHcqevZvll3gPORX/1w=="}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.9_1648123852491_0.8153101705116415"},"_hasShrinkwrap":false},"1.2.0-alpha.10":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.10","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"secret-4\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Secret TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"7fe043f5d32dbc22a3b88426f8e98b9816720e50","_id":"trustlessjs@1.2.0-alpha.10","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-gWBUB/rGZ50nUiImuc4cArunKX9ScsOW5YfgqV6z+9UGNTveJzHBQ1lryAe+33xu4f9/9l5qc/WyLEviHbfQGg==","shasum":"2a5e970707e2bb031822ff74e11cd5728716a060","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.10.tgz","fileCount":699,"unpackedSize":19503976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPG9cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMTQ//biUS+23UeV7+XvMoPaXz3YRfxe5Q4PU+GqS7d2OQjPkDptzK\r\nKN+0ZZy4uxIJmZeWNfAHTBb+bCUp3wn/EcuPR5klAUQPORRIByCJLiz/dnp5\r\nYpaIunpfhsTeTjJ4Lb+6VMepJSWoqzGiusMkHktquDqGm+n9rkvlVbm1tvKT\r\nUvttoN2ctUqmsSQInRA7Fn4wxE3+qomTtU5LWx9fkom5Hk7n7B7Og/2Vzn9H\r\nkR0kT5iX3yl5P1b8gTBhqtCGHkFLIP0MdTCMWCsEChMtmlEJX0AWbIHc/Gsu\r\nY5Izt1BDSVJf/20VfPW1FmOZCasi5ursDLFW/0NZPXPbJ84PeTlZSgcQmwlN\r\nRWK2YASjuYCkevl5O+x4SItP/DEFZAJ+hT9SWk/omye8NXnIiKOE4YJSyn7I\r\ngxcuSIWnpR1EIeIHk+FHIeBh60o/Y73P2fZCNSAbvzm6PjXgs04LUzcPmha4\r\nKzE8e4uLzcNErjzA7iHWrqDjZOyrEzQAn17r3ciiX2YKN3zgRPLj7p6EIhbS\r\nksfDqdxwC6XBXLUzl9Al9WQH+VBjZzOOMRGRQGoNRt8QnoFpsiveKPLCcUFO\r\n/58RgMLZ/ldl2jU2/EGa6Gi+/YG7fLbl4LFmVRcugVTWY1+T37t8fvlZLOiz\r\n6OLd8Z9rL7ccw6FvCsRb7F0c3ikJaOm1XA4=\r\n=Yt5j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCS7F20gH/TeqH24is935xnirhynTjalKXCS1TlPfsLlQIgDn+xyBWBT7iea4+thXVPFZZt4lfkfcGV31t7kz1dIfI="}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.10_1648127835806_0.22122509265574397"},"_hasShrinkwrap":false},"1.2.0-alpha.11":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.11","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"secret-4\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Secret TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"c61f63f4f08d984e396b9f5019164cee27f56a8e","_id":"trustlessjs@1.2.0-alpha.11","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-VfDq2l5tGcB2jzC2xvRH07ogoC4271ShTOG7YqkXwlcw/2d2sLuQ0B7DIpCPYFyhM37YyfaRShH5+3pqjGMEMw==","shasum":"a90717393ad9ae9849ba269d9c87b0bc84bc7a1d","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.11.tgz","fileCount":699,"unpackedSize":19503331,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPHHKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpakQ/8CXxAPJLrYgXipj17+60RMJB7VW5vtD0U0EjJI2ossSSp77F3\r\n2tNRQDkF6Z5W49ujI/nFyQN8+1HfAwB1mXjTu/00b1l4+M6Kmv0fvL5rw/Um\r\nxnZCkvKXSk9RhKzXUOOxmbWeVOSXbI8LadHqIm+0xC4hHOlBp528B/J9GOkp\r\nftBNI4OEnAjWdEF1TEUuauhKhl3/s6ANx4+LC2DMu4swqxqSsCt4Wg8CNpdz\r\n5r+IpK6+gES4EKledZFymJTiW46qaIOvrQvko3SPof5y735yIbUbU/Gg99CA\r\n4rFyMEXts5HXIl0z+T4mPyyNh+KFt4TFgGxgLI1bXqtKPfFsrGmfTWy8XiTp\r\nLYP0pjXxBZCNhz3V3/OtPcxzJcF0xcdalCSihRGbZx7cwKJ396tL0whpnUqn\r\nPdIu2lgVYlTBqVXxTA1/IPgOJhtADEYJYFsYZi/xpsphogaIMZPJk0sOc1xU\r\nDTWWcGDV8tC1d/pwBHDbBbtRvhtVUgNXEUzuGVP+93f7p6E5RgKOJQ961IFL\r\nMQKrqFQ7T8G4TSNwToFpvVSR3za2o85GXVYvfjaeik5iNBGKwjSCFl+/UJW2\r\nESy6k0jJSi1b4AmtUORjwP1HdZl7FZcJU5YQ8UhE+vV2IikTXK7aWuiKjcBw\r\nIRI4p8o0VkXTh3ewTij0sef2c1/5ZrfvBCo=\r\n=N5JD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5tHQZ8KEouVkyDlSpbfWXPooBGJWfYbM25YjQ3mtfNAIgBBGWqNG8WGbLhR14mqNN7YPlHLd1k7JhHiHj/w0/xLg="}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.11_1648128457813_0.29099065148569947"},"_hasShrinkwrap":false},"1.2.0-alpha.13":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.13","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"secret-4\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Secret TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"7f7ee3d40ad8b602fc5fc2ac5f9da6b6b7536a75","_id":"trustlessjs@1.2.0-alpha.13","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-WInOpc0SX6Q7Q3Ilbl6BnMPWjTDEbiDcsRORf+NqLwSYIOtPp8EhVaE81cSPBJqR2CtjZvgKE/SQ7tFZpqCXYw==","shasum":"4b5954cf42121f6d5ce722ee4183b34f2ad67941","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.13.tgz","fileCount":699,"unpackedSize":19502811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPIgeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpB2Q/+Pr9dS1UjwHuODlQ8WcUdPy9kygkvX29UDWzEcQ8s3BF8/66B\r\ndakB/83pFUXy8ExTkIChskRObgWADNu2JtbCcce+GLI/NPE9JW/8orkRPIrN\r\nYY9XkwjWstHRWmVbrWPMIvUW6PLSLTQhzs3pTB6yTf6rT6EEAUalttaNTcGn\r\nGsEz7OQkb0WpZl0URXfei/hU4rjTRBLAx48bFQGF2ORuDQVlJrB8r6hcstoD\r\ngObDtJfgCGBLMg+Dp3dQLnvgdypQc0VQpZqvWhll/OtU3ue0IevuvMWUaish\r\nVrkJRImMvIvHgh7uQxdNOD/Uqw6+Cvhkf/sTzOCv8SngDVJonv0RdcGy9aP0\r\nvJcdXt2eZL0e6ZEAt17CWTVsiq6cZb5NlZFOEV6qNCynyo0Przmws+TUnFad\r\ne3Fj+zB8qEBsUnL8d238ty8aJJuY9tAuOfdoTY+IjuGcce+Wp3JIZZ7MXZw7\r\n26GfX46wgJ5b9dCavBFw/3Cr8vYqt5ALDKwJOMtTFn/PVEe51MJ4qiU8DMiT\r\n9yl+D7oXaXUi6r3lXARbrBgnOYxbwH56qqDUnasHvhXIRjsCPSnGsfNehXWJ\r\n/1ljRG1p3z4SL9ZPEqjZUp14gLMQa+7gvUR9UygSUf2iJyzLTLdkqYBWQVFu\r\nlAmaGOiAKu4q8iC6l6R1nVlxYxDnthz9OxY=\r\n=s4lv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZQ7enTsjDnkpQmwIuwnbnassE7/78snUUhPqG9Yw6MAIgZ+ly+S21T2HAM3qJUf8iDgj/Jnf6wHoY3HXvdM6aBgo="}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.13_1648134174236_0.42883258028668325"},"_hasShrinkwrap":false},"1.2.0-alpha.14":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.14","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"secret-4\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Secret TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"1aee1cc313966523fb949e85d390b8cece8e6211","_id":"trustlessjs@1.2.0-alpha.14","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-lbei9aHJDAdmUMi02RCz0AGonoV9fkzkijvvmtfc7GBrzqAalzh0TKdKyz7J1dkJ0pVVvN5ZjcxPwmkvpgrsAw==","shasum":"5f27c1e754c1e48400759d44bcb4985d416ac530","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.14.tgz","fileCount":699,"unpackedSize":19504642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPLzgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/mg//YadZrsoU3wOzgVyKp86qLPwbMlNbkCjSJEv+CpTqYY1mp9qB\r\nkCnAMQ8tZRlUK2UBCdQxMfjAb753rUdFYLOJSrpKttI+UW7pIpfGsJfah78U\r\negVdis5H2DujH+rxYLisS4dFwzb2sWwP6yS5RxSZIX1gcntDOv0DFhnLLTze\r\notNARrWJyC42mfYuQ5ptU9f+nIXtkJ0wbvRtpK4upScmJfcD/tL4Lceag4A9\r\nuISnj8ew8p/i50VaclyQxr+QpiVEnH0ZfwWcvJq0Z3Qwq0UiZOkOAFgKhlnZ\r\nUVrKh0fC+4DIeu3R3euyCNph1TDnCGPb3jdFtBtami3G7/6iiOj0u0oKPzC4\r\nQr1/iUBNRMsDT4ZQ4n8ypjKvRkHUEaiMI9xk35JBRUqKduVuW6zsHgyYqUEJ\r\nHK84Rd/FMhQX4yt1Kg4KULGnizTdTf7N1jp7BklhzbjQJuoq5Xy3oiHFkfFs\r\ny3PQ9k83a8KL6/zVQFEtjWaWn59B20PzyS+XPn8xphCb5kpo3Ezna9pcsRFF\r\nu6fnHi60RORdtYISoiRIjDVfFZgT/E2rQDGadQTZ5HYFbr10v47IE3JMNBpQ\r\nX+emvNhjX4V5iyRjE8szWdpyDY8VsODlYNUS917xLgiI9qOJtCS0cal1E8cM\r\nDWbKt0WD8bajQ6zimtEW2O1uY7Uwzvc8hoU=\r\n=4Prm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4y0VOy5kWhAh8Z5/oZ0rH3xcT2eppI/UT8TBkoZHymAIhAObkxcZsLj7vmk2zXKuSSu1wq5g82k0dNgZ7AJmVMVFD"}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.14_1648147680658_0.025897681927139038"},"_hasShrinkwrap":false},"1.2.0-alpha.16":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.16","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"secret-4\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Secret TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"80992b4e2745f2af9133ad279cf05a6a38e62d2a","_id":"trustlessjs@1.2.0-alpha.16","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-vc+4yWgCGoplxuXlyYU9/Aj/h0d6E67DDgJwR/DI/sJzuEoHX82nOeAuyTh4HpfQg257gfXQv8YcNJuvb5c+pQ==","shasum":"b616517f41d61d9b28b4e8db4b5ab1dd265edcd7","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.16.tgz","fileCount":699,"unpackedSize":19504661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPbUuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq65w/+LG5UYvn4JLjH79xdpbkhJd2QQNLDvXm515NB7p1vmNzHfDTq\r\nmaVzB4vKq6CyvE/xjNfH+lyfSyDVeziThKGFhFt/b7urXQGUmzyBYf89KIAr\r\nXsSIBbHl2wbyP0AP8GP2Zn43LRG+zEuMUQer2ajSEQ0Z+IU0wWLtViTyBuL1\r\nlz32ps4uw6lj0z2E/6DbRhzJ/IxW0YyCaM+tW0T7HnAhglnIOL/J/u7ijUmD\r\n3Ygde19Qa5BqhIIRI3X0z4EL7cmD8JHEOVm9Oykihmr4RdsedviT4DxLGoCK\r\nr3/Q5hxKw9SplwEdJq1nLRyBM4pcZlWuGxIn4s/14hwG6rsNlmzELi1w4xvt\r\ni2xQIYxvJJWroZcx71S0aWW6PvzU7k9v5lmTDYdHCVM54KTQYzqBurj7T6AD\r\nE0ESHMeW2M14XEF7ik/PLsUpj5w5fvcSMsJqQvT7pZTgjcQEt3+XkHriBMZT\r\nNf7QGWkOJBmVBfpXoBIqAxmyDAnc7Tis2JSiyT5JaC1kk95IZ8SgDWPtmJ1E\r\nGe87Udf4goxLMm6sh9GeXaLO38Xqpn3BsKTYz8YHO85K+7tJXFTUQ0eEOgjt\r\nvf8HZLv3z9Xkyib58Bplrq5weoZ2ffRoUGlY/5JQpgUhma2v17SQDwBd5wSE\r\nxlp2klHXpUgmkcV+kLbcsPvw3+DrVOsariQ=\r\n=0v53\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErDoi6hnA9bR6TevF0CPNEiH5vzSj3JcPNmxdfMbifKAiA9adu08d/8xXY8VT5WoEJQa8uqsjpFVNEEPtqsniAMhg=="}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.16_1648211246148_0.49608952485168323"},"_hasShrinkwrap":false},"1.2.0-alpha.4":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.4","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"secret-4\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Secret TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"a175292abaebedbcb41be2ef76933682006e360a","_id":"trustlessjs@1.2.0-alpha.4","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-IsTlxIfPln/ojmfZn7wPA/tg5VZr+nr0uWmyF5aUd6U6Z4lxOolpr7ZVAQN75IycaGeihToUN5/+tgVawXPJCg==","shasum":"7aaa359356c05915835fc66cb55f100b73401a28","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.4.tgz","fileCount":699,"unpackedSize":19504053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPf7KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpw8g//d98WcG7isTOFEOIIf/n9cuUjPLG+oVjkdpBddDvu+KnRTbss\r\nCCMCxXRhhzzHsLqR4a6KRmx+ZqVAG3LQJN+4s6p6wF6U5Qn64erP/L1fN8WG\r\nBzfhA1qBnPLDVHqav0i7GoU7ds/s6J1l5oATzRFRqlE8BgrZeBpSRFSo5oZI\r\n12dK1HXsqkDDBn9CUnVr2PG8ly9O2iT4J5j0qvAXX4cHnFROh9axKFXPRaGp\r\nCo/Ggg0uInVYPJaNoiR2jyeQzJXSKHZngCp3waxzyIN2yZAz9ttcbeyqh/kE\r\nwjfkcR9p7cAd32rVb+dCpbmqFCljD8jv5ovq5V7p4hF22ubGGxUPbPHCoCLP\r\nmqBA5JCFpTq7XNpdX/JNWzDhZW9zeXcYABHo8sd//4JuKO4ZA4vB8gTUKCif\r\nDqayGDqgE7OxbLqyn7mbIZB3DIYKCoEdx6IOcIn7bAeQeQQvJEjhOf/sMOr7\r\nbX4skSC8jZwQoVEOicuvHD/mpaUq9ohbWr3gBmOkOI7LMjAdmrOMUeEzD5/J\r\nGhuFBH6hFhVEkPffrknik2jjKZ+LkZ/mDXhF7srawsain1+NCDkT2XnN5ak2\r\nuyXmomCD9KsJXVAHE6rnk3DO2z85sjwp4ypdrUwqyb91SxRB/RTwDm9vFpCw\r\nA9LCnPItOrqSXVZrtOwLX/Wjdt+nVeZKNMc=\r\n=ogq2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC07xDGdRs0MLCtk7spgiuFA8Km9RKyxTqCo4j2GIhnWAIgeWb1xORwPwlZjewVwq2ApAv9bbLMcwmKFDraPxGSL7U="}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.4_1648230090614_0.21453662949007302"},"_hasShrinkwrap":false},"1.2.0-alpha.5":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.5","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"secret-4\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Secret TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"d2272e59ad8c6f3bb3305f16e846563da6175eba","_id":"trustlessjs@1.2.0-alpha.5","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-PEc+/RiqSvc3Ckzd2HQ7xPaOL0eMW3m2coS+5ybpmtGr5vN7+NWpoH9npkYBzrLi3Svj2MKmtMTkgbTGLU6wYw==","shasum":"054691343479177166b7c2bb073c6ca8626d696e","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.5.tgz","fileCount":699,"unpackedSize":19504046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPg0QACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8UQ//aiD/OuZsl6PN+ZVuwnBM24RTfhq3sovW3pqljRRZnD0CfwWF\r\nZ9FJeJOWNe1Zxh+rAOvwQo0nauEYo8tS6Sv74d6tTBLh5XywAigF7sA0uYVt\r\nVj+sDcUw+/3dThndRmxmcbYv9Gh2pVR0oXx3ReF1yxYv0kEaBN73fOO6R58N\r\naAsRh+2eR0SmPksy3nqPcHmzvuvwFlCIVcRKKnc3W1CAyqDqkB8zVhO0Eewz\r\nb2/oe9pESoXMDALQOMrmiWtzHxJ55KEU/JXm3aigSj6GrctraORcDjnhX6bn\r\ndLb8rWg9nWnwZ4q0G2TvMvmDNWI7CGbOf/I5dWZEQoTap9eEsdvKe4hhaSti\r\nJ9wOnxREDqsLu6g33bnmhffhULtK5eKiB/PhANjoibpGuS7nbqYDxtY4XiG5\r\neQy2jO0b0dedy1PDQMf4xj+XA/cMmRqDtW51QgBO8JcxtUW0+Ec4dYMNf6i9\r\n0Fq44aZNk3NT7kJljFCNK5HNxPU8KP4JATeLFfoExSseQuQdP82d17WzVfeQ\r\nZeeHRNq9ZFoWwIOmXFQuTRNLxAwQdoswhxO3ZmJvfCiSVfy8rgNH2Mc1XAZV\r\nXzomP6OB8CINHqueN23aNZqQDE49awseUpg6lpwc6HH4fGH9NpbPjeECCe8B\r\nyZg+Uuhua7cW0qJ0rqHHxVWnyO3e47QWV1A=\r\n=MFnr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXnUxR7HymuLqmLLtQ+5SEHSCe2Ju4rU5zmHtwjE4SUwIgW8PZ/CmAToQZFyD3jXFkzC7RBXanLqAxWwELZTge4W8="}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.5_1648233744600_0.08262659696159091"},"_hasShrinkwrap":false},"1.2.0-alpha.6":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.6","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@cosmjs/tendermint-rpc":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"secret-4\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Secret TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"9d7727980cbc370e9ba556ac69e00c6cca215baa","_id":"trustlessjs@1.2.0-alpha.6","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-+tRuMiwtdZYFqJ/5gZQT3272oS22pK5b4fctpUn390N7BzVeLMeVqTOQ3x2EjpmRV2C3AgF4hYCzUJGr/McdVg==","shasum":"377103811b475faca4b99f6b8f28c6a7bda7bdef","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.6.tgz","fileCount":719,"unpackedSize":19633586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPwozACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwnA/7BZ3uXTWJErB3av41tcxOCZq7XBGvQscf04cxraC3Gv/V4o2W\r\neP51av//DLBHkQTFv0LD7gsKRlMWi8p9cL72p3AzAgPbzm6Z//thw1usQ4hE\r\nMoTrJ+kswM1ki1naeUwQRLU/QHit1ZNQ/NeM0sCfNwNXApAo/+s/NYu31wkl\r\nvVdliRffvCctVBQT3wQ//t0HDhjfRQHF1NG8Sio6XOaFVpPpDfYPD5FOYSJp\r\nfKBFMZWvmB+WoEKbzUs5jn6SBIfegfgV7UtWYGDl7FEQNnVmf7Yv1ZdIgHH5\r\nnt3Ptic8RlJWtguGwX3kuhsIzeW3loZ5AUnPdoj1hXOHacUN182dgux8dyLw\r\nqF/3z0ydBzgTJFT61IXUWVcRhv/dIKsK5dbFXImGro5XIONPITsQoj5Ro0SU\r\nbBSblVJrIrIXIEMVFXgyE7jb0VWA8/wlptJD9wXRzUYdq0qWZFGs87nVZdhv\r\nswe7w1jEu6C6vkJ1J7IaH5YuWA50K4YLtOuZGjcid2I3co6tjTLOdE97vPnX\r\nE4mZODiU9clqtYmQNDPQ+JR/kURMla3r/6wf2TokZ+BRwenpLyVk8KC4p3a4\r\nDfGH047MNlyivWi3EiZgycVoJXandsKhG/Xs64TP1dLasy9C5D+z0NDbnWOn\r\n7R7c39A07hHeW897q3dmqE1kN2irHJQJXFc=\r\n=DP8A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpvbM5ulYQKYbjbTT9JoUcOUK6iXDiUU/SKX5ZkbYFBAIhAIqBvDx7r/qAoEA/wUxtpMpr0u3/3c/Gda0nGF+d7YhO"}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.6_1648298546990_0.4020202692195869"},"_hasShrinkwrap":false},"1.2.0-alpha.8":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.0-alpha.8","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@cosmjs/tendermint-rpc":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/snip20-ibc.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"fbd1f0be89285cfb4d961ed79def8b8948ed0fdf","_id":"trustlessjs@1.2.0-alpha.8","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-JvLJbWacCwVmGfr5rRLAVDkw0JSX6zaQyYCeO6+JxYooQrw+NI8Olyeqy38d6bbNWPxjhSfx4dJhjAt86SI3FQ==","shasum":"02416bab82004cf1cd64cf6110762bfb118e7798","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.0-alpha.8.tgz","fileCount":719,"unpackedSize":19633549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPws3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaRA/+PYHWeuZIh41TcVboLywzCM8QB7yAcKTrYsQNP8fyGAFFsl9B\r\nVatRVw4QkCe3q+VZ37iuuI/y4lZyaANibAVb+y2WNOd/jT5qv0VnbD8WuITD\r\n0ezvG5Jp/7TQCazEY0wzZsHlJdNEQyJA2U77onikpuEKtFNWtmEYji2NoYwz\r\nXnQnFdlG5DLWFQUShGYgvjNdsu05Dw1Uy4anagof7Qa83OlvJgiyisQCN1f1\r\n1b16/EC+TsMiAE2OD7DyLGPHnJRKDZssThAv8eEirCIuaaL8pzVWJQFPmQS9\r\nLMJe4nYXOdjlF+XtlQwV2n8CTAsUaBBUp+gXXqkxS8xFSr/WWcwaEMu/A28a\r\nKX3vbKAm5h4K/xnXSmRXNMKWup2xyFWJX7x6MT2ZrtC5m2MvO1Py/KqNTpQS\r\nyISp7B0YxEhOSpWGgg57Ubv8ezzrThu1XuJ5WhOH2YVb+MFAwpT3u2JiYKb4\r\nQdP3ALr36EUf/feO5y0oz5qNl++tvy6ACcAZFekrKQArpMqnZrf8H068r6yE\r\nZWYrQ2K/PrSEDhDF8OrvhqciETrfrza+/bS7AgC5hTzUmF02Sp4lZoR8uj5Z\r\n/4ZJkX/EkYyxUzqq6tPVYlp7b4k3Sv1MASYpxlSN/WFYX7yKH4yu/ypU0PPD\r\nmX9FDpLZUuTm67SEIK8afIboGude82YzA70=\r\n=S3qt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDjoKFqP9QQsQcP0D2zLI8y3QfvCzaGMFQ7OY/Hfdpm8AiBtSPGWCuijNA4Qvk6w+0YmtRADRcS4XCp+EpgkMOx42w=="}]},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.0-alpha.8_1648298807527_0.9398370276883774"},"_hasShrinkwrap":false},"1.2.2-alpha.2":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.2-alpha.2","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@cosmjs/tendermint-rpc":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.contractCodeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"57294dcd213bc7f77054cad43055783443dbba94","_id":"trustlessjs@1.2.2-alpha.2","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-wb14GSDXH8NeaE7PwOeoUw7ZjNK0iaN6lb72UPm9H6ArgxNmV1u+61DvfEMfQ8xilN4/53hxubKuYhKcNppfZA==","shasum":"ef6c65f42f0662c62643f92389c6be92c60a3a4a","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.2-alpha.2.tgz","fileCount":727,"unpackedSize":19923225,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiFiwvIbjv3uzDlbbDV8wkP4ROE7hJxeGk+AlibFVeIQIgA/ufWjQQ5AjpRbfjtkFEcigOm7ApKTGfDtMKibWXKHA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwdEQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrvPRAAjkt/apfXjEPSSPsiUWe7D+TLDJnA4g6FiXoBnQfCUZtlCvkF\r\nYmHe8Hbia2lkfgpOCwdQK0Tiu1uLYlHhrfyQFg2mSZm9UFGC8FFQ45gMehTy\r\ncnAPpWHKMkvaOfHBgQGt59+C0kNp01WwmDW0KGeNWSQVFh0MKerXIunO0/d6\r\nI+r40QOZNrZDEsKHu28EViubB3mh1p0DyY4eMQItMIkXFZFFi6YUrn3/cLbY\r\n9orpzu2WZxWsxbA+bU416qC5uMeePXTGsWjl68EAvY/EZgPpTSZVm9R1YCkT\r\nscftMBidK8TARdFOm6kLVq8Fb6EEIWeagqAy2sDwRzFHXD9b2TZnvTgX7CAh\r\nMRxw6MP7yf/rbAE5NZU2pD7KNxK5HtqE7wjiJF13YN/fq1c1FyF4FqELqnTx\r\n28ffrms9yf1s+Q6OLDHXxOeuPcB0uuVir1XcE43u8iGH8akmQaZsMFodq/bS\r\nItdhpNMVr65vJYBn+0ySjnSb+PdJYIt7BuAN22/j302BExoZ5jXI3OhzKrht\r\nUAzduJcWcLGsExDUBecXN+Lv9DpK7mu17EkDJ2S87TjU+eSQuTrezj81Vgj+\r\nbLDVeyX/xj6cDnOyJHP8rvt17392tsBNUVMATfxOK2xcQmoMS31c2da9GtVJ\r\nrJEepIJ0NUIV2XrNR2PiK58b4uSwJksXurE=\r\n=pkGd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.2-alpha.2_1656869136185_0.3372466911526708"},"_hasShrinkwrap":false},"1.2.2-alpha.3":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.2-alpha.3","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@cosmjs/tendermint-rpc":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"_id":"trustlessjs@1.2.2-alpha.3","dist":{"shasum":"50042d4912085be70d773485354b8c17eb321b8f","integrity":"sha512-9cG9EU7ZbMCuuehuit/iu6StWgWR30Cu9qlyJBfX+LcY5hwUFLoHNr0b5qkgtVaofzZ5eZcVm0R02/n4VtGARQ==","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.2-alpha.3.tgz","fileCount":847,"unpackedSize":20029986,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICPr1Vtuj7MDhi5slkkph1ObNBS1L8dpNyMhPYj4Hl9dAiAS3WV9yLrBuKLTeRZMAi8h4K6rMmF+YCj0Zy3h8/T2Pw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi59X7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqybQ//QasZVhDgwx0ZTO5nZpZzbqk6r+OMhaKYMupc97UoCHnp/Iu9\r\nzFer1NijU5NFU8rhQKnLENSW/W+ZlMuJrfnPhtfWqWIbEHLR0YOAQT4F5mG5\r\n1EXiByShzMeKxg2LXg1yYAkFDX1Ye1KicrI2zSgXmeI20YvZgUQRwCLuTmqG\r\n2AuqE7o3heOEsLXe02ZtBA4+nwMC9s9oNdiKQjbXiH60JDgBlkC4HS7MXCnD\r\nEiAbMwaf7MihlleMXjrU1+3ybRR94ogQTbTkAt34xg2kEkdC0fm5vthci3Rw\r\nNbAqmD820GDehmbpMfLvoUpWgE3rypsmSuYM/w9PtqNkhKm+dA6UeCpToKJS\r\nuUv+ajfAQRSLChA+zG/gICvT2GJXCTiIwd3MGdXHlTb+8pIvAGatV/A2ko2J\r\nVqrSvW10k6Se1WDpxJdkzOS3kuy7E7gDOZeLajuR4CWNSbi/2QvOueZb7f7u\r\nco/q60f96k7N2sxXcmRzyeIj33nHDGzJVLW2NEnm5lGxAgiu2OXhZpUOrVgZ\r\nE3lRExfVUPV3whaZasKcuQyiLCkrd/zzWo7Pxdxjf0Nz5q+tkEHne4D/eptI\r\ndW9I3ZB0wFglGZVHa/DPhV5WXQspB9cgulvmeW9NtyIVt2CArsWRwQ6Y/xnK\r\nVX0PCgPB9RzTYvfq7rKNG5VTGRhGypsMBA4=\r\n=RhEA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.2-alpha.3_1659360763549_0.25511630374173944"},"_hasShrinkwrap":false},"1.2.2-alpha.4":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.2-alpha.4","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@cosmjs/tendermint-rpc":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"_id":"trustlessjs@1.2.2-alpha.4","dist":{"shasum":"b8ea096ff7bfd985fc893777f617a2d8dd4fe9bb","integrity":"sha512-Fs1Wxx+yIFv4rKzh91UJOnof7ehd/0NHnOYOfC1D1V1QYho1W0zBk4jDjaGmxwtZzyUFk6lGxIVrGM9XjLC/sA==","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.2-alpha.4.tgz","fileCount":847,"unpackedSize":20029986,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwEnXizsJrkP9WY6NCDMjF1mibP+bjKao77TUCP8CtIAIgKNU4Fb3I3R62vVCqMoDy6JibCzYtNYCKfp7joNZCydc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi591pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmovtA/6A19Tw0nux8Y78sRbEQqL0J7A+3oCESepDkHTTIc8bAAY6oNY\r\nirV4v9lwOJfHwsTq3pAsICYi2Lro2gAmtk5Ike1avYZpe/NOyzgRkoewkYMr\r\nEBxFoYMiH6+9ClV6JB6hOu1f1h1FMV8tNXPmC/IxLVwLOyP0rZhlGx30RjYu\r\nRCX5mcYylZbqapSNf/uFPosgCrWgtLDlGSVn9fxDD5gTmaDDUqwKa4g1XPLq\r\na9v9xpChHF504MQNsQ6JPUYFazXQKdje9+WhpAvusRQ2cD15shRP2Lap/L89\r\n+DwpHCRS3aU91UlYfvzcxypAgKpi5T2y3TF4a9R2agoPXdj3Ih2R7NPkkJPN\r\nkQrNH1p9sQohccZNFtYWtC1tjLziNXWsSHuZB27oYwfGISabvpzvr7O+u51C\r\n/FZEmisPRNCBe1i4ClHyUz6HJt15zNq44FZPF0X48IIPRjUSfNOg3rxVZOYX\r\nvKXuiB5HiDM62woVffu5CEPsBe27KB7P1n+K+dOaYoC0qUOKrpBZq7h9td0F\r\nVK2sbDDtpdJQ1lk/j6nBBRprfi6GTgo9FIthKkNdmpNyVWRMNyznxrpNP0+q\r\nesbm8fTGN+4XHDUbWE2l0GVZpAnvUt22XFAtoWwnv5qIRsNdN+WwOCbaICW5\r\nGXfBE4Nf2Xzh0bvhYRvbljNdhhZSqwPOQZE=\r\n=YgHe\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.2-alpha.4_1659362664722_0.6188419334406654"},"_hasShrinkwrap":false},"1.2.2-alpha.5":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.2-alpha.5","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@cosmjs/tendermint-rpc":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"_id":"trustlessjs@1.2.2-alpha.5","dist":{"shasum":"6f88e47dd27441fc5bdc103904c4fa8999ace5cc","integrity":"sha512-6/1rIw4uLeCTAZI7vGQdTNRPGlks0N2O5kNDzduVCqkMquydPJG0rbkI85GpZ0u81l+sFr5RpvN2hHt1Ql259g==","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.2-alpha.5.tgz","fileCount":847,"unpackedSize":20030116,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDdGVHaMGQkf2FAWwacrMXlcVSDEPnL6/EfnXjXHYiksAiEA8nX2tWpVtNZvwOsecYxoceWIfEplZyeYg2y5RJWia8A="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi592kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXpA//U8hcfcj8x6f248V3ZQcLjNOW8m9z/veCf/607qHk/1qpEWZw\r\nuX8MtCStBbvjdZ9w9FRGu9azIgyPvMPxV4nSJVG/n8kuL+hzrKhacM7UawfN\r\nJul/YbxJPMLLhVRX4Wf7fWsa3Kp/Ve37IsqyLv0SYi/UOfk028qZahNDc//f\r\nE0McQVn6Iiu9xsVQ3r3KoURB/9JJOSWpIuFlfQdtLEmPy5ESoVvLLlFuUcyW\r\nRLJ1PoU0cp3KaYW2XmJLo7CoCan/mfMCFgSUWhHt0hW+/3x+LhTgY6t7ICcy\r\n/c6LRTsQR4ut/wGUC/osg8kNVi6OemRbM96Lwc5cstkKS6ugJGUNbI6OXeB+\r\n9vgo3IxsIQfqZvzmChya2YxE9r1Ae/Z9uQ1QKIGyVKiF+thfF3Mp2HFED/It\r\npj6RqrtEtEHlx7GOagSIMoBpM6W7H1a1Bb1zFJ+e6KMXdijv7fdvBYWJcNwi\r\nmJoVKV5qIBmgp8ga/hBsNQvX4SWsYVrIdrmiQoIKgI5EC+4qZhnbuX1chCBo\r\nZ71SIcOgUmDVHDMSlOLAqBzGmpPszXhSn7EAfZZ+Ylequi8A8DJho4IKyYwS\r\npDj2RR2ESvDzN19pU/Sh1jJn4+2NvEnh/ajrivMm0S2k8P8ZMQGWDcK727hN\r\nwY5ahcSf3+z61bl10Xmt/z7i27u8f4euLIY=\r\n=xaZm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.2-alpha.5_1659362723717_0.5527354054384681"},"_hasShrinkwrap":false},"1.2.2-alpha.6":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.2-alpha.6","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@cosmjs/tendermint-rpc":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"81b7e96b97891a69b5fec2f50fdaa5690d0969b3","_id":"trustlessjs@1.2.2-alpha.6","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-zMMJ8YM8jgWhgvPQRKgU2sL6DWNs7byAZQBTooxU1rK4qDX0jM9KScdEoeGvEmw8JyfuP5DWqjSPD8+svzd34Q==","shasum":"6cf84ad15646cf70e326d7d3d44cb3acff4d190c","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.2-alpha.6.tgz","fileCount":739,"unpackedSize":20212901,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCP1UWcvm7dOghohVqChqHDT8fvjMgrvBA22hJFF/2uxAIgP5BU2T2eOnodfvUMN5OWmFDH5NC3SgxEBT7Ju4Z+0nE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY6/RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGwA//clGxD56LRlmOew9FbDN9gFdaJ6Y80SEvHZjOaUnIchtOJBTv\r\nothj1tuQZlgZiOrCJRy/ItC8ofoTHLQu3/0zcNLZflj5QrU5v6ettlxL24K4\r\nrnvfnk9QYyqhyWfy2AVj0nCozLqXtHQudcFIev3bSQ2k1fx8m+FDraRR4U+T\r\nCcCNElGq1DiL2pNeiZMM0QZjRPXuOqleLBzdII32tI6vVERq1yrWHni6pYZl\r\nLmt6cRPF0ioPn1PvIgYTyhIbgyPCNHBEm8y7cGBzbsXDOvBCvzYZ5kAAVbSq\r\n18GE6lFiUcAOBNLD3HccMnB2CB5KR4Tb0PUfIIBSWiAEIJ2CT6XV5SV5rB3v\r\nbRq48CqKtj27J9Tv423yEmUMmbtgDCp+8OFfEMWC1WISkLkIs7AC8jR+uJkg\r\n0eZMw1ZMVqaZsAXFU5cC9Hr8D3PfCTIjbk0kNrvnUCWC+K4Zn6Vgcf2xVXRG\r\n/UfA/2G4dxI9ZTWc/RLYh4hhTHwWL9J4yD3uLtczNMxrt9B+832oKpiW30my\r\nxn9XG6U+nXLCNm1ZdpwHiqHxnUkWID8yATLsSqqQHDYDbdXo+c/rii6LmOS8\r\nC5TDtvqEGhelcGKU9EvR9DZZFaxNYqgIJOPWubisyhN00I+hz2ApUWmgxiCj\r\nw4IOP+mldVlprbLIJqeNLNh3iCrgmW8vOL0=\r\n=2lEx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.2-alpha.6_1667477457600_0.8988822468507038"},"_hasShrinkwrap":false},"1.2.2-beta.0":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.2-beta.0","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@cosmjs/tendermint-rpc":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContract({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContract()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContract({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    initMsg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    initFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"518e5a5d4c23f58e0aef9cb9cf0f3282f539ae20","_id":"trustlessjs@1.2.2-beta.0","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-HUxrdNDqPht1uk/qV33glaxTPBg60x67e+dDa0RSSJwDzbb+c8JGey5gl/lsaD1OAXY0TIr3yZOJ39ba84or7A==","shasum":"827b045adbc8ca50c97ddda6369b1524f540d799","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.2-beta.0.tgz","fileCount":739,"unpackedSize":20212825,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGhRz7mgoOUqHwOj+FAnDZ2h7XSFDwBevyfRCCBnp23VAiAtNIDRqSgwSj5bawxFSVZLAcay5pw/jq1e3n7snYdolw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY7n1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxWg//Q7hINJzr28Ju4Arw2CKG0fSa86UZ60jmDor1PVHlTiCsIJdC\r\nXXTkohhbK66eU79+j4XDTOJh0f3zJ4ku2MebuCHsLui6OPH5h7MxUX0KV/4X\r\n/J8ARPqdAbSPLcxn/tizmneWfcP2XMb5HxXXl2CFoeGR7GGs+bpiv/38pipI\r\nHQ7Dg9kNHYuNfO9f6Dc92Fa1bqLkFriAXiN/TByxzA2Zxu1xSD7a7dkPFm7A\r\nGC1SUl39AHO2ANjKibaNncnap+fDOcKkv+03WUpOOCUyHFIrjbgxniNqrXNY\r\nemwcZyyz/tpzzlzwDov0xY5gZF/GkalKeWZQpqMGQACA1ZK7Mfod1LLJnJ7y\r\nhJvk5CQmkNXlIgqwNy7MQ5S7hg6SJrVTi5GY348k7upZggucHfW11gw57sED\r\n+bFv22J0AD76k4Ysljiq+V6OrdD8wt81iw0YcMkKLHVDTMQGnpkNUOp3Gg2J\r\nTmhfnu102hkS2bzdwJCPsVjL9h9LoMr/CfjSnxKZh+dFeC4xNKRk51xCvYaN\r\nS2kNv+g2cA5fDgpreOjkCGkVLPDjTvWlNnoc7miDJF31ujcU3Uzyb2asYZbP\r\nhVAZIk9JP7fD2en6lWqfmCj9VqNPl1H8aTlZE4PzQq6m/H7d9HSUMXZcjLnY\r\nDGC6LKoO9YN4apjT2ej28UuIhQ/+Tp0GKRA=\r\n=V4rm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.2-beta.0_1667480053241_0.5825372252635346"},"_hasShrinkwrap":false},"1.2.2-alpha.0":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.2-alpha.0","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@cosmjs/tendermint-rpc":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"54045971c71cea029a35e01aa19cb5f672ddcfaf","_id":"trustlessjs@1.2.2-alpha.0","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-Cuki/y+IgzZMpdVN2ty0Hn7zStpoQ07X6yOnGuzO8a9EHpo6FhuM0r4McAiLL0KqLOSCkbheKtJDdyt5KInImQ==","shasum":"63c134d2fa129b08768545aca59d1becdf9dd0a0","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.2-alpha.0.tgz","fileCount":739,"unpackedSize":20213777,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRJkr4rVJPQK5P5li2aO5oh4ovvWW+NDmbZsSRaXRPsgIgDCrUVZtPdHvTmCGgb1JfaeMe7uA0emOdc7+3ho8c0Y8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY9QdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdJA//ZX5GfQGAmSfTx+9U2MgiamMHCVRiFvdJrBDnnGn5SEdYMG2B\r\n0b4wkp8YTjQy+2Zt2rwvwmzVhNwjAGBPg3GmA5jWXmhQfBYwCjeefoofUpAR\r\n8YvCFjm+6Mt0gmOlqEe70EQbsPVO8F/jO8jkP9ueRpOnJwUYedTSm35k5JeH\r\neCT2MayNWk4Ra3dwzVKm3qYzO3d0N5YxRZ1TgNYZeOUNscF+LFfHWQ+WG7UH\r\nUcZ1A4OHjRlUN1kA3A3ayMMTXEwu/n3KyjjmNRLrZsP7Olu2/JHUX24lQ1wS\r\nZ4yrBXkI5LOkycDVjwNuf5yo0QXqrkpD6RT/EVOnm+7Z/Pq+8Ue1pB2CV5NI\r\nR+74LIKx9BGEssXJ7cJ6b8PB/sHatFOun67OJvsGDrKgfunNgyT3kCmkiSCx\r\nv9VyZXhaDX1ZPdG+GjNwFxS/Cq3ErbRIkJeMr2YFPhZ94pMexKSKJtH7Zkyv\r\n7arnNPZI2BXm/0ED3KaiD2nIhQbQpI0bzEMN/KtkWmG5NYdJFK3iNf9mtmH/\r\nu2DkLv9HJSehJkx5TY+U7dc+3Ps4O0MmrONq/EMpUSCPJVTIV9O8uW/AF0wD\r\nlsEr9EEAqVSLE3f/1nlqpPBRHOpQGcYxl2+m0ItpOQszHcbBhaP8zE9jDId0\r\nfvXWL/mr+fYXHuZPdsZJQntxCHRxgEmn+z0=\r\n=BS9N\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.2-alpha.0_1667486749038_0.5918610180296164"},"_hasShrinkwrap":false},"1.2.2-alpha.1":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.2-alpha.1","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"export NODE_OPTIONS=--openssl-legacy-provider && jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@cosmjs/tendermint-rpc":"0.27.1","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.5.2","bech32":"2.0.0","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.2","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"27.4.7","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  address: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  address: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"76e685df2fac0030fe4373f0746220ce600e7cfa","_id":"trustlessjs@1.2.2-alpha.1","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-wqpK0hBzkGz0paxs8FI8HxTkBQvlPmoKq4nGjO7ru+bcdyevnweKNS2JQqpzOLWKpuXXOkC0mgALHF0VUTOlFQ==","shasum":"69644c39e7041ce476d6530cfc6fc4cebbc4eca4","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.2-alpha.1.tgz","fileCount":739,"unpackedSize":20560052,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA21Fb6fmCiI9rMiqJYYzLzCURW6aCnnJ9xKRXFxrDDsAiEAglsYgNjK4TdeGxQkI0H2PDtBtMxeIBpIYTg0q2fo9zY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY+BFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVxxAAnbuDj6SbUirJ81J/UJOkLqPF/R6AhDulea7LpgcXIoQ3Trj0\r\nh84dGN1m3kTpKkCBizyaZg/eBkbIKNk0sl6sfde/GCS7uV8vp5NWRzUEnRkm\r\ns8RjiEqBLqJqyvAIFacTgwWDhExmgC6rbZhJR+Tt+FQ6b8mHG7pEy/5B0f0L\r\nOz3MIhkjH4WZ2np/YNU3hpy9tH3B6af8CJQ04f3PBet/3f1gD+7X8GSwFeVU\r\ncScl6EJwYj3W0EcsCJwCxNQoIfpTx7lmKYLbqA0URM8F6w9waZvya0p8hwtR\r\nq/2muRkGckefCFxLJ4LBMxvE9swzCrnPwFblUBUoisPZKaUQTZlQQLoix+Cl\r\n/SBowZFmlRMIwxkc1Cyz3qVRH+jQTQOnniLeEbTu8+0M+kgHENZlzS8X6krP\r\nSfe7E8JfH6SvCzWQcfDOoCfOGzgsiv3ldNAn2aPo/ptWYCMgCXBhZqByKryx\r\n4RD++okawXFTLISnl/LKIzdRgENpY1sXms8GgdDu06+nvvEh9vkTdwf5Qs8S\r\npoKEuOooDI29+x3sESRRViYQpajsXbmI1Rasc48x4zUA/7oxus/1DmomRe/4\r\nz8riyzmO5ktFB8WMVeTSLbLuw1iabznH5+JVVL1JFGlg8hI/41g4NQbnq7rP\r\ngZaSfr3n8xHKIC0G/ZqnSIZXygsE5/VmWpY=\r\n=3hyx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.2-alpha.1_1667489861344_0.9122324429409276"},"_hasShrinkwrap":false},"1.2.3-alpha.2":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.3-alpha.2","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"d4b77d6ad63c3bd46f4c260e17717ca1a21bc354","_id":"trustlessjs@1.2.3-alpha.2","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-GTHdYwI/D4x69Qj4570YI20VyiCGz6hYvld1J9O80J/L9gpEOTLTPL/rEnkuJcKG+NrfvdnSgWvJGj3wEXUw8A==","shasum":"5026186af79a576f47f02e4abeb1825c58cee034","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.3-alpha.2.tgz","fileCount":783,"unpackedSize":20701907,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFnqd1uaqCm8vTqPew3iv/bE/ktIBHtLqVotFEUpPVCIAiEA4pR6DrM8ni5/aRvbRTWLrULxvnF4nYGI6s3uMTaSI04="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjg2SOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3LQ//SgvvSRvORjQyczlpuAiofY4QkCabYKc0fDTg3Ln9PgOpYxEc\r\nTq5SW4QK7ifqhYEnCk8Zt0euESglMhLp8XSuz6W3T9DMKggyfrTgwpSc7Lrz\r\nR15RSDngxTFM+F6M7WjVuczYhW5ZXKMZskZno3TT62FTHqkQp/aGoKmzsfL/\r\n5jFhfWuc/9K1m/cYpF58bk1idDOKlJY4q6U8V7tAdu4lePfxSXrAaMkhlbW8\r\nFDqFmHcfopwyRDVeoyJZ82pM8ROWD9vVuv93RqCcxz/K2vGDDGueJwxG1/fn\r\nsX1aQE3SFfUKJ709MXAcrwwHDQd8/CGU6NSGDW4YIZM/yz+nF0nXCqo7ddwk\r\nwmQstSSw2VMSrTPbSptrJHxgYOedL+bPUylh/q53jwfHqUf+4OhWKfYEhKOH\r\nIvcV2wzXUF2biuk7uUjXB9fRjWi/VJIm0mMuH9boXRvAvBWpji6pq+fsRLWS\r\nz3Ezgvx1qkM4utZehKEoy2/HULnwOPy+Sa5tZeirVt124TNhsDq7JiHltxbI\r\nMMEHmzkQWiMAZfHVo/CmwH+NuWkLrivfuyQg3f4Fd0KoY6td4acIV8UCYoRd\r\ng0C1/InPhfIcE2F1Hp0awSVZCu28ZB64wZroD0HX9x/AQRa5eNEEHHx2O4jB\r\nkN+tuRvq5ZoswpXPLmB2SlpDV7i8MW70aFg=\r\n=wNG+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.3-alpha.2_1669555342406_0.7265576835475787"},"_hasShrinkwrap":false},"1.2.3-alpha.3":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.3-alpha.3","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"57a2fe29b482678a626b983487241cc90f5474ae","_id":"trustlessjs@1.2.3-alpha.3","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-HF2AbC41nmxePscw+/E/HLxqCgTdiw+102ougfRuCgWYap/6pmqt//yye+vemSeJjsVY7s9WcxeFbIBu/C1sIg==","shasum":"93bd33d1fdbe5cf40e160e437476e285f0fac955","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.3-alpha.3.tgz","fileCount":783,"unpackedSize":20702026,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOw3dYU9Ke2EDWelagVAeSys2kzSS3zfsUqC8PTF7h9gIhAO8P8M8RDRhdMKee/oItDbDZJttbxGWQM3YZ7BbmQaDV"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjzjiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7aw//byRvC3czWdBmpxpnaK40RVMkXreNp6z3UVz3yvpaMXFrKTwi\r\nqaMu9dih6cenfiM93JHVTqdEypsKe+b2uX7cONjfteY81hPaKFrkc0Vzx/dF\r\nja0tFjMpuP08539Eqvbv7TW61ajx6R1BGENwnVrSGgIA5m+U8khAnaf/1TtB\r\nvwrnrQVc5trtQ466nVnrrKZLLCvMN2oAWv5aa/5kuySGaBUTDsvv0D3OJp9x\r\nhS4EdLk+BOgGHLngoCM1HwNnGQb/KJubf98aTTeruT3XTKY680isRbcJ2kzC\r\nDd9qW0EbWgTmL/bSFmMS/mXjWuaP1U4ukTAfeACgciyZzsZScMM4o8nl/wKB\r\ns7AeEq6rbfK3UiIcAD0au93wFOsYDQoJ6grc4doILf/FundOo6XRstrqFXWQ\r\n4A7znNaOElaLhgcECWcZxN+LXynN7arMlCLWT5mUMeeXls5Wji4YPN8yr+37\r\nkkV89+Y8iCNCmYJBprPkus3F7UCJYUhx+7snt/vnWN5/HzMFMtESZM+wg/wC\r\nHfY+e0DLIKHkpnb0RPGJCb2TeNijoJr6yDcHPdUEwTOr6fjOqgA2IBm0CcpK\r\nxIig8awqy4V94OdtH3QkS1TYo3/VAT0oX318F0IyQ8cUhUJBM2UrMdIXNPxO\r\nwIB1gvaIWEh7UK0soWLJFvlUYcsS2yUAfr0=\r\n=whcK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.3-alpha.3_1670330594476_0.6810545330667139"},"_hasShrinkwrap":false},"1.2.3-alpha.4":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.3-alpha.4","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"267c3f54d566abcc0881271e37213c0b8be81b4f","_id":"trustlessjs@1.2.3-alpha.4","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-pRA20swc87DzaDfhSMF5yihXaTwBX4q7Q+MyYmrti+xVvf2WH4WSx5JG1zjnc1joO0ehYGkMLwofremFd76kOw==","shasum":"b6147a352b080f0a5a242319e0889d1b3ba9c934","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.3-alpha.4.tgz","fileCount":783,"unpackedSize":20779891,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAlP+mGLXFZz4st1eh7qYE4GFSKqTC+hPlPC6RiUGTfVAiEAqXDX8nXg4vXJgSa3rUYqP+58tJ4cVc3Lzn3si5C8K3M="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkiGyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr31A//R9qDdQ6Y+36NRxx9zxrBNPEcoJ2NOw8AlVY/5cOV2rabGGH8\r\nsXFdgM4lj5gfvpsFKYRkczfRAlpuUwxpuDRYp4gVQQmJzU7Y0xVgRHHSE8h5\r\nsYiSxDbh5esJ1YJQ4Vsw19fSVQis9AJUxJnk6Kr7+4Cy75LPpI5Iep6GA/uy\r\nCWaKdoKBL6EU+iEoBLuB+i8SH2197RHrIBMMH0CBrI5m8LBghwWonp1uf0Bz\r\nDllT5yK1gBIKNeNVd/DUeZ1JF9x9dbVOjkkwPFQ5cGZDEbOKyPgX3zqJTiwZ\r\nFS69+xdv2ivauPahpj6rcDYfckxfCnNgLt49i5iCbKo+1UikssmbJ2KpRl5F\r\n8csTDOTYeP8Ze2mc946M2qRP07Vl/L36jQimUAv4wUAPBa+pQJa7bzSgvytJ\r\nUAvvxjCl/XWzv5cRVL0CDAzgARsHKMlVTNAYuXAcKECVeB7N/XVD1oYMIazF\r\nr06WCIlMKX82mXwSm6/2sGQg1BezzHBmqJnk+PqsqtSWCr9gHb15zHZ/6uRQ\r\nQCPVcco39WMzEQDd1eGJ+MJk8qIqtpC2hie92LpaTKtTDIoWJCDTuA7yu1+L\r\nyxSVxlu/8jfkfVFgnk0f8ZHpAUUClc2zd0ghISjenKoQoKiltcXfFxstzCxA\r\nSbMbejcnCUcpLZH1ySP5ZKjOnlm8XdfyZ9Y=\r\n=YhmS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.3-alpha.4_1670521266534_0.06603117372378708"},"_hasShrinkwrap":false},"1.2.3-alpha.5":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.3-alpha.5","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"d527de010d8d625212691029e6f3d708d90da7ab","_id":"trustlessjs@1.2.3-alpha.5","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-lLlqazbUWStPOWFEZNJTkTQ+O7c9eKIeIEouZLw3cMWnJz9JbQRn5hfQRS3IA9/EE7xUH/+DBwevq61d3aco4A==","shasum":"1a7c01077c6bdcaf04e032c89ff3720cc913d297","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.3-alpha.5.tgz","fileCount":783,"unpackedSize":20780146,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAHHzax0xiOEHRVGCyt9iUcUq4n9myryr1XAYkzQMt8oAiEAk0NnOpORQY+9lv7kqWvVVnLBXVsaxHWL/AT7auP2ffE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkiURACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptsQ//RT3egboaccwFIe2I2Z8rTt7Sfm4QL6ciTMCySQ4Rq3G2753q\r\nKldVtzqmv0N3DALCfqZD6LVGR33k+jx4MSxjmzgHoUjOpf9AGFlOlOPenPsN\r\n6QQRmslhLcSr1Fs3MqYdCWiz33GEzIPiu7055JZuoG7EupqUym8aEqT3w+3W\r\nF+xUbkTxOPAsAHRT1g2PA8b3kwxG1hbkvP+S981y9U7tppzHap4ugHzFZN5y\r\nk4TQYjCY6gaE+ARE0C+zJkv3klqf3JWUrsuFb6FxqW9QSxF7kJCZbxxIEsPT\r\nc83r0jtg7WuH+RLGSEBoF2aNbjsL7pqJWpFYKG9pgiZCWwdRQM9By9ipg6O/\r\npfyp67OTUv/4fq6G2YknXh+2tc8Qg459udlWEkbm5uwGj6z9JPFMUrtWP6js\r\njevI0/R1AxOeCZAHuNPZ1w4UcpwyYxVSY/kIDX54yjKAm6UyU0iUJyfqTmnZ\r\noqNpazGRmxpIZVB/MlCsxgRTOSSYktJA5iRk+dwKSJhQ9RiKZaCuRUcZnMaN\r\nL4E4aabWrTTgftxq09re397eS5J3DkLB4cECBjCI/ysru6G1T4zWebuoXcJX\r\nojp/Jx730zUwJJSb1UUn68joJAb8cJo+4CJPr20FtijmRDd+1PdFLoN0kWwi\r\n13HwaD8EM/9C+J8l9XAKkSaT9Gf3lm2bM34=\r\n=Nl0U\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.3-alpha.5_1670522129097_0.02510499465941396"},"_hasShrinkwrap":false},"1.2.3-alpha.6":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.3-alpha.6","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"3f5ed98ead492509860ccc066a6567e6590be817","_id":"trustlessjs@1.2.3-alpha.6","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-oZ0Qb0kyTSHhwMKESRRoHKlChZkZWVyjxEFQ/2nPweAU86d7dSwvjeHThP7OGyQz+0t+SXu3ok9nQX3B3+Kjcw==","shasum":"a02548a700677d7923140c5504b3b30597021c94","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.3-alpha.6.tgz","fileCount":783,"unpackedSize":20780449,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRNOFkyFwtfVaRU5lKsC5fS7IyAQ8cIp+JQqqeTO8wFQIgbcGZmjSWo8jwHqbUiLFAh+B2a7Yyx0kx2b/h0qhlbD0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoY7OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3GQ//RuZTMmsgwxqtt1W/ng8jmLJuLwFe67X6M/67jsZEB/9zj7es\r\n79beB81JPK7Gbtc2mqCaWSN33OYeISMJ3cqEnGoaH4t9/ooRKRqs69l8dFLP\r\nNwi7XHdRvysaeaBdQR4iVgn+458A56h+cJuhIssVJZx4rAiZ0NL0GrIDJNg5\r\nv1eXyKKpC+G5KeIf9Nex0/AtcE5XQnfXkpc2s+rN5eOF3Uihxz2ZWpQaViq0\r\nley83nfwlBfBM8wfJkzyR2PlZa1otg+cZrAAJ1VeImBpzzEsHO1wKcvz+eMQ\r\n+qgkUqYV2EXUft+xDRvwsG2ZWnM/cEiJbWACjhEtng46ihd4khFdRzp9ZyLE\r\nLmBKmXxid+XJIacqv0VEGMPOnaYvtAToIHsdb//46qFYQ/F9/bG/zHOAVdMg\r\n4QDTy6f/tEcjpR+mwFKOShuMIn7XtCZugofZ43nft6ZR1CvrKGZUHtSSzV9Q\r\nnnG0wXJ1vhMNm+Yflyd/aqeXx6ew6s3513di+tgQ42BzHaaQO6fS3W+ZLiq2\r\nDfpWN96BIggqlAuQRHE9repJXLeY2znaIiNW+svwNzAW+mXyEnjIobBJS0Cd\r\nvHtN/tlduGF6usBR68FOLFdohX6qLt3NZ2O1YNGFzgUWlCOoC7cpe795MITP\r\n3J/Apnd1qy2IDzvysSuMw+pf5e7OgABJKYQ=\r\n=Jzop\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.3-alpha.6_1671532238026_0.9429305471339195"},"_hasShrinkwrap":false},"1.2.3-alpha.7":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.3-alpha.7","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"05925e7736369dcdb9579ecc97292b720f595d3f","_id":"trustlessjs@1.2.3-alpha.7","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-V1mkmDeKCLEHNd6O5oU1ll6AtqLZU2qUVsVV/duWd6r5vOo0L5Q15Dixqt7Ur96wxfx8Ey9UQiliA3GlFlIrGg==","shasum":"3078c71753e05ffb825205b53b6453c694dbac3c","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.3-alpha.7.tgz","fileCount":787,"unpackedSize":20841331,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHbzTgAT//77uCw1fFXtfNu8YfPtyaEapYs2Q9dI6zvdAiBazGIz3bV1JDjKKg2ZGTpITsYsoS0H9lYaBLzTKXfEfg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjw/SVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqS1BAAhG2tzxsO7X8qdNSYjdMCvjottBXwMF0GoYansLlrGGijuo4z\r\nWAdSXdRhBe+W8zvYSaN7yhFds4Gbz7FWFZvbTqQE/wtyyObzTGqXlBFzmmfC\r\nC+CblOEcqo7j70yJxB48eWbXVasOwCZuGNLQcb9TJNMbHl2fSrM3gYT2DGXi\r\nLzwM6nbxiv8+V3kYkt4RQlxL4/hSk6B/l+Zc2qoSDHQCPIOnZrdvpdtMpA8D\r\nBKwvRiSawMxFk3IcZ4tvcaqDi+ajXWocpXYR/CTHZfqxlWnew8D+GzpEZBjO\r\nSHo2SnY8qVbCX5IgOO9teyJEsxOF906QDQ5h4iAuRSwtI+UgozoVUeuB+PMQ\r\nj0EopzD690ysGcPBt/k7SVUmxJnrbSV0j6PbX5LbCI1EjNjkg+xQyi2EiZR3\r\nYZfqBUou82BppiXz4pOgNcwG5HMecbhqX5nI5rDJod+VoWy78t5tXvVgFAxC\r\nlPgPxk/AgMp6wYwuGgDbcAYJgcsOTP9t+bT/SMW6i7M7U+mosF1CwlRKnbs9\r\nU2zFbSIb4zbfojEoG8vZsOpv/eWdWe9Z+s79tyb22tXvvaU8dvGrSWbEOmIa\r\niD7LkvlWciNgUkw3HqnSBdyseijSAtx0zZ0wmL83Olyu1x6SApARXrUahEO/\r\ncp2UqvHCtJAdPvWHJHBG/x5/Fv/CnbMUzUE=\r\n=34lz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.3-alpha.7_1673786516799_0.9706629135876841"},"_hasShrinkwrap":false},"1.2.3-beta.0":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.3-beta.0","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"7ac8cdc40aeb019bd32dff403c09ae2a3c6d68d9","_id":"trustlessjs@1.2.3-beta.0","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-KdueZ3yMY+ODe3aIhTOrlxJ8oXY/LvO+tzbvAWqGVH/8f+By/+FAO8NQ+HhaP5QlEdng/uUw21eDXoYnVTWZAA==","shasum":"8852e27f5735539cec85b69a5f8cda43c7c67934","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.3-beta.0.tgz","fileCount":807,"unpackedSize":21158825,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTdap5HS2cc3sR6eyReTRFtZjRqnymfEKnEytwdgHXBgIgboFwD+Y99XVRWOPtszTITCOYBkHDc1nG6xKo+1Mb0go="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjzP3UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkSw//TY8wsgWU5fDgvHAVMhUUbfwWKGXcbpcOfWIbdo6eXPNn9lil\r\nbXhWFWdJxvRsFOzaPjbppQRlG5y8+zhEvgzEVmdC0Z7d61tzW3/enjeQRxHH\r\n4h1tX+X0Ism+BWwXkndpTgM5T9W0/r4fTtnVhmRaNCEML13fvymxE8XeZNav\r\nJLND56/KAo4xOn2v2oB1K0ytl9DhEUQGcp2tu84QzHViJvFu1mX/cBc7W525\r\nmvnn1/puHtA5VPPh4g8dkFvVObF/ax5jkNKWmYt/F90OvJQVAgafzgkpWycV\r\ntuerhzret3n802S6gHIKCcz6oDTwXZxVhwaPYc1U7CxNTz+5gUt08aaujqlK\r\nYxwHeXsfHyHTXVcarQQrCRxS/ZZHlC11WcH8x4+h7FHMKCAGYsEahtkl/ebk\r\nxHXQ31jHChabQdfFGNtw5PwAUS6jkty3H6oi/7SJ/wOVr3VIUBabGlN8tJc3\r\nWZoBuvY1FjFdgPJLn5+nQvk3NzM4HhtvVLY/ekZ6MrG70wY1l9bykr4OwUg5\r\nJNm2KCjM7IYYXsHwD1CbKqfH5JDHBVeLjAX90i1NGv3aW9+BPEIpUb5YTfAW\r\nD7Hk7L3+/dKj4tr0CA/HcaotPgPO6mZaMuWNeW5XKRrf7FAC+sC1HG/pqdhY\r\n2lDTiz4746F0EqtcOm/z1QtEeSV26npLfUM=\r\n=I2Kq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.3-beta.0_1674378708433_0.5647467370685542"},"_hasShrinkwrap":false},"1.2.3-alpha.0":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.3-alpha.0","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"7134c6757bd49dacb922a6b8e99a79fb711c38df","_id":"trustlessjs@1.2.3-alpha.0","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-PHx79AxTJUUlWmdGzepPPASRqocyFxe1qEeRdBw8o5Pf1B41AXy214/t2NrxK3ygSFbRn7kc9VnzgxJ49UlebQ==","shasum":"8acbef896d5165479d4f8702838419d00876aad5","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.3-alpha.0.tgz","fileCount":807,"unpackedSize":21158578,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzHccD5ylHGR3aZk7sFJl8m8SyohRWRffchFXGov5rJAIgREoRLXQDl3mrRUpMtbmLmJg7YAF+WMlyJ6tcVGJpS9U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjzSl9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqv7A//QUJ9XR5VguZxXk0HmWoqeYdX0iTswWrjjhq0LOtQweTbQ4QU\r\nQ8YaIT0gzNe5fUgrFxN0CwG71So7Uf4QIGhLYM6aD5y7zXka0M+Fl6VB2mX7\r\nlErA43Lp/m+VfRMhZO/tZxD8BsJZgj6g7/xTPM10hLi0OVDa4zCC1RkpFQz7\r\njpLvaAVL5EGOXy2f9nxNYMqTKeTeLii9FpKWMgzVOrq9hQPJO4uWtJefht+7\r\nomTPKQfBGoTuVo0Rz80yZEfYj5uJy0WPGod1wdOUxJ0DepKET5TVQDZwIUhY\r\nmLbDEqhKZMPjcCsYMdV9plYgRcE8K0HzQDrOvSsAp5xkhyHpuQPlnNHT+1Xb\r\ndttPRR2u/5TrT7YuReRwSEHfBn384kkwzi6rnnMh5EHOLPsFTD7fH6f+Elo2\r\nwzR8Kl3557bBmBg2sQd4o5Li65CxYBOw9EcJh479tj98gfnKrLJky1CSSiWZ\r\nQBIlIKiK7nEhF+sxn5U9SrY6YDeOSKElFvlXFhV4j9nDE2rngYCdJfLQu6w8\r\nVwiz9Cg7Ur1LYoJK9PB/B5/IF90Qz9b5k7RQ28M7kEVYD1MLUKha/75OvXo3\r\nv6nKVUFxb0BBhxoTfqEs92v3xYO8W+wxsf4KQjLpFCuVXbilMYD/Ke1gQgPx\r\nYywVGRFHxRyMeTKvL0tHMiSvEyug1nDK3j0=\r\n=MPAw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.3-alpha.0_1674389885399_0.9771486640767446"},"_hasShrinkwrap":false},"1.2.3-alpha.1":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.3-alpha.1","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"7011c93ddc87e0613f85c6f1ac7564c1a477f7bc","_id":"trustlessjs@1.2.3-alpha.1","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-RXmvstHkYbDWg0ikDZQjpO0OnKIH3Xj7SR42c9Ptgvc8a/L1USg0ldH2EZJYVuqfb08O1AA00dR7m5RBZN21vg==","shasum":"cb0b693b17dbf72d43c81423470c4d68f4eb8e0c","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.3-alpha.1.tgz","fileCount":799,"unpackedSize":21138607,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2+vtprQLcFMvOwIZk9DCvHCf3njOpeHZGPEtzERPPiwIgSFB0O5KdNI4NQpDRW1txxD/rEPDnISz8TZDTfRZr8cg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1QumACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpTA//YuatoXUfzACQotHCeOMq1d5t1oSjgb3VsI85r1ztbuKAsAn3\r\nXHikmupTv6+UAYSyw0o+X6lJeWZKUBA6fuKjxbioCUfQSj5BZlnfSuj0cvAQ\r\n8TyhZMIGDiPIIgXw6/VYO6K6pCXIPAsmScraVuiPAssVSvJdRAETavkE4vDm\r\ntbV05o6qjzEDVEjqbDtvnUYQF+zzNwP5lbY+6tsQ1OoWkbm+wp+D7p+kzKL/\r\nzxc243KKNV8r0HPoPHTSotHpSMFoNFeZt58fhuCrizF3Agy3n+nuIeivfhSO\r\nCg/o31Fa6VD+S7oGwylnTNoJxC9XRHAumpfkv6TjMmEarZ2DRyiBF4rCxB54\r\nrBUf50W2B3nwpjOv0TtkHSfgpKrlN49fehA63mWYRYTVVUdUKvuXiieI66Nj\r\nRA3RmOyCkZbbZ5nD9QF34LloGiP4vNn2vHoWUs2BZKxGvePm96z9YtkklQPU\r\nlkVx3p6hc1mE1+362Al9zvOmT+/4c8bOraZ32mc8cav3wc44mxfPNBXWHTD3\r\nX7WY57lKSxvuDIkgNSvZ/tKnrZJmYrpm/VNj0rHLHgpJSWPWfuOxpqhuNnqH\r\noRoeuECR+UQeMM4bqwhdjYL9LO7rFt9MwIf3kkc+kZ1gJciGHtkCQTPmP1Qv\r\n7jgXcsNwY9zAIwJnF1TfCXEh5F565BQRIHU=\r\n=IXQp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.3-alpha.1_1674906534337_0.7870570303410596"},"_hasShrinkwrap":false},"1.2.3-beta.1":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.3-beta.1","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"f6926a475a703e601e902cdb27b0c2c4088c6d43","_id":"trustlessjs@1.2.3-beta.1","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-dPBZGCLxqIJL7oFkwzuE/IEiVEjoDDdiGg+nFKb4c4LsiIWAQ55kcuHrktLuGipERVdbQ/Mc3kiZrjFK01gWfQ==","shasum":"4e049929b8bc005d25835f10ca02a30d0f8a51ef","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.3-beta.1.tgz","fileCount":799,"unpackedSize":21138590,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAORREfvnxaqiBM1lzvog/8k+3dR6T7qU2ZvdmFOFVfFAiBxAzsReVL1U7QENg/W5qG90TbAhN9HU65drFKPfWWkXw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1Q8rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIEw//TsIvgxCmIpQgr/QvjpmaqMDsct0SsvejWUbB0KyaOFcYMFQE\r\nOwZkuYJkMdBgQ12C4Sff8bK/uvhebn5yuDFea8TLLnUHym1r22xMZ9aKsXmm\r\nHKOlJhffnmARFHKCSRgoKt6uWtDNdTeY+JOgc5uwFSWV82VDqDDtRAeJNheM\r\n0Eyzr/9ucfTsfHwM5pf585I6trmQczChz9zEpXz3c5g5favRVlYibXYqJzwe\r\nr1g0ydjfb1mtAITG4xLWSRF+zLFF5yOvQhCUGuYIs+vMyxSUeiEhbYYxceIP\r\n3hCi1Rmu0SuUhtlEpbXpw6dgSC8g6wyuXA96JZeSsuUEqGznQ3tMgeu1HCR/\r\nIsmhbxXV7vYdBYRM8ATyNguc/aNGmveO4/mQsEdej3Ck+guxOFzwAhmrIC5Q\r\n9S8SZZzSNOBEUCRqvj39Wn+G8n9dXN/xLmgMjVqFW8tFG8MI0XB/ts5LoP/L\r\n1lJ2rcntTx5VH6JIMKmn/gGX4t4TDrtuj7d9BJ8eeR1JUns8nFGazqW1EcvL\r\nMhjkgLLT1ujgtombQlrX9SbVJuh3owroaxg4sOWYxQFjL7u9vevkCFo7DzjI\r\nXKnNvs7vJG7fB50oKKLhNayVtQyBCBGTO5bzoac4Q86/HEbrSt5eC1Zg9HMv\r\nnrJBBqk7M/TtVAD+uU22PUgkBl5jkkkiwyA=\r\n=kK1L\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.3-beta.1_1674907434713_0.5239431883269932"},"_hasShrinkwrap":false},"1.2.4-alpha.2":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.2","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"cff5a28fcf2537809e6feb691c88bad37b5704b8","_id":"trustlessjs@1.2.4-alpha.2","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-voAG9x5BwHFCFJvQiF0kzvaeBD1pgtpbEgBKVoS/ndUJyRGRD99oQuggUdCsPb5BaNsdFuCTeleMS51ISR0MeQ==","shasum":"4f1c136ae0919df7e6a2a0ebcd579bb41468d2cf","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.2.tgz","fileCount":799,"unpackedSize":21138384,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID/hr3M2hjGMPtNa0bX645AhQfnuGQinflh4yX1usyihAiEAqBuGnvynNFxNrYDy8COnRoMDX4FOavgDjkCh3OGIzuk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1SK4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSzg/8DF84WoqIUvv7lfzzyPCVZH0UC1QtTrdL00EADjYled+EJWv+\r\no0bOhHVtA0hvCewoqYztVIeJaa1Cr8I1Mgspv/yeXCsSnVKWUrdLfEhZLqcr\r\nveXmXL51RilNlehv4eA5zT4cOS/+It8mCM6Ucl249QhXeKOBb1ZRtBOrhDXa\r\nUEyUvytxBAgZ7Boq1UHBXtB7o/+utOU7WnROrRtMmj0ZkkJ5yzidbh3vxg4Q\r\nhzmRqmVuv02iwlQNU+RfIVHLMqrUdAz6b6fHwH8guIvmW2iwUVoBhGG6LGVk\r\npJrk4EWZ1UEZ5honddKwX009t1ollQ9Z3WNCvQ9TCJOcpVywl5mMAUEd5lhV\r\npGc3igUv0/162+KLKAVqtGYLTCYnXyg7YNZmDFDOEW/ARqAstmVLLesridhk\r\nJuawfKLAR5lPV1diTYEQobf1os+j96ObUhI11etE+IK5QDmahiTWdxA/8E3/\r\n9VUQfBilJlFB5TOxO3bJK5YdnRB4nhl2WDCZVSSD2v8PCCV2DDHy8GCnYD3q\r\nk/91sxI8gRu+j0De/wtvtoF1YCAsG0vd4IlplMs9ZPEn8FCl5IP+G7nQC7GT\r\noKLlPfkpGGRwFfJuKY/8IIEyTDxXkb4rZ2KaNnJq3wAjYjo1FAaLjS8PMyoB\r\ncts9smm7F9jryKsUa8t3zphk97vZpFemYuY=\r\n=BKxi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.2_1674912440479_0.8392613107413822"},"_hasShrinkwrap":false},"1.2.4-alpha.3":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.3","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"5ab2e2ca5ed6a39d43aed89a2fc7a9bf019e4922","_id":"trustlessjs@1.2.4-alpha.3","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-E3nmh0GHvRhA3bBGD21KW6JrGTcLq2IKkJaAoJaQrgrAnPUcHpVZFjT0BMKhovt0Rb4e30/PUZnOpvrAhBZ+wg==","shasum":"51d17f58e2e40990a4eebbc32464af0a6022b250","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.3.tgz","fileCount":799,"unpackedSize":21138970,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqMpNbfilIBCxBmwM3tUAbTPg+tVyj0fE7mdlETpaYiQIhAJVHb9A8LtTmrte0K0+750vEKhgiEAWAw8GX6tuYKeB1"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj34bhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFhg/7B4Zm58LtFyih9rY5heI4GkMZ5ZQzQHk7GymElqoTR+RdhGFd\r\n0P2MeHnouR6MMBzNiK3/0NmFP8OTgr/efYubQt1foOjaJzcQKi8OT/kcmLu9\r\n6i9YKD686wep5NK3/09a2X2r1dLjxYyKjZXTWrDp7kuegWIUuhfSQBdsAVrG\r\nXJoIYit8VNOGce6twdWdCudVpFd3omXXC2CQdF2b59hLuP/m/T1ctxFtWDG6\r\nUtgOtUq6W3qlfbCk6TwXjzLjRZl9z7oW9aTxE+LMr6rcAykJBlupUU+tB6lf\r\nrbJF3Un8JGtmgDOke6w76wzDi7tiBajiCYc/ob/q2g+7KWvvkWPlFYNMlH+s\r\ndoCKi9OXRt2ZxOyvgIKM0gNngfSapIm29W0WUp95CpN3j2QBtQLm9kdX1BXd\r\ngp/9cbEHZBpKX+AtR6HMQiPyamvkPMorOSnmLe12A9S5wZZNi+5r2h02ufvO\r\n9T3H35ITAou65sy5aBJF+Sd+DEVI+pxs94vPYWkJ00XKvq1+alhfezLIooSr\r\nNKtZIrmlcbawqV+cYJxYSo0nseWfxDJWJ2OEr/Hp4euP4mskHlB32486EAxU\r\n+GaNUDGevzrehoP96aZHmO/1Sjvsh88ATh7ITfvehBS9ZowATKXpgfIc0XOj\r\nWisfDn1ROPge0OanS8JgndiMsy/hf0tBTCY=\r\n=QGuT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.3_1675593441614_0.27061310607409816"},"_hasShrinkwrap":false},"1.2.4-alpha.4":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.4","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"ecd48cf0e7e24ed631ca1687d0fa1c68b78e9a68","_id":"trustlessjs@1.2.4-alpha.4","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-NmOarCFBXh+xomuWIyv7pEWOxTT/RxqFzDhBjRfscIWrZtLxVKWHGDzWC4KXABdOPhhsJ2zWEn3gxRv1liKQrA==","shasum":"ab5e8756585757558cab389e5749c99ef45e92d2","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.4.tgz","fileCount":815,"unpackedSize":21508165,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf2p+/cYUUJZcjZiLYyc8DpM/b8z7mkj9Ff4NWj25HjwIhAMOpqu6LoCBuXCp+fWNxk9Ap93IjhAj6XR1fBPcX97sx"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj37hzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4mA/+Iu99t/vz4eOIwsTVayDhwJVK3udVLGL/pFrwbzzGAfzsiG+R\r\nhsj7hx/a2GIRDbuwPTtPtQwHzotcFrZLmVe4iutD0I0yKWwJGwOkh90KgBc4\r\n/22HO+kD3wq4WY+YLM4B+D7crpxxZRA9s9RQXvpW3Mh5yFn197PU91EKFLvK\r\n/pgCmsZQfOTemBwy6QfxYhDjipmjJehbHFwmZub/H2wZ7iGcPeSuUPIlZr0/\r\nbZnEG0s62ITWKHc02/j9HQVLfA38PeVuJJ+EPbXrUTE/Ddqr+XL3jG/9qWcC\r\npzWeF612s6A2wlHNXt1fEGJqg4IuLtMd3Yd2tqr19WXCKAhNSHjchqysBtXr\r\nFvUOLP+dpGvaaEpSWn+K9JsS5vfAwi4YXRlRFP8O2g2R1XQ7No+lKB7Uf4IL\r\nVeLVXzqZncRHcOBGLsijlqk8SaDR92M+zfN/8UcAV/91rjiFqK/aoBIIWybZ\r\n77BRWjHn3aQmhx2F21oVGxFGW1dwx1E1kEfqt8G0yRJ3LU4mlbEu6hwRJ6q4\r\nGX5FwvqXLRNPCROSAbTQl8Vzu5aVShspnv5Vy5bdvm+TPzH1JfIeYbF50/6l\r\nMu4T6IbHl2jSKOCnQ+eNZzDixvf7JrW0CQUftpUFFUQ3vrilHMklNACH/T4I\r\nnZ27Tg7F/znWeX7dD3GSY6IkzcDhEYt4jRY=\r\n=Bne8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.4_1675606131063_0.39397404717104645"},"_hasShrinkwrap":false},"1.2.4-alpha.5":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.5","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"3e9ba0b0f95e6af60df00673b205ee4638b39c19","_id":"trustlessjs@1.2.4-alpha.5","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-Enb0k/Wmew+YOajzL12jsGhL6MkOpi/34pp8SLX06yTmvXlL+Y6ZILVSpRd0eep/sf2oWpiAerhSs1tiZCu3tA==","shasum":"4b93e41ed7e450b551dc8f772cf5ab7bb37b74c6","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.5.tgz","fileCount":815,"unpackedSize":21536529,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkLRw5JfMuXM3H9cnhONZNIfiNngCF14UmflSI1f6RbAIgQjoBqeZJyiHcHPMquUcoWukixnQjCuh4fqR9QKyD8wU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3+vaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSRw/+KQ0JdCD67AbMJC7WFHZweYaQxiETTNU8E3zcL5tbKkt8GeYH\r\nIfcrkCi4v2a1en/wItG3bOzrZZR6jjcSgoWjVL9zJAquZ4plQTaKovcK21/I\r\nVfRsXVYvcxiBnG5Lej+dxOMfE3r27pILvU3eM99c0uk7SQs6RhiXibZcXTYa\r\nzfhn36uhY3z8FZhZHfYXKp3vS3JJkYo+jTqRfRU/EoTcsX1xp3vnayOhHlSc\r\nxzxF+sCxiu1fh+73CCL9+XEqWXdTKLs4JN7U2r6+/GxPL7rTyBUiYwMo7hbQ\r\nVOrFN8ZliFNsuOTq537nelD3PxW07CldyPIVYT5AqJPBsK9/uNIZfDMptFZt\r\nYIy0UdVsIcvOGHQih6XaFUWwkPl4Wd2517PN5RxjczvvOavoVwCXxzOyQpUg\r\nBX1YoiaDM8ofgK9TW9hFxkuFax8ZTypUwcMlBLYaMOQdsChWxeir4CKHbnkd\r\nSQAeh+EO1xyPExmjdn7e4wo1TO9Yu51h6Yk/s8xvKnErm08gf/ZRJyaBkMZG\r\nR4+WsWxEKLrpdfRBZrr4qoWlMhO3EiaNUep7jYyaxUhuBMczVHQ/uFi5C1w4\r\nH7/AqpHdwaF1AFHOA7lEELSucKbNANuSYzxHwvL14quL2OsG6ZN+K048zupd\r\nvUSrpsBNZpF7Ywof3Hyyg8Bi4D6m++7pkUk=\r\n=WPZx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.5_1675619290627_0.9174293969527938"},"_hasShrinkwrap":false},"1.2.4-alpha.6":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.6","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"4edf3346d72438a685ab4d3a1c745a067e089659","_id":"trustlessjs@1.2.4-alpha.6","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-yt4Oeur/kL9BXagdT7gQFN0c4axUsMqlZ+kcXoceYj+S0RpREVe8T/YPrAOXfFRsqUPPEe+2f5R4IfGgWwz7uA==","shasum":"cec71bab2b42084e09a28697ad0984e735f259ff","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.6.tgz","fileCount":815,"unpackedSize":21583426,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDRuXGbUiPQxM3V7WzAcrSVvG97Uv0HOCnkBW2wh6BLvAiA0MP8XHAorEt/5b+/WlHjIKD7P7fnkpAOEpl7QDji2eQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8zdQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpl+w//aotY4yCXNMHry0+h99yDOJD9FLk6v8c6h5xMk9QOeuI8goL+\r\npfD5+q6TKaL9F7C+F+/1fd4oX/Ks4k4ltFWZfd6XMtrtZW2m+Kg8S++RJUe8\r\nV5qd17EJseN5t4UAQUpkxWH1SBEG8ZOj2fDaZhsd26A0qsAu2BN5T0hHVQEc\r\nZI1rRxbFPJNcM3RmQvoGtmdnLsww/Qu28GszxUF9jZZ5I4vvDlWjOgTSSwYz\r\nLLQbimOn3ftAUgyqZ8Gz2CJiM5+yhXOV+dfGNsgznnM2cuDsoZApmAmD0OEU\r\noKWyWqJr9fKHJyhZJ+YAZsw6pwyyxsurr4541TpJJQlFX/vYlzHiK2hxC/Ta\r\nVRQ5uOEcjm9DRFrI/N2CpW/R/hQoZi6cW9XxiRBaeGAUBwy78ND64Y/BgKpo\r\nn+ZIrmGXUoL44doh9WxEifEEvLBVMBOG6IJZeFqI2f9Li6M0ghP/2fWJ6wl5\r\n0jF4ACxVES1wDX60FpjjE5PpNjMEKHwsHMoTVEY08dkqEcxr+GPafOGJQTgY\r\nf6y/ze9bkGCYfTTWNdTxMabGusyBtJMUF6zdRjEA8fXsSbMm+tQ8eWzUPw0h\r\nVuhyQj4KUoM1RA05vcWp3qw7proDbAzGZpqV9UVOu5CvI8FY3UMoWL837GOX\r\nGSqvnNwlXfVgQ2jrUG+kUazG6T5G/3rMu1U=\r\n=mW5J\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.6_1676883791837_0.32060752158164507"},"_hasShrinkwrap":false},"1.2.4-alpha.7":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.7","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"43fd8b722884afa2a57d20a81e06b3af9f3f246c","_id":"trustlessjs@1.2.4-alpha.7","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-XoRS5cxhtsxsYT7mv1pDj08Xk2UlHIaKGqgb3/st7eBaj+uXhfayJSC9rYk1eZ9M5JV9f2nFvLhDzS38G13KDg==","shasum":"81923b9cd1f577b0040e39f8ba34c32350de8d97","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.7.tgz","fileCount":815,"unpackedSize":21583412,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/oaXrQThtH4+mbkWYODkPKmhcbi4LwrTjh/pr+BzIVAIgBYt+oGdXp5OfpCdyoKvp7ug9xF9Q9twcuVf5XI51b8s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj86QIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgmQ//b9E0M3A9itb+joxiVMhESVMbfF+MybvmKhjBpwfrKw1Rvm3l\r\nwwRB++RLjcIn3+AdKcM7MC0gqvZ27J2Rz8YL56VKxZ5w96mAGKk0rmbQ7uJp\r\noKFBSmRoPdYURJZ+xHTLXnMmJLXDMbGdGB/ECmSAbjP5xw5uvCUGpzEdB14E\r\n4yIcDzjHTtgz45KpxX9GuU8LqhDvCupQqPemi/8k3tj+cImev3j2PoklNlcv\r\nsDJQPoUseQeimTtPL4bNkF6k+pDMbgkYL3Tp0L6vLJu00IO3Vb7JTP8y8ura\r\nsY7mPmZA3EzJynyBjfti6/X5jKUvO+WTOZr9YOwVZTdVBfSRGjShvHj+Qs/e\r\n6lvPCzAULIpQ+9FuEtx4xo5LDdXLEiMduYg5mC47RqwYlApf9xY8+5Ronqjp\r\nebLX6h7FSpylGzYmJrchuxPLvotxzkJOd6IcmMKmHE3/mICbbiNrikb9fWRi\r\nogc2xBvfakfNp3hSLNIX+wEKTFvK1ORjN8sY00OHHme0XYuqfsolmeOJYxr2\r\n43buKCpfB6cPJ3b5FU8rDPS4uGWfX5t2q3dhKwGOCLIeoFIOUZMqVpUno73h\r\ndRfOEv6CMMsF+gVgur5caa9f1Yv0lt//rh58U04Mr5WInJSo1tDeXknw9YLi\r\nRtAXNAyraj7U7pQhjoMgV4LG7cli/uabXOU=\r\n=NwyJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.7_1676911624527_0.23669488221984047"},"_hasShrinkwrap":false},"1.2.4-alpha.8":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.8","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"8246b242b5b7508059cf4583b83160d52ba48b91","_id":"trustlessjs@1.2.4-alpha.8","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-TVl6wLxmKYCjB7RRyiM9dCvEu1yHSPKhtbHJQKGqUZyJmaQpcVBnM69YXera0267xQcTZffO9KK9JPKjql8uog==","shasum":"40372c0e2b4cac64e94191c55a9ae881f78b2fb2","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.8.tgz","fileCount":815,"unpackedSize":21575505,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZygoToCJD50xsdxkyklnvRFGtsE7rkZGVQXRYnlmkOAiEAkuVKN3cfwrU1CKbJbRa0YSe2vXiBBv+hxvWc7JMEVqg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj86Y/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/hQ/9GLciZJdBXwa0GMCeUTNIu61CIy4pNh5Sx2qFi6zAHLpFV3BO\r\nPOoTFVzue7sOhisNpm3VRFusvYap7CIlJkXZf4iud+s+JRzSYBHRbuxR+kPy\r\nLFINeZbvrR/z5n5zntOeWjqlwkJyGnuwYebPQ5RtcRsmKF3151ZwkiOhSyCw\r\nyxfYQcHwuOr3cYEukDFxN+rArjOl8SkDAflJY8D2eJd7UABJMrZVkZwtqFls\r\ntxNVL3ZkB+zhIA1Yq/NZC9puAYUzzhlhrI6yFK3ByaW2TUagQiRNClo3rRph\r\nHzNTbSdtvocLy/PZikRiL16i+uT+EK+zrr+WnhFIG58e//ir3mdFx2t9P0fR\r\nCRtb/IC6IDeVUlPIpyMrknYxN4jkOIpWxL+8B9qIVNcK0UbYV/YPMzDKSS//\r\nCdJD2qr/iaWrZmqd7xxDS78lqsrYQt+ls/B3zkzlzgbWQR1pJfK0s4AyRAUi\r\nGm9QxnW4ba3R7V3V+0TEotY960g9fnQjFFnqXF/o86z56o5Y36Jhkq9JVjZ7\r\naMNw3wpR4rZ/C1adYVyiidth0D2CX0ApAu2ZXNXAliJpF13NmGwbvPz4BAJB\r\nTu8pmeMlxymcIoKAL4gUL38IkEUAz/o8ZxbECdgIl1zYH9m2rkiodtyv9ge1\r\nvxq5RED8zIjMwDlPo8tVLc2ZW5Byf7n96Oo=\r\n=1Utu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.8_1676912191271_0.3915482077128256"},"_hasShrinkwrap":false},"1.2.4-alpha.9":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.9","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"58cfc32d97c6ad039ab7bd2211c8dcb958288f41","_id":"trustlessjs@1.2.4-alpha.9","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-BmnNZ5yectSP/SsNi63mm2sqyNjzihM37nrM6JpNdupdUMQrMVuzgyzZCXCryjDWIYu5fUqw1MFOBMv9AwbGYw==","shasum":"94ad8a74730059ddf55d0d3f7c49fdc7cbd716f5","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.9.tgz","fileCount":815,"unpackedSize":21709273,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGu7N51XTZUwvC3mXX9ghc7P1f3/Kd4UDInqpyp4q+MjAiASb8s747gIDXzznzFpPvKNLJ8YVP3JMPTQt2Hb7KRoXw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9JP8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqpxw/8Dedzq++KkHi5YDl0RDCcXP3pocqGDixC5y6J/3uHdQkUtfRe\r\nwFiOSthpPV/IIfjoNNAqy3dEUTB/ABpOODjgSm1USkfIdCQeI9IQXr/C9kBN\r\nBwNSjKpcmpBzI3IVO7GXBysY62ZJrhvHf+CnzDtN0Vp32km3P9LTg83d1Z54\r\n+pNPMFugHKsXwkYGcPz8cqD6V2ZcKyBlsFpcGVTEcWEDJ8WrH393La/XPxrx\r\nluu4uq8WCa3hSXK9otKbQ9v8kMSX5Z1uMDtL0oqT75GryX5bWzjl+VH875DJ\r\nvlmRdBofZYKFPH+0/dd0xWtYL99FZ+2J9VEwTh3j/QifS18Gf8PrQNhyeMNi\r\nnerXblaJ7Anwc0Jt0w8X1S3WlD0wV8q6RcJ80uaMIwxPrBsVn4PYl11cCC3N\r\ndyhK+FXw3TfCa80/8gR9leMp1DPP496LT2dzC1nikjL/CyIh4FgjB938mJui\r\nU/vhtICG3oyswgg8PDTbMIUOm0XytePKPqwpGebLr2109ZvP0fyfrmS4jy/j\r\n+nZT4Yp+K32QKSNtUha88Ie3mUNoX+NbTwlxKPKpQhv8viWrGaTeEMRsACaI\r\nfRmKqN2k5Azx1Jr7SWeP3jpAHeHNjI4/nUMFVPJq3/cjmORndB/8F+AdOv/M\r\nLJlC2os0lHs+oagKdCwO6bwEeNfRiksQHoA=\r\n=vccO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.9_1676973052388_0.7635140245305612"},"_hasShrinkwrap":false},"1.2.4-alpha.10":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.10","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"363cc3242205fd0ee35cad4fe9f5310853e0f072","_id":"trustlessjs@1.2.4-alpha.10","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-Ya5WhLu3sFwZl6XBFYgCUDTWkWphh9Jfadfn3ZAtu+EVfGoMvTYKBa1UR1zV6lrUUsLdg4egK9C0/hFgtz2ERQ==","shasum":"918770ac642c65d75ebb3d1bb064b3adeef5dd43","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.10.tgz","fileCount":815,"unpackedSize":21770234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFfDob0j8X0Jkh+dU5RFviCzB17dcpu636Rmha7j1kolAiAg3suPpcBlBGaZiNxmMdxDPPsAMA2w0G4WnOYzs4ZaYw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJxQJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXhg/+LeT09m8hyEx6d4ufou/GfC9LxlvXEKOyNlu933BIe58ABrBK\r\nWJxDGQx9VVgW44DTrZUvH2Bnmxke0bbwz0TaGVRL/OcnFuruID2ydVc5XX/T\r\ng0V3IxlA5rGKbi96RJU4FK6j3Zhvjt6rNvJD5pDzuNcPfXx7t9MY0O7koYir\r\nxw/OjKcenxtLDly6I6puOIOhX3LLY/iPnBGlMcD0Ms1uOWdXLwDCtBX2/GEl\r\n5WxhRfDjHLJdExEHePk8J6UpN/eaTYhtT6GedYr8sdYQUHhhjGj2r0KzgO9v\r\n5EKxvG6qtgz3MUdYDYFVr3wpBruwEhWgAyciaNDyAehylw/7KyQsBksZP/iX\r\nCWPzYfh5eMHkMhDchnpEsQnmZNfHaausREPJF7CIZcAF+/F8mCwAFpfkKA0W\r\nXpfUjh2z5JY5B4ol9+rTKMDL5otHDrdIYI+uDTrH5qTE2FdZW5UcxhWad+0+\r\noAU5IUF8c7d82/XnAQu7nn9aAlVG77vCoQpAU8321ElPxvbJecs6W/Z52SQG\r\nDKRB9q97y8Bts4gguoV6XK+RKVaK+RTaITV99QQ0Cym32/MTlhkGWbzhM37f\r\nU2r3wtj3sRNA9jqY1+TmJgL89hdDThVlsWFsGW4ij+i7w03kiu4lTJvpP9J8\r\n7GIkccjMCVMc8LVkprI16LEUGsdHRadDehs=\r\n=by9g\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.10_1680282633424_0.9680088282264132"},"_hasShrinkwrap":false},"1.2.4-alpha.11":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.11","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"5b6ef509f5aa98067a1ea8a65ce1781d7f7672fa","_id":"trustlessjs@1.2.4-alpha.11","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-Qb27c4tFDguJyooitpyVJ9LbMB+eqGO4yTVcjDFan888Z5Clb4uXQxJTdSWwN5F4Qp8AiKm3Fdv92fDA1xvkRw==","shasum":"de7bd073f64eb62083d8bb2c2e6aab878d669be0","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.11.tgz","fileCount":815,"unpackedSize":21770858,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBq6PYDzOJKSuIEGgZI8QdO4sT6NCmtgAfUHcDdOOp8MAiEAlivcoQVKTodD6omsBJKRfmyx77BAqNohBApZ4kU+C+4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJ/TJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+pBAAlSnA2yAVy5AdRZ88e4AAUyccpKbSn8VSqQUakpq6NU4SG9Z+\r\ny9IKAo0LwSWfjhN/fjndYIhnVq2WfEUz/IaseaX+XSGY0FHpLvdR8O9wNuWo\r\nogQT7PW+GU9h2f9Wgs2xSQMBHPZ5XH8m9y9NwJY4KoRUwAg6TlWEUw/wazcz\r\nIGqp+zi9tUdSjvYNoMGvnMsguBMEjpxTOpjnggoO0v5ECoRpSZQzVkEsUkUW\r\nQz79zps4AolcYBHEhApGS7SvcZ/kzFM8ASr37tusvDMBOi/ag6hEDtIZmmgr\r\nNT+6f++CN+e7tSF45yeOWjS9bLfU86twPuOPe/TUqYKJb9DXC4JaD361JtMo\r\n8mYXAhiBXifJbtLs2Euvmc06/SKpy01ow5o3FlJqUVUyQMnNaUpXAsNUb7K9\r\nXbQv7qStpUhjXf4s4l/qaXW/VFnxNehQS3iCEAX4NgR/TnkYplPsoiGfNawy\r\n8dTNZGFR3psSp8oYMtM8MqC7eu2Au/aOxuP5kU98UG3uo7c81AaYh0XrLE5F\r\nz1HeArPxzchIXN3r6g5eaHiHzuvoEWAzZ2x6VEGzIWdiQ48lzIuTPxoUX4xp\r\nRJ9PK3QSGX7G9Nn8G3raR/XooZ0eZFBqpzKO3ffpiOT7gFfeVMxU8OrU1k+o\r\nT/ftVuvREqBxrBetKbg02vHNSPAQzjTHREE=\r\n=cHYp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.11_1680340168758_0.03365196171266005"},"_hasShrinkwrap":false},"1.2.4-alpha.12":{"name":"trustlessjs","description":"The JavaScript SDK for Trustless Hub","version":"1.2.4-alpha.12","license":"MIT","author":{"name":"TRST Labs"},"bugs":{"url":"https://github.com/trstabs/trustlesscontracts.js/issues"},"types":"dist/index.d.ts","main":"dist/index.js","browser":"dist/browser.js","scripts":{"build":"rm -rf ./dist && webpack && tsc","test":"jest","gen-docs":"typedoc"},"dependencies":{"@cosmjs/encoding":"0.27.1","@cosmjs/math":"0.27.1","@improbable-eng/grpc-web":"0.15.0","@improbable-eng/grpc-web-node-http-transport":"0.15.0","@noble/hashes":"1.0.0","@noble/secp256k1":"1.6.3","@osmonauts/helpers":"0.3.8","bech32":"2.0.0","big-integer":"1.6.51","bignumber.js":"9.0.2","bip32":"2.0.6","bip39":"3.0.4","curve25519-js":"0.0.4","google-protobuf":"^3.14.0","is-gzip":"2.0.0","miscreant":"0.3.2","pako":"2.0.4","protobufjs":"6.11.3","secure-random":"1.1.2"},"devDependencies":{"@improbable-eng/grpc-web-node-http-transport":"0.15.0","@types/is-gzip":"2.0.0","@types/jest":"27.4.0","@types/pako":"1.0.3","@types/protobufjs":"6.0.0","@types/secure-random":"1.1.0","jest":"^27.5.1","node-polyfill-webpack-plugin":"1.1.4","prettier":"2.5.1","ts-jest":"27.1.3","ts-loader":"9.2.6","ts-node":"^10.9.1","ts-proto":"1.104.0","typedoc":"0.22.11","typedoc-plugin-extras":"2.2.3","typedoc-plugin-missing-exports":"0.22.6","typescript":"^4.5.5","webpack":"5.68.0","webpack-cli":"4.9.2"},"readme":"<p align=\"center\">\n  <img src=\"./media/logo-light.png#gh-light-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"light-logo\" />\n  <img src=\"./media/logo-light.png#gh-dark-mode-only\" type=\"image/svg+xml\" width=\"75%\" class=\"dark-logo\" />\n</p>\n\n<p align=\"center\">\n  The JavaScript SDK for Trustless Hub\n</p>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/trustlessjs/beta\" />\n  <img alt=\"ci\" style=\"margin-left: 0.3em\" src=\"https://github.com/trstlabs/trustlesscontracts.js/actions/workflows/test.yml/badge.svg?branch=master\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://trustlessjs.trustlesshub.com\" target=\"_blank\"><strong>Explore the Docs »</strong></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/trstlabs/trustlesscontracts.js\" target=\"_blank\"><strong>GitHub »</strong></a>\n</p>\n\n<h1 id=\"table-of-contents\">Table of Contents</h1>\n\n- [Key Features](#key-features)\n- [Beta Version Notice](#beta-version-notice)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Sending Queries](#sending-queries)\n  - [Broadcasting Transactions](#broadcasting-transactions)\n  - [Keplr Wallet](#keplr-wallet)\n    - [`getOfflineSignerOnlyAmino()`](#getofflinesigneronlyamino)\n    - [`getOfflineSigner()`](#getofflinesigner)\n    - [`getOfflineSignerAuto()`](#getofflinesignerauto)\n\n- [API](#api)\n  - [Wallet](#wallet)\n    - [Importing account from mnemonic](#importing-account-from-mnemonic)\n    - [Generating a random account](#generating-a-random-account)\n  - [TrustlessChainClient ](#TrustlessChainClient )\n    - [Querier trustlesscontracts.js](#querier-trustlessjs)\n    - [Signer trustlesscontracts.js](#signer-trustlessjs)\n    - [`trustlessjs.query`](#trustlessjsquery)\n    - [`trustlessjs.address`](#trustlessjsaddress)\n    - [`trustlessjs.tx`](#trustlessjstx)\n\n# Key Features\n\ntrustlessjs a JavaScript SDK for writing applications that interact with the Trustless Hub blockchain.\n\n- Written in TypeScript and provided with type definitions.\n- Provides simple abstractions over core data structures.\n- Supports every possible message and transaction type.\n- Exposes every possible query type.\n- Handles input/output encryption/decryption for Trustless Contracts.\n- Works in Node.js, modern web browsers and React Native.\n\n# Beta Version Notice\n\nThis library is still in beta, **APIs may break**. Beta testers are welcome!\n\nSee [project board](https://github.com/trstlabs/trustlesscontracts.js/projects/1) for list of existing/missing features.\n\n# Installation\n\n```bash\nnpm install trustlessjs@beta\n```\n\nor\n\n```bash\nyarn add trustlessjs@beta\n```\n\n# Usage Examples\n\nFor a lot more usage examples [refer to the tests](./test/test.ts).\n\n## Sending Queries\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, pass in a gRPC endpoint. \n//To expose the endpoint, the node should NGINX with the right headers. Preflight should include x-grpc-web and content-type, as well as the allow-orgin from header to be [*] or point to the app url.\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n\nconst {\n  balance: { amount },\n} = await trustlessjs.query.bank.balance({\n  address: \"trust1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03\",\n  denom: \"utrst\",\n});\n\nconsole.log(`I have ${amount / 1e6} TRST!`);\n\nconst pTRST = \"trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek\";\n// Get codeHash using `trstd q compute contract-hash trust1k0jntykt7e4g3y88ltc60czgjuqdy4c9e8fzek`\nconst pTRSTCodeHash =\n  \"af74387e276be8874f07bec3a87023ee49b0e7ebe08178c49d0a49c3c98ed60e\";\n\nconst { token_info } = await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRST,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n});\n\nconsole.log(`pTRST has ${token_info.decimals} decimals!`);\n```\n\n## Broadcasting Transactions\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst bob = \"trust1dgqnta7fwjj6x9kusyz7n8vpl73l7wsm0gaamk\";\nconst msg = new MsgSend({\n  fromAddress: myAddress,\n  toAddress: bob,\n  amount: [{ denom: \"utrst\", amount: \"1\" }],\n});\n\nconst tx = await trustlessjs.tx.broadcast([msg], {\n  gasLimit: 20_000,\n  gasPriceInFeeDenom: 0.25,\n  feeDenom: \"utrst\",\n});\n```\n\n## Keplr Wallet\n\nThe recommended way to integrate Keplr is by using `window.keplr.getOfflineSignerOnlyAmino()`:\n\n```ts\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nwhile (\n  !window.keplr ||\n  !window.getEnigmaUtils ||\n  !window.getOfflineSignerOnlyAmino\n) {\n  await sleep(100);\n}\n\nconst CHAIN_ID = \"trst_chain_1\";\nconst CHAIN_GRPC = \"https://cli.trustlesshub.com/\";\n\nawait window.keplr.enable(CHAIN_ID);\n\nconst keplrOfflineSigner = window.getOfflineSignerOnlyAmino(CHAIN_ID);\nconst [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();\n\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: CHAIN_GRPC,\n  chainId: CHAIN_ID,\n  wallet: keplrOfflineSigner,\n  walletAddress: myAddress,\n  encryptionUtils: window.getEnigmaUtils(CHAIN_ID),\n});\n\n// Note: Using `window.getEnigmaUtils` is optional, it will allow\n// Keplr to use the same encryption seed across sessions for the account.\n// The benefit of this is that `trustlessjs.query.getTx()` will be able to decrypt\n// the response across sessions.\n```\n\n### `getOfflineSignerOnlyAmino()`\n\nAlthough this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.\n\n- 🟩 Looks good on Keplr\n- 🟩 Supports users signing with Ledger\n- 🟥 Doesn't support signing transactions with these Msgs:\n  - [authz/MsgExec](https://trustlessjs.trustlesshub.com/classes/MsgExec)\n  - [authz/MsgGrant](https://trustlessjs.trustlesshub.com/classes/MsgGrant)\n  - [authz/MsgRevoke](https://trustlessjs.trustlesshub.com/classes/MsgRevoke)\n  - [feegrant/MsgGrantAllowance](https://trustlessjs.trustlesshub.com/classes/MsgGrantAllowance)\n  - [feegrant/MsgRevokeAllowance](https://trustlessjs.trustlesshub.com/classes/MsgRevokeAllowance)\n  - All IBC relayer Msgs:\n    - [gov/MsgSubmitProposal/ClientUpdateProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#ClientUpdateProposal)\n    - [gov/MsgSubmitProposal/UpgradeProposal](https://trustlessjs.trustlesshub.com/enums/ProposalType#UpgradeProposal)\n    - [ibc_channel/MsgAcknowledgement](https://trustlessjs.trustlesshub.com/classes/MsgAcknowledgement)\n    - [ibc_channel/MsgChannelCloseConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseConfirm)\n    - [ibc_channel/MsgChannelCloseInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelCloseInit)\n    - [ibc_channel/MsgChannelOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenAck)\n    - [ibc_channel/MsgChannelOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenConfirm)\n    - [ibc_channel/MsgChannelOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenInit)\n    - [ibc_channel/MsgChannelOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgChannelOpenTry)\n    - [ibc_channel/MsgRecvPacket](https://trustlessjs.trustlesshub.com/classes/MsgRecvPacket)\n    - [ibc_channel/MsgTimeout](https://trustlessjs.trustlesshub.com/classes/MsgTimeout)\n    - [ibc_channel/MsgTimeoutOnClose](https://trustlessjs.trustlesshub.com/classes/MsgTimeoutOnClose)\n    - [ibc_client/MsgCreateClient](https://trustlessjs.trustlesshub.com/classes/MsgCreateClient)\n    - [ibc_client/MsgSubmitMisbehaviour](https://trustlessjs.trustlesshub.com/classes/MsgSubmitMisbehaviour)\n    - [ibc_client/MsgUpdateClient](https://trustlessjs.trustlesshub.com/classes/MsgUpdateClient)\n    - [ibc_client/MsgUpgradeClient](https://trustlessjs.trustlesshub.com/classes/MsgUpgradeClient)\n    - [ibc_connection/MsgConnectionOpenAck](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenAck)\n    - [ibc_connection/MsgConnectionOpenConfirm](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenConfirm)\n    - [ibc_connection/MsgConnectionOpenInit](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenInit)\n    - [ibc_connection/MsgConnectionOpenTry](https://trustlessjs.trustlesshub.com/classes/MsgConnectionOpenTry)\n\nNote that [ibc_transfer/MsgTransfer](https://trustlessjs.trustlesshub.com/classes/MsgTransfer) for sending funds across IBC **is** supported.\n\n<img src=\"./media/keplr-amino.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSigner()`\n\nThe new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.\n\n- 🟥 Looks bad on Keplr\n- 🟥 Doesn't support users signing with Ledger\n- 🟩 Supports signing transactions with all types of Msgs\n\n<img src=\"./media/keplr-proto.png\" width=\"65%\" style=\"border-style: solid;border-color: #5e72e4;border-radius: 10px;\" />\n\n### `getOfflineSignerAuto()`\n\nCurrently this is equivalent to `keplr.getOfflineSigner()` but may change at the discretion of the Keplr team.\n\n\n# API\n\n## Wallet\n\nAn offline wallet implementation, used to sign transactions. Usually we'd just want to pass it to `TrustlessChainClient `.\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/Wallet.html)\n\n### Importing account from mnemonic\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n```\n\n### Generating a random account\n\n```ts\nimport { Wallet } from \"trustlessjs\";\n\nconst wallet = new Wallet();\nconst myAddress = wallet.address;\nconst myMnemonicPhrase = wallet.mnemonic;\n```\n\n## TrustlessChainClient \n\n[**Full API »**](https://trustlessjs.trustlesshub.com/classes/TrustlessChainClient.html)\n\n### Querier trustlesscontracts.js\n\nA querier client can only send queries and get chain information. Access to all query types can be done via `trustlessjs.query`.\n\n```ts\nimport { TrustlessChainClient } from \"trustlessjs\";\n\n// To create a readonly trustlesscontracts.js client, just pass in an RPC endpoint\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"{grpcendpoint}.{node}.com\",\n});\n```\n\n### Signer trustlesscontracts.js\n\nA signer client can broadcast transactions, send queries and get chain information.\n\nHere in addition to `trustlessjs.query`, there are also `trustlessjs.tx` & `trustlessjs.address`.\n\n```ts\nimport { Wallet, TrustlessChainClient , MsgSend, MsgMultiSend } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n```\n\n### `trustlessjs.query`\n\n#### `trustlessjs.query.getTx(hash)`\n\nReturns a transaction with a txhash. `hash` is a 64 character upper-case hex string.\n\n#### `trustlessjs.query.txsQuery(query)`\n\nReturns all transactions that match a query.\n\nTo tell which events you want, you need to provide a query. query is a string, which has a form: `condition AND condition ...` (no OR at the moment). Condition has a form: `key operation operand`. key is a string with a restricted set of possible symbols (`\\t`, `\\n`, `\\r`, `\\`, `(`, `)`, `\"`, `'`, `=`, `>`, `<` are not allowed). Operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS` AND `EXISTS`. Operand can be a string (escaped with single quotes), number, date or time.\n\nExamples:\n\n- `tx.hash = 'XYZ'` # single transaction\n- `tx.height = 5` # all txs of the fifth block\n- `create_validator.validator = 'ABC'` # tx where validator ABC was created\n\nTendermint provides a few predefined keys: `tx.hash` and `tx.height`. You can provide additional event keys that were emitted during the transaction. All events are indexed by a composite key of the form `{eventType}.{evenAttrKey}`. Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.\n\nTo create a query for txs where AddrA transferred funds: `transfer.sender = 'AddrA'`\n\nSee `txsQuery` under https://trustlessjs.trustlesshub.com/modules#Querier.\n\n#### `trustlessjs.query.auth.account()`\n\nReturns account details based on address.\n\n```ts\nconst { address, accountNumber, sequence } = await trustlessjs.query.auth.account({\n  address: myAddress,\n});\n```\n\n#### `trustlessjs.query.auth.accounts()`\n\nReturns all existing accounts on the blockchain.\n\n```ts\n/// Get all accounts\nconst result = await trustlessjs.query.auth.accounts({});\n```\n\n#### `trustlessjs.query.auth.params()`\n\nQueries all x/auth parameters.\n\n```ts\nconst {\n  params: {\n    maxMemoCharacters,\n    sigVerifyCostEd25519,\n    sigVerifyCostSecp256k1,\n    txSigLimit,\n    txSizeCostPerByte,\n  },\n} = await trustlessjs.query.auth.params();\n```\n\n#### `trustlessjs.query.authz.grants()`\n\nReturns list of authorizations, granted to the grantee by the granter.\n\n#### `trustlessjs.query.bank.balance()`\n\nBalance queries the balance of a single coin for a single account.\n\n```ts\nconst { balance } = await trustlessjs.query.bank.balance({\n  address: myAddress,\n  denom: \"utrst\",\n});\n```\n\n#### `trustlessjs.query.bank.allBalances()`\n\nAllBalances queries the balance of all coins for a single account.\n\n#### `trustlessjs.query.bank.totalSupply()`\n\nTotalSupply queries the total supply of all coins.\n\n#### `trustlessjs.query.bank.supplyOf()`\n\nSupplyOf queries the supply of a single coin.\n\n#### `trustlessjs.query.bank.params()`\n\nParams queries the parameters of x/bank module.\n\n#### `trustlessjs.query.bank.denomMetadata()`\n\nDenomsMetadata queries the client metadata of a given coin denomination.\n\n#### `trustlessjs.query.bank.denomsMetadata()`\n\nDenomsMetadata queries the client metadata for all registered coin denominations.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash of a Trustless Contract.\n\n#### `trustlessjs.query.compute.codeHash()`\n\nGet codeHash from a code id.\n\n#### `trustlessjs.query.compute.contractInfo()`\n\nGet metadata of a Trustless Contract.\n\n#### `trustlessjs.query.compute.contractsByCode()`\n\nGet all contracts that were instantiated from a code id.\n\n#### `trustlessjs.query.compute.queryContractPrivateState()`\n\nQuery a Trustless Contract.\n\n```ts\ntype Result = {\n  token_info: {\n    decimals: number;\n    name: string;\n    symbol: string;\n    total_supply: string;\n  };\n};\n\nconst result = (await trustlessjs.query.compute.queryContractPrivateState({\n  contractAddress: pTRSTAddress,\n  codeHash: pTRSTCodeHash, // optional but significantly faster\n  query: { token_info: {} },\n})) as Result;\n```\n\n#### `trustlessjs.query.compute.code()`\n\nGet WASM bytecode and metadata for a code id.\n\n```ts\nconst { codeInfo } = await trustlessjs.query.compute.code(codeId);\n```\n\n#### `trustlessjs.query.compute.codes()`\n\nQuery all contract codes on-chain.\n\n#### `trustlessjs.query.distribution.params()`\n\nParams queries params of the distribution module.\n\n#### `trustlessjs.query.distribution.validatorOutstandingRewards()`\n\nValidatorOutstandingRewards queries rewards of a validator address.\n\n#### `trustlessjs.query.distribution.validatorCommission()`\n\nValidatorCommission queries accumulated commission for a validator.\n\n#### `trustlessjs.query.distribution.validatorSlashes()`\n\nValidatorSlashes queries slash events of a validator.\n\n#### `trustlessjs.query.distribution.delegationRewards()`\n\nDelegationRewards queries the total rewards accrued by a delegation.\n\n#### `trustlessjs.query.distribution.delegationTotalRewards()`\n\nDelegationTotalRewards queries the total rewards accrued by a each validator.\n\n#### `trustlessjs.query.distribution.delegatorValidators()`\n\nDelegatorValidators queries the validators of a delegator.\n\n#### `trustlessjs.query.distribution.delegatorWithdrawAddress()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.distribution.communityPool()`\n\nCommunityPool queries the community pool coins.\n\n#### `trustlessjs.query.distribution.foundationTax()`\n\nDelegatorWithdrawAddress queries withdraw address of a delegator.\n\n#### `trustlessjs.query.evidence.evidence()`\n\nEvidence queries evidence based on evidence hash.\n\n#### `trustlessjs.query.evidence.allEvidence()`\n\nAllEvidence queries all evidence.\n\n#### `trustlessjs.query.feegrant.allowance()`\n\nAllowance returns fee granted to the grantee by the granter.\n\n#### `trustlessjs.query.feegrant.allowances()`\n\nAllowances returns all the grants for address.\n\n#### `trustlessjs.query.gov.proposal()`\n\nProposal queries proposal details based on ProposalID.\n\n#### `trustlessjs.query.gov.proposals()`\n\nProposals queries all proposals based on given status.\n\n```ts\n// Get all proposals\nconst { proposals } = await trustlessjs.query.gov.proposals({\n  proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,\n  voter: \"\",\n  depositor: \"\",\n});\n```\n\n#### `trustlessjs.query.gov.vote()`\n\nVote queries voted information based on proposalID, voterAddr.\n\n#### `trustlessjs.query.gov.votes()`\n\nVotes queries votes of a given proposal.\n\n#### `trustlessjs.query.gov.params()`\n\nParams queries all parameters of the gov module.\n\n#### `trustlessjs.query.gov.deposit()`\n\nDeposit queries single deposit information based proposalID, depositAddr.\n\n```ts\nconst {\n  deposit: { amount },\n} = await trustlessjs.query.gov.deposit({\n  depositor: myAddress,\n  proposalId: propId,\n});\n```\n\n#### `trustlessjs.query.gov.deposits()`\n\nDeposits queries all deposits of a single proposal.\n\n#### `trustlessjs.query.gov.tallyResult()`\n\nTallyResult queries the tally of a proposal vote.\n\n#### `trustlessjs.query.ibc_channel.channel()`\n\nChannel queries an IBC Channel.\n\n#### `trustlessjs.query.ibc_channel.channels()`\n\nChannels queries all the IBC channels of a chain.\n\n#### `trustlessjs.query.ibc_channel.connectionChannels()`\n\nConnectionChannels queries all the channels associated with a connection end.\n\n#### `trustlessjs.query.ibc_channel.channelClientState()`\n\nChannelClientState queries for the client state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.channelConsensusState()`\n\nChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.\n\n#### `trustlessjs.query.ibc_channel.packetCommitment()`\n\nPacketCommitment queries a stored packet commitment hash.\n\n#### `trustlessjs.query.ibc_channel.packetCommitments()`\n\nPacketCommitments returns all the packet commitments hashes associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.packetReceipt()`\n\nPacketReceipt queries if a given packet sequence has been received on the queried chain\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgement()`\n\nPacketAcknowledgement queries a stored packet acknowledgement hash.\n\n#### `trustlessjs.query.ibc_channel.packetAcknowledgements()`\n\nPacketAcknowledgements returns all the packet acknowledgements associated with a channel.\n\n#### `trustlessjs.query.ibc_channel.unreceivedPackets()`\n\nUnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.unreceivedAcks()`\n\nUnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.\n\n#### `trustlessjs.query.ibc_channel.nextSequenceReceive()`\n\nNextSequenceReceive returns the next receive sequence for a given channel.\n\n#### `trustlessjs.query.ibc_client.clientState()`\n\nClientState queries an IBC light client.\n\n#### `trustlessjs.query.ibc_client.clientStates()`\n\nClientStates queries all the IBC light clients of a chain.\n\n#### `trustlessjs.query.ibc_client.consensusState()`\n\nConsensusState queries a consensus state associated with a client state at a given height.\n\n#### `trustlessjs.query.ibc_client.consensusStates()`\n\nConsensusStates queries all the consensus state associated with a given client.\n\n#### `trustlessjs.query.ibc_client.clientStatus()`\n\nStatus queries the status of an IBC client.\n\n#### `trustlessjs.query.ibc_client.clientParams()`\n\nClientParams queries all parameters of the ibc client.\n\n#### `trustlessjs.query.ibc_client.upgradedClientState()`\n\nUpgradedClientState queries an Upgraded IBC light client.\n\n#### `trustlessjs.query.ibc_client.upgradedConsensusState()`\n\nUpgradedConsensusState queries an Upgraded IBC consensus state.\n\n#### `trustlessjs.query.ibc_connection.connection()`\n\nConnection queries an IBC connection end.\n\n#### `trustlessjs.query.ibc_connection.connections()`\n\nConnections queries all the IBC connections of a chain.\n\n#### `trustlessjs.query.ibc_connection.clientConnections()`\n\nClientConnections queries the connection paths associated with a client state.\n\n#### `trustlessjs.query.ibc_connection.connectionClientState()`\n\nConnectionClientState queries the client state associated with the connection.\n\n#### `trustlessjs.query.ibc_connection.connectionConsensusState()`\n\nConnectionConsensusState queries the consensus state associated with the connection.\n\n#### `trustlessjs.query.ibc_transfer.denomTrace()`\n\nDenomTrace queries a denomination trace information.\n\n#### `trustlessjs.query.ibc_transfer.denomTraces()`\n\nDenomTraces queries all denomination traces.\n\n#### `trustlessjs.query.ibc_transfer.params()`\n\nParams queries all parameters of the ibc-transfer module.\n\n#### `trustlessjs.query.mint.params()`\n\nParams returns the total set of minting parameters.\n\n#### `trustlessjs.query.mint.inflation()`\n\nInflation returns the current minting inflation value.\n\n#### `trustlessjs.query.mint.annualProvisions()`\n\nAnnualProvisions current minting annual provisions value.\n\n#### `trustlessjs.query.params.params()`\n\nParams queries a specific parameter of a module, given its subspace and key.\n\n#### `trustlessjs.query.registration.txKey()`\n\nReturns the key used for transactions.\n\n#### `trustlessjs.query.registration.registrationKey()`\n\nReturns the key used for registration.\n\n#### `trustlessjs.query.registration.encryptedSeed()`\n\nReturns the encrypted seed for a registered node by public key.\n\n#### `trustlessjs.query.slashing.params()`\n\nParams queries the parameters of slashing module.\n\n#### `trustlessjs.query.slashing.signingInfo()`\n\nSigningInfo queries the signing info of given cons address.\n\n#### `trustlessjs.query.slashing.signingInfos()`\n\nSigningInfos queries signing info of all validators.\n\n#### `trustlessjs.query.staking.validators()`\n\nValidators queries all validators that match the given status.\n\n```ts\n// Get all validators\nconst { validators } = await trustlessjs.query.staking.validators({ status: \"\" });\n```\n\n#### `trustlessjs.query.staking.validator()`\n\nValidator queries validator info for given validator address.\n\n#### `trustlessjs.query.staking.validatorDelegations()`\n\nValidatorDelegations queries delegate info for given validator.\n\n#### `trustlessjs.query.staking.validatorUnbondingDelegations()`\n\nValidatorUnbondingDelegations queries unbonding delegations of a validator.\n\n#### `trustlessjs.query.staking.delegation()`\n\nDelegation queries delegate info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.unbondingDelegation()`\n\nUnbondingDelegation queries unbonding info for given validator delegator pair.\n\n#### `trustlessjs.query.staking.delegatorDelegations()`\n\nDelegatorDelegations queries all delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.delegatorUnbondingDelegations()`\n\nDelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.\n\n#### `trustlessjs.query.staking.redelegations()`\n\nRedelegations queries redelegations of given address.\n\n#### `trustlessjs.query.staking.delegatorValidators()`\n\nDelegatorValidators queries all validators info for given delegator address.\n\n#### `trustlessjs.query.staking.delegatorValidator()`\n\nDelegatorValidator queries validator info for given delegator validator pair.\n\n#### `trustlessjs.query.staking.historicalInfo()`\n\nHistoricalInfo queries the historical info for given height.\n\n#### `trustlessjs.query.staking.pool()`\n\nPool queries the pool info.\n\n#### `trustlessjs.query.staking.params()`\n\nParameters queries the staking parameters.\n\n#### `trustlessjs.query.tendermint.getNodeInfo()`\n\nGetNodeInfo queries the current node info.\n\n#### `trustlessjs.query.tendermint.getSyncing()`\n\nGetSyncing queries node syncing.\n\n#### `trustlessjs.query.tendermint.getLatestBlock()`\n\nGetLatestBlock returns the latest block.\n\n#### `trustlessjs.query.tendermint.getBlockByHeight()`\n\nGetBlockByHeight queries block for given height.\n\n#### `trustlessjs.query.tendermint.getLatestValidatorSet()`\n\nGetLatestValidatorSet queries latest validator-set.\n\n#### `trustlessjs.query.tendermint.getValidatorSetByHeight()`\n\nGetValidatorSetByHeight queries validator-set at a given height.\n\n#### `trustlessjs.query.upgrade.currentPlan()`\n\nCurrentPlan queries the current upgrade plan.\n\n#### `trustlessjs.query.upgrade.appliedPlan()`\n\nAppliedPlan queries a previously applied upgrade plan by its name.\n\n#### `trustlessjs.query.upgrade.upgradedConsensusState()`\n\nUpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.\n\n#### `trustlessjs.query.upgrade.moduleVersions()`\n\nModuleVersions queries the list of module versions from state.\n\n### `trustlessjs.address`\n\nOn a signer trustlesscontracts.js, `trustlessjs.address` is the same as `walletAddress`:\n\n```ts\nimport { Wallet, TrustlessChainClient } from \"trustlessjs\";\n\nconst wallet = new Wallet(\n  \"grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar\",\n);\nconst myAddress = wallet.address;\n\n// To create a signer trustlesscontracts.js client, also pass in a wallet\nconst trustlessjs = await TrustlessChainClient.create({\n  grpcWebUrl: \"https://grpc.someTrustlessHubnode.com/\",\n  wallet: wallet,\n  walletAddress: myAddress,\n  chainId: \"pulsar-2\",\n});\n\nconst alsoMyAddress = trustlessjs.address;\n```\n\n### `trustlessjs.tx`\n\nOn a signer trustlesscontracts.js, `trustlessjs.tx` is used to broadcast transactions. Every function under `trustlessjs.tx` can receive an optional [TxOptions](https://trustlessjs.trustlesshub.com/modules#TxOptions).\n\n[**Full API »**](https://trustlessjs.trustlesshub.com/modules#TxSender)\n\n#### `trustlessjs.tx.broadcast()`\n\nUsed to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.\n\nFor a list of all messages see: https://trustlessjs.trustlesshub.com/interfaces/Msg\n\n```ts\nconst addMinterMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: { add_minters: { minters: [MY_ADDRESS] } },\n  sentFunds: [], // optional\n});\n\nconst mintMsg = new MsgExecuteContract({\n  sender: MY_ADDRESS,\n  contract: MY_NFT_CONTRACT,\n  codeHash: MY_NFT_CONTRACT_CODE_HASH, // optional but significantly faster\n  msg: {\n    mint_nft: {\n      token_id: \"1\",\n      owner: MY_ADDRESS,\n      public_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-secondary-black.png\",\n          name: \"trustless-hub-logo-secondary-black\",\n        },\n      },\n      private_metadata: {\n        extension: {\n          image: \"https://trustlesshub.com/trustless-hub-logo-primary-white.png\",\n          name: \"trustless-hub-logo-primary-white\",\n        },\n      },\n    },\n  },\n  sentFunds: [], // optional\n});\n\nconst tx = await trustlessjs.tx.broadcast([addMinterMsg, mintMsg], {\n  gasLimit: 200_000,\n});\n```\n\n#### `trustlessjs.tx.authz.exec()`\n\nMsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.\n\nInput: [MsgExecParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecParams)\n\n#### `trustlessjs.tx.authz.grant()`\n\nMsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.\n\nInput: [MsgGrantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantParams)\n\n#### `trustlessjs.tx.authz.revoke()`\n\nMsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.\n\nInput: [MsgRevokeParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeParams)\n\n#### `trustlessjs.tx.bank.multiSend()`\n\nMsgMultiSend represents an arbitrary multi-in, multi-out send message.\n\nInput: [MsgMultiSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgMultiSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.multiSend(\n  {\n    inputs: [\n      {\n        address: myAddress,\n        coins: [{ denom: \"utrst\", amount: \"2\" }],\n      },\n    ],\n    outputs: [\n      {\n        address: alice,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n      {\n        address: bob,\n        coins: [{ denom: \"utrst\", amount: \"1\" }],\n      },\n    ],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.bank.send()`\n\nMsgSend represents a message to send coins from one account to another.\n\nInput: [MsgSendParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSendParams)\n\n```ts\nconst tx = await trustlessjs.tx.bank.send(\n  {\n    fromAddress: myAddress,\n    toAddress: alice,\n    amount: [{ denom: \"utrst\", amount: \"1\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.compute.storeCode()`\n\nUpload a compiled contract to Trustless Hub\n\nInput: [StoreCodeProposalParams](https://trustlessjs.trustlesshub.com/interfaces/StoreCodeProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.storeCode(\n  {\n    sender: myAddress,\n    wasmByteCode: fs.readFileSync(\n      `${__dirname}/contract.wasm.gz`,\n    ) as Uint8Array,\n    source: \"\",\n    builder: \"\",\n  },\n  {\n    gasLimit: 1_000_000,\n  },\n);\n\nconst codeId = Number(\n  tx.arrayLog.find((log) => log.type === \"message\" && log.key === \"code_id\")\n    .value,\n);\n```\n\n#### `trustlessjs.tx.compute.instantiateContract()`\n\nInstantiate a contract from code id\n\nInput: [MsgInstantiateContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgInstantiateContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.instantiateContract(\n  {\n    sender: myAddress,\n    codeId: codeId,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      name: \"Private TRST\",\n      admin: myAddress,\n      symbol: \"pTRST\",\n      decimals: 6,\n      initial_balances: [{ address: myAddress, amount: \"1\" }],\n      prng_seed: \"eW8=\",\n      config: {\n        public_total_supply: true,\n        enable_deposit: true,\n        enable_redeem: true,\n        enable_mint: false,\n        enable_burn: false,\n      },\n      supported_denoms: [\"utrst\"],\n    },\n    autoMsg: {},\n    contractId: \"pTRST\",\n    funds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n\nconst contractAddress = tx.arrayLog.find(\n  (log) => log.type === \"message\" && log.key === \"contract_address\",\n).value;\n```\n\n#### `trustlessjs.tx.compute.executeContract()`\n\nExecute a function on a contract\n\nInput: [MsgExecuteContractParams](https://trustlessjs.trustlesshub.com/interfaces/MsgExecuteContractParams)\n\n```ts\nconst tx = await trustlessjs.tx.compute.executeContract(\n  {\n    sender: myAddress,\n    contract: contractAddress,\n    codeHash: codeHash, // optional but significantly faster\n    msg: {\n      transfer: {\n        recipient: bob,\n        amount: \"1\",\n      },\n    },\n    sentFunds: [], // optional\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.crisis.verifyInvariant()`\n\nMsgVerifyInvariant represents a message to verify a particular invariance.\n\nInput: [MsgVerifyInvariantParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVerifyInvariantParams)\n\n#### `trustlessjs.tx.distribution.fundCommunityPool()`\n\nMsgFundCommunityPool allows an account to directly fund the community pool.\n\nInput: [MsgFundCommunityPoolParams](https://trustlessjs.trustlesshub.com/interfaces/MsgFundCommunityPoolParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.fundCommunityPool(\n  {\n    depositor: myAddress,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.setWithdrawAddress()`\n\nMsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).\n\nInput: [MsgSetWithdrawAddressParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSetWithdrawAddressParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.setWithdrawAddress(\n  {\n    delegatorAddress: mySelfDelegatorAddress,\n    withdrawAddress: myOtherAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawDelegatorReward()`\n\nMsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.\n\nInput: [MsgWithdrawDelegatorRewardParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawDelegatorRewardParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawDelegatorReward(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.distribution.withdrawValidatorCommission()`\n\nMsgWithdrawValidatorCommission withdraws the full commission to the validator address.\n\nInput: [MsgWithdrawValidatorCommissionParams](https://trustlessjs.trustlesshub.com/interfaces/MsgWithdrawValidatorCommissionParams)\n\n```ts\nconst tx = await trustlessjs.tx.distribution.withdrawValidatorCommission(\n  {\n    validatorAddress: myValidatorAddress,\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\nOr a better one:\n\n```ts\nconst tx = await trustlessjs.tx.broadcast(\n  [\n    new MsgWithdrawDelegatorReward({\n      delegatorAddress: mySelfDelegatorAddress,\n      validatorAddress: myValidatorAddress,\n    }),\n    new MsgWithdrawValidatorCommission({\n      validatorAddress: myValidatorAddress,\n    }),\n  ],\n  {\n    gasLimit: 30_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.evidence.submitEvidence()`\n\nMsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.\n\nInput: [MsgSubmitEvidenceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitEvidenceParams)\n\n#### `trustlessjs.tx.feegrant.grantAllowance()`\n\nMsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.\n\nInput: [MsgGrantAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgGrantAllowanceParams)\n\n#### `trustlessjs.tx.feegrant.revokeAllowance()`\n\nMsgRevokeAllowance removes any existing Allowance from Granter to Grantee.\n\nInput: [MsgRevokeAllowanceParams](https://trustlessjs.trustlesshub.com/interfaces/MsgRevokeAllowanceParams)\n\n#### `trustlessjs.tx.gov.deposit()`\n\nMsgDeposit defines a message to submit a deposit to an existing proposal.\n\nInput: [MsgDepositParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDepositParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.deposit(\n  {\n    depositor: myAddress,\n    proposalId: someProposalId,\n    amount: [{ amount: \"1\", denom: \"utrst\" }],\n  },\n  {\n    gasLimit: 20_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.submitProposal()`\n\nMsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.\n\nInput: [MsgSubmitProposalParams](https://trustlessjs.trustlesshub.com/interfaces/MsgSubmitProposalParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.submitProposal(\n  {\n    type: ProposalType.TextProposal,\n    proposer: myAddress,\n    initialDeposit: [{ amount: \"10000000\", denom: \"utrst\" }],\n    content: {\n      title: \"Hi\",\n      description: \"Let's vote on this\",\n    },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n\nconst proposalId = Number(\n  tx.arrayLog.find(\n    (log) => log.type === \"submit_proposal\" && log.key === \"proposal_id\",\n  ).value,\n);\n```\n\n#### `trustlessjs.tx.gov.vote()`\n\nMsgVote defines a message to cast a vote.\n\nInput: [MsgVoteParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteParams)\n\n```ts\nconst tx = await trustlessjs.tx.gov.vote(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    option: VoteOption.VOTE_OPTION_YES,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.gov.voteWeighted()`\n\nMsgVoteWeighted defines a message to cast a vote, with an option to split the vote.\n\nInput: [MsgVoteWeightedParams](https://trustlessjs.trustlesshub.com/interfaces/MsgVoteWeightedParams)\n\n```ts\n// vote yes with 70% of my power\nconst tx = await trustlessjs.tx.gov.voteWeighted(\n  {\n    voter: myAddress,\n    proposalId: someProposalId,\n    options: [\n      // weights must sum to 1.0\n      { weight: 0.7, option: VoteOption.VOTE_OPTION_YES },\n      { weight: 0.3, option: VoteOption.VOTE_OPTION_ABSTAIN },\n    ],\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.ibc.transfer()`\n\nMsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures\n\nInput: [MsgTransferParams](https://trustlessjs.trustlesshub.com/interfaces/MsgTransferParams)\n\n#### `trustlessjs.tx.slashing.unjail()`\n\nMsgUnjail defines a message to release a validator from jail.\n\nInput: [MsgUnjailParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUnjailParams)\n\n```ts\nconst tx = await trustlessjs.tx.slashing.unjail(\n  {\n    validatorAddr: mValidatorsAddress,\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.beginRedelegate()`\n\nMsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.\n\nInput: [MsgBeginRedelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgBeginRedelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.beginRedelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorSrcAddress: someValidator,\n    validatorDstAddress: someOtherValidator,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.createValidator()`\n\nMsgCreateValidator defines an SDK message for creating a new validator.\n\nInput: [MsgCreateValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgCreateValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.createValidator(\n  {\n    selfDelegatorAddress: myAddress,\n    commission: {\n      maxChangeRate: 0.01, // can change +-1% every 24h\n      maxRate: 0.1, // 10%\n      rate: 0.05, // 5%\n    },\n    description: {\n      moniker: \"My validator's display name\",\n      identity: \"ID on keybase.io, to have a logo on explorer and stuff\",\n      website: \"example.com\",\n      securityContact: \"hi@example.com\",\n      details: \"We are good\",\n    },\n    pubkey: toBase64(new Uint8Array(32).fill(1)), // validator's pubkey, to sign on validated blocks\n    minSelfDelegation: \"1\", // utrst\n    initialDelegation: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 100_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.delegate()`\n\nMsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.\n\nInput: [MsgDelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgDelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.delegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.editValidator()`\n\nMsgEditValidator defines an SDK message for editing an existing validator.\n\nInput: [MsgEditValidatorParams](https://trustlessjs.trustlesshub.com/interfaces/MsgEditValidatorParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.editValidator(\n  {\n    validatorAddress: myValidatorAddress,\n    description: {\n      // To edit even one item in \"description you have to re-input everything\n      moniker: \"papaya\",\n      identity: \"banana\",\n      website: \"watermelon.com\",\n      securityContact: \"sec@watermelon.com\",\n      details: \"We are the banana papaya validator yay!\",\n    },\n    minSelfDelegation: \"2\",\n    commissionRate: 0.04, // 4%, commission cannot be changed more than once in 24h\n  },\n  {\n    gasLimit: 5_000_000,\n  },\n);\n```\n\n#### `trustlessjs.tx.staking.undelegate()`\n\nMsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator\n\nInput: [MsgUndelegateParams](https://trustlessjs.trustlesshub.com/interfaces/MsgUndelegateParams)\n\n```ts\nconst tx = await trustlessjs.tx.staking.undelegate(\n  {\n    delegatorAddress: myAddress,\n    validatorAddress: someValidatorAddress,\n    amount: { amount: \"1\", denom: \"utrst\" },\n  },\n  {\n    gasLimit: 50_000,\n  },\n);\n```\n","readmeFilename":"README.md","gitHead":"1b93836458f39907be3587fc8eebd94456f97967","_id":"trustlessjs@1.2.4-alpha.12","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-EdJNPPjeRod+Tn63q0ardbGhxbdwiHDMGm4kmSmRORedvcYTu98oJALdSuPFZRaDWCYxJieWLK1bUc7eJUTmcQ==","shasum":"e839c272afe49ae0a1c8b70d18dcd0b8cb4255d0","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-1.2.4-alpha.12.tgz","fileCount":815,"unpackedSize":21771443,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhE38gjby1k3SkO2fKr811NYriKDlnNhlpyAJZB4FtxAIgdAL81yfqR60plSQkwrC03R3V+3xm/3cgD6z7Qe0YJxY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkKU/EACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqo2g/+JEB2Q+im3J4YvYabEr7QDCMoRz9wd+2vF1MEGqeQj497a+i/\r\nmwNovjdoXwvo8gwxlUFipJhaKExV4qraeDDng7eGB/rU8AKo0ZjTg07Rov5/\r\neWPCLjhQdfUBDQmhsfdcoHxu8fsAE7MEl+jpIRqQ+GZczL+o8c7buMJLjgve\r\n2Sc4+tKu7pFb5Fe4LRh+nIVv1gowGZtcqAkHAsLPejkdBlJUSiEvDobBT3cT\r\nCysupWiqq/9cReeCHiVa5Xj17GT4/5Qy5/oBC8bUBkaEJ0tKOiCL4VgXusUH\r\n/NoudLUGbcZ8pWdCAwss4g+02Z5T9k1X4JH15hy3m6AU9Hw9tg6qqqw2W5A8\r\nIqLxiblkYsL14lkbDwQFwkmsn6ODsDwj3alR8EVEN3UXl0cQlvp9YXTYlVPw\r\nmfHSViNS+Pie/17WkcKUTw9yJpRRJfw4CF0+eef8Fvq+UCaGnJxIva+v41Hi\r\nRE9YT7TweKzoIDBQdGr04S4vaO+SnrgSxcRW4WfEL9uOJFZUEvPkrDKCmc76\r\nW+beBF+A3kZ4NvcPeqS26RfCyxJsurzN3DHzqC8/9K7oqcml1dKl/pKi6RWH\r\nwgxfhqUw+NpdG2J0ISBf3LAGbYNUFI8bRusswvIw7xKHmukB7obx49CYfcV4\r\nn3YV0XjDWkzNELP1lFX0RiiXHj6DwHAGe9w=\r\n=+TVl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"},"directories":{},"maintainers":[{"name":"trstlabs","email":"trustpriceprotocol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_1.2.4-alpha.12_1680428995713_0.42098221885608567"},"_hasShrinkwrap":false},"0.7.0-alpha.1":{"name":"trustlessjs","version":"0.7.0-alpha.1","description":"trustlessjs","homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"main/index.js","module":"module/index.js","typings":"types/index.d.ts","directories":{"lib":"src","test":"__tests__"},"scripts":{"build:main":"cross-env BABEL_ENV=production babel src --out-dir main --delete-dir-on-start --extensions \".tsx,.ts,.js\"","build:module":"cross-env MODULE=true babel src --out-dir module --delete-dir-on-start  --extensions \".tsx,.ts,.js\"","build":"npm run build:module && npm run build:main","build:ts":"tsc --project ./tsconfig.json","buidl":"npm run build && npm run build:ts","codegen:build":"buf export ./Trustless-Hub --output=./Trustless-Hub/build","codegen":"npm run codegen:cleanup && npm run codegen:build && npm run codegen:run","codegen:run":"cross-env NODE_ENV=development babel-node scripts/codegen.js","codegen:cleanup":"cross-env rm -rf ./codegen","prepare":"npm run build","dev":"cross-env NODE_ENV=development babel-node src/index --extensions \".tsx,.ts,.js\"","watch":"cross-env NODE_ENV=development babel-watch src/index --extensions \".tsx,.ts,.js\"","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@babel/cli":"7.18.10","@babel/core":"7.18.10","@babel/eslint-parser":"^7.18.9","@babel/node":"^7.18.10","@babel/plugin-proposal-class-properties":"7.18.6","@babel/plugin-proposal-export-default-from":"7.18.10","@babel/plugin-proposal-nullish-coalescing-operator":"7.18.6","@babel/plugin-proposal-numeric-separator":"7.18.6","@babel/plugin-proposal-object-rest-spread":"7.18.9","@babel/plugin-proposal-optional-chaining":"7.18.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.18.10","@babel/preset-typescript":"^7.18.6","@bufbuild/buf":"^1.21.0-1","@osmonauts/telescope":"^0.35.0","@protobufs/cosmos":"^0.0.11","@protobufs/ibc":"^0.0.11","@types/jest":"^28.1.6","babel-core":"7.0.0-bridge.0","babel-jest":"28.1.3","babel-watch":"^7.0.0","cross-env":"^7.0.2","eslint":"8.21.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","jest":"^28.1.3","jest-in-case":"^1.0.2","long":"^5.2.0","prettier":"^2.7.1","regenerator-runtime":"^0.13.7","rimraf":"^3.0.2","ts-jest":"^28.0.7","typescript":"^4.7.4"},"dependencies":{"@babel/runtime":"^7.18.9","@cosmjs/amino":"^0.30.1","@cosmjs/proto-signing":"^0.30.1","@cosmjs/stargate":"^0.30.1","@cosmjs/tendermint-rpc":"^0.30.1","@osmonauts/helpers":"^0.6.0","@osmonauts/lcd":"^0.6.0","protobufjs":"^6.11.2"},"resolutions":{"long":"^5.2.0"},"gitHead":"74dea40ebac9a3e5b964ac9e9ee5b3bb3631cc4e","_id":"trustlessjs@0.7.0-alpha.1","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-QkDXMmhQqFTQo8Jxb9OcY2EUyZZ1GlpxW+gowfSVGPLasbdHtK56ytESQKL/JaCznHA4LMh64C4ulr+jz6kY6g==","shasum":"62edf43c0a8a64bca1466e4df0b909c861c7975d","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.0-alpha.1.tgz","fileCount":336,"unpackedSize":2230523,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKE25UGRouwaPapV7rzjXAwVQEOcq2AawXzOYPA0JN8gIgLx4O2Vm56LH6MQ6ZMoyXGQ18xhENGZq3Vt43z36ERsE="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.0-alpha.1_1690651888057_0.504061912049429"},"_hasShrinkwrap":false},"0.7.0-alpha.2":{"name":"trustlessjs","version":"0.7.0-alpha.2","description":"trustlessjs","homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"main/index.js","module":"module/index.js","typings":"types/index.d.ts","directories":{"lib":"src","test":"__tests__"},"scripts":{"build:main":"cross-env BABEL_ENV=production babel src --out-dir main --delete-dir-on-start --extensions \".tsx,.ts,.js\"","build:module":"cross-env MODULE=true babel src --out-dir module --delete-dir-on-start  --extensions \".tsx,.ts,.js\"","build":"npm run build:module && npm run build:main","build:ts":"tsc --project ./tsconfig.json","buidl":"npm run build && npm run build:ts","codegen:build":"buf export ./Trustless-Hub --output=./Trustless-Hub/build","codegen":"npm run codegen:cleanup && npm run codegen:build && npm run codegen:run","codegen:run":"cross-env NODE_ENV=development babel-node scripts/codegen.js","codegen:cleanup":"cross-env rm -rf ./codegen","prepare":"npm run build","dev":"cross-env NODE_ENV=development babel-node src/index --extensions \".tsx,.ts,.js\"","watch":"cross-env NODE_ENV=development babel-watch src/index --extensions \".tsx,.ts,.js\"","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@babel/cli":"7.18.10","@babel/core":"7.18.10","@babel/eslint-parser":"^7.18.9","@babel/node":"^7.18.10","@babel/plugin-proposal-class-properties":"7.18.6","@babel/plugin-proposal-export-default-from":"7.18.10","@babel/plugin-proposal-nullish-coalescing-operator":"7.18.6","@babel/plugin-proposal-numeric-separator":"7.18.6","@babel/plugin-proposal-object-rest-spread":"7.18.9","@babel/plugin-proposal-optional-chaining":"7.18.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.18.10","@babel/preset-typescript":"^7.18.6","@bufbuild/buf":"^1.21.0-1","@osmonauts/telescope":"^0.35.0","@protobufs/cosmos":"^0.0.11","@protobufs/ibc":"^0.0.11","@types/jest":"^28.1.6","babel-core":"7.0.0-bridge.0","babel-jest":"28.1.3","babel-watch":"^7.0.0","cross-env":"^7.0.2","eslint":"8.21.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","jest":"^28.1.3","jest-in-case":"^1.0.2","long":"^5.2.0","prettier":"^2.7.1","regenerator-runtime":"^0.13.7","rimraf":"^3.0.2","ts-jest":"^28.0.7","typescript":"^4.7.4"},"dependencies":{"@babel/runtime":"^7.18.9","@cosmjs/amino":"^0.30.1","@cosmjs/proto-signing":"^0.30.1","@cosmjs/stargate":"^0.30.1","@cosmjs/tendermint-rpc":"^0.30.1","@osmonauts/helpers":"^0.6.0","@osmonauts/lcd":"^0.6.0","protobufjs":"^6.11.2"},"resolutions":{"long":"^5.2.0"},"gitHead":"74dea40ebac9a3e5b964ac9e9ee5b3bb3631cc4e","_id":"trustlessjs@0.7.0-alpha.2","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-SI35rkKg/8JfYjPbpm5qYU4CFRm9TpF2ZQx0GkwVsN6e+AuU3XOL8TwmPdMrJ6ExSwUGubLW+nT+E3ba1mhwpw==","shasum":"dcfd2a881a155b58dc553bd3b98db23123ca39bc","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.0-alpha.2.tgz","fileCount":336,"unpackedSize":2230485,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC73qagmQBxxRzxJ15eoOsQfK/FT8qwiDRO4owoFPRysAiAUCkBVpIZImuGs9y25khDJAlY+rBAOmWWOwqvc+Ov5mQ=="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.0-alpha.2_1690652055617_0.26010036059972186"},"_hasShrinkwrap":false},"0.7.0-alpha.3":{"name":"trustlessjs","version":"0.7.0-alpha.3","description":"trustlessjs","homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"main/index.js","module":"module/index.js","typings":"types/index.d.ts","directories":{"lib":"src","test":"__tests__"},"scripts":{"build:main":"cross-env BABEL_ENV=production babel src --out-dir main --delete-dir-on-start --extensions \".tsx,.ts,.js\"","build:module":"cross-env MODULE=true babel src --out-dir module --delete-dir-on-start  --extensions \".tsx,.ts,.js\"","build":"npm run build:module && npm run build:main","build:ts":"tsc --project ./tsconfig.json","buidl":"npm run build && npm run build:ts","codegen:build":"buf export ./Trustless-Hub --output=./Trustless-Hub/build","codegen":"npm run codegen:cleanup && npm run codegen:build && npm run codegen:run","codegen:run":"cross-env NODE_ENV=development babel-node scripts/codegen.js","codegen:cleanup":"cross-env rm -rf ./codegen","prepare":"npm run build","dev":"cross-env NODE_ENV=development babel-node src/index --extensions \".tsx,.ts,.js\"","watch":"cross-env NODE_ENV=development babel-watch src/index --extensions \".tsx,.ts,.js\"","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@babel/cli":"7.18.10","@babel/core":"7.18.10","@babel/eslint-parser":"^7.18.9","@babel/node":"^7.18.10","@babel/plugin-proposal-class-properties":"7.18.6","@babel/plugin-proposal-export-default-from":"7.18.10","@babel/plugin-proposal-nullish-coalescing-operator":"7.18.6","@babel/plugin-proposal-numeric-separator":"7.18.6","@babel/plugin-proposal-object-rest-spread":"7.18.9","@babel/plugin-proposal-optional-chaining":"7.18.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.18.10","@babel/preset-typescript":"^7.18.6","@bufbuild/buf":"^1.21.0-1","@osmonauts/telescope":"^0.35.0","@protobufs/cosmos":"^0.0.11","@protobufs/ibc":"^0.0.11","@types/jest":"^28.1.6","babel-core":"7.0.0-bridge.0","babel-jest":"28.1.3","babel-watch":"^7.0.0","cross-env":"^7.0.2","eslint":"8.21.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","jest":"^28.1.3","jest-in-case":"^1.0.2","long":"^5.2.0","prettier":"^2.7.1","regenerator-runtime":"^0.13.7","rimraf":"^3.0.2","ts-jest":"^28.0.7","typescript":"^4.7.4"},"dependencies":{"@babel/runtime":"^7.18.9","@cosmjs/amino":"^0.30.1","@cosmjs/proto-signing":"^0.30.1","@cosmjs/stargate":"^0.30.1","@cosmjs/tendermint-rpc":"^0.30.1","@osmonauts/helpers":"^0.6.0","@osmonauts/lcd":"^0.6.0","protobufjs":"^6.11.2"},"resolutions":{"long":"^5.2.0"},"gitHead":"a1530b909186f19da26d09ecded3666346215e11","_id":"trustlessjs@0.7.0-alpha.3","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-zJ9h+za9SHU5oro+eGsbJKEWDrop6pbcLfwH0PMtOEMPbLKpSRTWlURL40reVsSJLtAX69i/TarCNQJciOeZeQ==","shasum":"82ff50bcb895e95593bf3bc39c3059292c3da03c","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.0-alpha.3.tgz","fileCount":334,"unpackedSize":2221833,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHY/wnKvaiSIUybA7bIVutJ/w5du/6+EC+IilKFY5M7wAiEA/iubWYv21q3X2ydI7CNI9v6PID7bxh6ftPHvfO0Dfcs="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.0-alpha.3_1690705741726_0.26597763665489516"},"_hasShrinkwrap":false},"0.7.1-alpha.1":{"name":"trustlessjs","version":"0.7.1-alpha.1","description":"trustlessjs","homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"main/index.js","module":"module/index.js","typings":"types/index.d.ts","directories":{"lib":"src","test":"__tests__"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"cross-env NODE_ENV=development babel-node scripts/codegen.js","prepare":"npm run build","lint":"eslint .","format":"eslint . --fix","test":"jest --config ./jest.osmojs.config.json","test:watch":"jest --watch --config ./jest.osmojs.config.json","test:debug":"node --inspect node_modules/.bin/jest --runInBand --config ./jest.osmojs.config.json","e2e":"npm run e2e:test","e2e:deps":"cd tests && make setup","e2e:kind":"cd tests && make setup-kind","e2e:start":"cd tests && make start","e2e:test":"jest --config ./jest.starship.config.json --verbose --bail","e2e:debug":"jest --config ./jest.starship.config.json --runInBand --verbose --bail","e2e:watch":"jest --watch --config ./jest.starship.config.json","e2e:stop":"cd tests && make stop","e2e:clean":"cd tests && make stop clean"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@babel/cli":"7.22.9","@babel/core":"7.22.9","@babel/eslint-parser":"^7.22.9","@babel/generator":"7.22.9","@babel/node":"^7.22.6","@babel/parser":"^7.22.7","@babel/plugin-proposal-class-properties":"7.18.6","@babel/plugin-proposal-export-default-from":"7.22.5","@babel/plugin-proposal-nullish-coalescing-operator":"7.18.6","@babel/plugin-proposal-numeric-separator":"7.18.6","@babel/plugin-proposal-object-rest-spread":"7.20.7","@babel/plugin-proposal-optional-chaining":"7.21.0","@babel/plugin-syntax-dynamic-import":"7.8.3","@babel/plugin-transform-runtime":"7.22.9","@babel/preset-env":"7.22.9","@babel/preset-typescript":"^7.22.5","@babel/traverse":"7.22.8","@babel/types":"7.22.5","@chain-registry/client":"1.14.1","@confio/relayer":"0.7.0","@cosmjs/cosmwasm-stargate":"0.29.4","@cosmjs/crypto":"0.29.4","@cosmology/telescope":"0.102.0","@protobufs/confio":"^0.0.6","@protobufs/cosmos":"^0.1.0","@protobufs/cosmos_proto":"^0.0.10","@protobufs/cosmwasm":"^0.0.11","@protobufs/gogoproto":"^0.0.10","@protobufs/google":"^0.0.10","@protobufs/ibc":"^0.1.0","@protobufs/osmosis":"^0.2.0","@protobufs/tendermint":"^0.0.10","@types/jest":"^29.5.3","ast-stringify":"0.1.0","axios":"^0.27.2","babel-core":"7.0.0-bridge.0","babel-jest":"29.6.1","babel-watch":"^7.8.1","bignumber.js":"9.1.1","case":"1.6.3","cosmjs-types":"0.5.2","cross-env":"^7.0.2","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","glob":"8.0.3","jest":"^29.6.1","jest-in-case":"^1.0.2","js-yaml":"4.1.0","mkdirp":"1.0.4","node-fetch":"^2.6.9","path":"^0.12.7","prettier":"^2.7.0","publish-scripts":"0.1.0","rimraf":"3.0.2","sinon":"14.0.2","ts-jest":"^29.1.1","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.29.3","@cosmjs/proto-signing":"0.29.3","@cosmjs/stargate":"0.29.3","@cosmjs/tendermint-rpc":"^0.29.3","@cosmology/lcd":"^0.12.0","@osmonauts/lcd":"^0.11.1"},"gitHead":"590709d598d811674ba46579aaae9259c19f33cc","_id":"trustlessjs@0.7.1-alpha.1","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-J9VLgUmcsrm+MB+O+VJy5TcM0EtVQtTglRrHKKbuyVp9eITVOBT1KLDJ3XAD6IKMYuEe04TP1zL6uA+qI0xMmg==","shasum":"e5117e8d56533f7638eac4afb7da1476be95ffa5","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.1-alpha.1.tgz","fileCount":334,"unpackedSize":2222838,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHgabnXwJLwdZBaCNh4i2NUxs/YhK532b4QhcFblODhCAiEAtdlOKQVYQZOM/FEBypN8gXdpk1HGLhYOnUEBItxbmbk="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.1-alpha.1_1690822305511_0.06388154043831595"},"_hasShrinkwrap":false},"0.7.1-alpha.2":{"name":"trustlessjs","version":"0.7.1-alpha.2","description":"trustlessjs","homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"main/index.js","module":"module/index.js","typings":"types/index.d.ts","directories":{"lib":"src","test":"__tests__"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"cross-env NODE_ENV=development babel-node scripts/codegen.js","prepare":"npm run build","lint":"eslint .","format":"eslint . --fix","test":"jest --config ./jest.osmojs.config.json","test:watch":"jest --watch --config ./jest.osmojs.config.json","test:debug":"node --inspect node_modules/.bin/jest --runInBand --config ./jest.osmojs.config.json","e2e":"npm run e2e:test","e2e:deps":"cd tests && make setup","e2e:kind":"cd tests && make setup-kind","e2e:start":"cd tests && make start","e2e:test":"jest --config ./jest.starship.config.json --verbose --bail","e2e:debug":"jest --config ./jest.starship.config.json --runInBand --verbose --bail","e2e:watch":"jest --watch --config ./jest.starship.config.json","e2e:stop":"cd tests && make stop","e2e:clean":"cd tests && make stop clean"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@babel/cli":"7.22.9","@babel/core":"7.22.9","@babel/eslint-parser":"^7.22.9","@babel/generator":"7.22.9","@babel/node":"^7.22.6","@babel/parser":"^7.22.7","@babel/plugin-proposal-class-properties":"7.18.6","@babel/plugin-proposal-export-default-from":"7.22.5","@babel/plugin-proposal-nullish-coalescing-operator":"7.18.6","@babel/plugin-proposal-numeric-separator":"7.18.6","@babel/plugin-proposal-object-rest-spread":"7.20.7","@babel/plugin-proposal-optional-chaining":"7.21.0","@babel/plugin-syntax-dynamic-import":"7.8.3","@babel/plugin-transform-runtime":"7.22.9","@babel/preset-env":"7.22.9","@babel/preset-typescript":"^7.22.5","@babel/traverse":"7.22.8","@babel/types":"7.22.5","@chain-registry/client":"1.14.1","@confio/relayer":"0.7.0","@cosmjs/cosmwasm-stargate":"0.29.4","@cosmjs/crypto":"0.29.4","@cosmology/telescope":"0.102.0","@protobufs/confio":"^0.0.6","@protobufs/cosmos":"^0.1.0","@protobufs/cosmos_proto":"^0.0.10","@protobufs/cosmwasm":"^0.0.11","@protobufs/gogoproto":"^0.0.10","@protobufs/google":"^0.0.10","@protobufs/ibc":"^0.1.0","@protobufs/osmosis":"^0.2.0","@protobufs/tendermint":"^0.0.10","@types/jest":"^29.5.3","ast-stringify":"0.1.0","axios":"^0.27.2","babel-core":"7.0.0-bridge.0","babel-jest":"29.6.1","babel-watch":"^7.8.1","bignumber.js":"9.1.1","case":"1.6.3","cosmjs-types":"0.5.2","cross-env":"^7.0.2","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","glob":"8.0.3","jest":"^29.6.1","jest-in-case":"^1.0.2","js-yaml":"4.1.0","mkdirp":"1.0.4","node-fetch":"^2.6.9","path":"^0.12.7","prettier":"^2.7.0","publish-scripts":"0.1.0","rimraf":"3.0.2","sinon":"14.0.2","ts-jest":"^29.1.1","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.29.3","@cosmjs/proto-signing":"0.29.3","@cosmjs/stargate":"0.29.3","@cosmjs/tendermint-rpc":"^0.29.3","@cosmology/lcd":"^0.12.0","@osmonauts/lcd":"^0.11.1"},"gitHead":"28fc0425bbfd77534aeaeff24ef0bbb65b73dbc1","_id":"trustlessjs@0.7.1-alpha.2","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-xCG+7kMuyvLmw9D1MKD3HXemC/AT7p1/TeRNy3lZo+p2K72YSzf+7F0lcuKuoCmNPqx4BsexUX9MBgDRe562tA==","shasum":"a2fcdf79d2c0d60324d4a9099c2f98879bbe2bf5","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.1-alpha.2.tgz","fileCount":334,"unpackedSize":2222838,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzq6jjT7FPIOOiPDKcXGv1RG7FQnWyXIws3hNuYg7TjQIgDTqrP/SZiGB66FDmdq4rHZEdf5NkIQ/ouQPdCv/L5W8="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.1-alpha.2_1690827908829_0.3642973081285219"},"_hasShrinkwrap":false},"0.7.1-alpha.3":{"name":"trustlessjs","version":"0.7.1-alpha.3","description":"trustlessjs","homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"main/index.js","module":"module/index.js","typings":"types/index.d.ts","directories":{"lib":"src","test":"__tests__"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"cross-env NODE_ENV=development babel-node scripts/codegen.js","prepare":"npm run build","lint":"eslint .","format":"eslint . --fix","test":"jest --config ./jest.osmojs.config.json","test:watch":"jest --watch --config ./jest.osmojs.config.json","test:debug":"node --inspect node_modules/.bin/jest --runInBand --config ./jest.osmojs.config.json","e2e":"npm run e2e:test","e2e:deps":"cd tests && make setup","e2e:kind":"cd tests && make setup-kind","e2e:start":"cd tests && make start","e2e:test":"jest --config ./jest.starship.config.json --verbose --bail","e2e:debug":"jest --config ./jest.starship.config.json --runInBand --verbose --bail","e2e:watch":"jest --watch --config ./jest.starship.config.json","e2e:stop":"cd tests && make stop","e2e:clean":"cd tests && make stop clean"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@babel/cli":"7.22.9","@babel/core":"7.22.9","@babel/eslint-parser":"^7.22.9","@babel/generator":"7.22.9","@babel/node":"^7.22.6","@babel/parser":"^7.22.7","@babel/plugin-proposal-class-properties":"7.18.6","@babel/plugin-proposal-export-default-from":"7.22.5","@babel/plugin-proposal-nullish-coalescing-operator":"7.18.6","@babel/plugin-proposal-numeric-separator":"7.18.6","@babel/plugin-proposal-object-rest-spread":"7.20.7","@babel/plugin-proposal-optional-chaining":"7.21.0","@babel/plugin-syntax-dynamic-import":"7.8.3","@babel/plugin-transform-runtime":"7.22.9","@babel/preset-env":"7.22.9","@babel/preset-typescript":"^7.22.5","@babel/traverse":"7.22.8","@babel/types":"7.22.5","@chain-registry/client":"1.14.1","@confio/relayer":"0.7.0","@cosmjs/cosmwasm-stargate":"0.29.4","@cosmjs/crypto":"0.29.4","@cosmology/telescope":"0.102.0","@protobufs/confio":"^0.0.6","@protobufs/cosmos":"^0.1.0","@protobufs/cosmos_proto":"^0.0.10","@protobufs/cosmwasm":"^0.0.11","@protobufs/gogoproto":"^0.0.10","@protobufs/google":"^0.0.10","@protobufs/ibc":"^0.1.0","@protobufs/osmosis":"^0.2.0","@protobufs/tendermint":"^0.0.10","@types/jest":"^29.5.3","ast-stringify":"0.1.0","axios":"^0.27.2","babel-core":"7.0.0-bridge.0","babel-jest":"29.6.1","babel-watch":"^7.8.1","bignumber.js":"9.1.1","case":"1.6.3","cosmjs-types":"0.5.2","cross-env":"^7.0.2","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","glob":"8.0.3","jest":"^29.6.1","jest-in-case":"^1.0.2","js-yaml":"4.1.0","mkdirp":"1.0.4","node-fetch":"^2.6.9","path":"^0.12.7","prettier":"^2.7.0","publish-scripts":"0.1.0","rimraf":"3.0.2","sinon":"14.0.2","ts-jest":"^29.1.1","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.29.3","@cosmjs/proto-signing":"0.29.3","@cosmjs/stargate":"0.29.3","@cosmjs/tendermint-rpc":"^0.29.3","@cosmology/lcd":"^0.12.0","@osmonauts/lcd":"^0.11.1"},"gitHead":"24fe2e0a0bccbbfae36e175a24e07ec504ba8973","_id":"trustlessjs@0.7.1-alpha.3","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-GZx2W8mQoqIch4S7p3xo7NQY2ajnqgCfrex/VT8N/3J+hqO2h1k0BvwxH9xtYFMnV7JKkbWsCwwwR56adShK7g==","shasum":"ee07e3129f23ee44aee2d7fbe7048cad807a12d2","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.1-alpha.3.tgz","fileCount":716,"unpackedSize":6239020,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHOl/3cW/tOPEuqxoI+zTbTTDS+tBCBLEJsN0Focb+8VAiEAnMuhjGwRFaLSL6L0660/te9gFwVdUSvvUnAKFVgRjYQ="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.1-alpha.3_1690878976725_0.7404850920158557"},"_hasShrinkwrap":false},"0.7.1-alpha.4":{"name":"trustlessjs","version":"0.7.1-alpha.4","description":"trustlessjs","homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src","test":"__tests__"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"cross-env NODE_ENV=development babel-node scripts/codegen.js","prepare":"npm run build","lint":"eslint .","format":"eslint . --fix","test":"jest --config ./jest.osmojs.config.json","test:watch":"jest --watch --config ./jest.osmojs.config.json","test:debug":"node --inspect node_modules/.bin/jest --runInBand --config ./jest.osmojs.config.json","e2e":"npm run e2e:test","e2e:deps":"cd tests && make setup","e2e:kind":"cd tests && make setup-kind","e2e:start":"cd tests && make start","e2e:test":"jest --config ./jest.starship.config.json --verbose --bail","e2e:debug":"jest --config ./jest.starship.config.json --runInBand --verbose --bail","e2e:watch":"jest --watch --config ./jest.starship.config.json","e2e:stop":"cd tests && make stop","e2e:clean":"cd tests && make stop clean"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@babel/cli":"7.22.9","@babel/core":"7.22.9","@babel/eslint-parser":"^7.22.9","@babel/generator":"7.22.9","@babel/node":"^7.22.6","@babel/parser":"^7.22.7","@babel/plugin-proposal-class-properties":"7.18.6","@babel/plugin-proposal-export-default-from":"7.22.5","@babel/plugin-proposal-nullish-coalescing-operator":"7.18.6","@babel/plugin-proposal-numeric-separator":"7.18.6","@babel/plugin-proposal-object-rest-spread":"7.20.7","@babel/plugin-proposal-optional-chaining":"7.21.0","@babel/plugin-syntax-dynamic-import":"7.8.3","@babel/plugin-transform-runtime":"7.22.9","@babel/preset-env":"7.22.9","@babel/preset-typescript":"^7.22.5","@babel/traverse":"7.22.8","@babel/types":"7.22.5","@chain-registry/client":"1.14.1","@confio/relayer":"0.7.0","@cosmjs/cosmwasm-stargate":"0.29.4","@cosmjs/crypto":"0.29.4","@cosmology/telescope":"0.102.0","@protobufs/confio":"^0.0.6","@protobufs/cosmos":"^0.1.0","@protobufs/cosmos_proto":"^0.0.10","@protobufs/cosmwasm":"^0.0.11","@protobufs/gogoproto":"^0.0.10","@protobufs/google":"^0.0.10","@protobufs/ibc":"^0.1.0","@protobufs/osmosis":"^0.2.0","@protobufs/tendermint":"^0.0.10","@types/jest":"^29.5.3","ast-stringify":"0.1.0","axios":"^0.27.2","babel-core":"7.0.0-bridge.0","babel-jest":"29.6.1","babel-watch":"^7.8.1","bignumber.js":"9.1.1","case":"1.6.3","cosmjs-types":"0.5.2","cross-env":"^7.0.2","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","glob":"8.0.3","jest":"^29.6.1","jest-in-case":"^1.0.2","js-yaml":"4.1.0","mkdirp":"1.0.4","node-fetch":"^2.6.9","path":"^0.12.7","prettier":"^2.7.0","publish-scripts":"0.1.0","rimraf":"3.0.2","sinon":"14.0.2","ts-jest":"^29.1.1","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.29.3","@cosmjs/proto-signing":"0.29.3","@cosmjs/stargate":"0.29.3","@cosmjs/tendermint-rpc":"^0.29.3","@cosmology/lcd":"^0.12.0","@osmonauts/lcd":"^0.11.1"},"gitHead":"dda12003691b1fb2d500e1fa8c85542bfce5ade1","_id":"trustlessjs@0.7.1-alpha.4","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-j0RR1YrdZKG5qx1PvyLoBLL82cQ4Zp8epPslojPb690woakTz4uwCPl4uUGn5xRTqCd5Q6nGP03bl8CJT7S/GA==","shasum":"378fd4312de23eadf6ad6ed33fc4548caf632cca","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.1-alpha.4.tgz","fileCount":715,"unpackedSize":6238270,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/Kkfhpnfiytg0kgRm9Ui/GJfhuYod3idVjrOQyhJedgIgYVlf8wAGE4hnIY9upS6eqX3bUe9+aOMQ3q27ollEAWU="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.1-alpha.4_1690879293570_0.36509200865621994"},"_hasShrinkwrap":false},"0.7.1-alpha.5":{"name":"trustlessjs","version":"0.7.1-alpha.5","description":"trustlessjs","homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src","test":"__tests__"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"cross-env NODE_ENV=development babel-node scripts/codegen.js","prepare":"npm run build","lint":"eslint .","format":"eslint . --fix","test":"jest --config ./jest.osmojs.config.json","test:watch":"jest --watch --config ./jest.osmojs.config.json","test:debug":"node --inspect node_modules/.bin/jest --runInBand --config ./jest.osmojs.config.json","e2e":"npm run e2e:test","e2e:deps":"cd tests && make setup","e2e:kind":"cd tests && make setup-kind","e2e:start":"cd tests && make start","e2e:test":"jest --config ./jest.starship.config.json --verbose --bail","e2e:debug":"jest --config ./jest.starship.config.json --runInBand --verbose --bail","e2e:watch":"jest --watch --config ./jest.starship.config.json","e2e:stop":"cd tests && make stop","e2e:clean":"cd tests && make stop clean"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@babel/cli":"7.22.9","@babel/core":"7.22.9","@babel/eslint-parser":"^7.22.9","@babel/generator":"7.22.9","@babel/node":"^7.22.6","@babel/parser":"^7.22.7","@babel/plugin-proposal-class-properties":"7.18.6","@babel/plugin-proposal-export-default-from":"7.22.5","@babel/plugin-proposal-nullish-coalescing-operator":"7.18.6","@babel/plugin-proposal-numeric-separator":"7.18.6","@babel/plugin-proposal-object-rest-spread":"7.20.7","@babel/plugin-proposal-optional-chaining":"7.21.0","@babel/plugin-syntax-dynamic-import":"7.8.3","@babel/plugin-transform-runtime":"7.22.9","@babel/preset-env":"7.22.9","@babel/preset-typescript":"^7.22.5","@babel/traverse":"7.22.8","@babel/types":"7.22.5","@chain-registry/client":"1.14.1","@confio/relayer":"0.7.0","@cosmjs/cosmwasm-stargate":"0.29.4","@cosmjs/crypto":"0.29.4","@cosmology/telescope":"0.102.0","@protobufs/confio":"^0.0.6","@protobufs/cosmos":"^0.1.0","@protobufs/cosmos_proto":"^0.0.10","@protobufs/cosmwasm":"^0.0.11","@protobufs/gogoproto":"^0.0.10","@protobufs/google":"^0.0.10","@protobufs/ibc":"^0.1.0","@protobufs/osmosis":"^0.2.0","@protobufs/tendermint":"^0.0.10","@types/jest":"^29.5.3","ast-stringify":"0.1.0","axios":"^0.27.2","babel-core":"7.0.0-bridge.0","babel-jest":"29.6.1","babel-watch":"^7.8.1","bignumber.js":"9.1.1","case":"1.6.3","cosmjs-types":"0.5.2","cross-env":"^7.0.2","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","glob":"8.0.3","jest":"^29.6.1","jest-in-case":"^1.0.2","js-yaml":"4.1.0","mkdirp":"1.0.4","node-fetch":"^2.6.9","path":"^0.12.7","prettier":"^2.7.0","publish-scripts":"0.1.0","rimraf":"3.0.2","sinon":"14.0.2","ts-jest":"^29.1.1","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.29.3","@cosmjs/proto-signing":"0.29.3","@cosmjs/stargate":"0.29.3","@cosmjs/tendermint-rpc":"^0.29.3","@cosmology/lcd":"^0.12.0","@osmonauts/lcd":"^0.11.1"},"gitHead":"dda12003691b1fb2d500e1fa8c85542bfce5ade1","_id":"trustlessjs@0.7.1-alpha.5","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-2JxvdhNrkTvtQcqKfz6bAMfKybYTjTo8BYUkKAxNMJHiJRsJPOdyEo8yWVH69qbrwa0n+IIevrquB/leSSN0vQ==","shasum":"f0ab67108d1fb549a0f82da8adf345057e33e47a","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.1-alpha.5.tgz","fileCount":1045,"unpackedSize":9044229,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/QRkaqie9cHTL9a1BVzCbJGIe7POkXzY2mtJYDvj5oAiAggoKABnyogEXosIjsgDAhhT+UseeZleJpJiuSUDCxqQ=="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.1-alpha.5_1690884888501_0.7822561593216495"},"_hasShrinkwrap":false},"0.7.2-alpha.1":{"name":"trustlessjs","version":"0.7.2-alpha.1","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"^0.102.0","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.29.4","@cosmjs/proto-signing":"0.29.4","@cosmjs/stargate":"0.29.4","@cosmjs/tendermint-rpc":"^0.29.4"},"gitHead":"c362c3687e1e9d9128a10af48b2206dfc198f29a","_id":"trustlessjs@0.7.2-alpha.1","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-dprcubNtp0zb7+fyTCa+LafEnD/M0WexVZreulmAV4J1zxqf6OXnewxdbYy1RN02Q/ercQStdLcawCOvCn99Vw==","shasum":"5533bde8469f6d02853e9bd6d84addae2956df6d","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.2-alpha.1.tgz","fileCount":731,"unpackedSize":9753166,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDbAkjMyjBkSQQ03OnVUeWsksdHoJ/p8LnEvFY2onGxwAiEAycAOy4XRKtEG0fBanQd3+purvkMPGGOoaPuPB5D4DSQ="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.2-alpha.1_1690889147037_0.6545864959725443"},"_hasShrinkwrap":false},"0.7.2-alpha.2":{"name":"trustlessjs","version":"0.7.2-alpha.2","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"^0.102.0","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.29.4","@cosmjs/proto-signing":"0.29.4","@cosmjs/stargate":"0.29.4","@cosmjs/tendermint-rpc":"^0.29.4"},"gitHead":"dcf730b6eb9bd0fad5412185de6bf3eab5e15286","_id":"trustlessjs@0.7.2-alpha.2","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-Rf06sN4TEgZp39LJI+KPx43o935OHnSiGcQUmNdLgl3i/BuP97AP36V3kFwP6kEfXxIRHIgo9PovfMwoWYJpMw==","shasum":"246f401ccaaccf786ccba271c0c318811fbaaf8d","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.2-alpha.2.tgz","fileCount":735,"unpackedSize":9762082,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGFgksv4RvFSWOPdXjzZQNvRccGWzwOjnROEcALtIu3AiEAuUSdQzNFxbBRAPmyk882C9znTAdvgl6cDD1/vuriqdU="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.2-alpha.2_1690889863466_0.18570187767657864"},"_hasShrinkwrap":false},"0.7.2-alpha.3":{"name":"trustlessjs","version":"0.7.2-alpha.3","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"^0.102.0","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.29.4","@cosmjs/proto-signing":"0.29.4","@cosmjs/stargate":"0.29.4","@cosmjs/tendermint-rpc":"^0.29.4"},"gitHead":"dcf730b6eb9bd0fad5412185de6bf3eab5e15286","_id":"trustlessjs@0.7.2-alpha.3","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-59ouwbk5EMw2ltCkagLFLn7M1axyhR9Ehj7oa9UpRNWEYcuXaq1tWl6O016nzI0rWQUKXRmz5nTIffK05i44VQ==","shasum":"d9ccdf90d5e5f0665f03e61aa9c517894988f325","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.2-alpha.3.tgz","fileCount":735,"unpackedSize":9757112,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAtgyrTGhIWvtmenk+taQq6BefKXZFVQIko5GeYcjAlmAiEAuYXZxYQt5cDAOyVj84EBg4NApYrq79/9Tvf0Jpk+WwU="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.2-alpha.3_1690890840655_0.01843169512385634"},"_hasShrinkwrap":false},"0.7.2-alpha.4":{"name":"trustlessjs","version":"0.7.2-alpha.4","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"^0.102.0","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.29.5","@cosmjs/proto-signing":"0.29.5","@cosmjs/stargate":"0.29.5","@cosmjs/tendermint-rpc":"0.29.5"},"gitHead":"dcf730b6eb9bd0fad5412185de6bf3eab5e15286","_id":"trustlessjs@0.7.2-alpha.4","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-3zbtDs6zupEv0nGlQVqrLDi99lzBsuPOsWZ7bpkfZ4DyhcJviBeIYOibJ3UlsCtQ/Ri15C5AtCAs2kw3l5+39g==","shasum":"679bc45a484dcef032b6b98ed3b2c6a3ed7f4191","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.2-alpha.4.tgz","fileCount":735,"unpackedSize":9752544,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6XueRpzsrE4CifQfNXjOElblmR4AFc2Wfc0iN9/uKsAIgb2MJPN5Bbdmpr1/asGqFio94hNpaokpCVzyXN/g5i7o="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.2-alpha.4_1690908484970_0.3353673693695407"},"_hasShrinkwrap":false},"0.7.2-alpha.5":{"name":"trustlessjs","version":"0.7.2-alpha.5","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"^0.102.0","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.29.5","@cosmjs/proto-signing":"0.29.5","@cosmjs/stargate":"0.29.5","@cosmjs/tendermint-rpc":"0.29.5"},"gitHead":"dcf730b6eb9bd0fad5412185de6bf3eab5e15286","_id":"trustlessjs@0.7.2-alpha.5","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-UvZEZPAAFxjFKJbAA3tJLgjwP/4CF5d4yaTDWbee/vMidI33Hbt6xkyxlApsVEOXBgcZUAI/mdGysgadbRwo4g==","shasum":"2b7d36b33a64939651b2bfcb3d0d5ad6ddc7cafb","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.2-alpha.5.tgz","fileCount":745,"unpackedSize":9388316,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDW04fucusv6emfcr/rts+iE1gYozUifdJ/WQ637uUAMAIgEMsyU8dkKvx7weobYr4n2YyKOTSKJ+vbiY0yXfgb5Ds="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.2-alpha.5_1691061683853_0.43808676020717874"},"_hasShrinkwrap":false},"0.7.2-alpha.6":{"name":"trustlessjs","version":"0.7.2-alpha.6","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"^0.102.0","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.31.0","@cosmjs/proto-signing":"0.31.0","@cosmjs/stargate":"0.31.0","@cosmjs/tendermint-rpc":"0.31.0"},"gitHead":"bbc95eddefc10d0a0a766b69288088c85629a375","_id":"trustlessjs@0.7.2-alpha.6","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-9nO+1C5C3rwlQUoEXN90jRKihdW9ZlLHTaSbQ1PzT5gpFXj9UCfN9EveknzRbwSfWJWuf8GaE8yOhXpeyUbuDA==","shasum":"5d2e58fe20e33ea1c56bd1a91b9de8a38484b7eb","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.2-alpha.6.tgz","fileCount":745,"unpackedSize":9388316,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8nN8yhBT392t1CJBVYSh9t000T7wyi5dIVFaT1Qi3JAiBrC6ynZ4aCV+X6iSTo5ACPYXSJLFrdaoMXazr+LyTQGw=="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.2-alpha.6_1692033147408_0.9898356344676809"},"_hasShrinkwrap":false},"0.7.2-alpha.8":{"name":"trustlessjs","version":"0.7.2-alpha.8","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"^0.102.0","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.31.0","@cosmjs/proto-signing":"0.31.0","@cosmjs/stargate":"0.31.0","@cosmjs/tendermint-rpc":"0.31.0"},"gitHead":"068e00265bdcceb058194bee4a8a264fb2ae36b1","_id":"trustlessjs@0.7.2-alpha.8","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-x77wI2zQ4gq7xFp41obGwLKcLrSZKHEdpEyF2bdP/f7sxp35yeTbF2wHr8MH1JyO9wgSmuAEHzU+BAZ8Yh+d0w==","shasum":"5d742caa7f7833fb834eec5bf3364d399a7b0ff7","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.2-alpha.8.tgz","fileCount":745,"unpackedSize":9423552,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAERLV7VedMsslfsltKjSGZvf/nMjniLRFtffohZpz9TAiBPJvaocQx/eUOl9S3Il9UdPVfbjhy3WDl9pT172UKU2A=="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.2-alpha.8_1705162274938_0.4220130509698494"},"_hasShrinkwrap":false},"0.7.3-alpha.1":{"name":"trustlessjs","version":"0.7.3-alpha.1","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"^0.102.0","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.31.0","@cosmjs/proto-signing":"0.31.0","@cosmjs/stargate":"0.31.0","@cosmjs/tendermint-rpc":"0.31.0"},"gitHead":"eae128e848329ae5594d1ce174125e414c6c299e","_id":"trustlessjs@0.7.3-alpha.1","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-DikCiZ6ZVX2FEvtx99quAQ8COIgU1/HnFadYIs1nePX4hV/WsDgW/yhVVzI7syTVQo7RPO+aiCAMwN+K0HBNSw==","shasum":"0b3b4fa86a89c9db8642fae834daf7a3d1eedb17","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.3-alpha.1.tgz","fileCount":747,"unpackedSize":10077836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2xnqeMabgjR1o5ws9gfF6zicHATWLTovs/VxzKVgiIwIgXLwl3r/JEFYuG7Qn4TOhXBI/LnIymHcw4jPTymzk+eU="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.3-alpha.1_1706441117092_0.7532526520359513"},"_hasShrinkwrap":false},"0.7.3-alpha.2":{"name":"trustlessjs","version":"0.7.3-alpha.2","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"^0.102.0","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.31.0","@cosmjs/proto-signing":"0.31.0","@cosmjs/stargate":"0.31.0","@cosmjs/tendermint-rpc":"0.31.0"},"gitHead":"eae128e848329ae5594d1ce174125e414c6c299e","_id":"trustlessjs@0.7.3-alpha.2","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-KD4d3YuGqrMn6p/5Y6U2kq0UDpvQn6HqPf2UnJEHQlrPD77ebR0+3URpWH/g6t4hI9GqcEILZakm3irILxl0wQ==","shasum":"2d044948fbe888fbcca2f4e8e080f0bbfef65b52","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.3-alpha.2.tgz","fileCount":747,"unpackedSize":10081136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAJzIz/R1Z8w3V7q6YpRl2ih5NAXSwHj6fAEGUWRhIqjAiEAmk6R8e/zUlX/GlbV7jmpYnVkWoSOF8QL55OlHLkXqj4="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.3-alpha.2_1706442587764_0.6190921122611943"},"_hasShrinkwrap":false},"0.7.3-alpha.3":{"name":"trustlessjs","version":"0.7.3-alpha.3","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","build:mjs":"yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true","clean:mjs":"rimraf mjs","clean:dist":"rimraf dist","clean":"npm run clean:mjs && npm run clean:dist","build:rename":"publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir","build":"npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint src --fix","test":"jest","test:watch":"jest --watch","test:debug":"node --inspect node_modules/.bin/jest --runInBand"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"^0.102.0","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"0.31.0","@cosmjs/proto-signing":"0.31.0","@cosmjs/stargate":"0.31.0","@cosmjs/tendermint-rpc":"0.31.0"},"gitHead":"eae128e848329ae5594d1ce174125e414c6c299e","_id":"trustlessjs@0.7.3-alpha.3","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-ido+bTTlFjbNmllApY8HvT3edWa9boqf2o9yQfwyZRyf0b97dsuX4tj0J2A+Gug471R32adRuEUZG6MrnVcyyQ==","shasum":"2ec0ae20364326ba11bd2c8c13cc636f13907431","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.3-alpha.3.tgz","fileCount":747,"unpackedSize":10080706,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbAWkhrDRTPJ+qxLXqOEQ7H8lEqgEvrsmpUVhWS5ZoVgIgEeDNFIkiwz0uCWhMfj0IREzH8sjJ9Y5a/QRBJutSHaU="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.3-alpha.3_1706447559528_0.9433810669423575"},"_hasShrinkwrap":false},"0.7.3-alpha.4":{"name":"trustlessjs","version":"0.7.3-alpha.4","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","clean:dist":"rimraf dist","clean":"npm run clean:dist","build":"npm run clean && npm run build:cjs","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint ."},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"1.4.12","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"^0.32.0","@cosmjs/proto-signing":"^0.32.0","@cosmjs/stargate":"^0.32.0","@cosmjs/tendermint-rpc":"^0.32.0"},"gitHead":"eae128e848329ae5594d1ce174125e414c6c299e","_id":"trustlessjs@0.7.3-alpha.4","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-huT9u5hhi7tLv8hYZNUJEzBEJ+TOSECsSUFz10hfnsZvp2QjLXqR0ydV67SLMietzcqfZcLu6+02Y5Z29mluRQ==","shasum":"51fe521437bb6bc06cfcef1f48bc828848931fdc","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.3-alpha.4.tgz","fileCount":567,"unpackedSize":8997533,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyTU+79JlFoIi8h16EbND9/KXAaIy+S+jBOGApeYAtTgIgPhv892HXVYy6aIBDDsqnh57GauTwwReOPeROkiWdckw="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.3-alpha.4_1706458244464_0.934410272401849"},"_hasShrinkwrap":false},"0.7.4-alpha.2":{"name":"trustlessjs","version":"0.7.4-alpha.2","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","clean:dist":"rimraf dist","clean":"npm run clean:dist","build":"npm run clean && npm run build:cjs","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint ."},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"1.4.12","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"^0.32.0","@cosmjs/proto-signing":"^0.32.0","@cosmjs/stargate":"^0.32.0","@cosmjs/tendermint-rpc":"^0.32.0"},"gitHead":"eae128e848329ae5594d1ce174125e414c6c299e","_id":"trustlessjs@0.7.4-alpha.2","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-C5qvy2pjbe7rjfKn/LVesqoEJz4YcSWbD03W9wqiRkmmA4yGh3NIQLXkLJ8A/ePla/+N8If+m70/YgB0mpWvww==","shasum":"38401c4314bdcc28886f894e5218445f2cb8eb61","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.4-alpha.2.tgz","fileCount":567,"unpackedSize":8997547,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+jGvoxHgTrKWw1Rs1MBH0sN8a2UdQhZJkLobM5DlCOwIhAIRw5xuquX55XJjm+DbmQCava7xRjrmccb6zUp/6Lxs3"}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.4-alpha.2_1708101917085_0.32242458876332614"},"_hasShrinkwrap":false},"0.7.4-alpha.3":{"name":"trustlessjs","version":"0.7.4-alpha.3","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","clean:dist":"rimraf dist","clean":"npm run clean:dist","build":"npm run clean && npm run build:cjs","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint ."},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"1.4.12","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"^0.32.0","@cosmjs/proto-signing":"^0.32.0","@cosmjs/stargate":"^0.32.0","@cosmjs/tendermint-rpc":"^0.32.0"},"gitHead":"23e8864c511a4dde3a286ebcb96a7d75b13fcc82","_id":"trustlessjs@0.7.4-alpha.3","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-VjSIZiAfpWRG1oTYP7eKXOqphEn6DProKieW3DQy6JmwmpmDc3O1iU+ZD913qRF+w+9bKrlA4GIwtfK44PTZrQ==","shasum":"0ac180cf83d1fd506db6484680a4cb5d834ced72","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.4-alpha.3.tgz","fileCount":567,"unpackedSize":9038916,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICHhAUlCh5kU4yzVr8lsZkeNsuWS2AVZaZ9uJthBmCjNAiEAxmk1oRhQc1KJO7cuE9Bq6CAkdvGtfZbNe3FxT7V7IfE="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.4-alpha.3_1708102358296_0.07342801047667025"},"_hasShrinkwrap":false},"0.7.4-alpha.4":{"name":"trustlessjs","version":"0.7.4-alpha.4","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","clean:dist":"rimraf dist","clean":"npm run clean:dist","build":"npm run clean && npm run build:cjs","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint ."},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"1.4.12","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"^0.32.0","@cosmjs/proto-signing":"^0.32.0","@cosmjs/stargate":"^0.32.0","@cosmjs/tendermint-rpc":"^0.32.0"},"_id":"trustlessjs@0.7.4-alpha.4","gitHead":"b239058be869b0a4ede5c9a08a78ff31ade4299e","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-S1/bmNW8P+M2KZWsqvBRQgNIOFkrAOb0I6EBotm9VP0Q7R7fJQrSD4hKAZwOefC3KOMkdAsjo4mYdOxY3c0OqQ==","shasum":"f05a3ac5161a7cf20c327e6c616678be26cfd5d7","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.4-alpha.4.tgz","fileCount":567,"unpackedSize":9038902,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRo/stZWJQg22Wy4UVlMNZeA/QephF5m0eEjVI9AEJowIhANZ/qIoSxdjXocsx3hSVUBWX+aiMHQXW/1iMARMHH0Wm"}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.4-alpha.4_1708109609988_0.5800296475185998"},"_hasShrinkwrap":false},"0.7.4-alpha.5":{"name":"trustlessjs","version":"0.7.4-alpha.5","description":"package to interact with TrustlessHub","author":{"name":"danieljdd","email":"info@trstlabs.xyz"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","license":"SEE LICENSE IN LICENSE","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","directories":{"lib":"src"},"scripts":{"build:cjs":"yarn tsc -p tsconfig.json --outDir dist --module commonjs || true","clean:dist":"rimraf dist","clean":"npm run clean:dist","build":"npm run clean && npm run build:cjs","codegen":"node scripts/codegen.js","prepare":"npm run build","lint":"eslint ."},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"keywords":[],"bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"devDependencies":{"@cosmology/telescope":"1.4.12","@types/jest":"^29.5.0","eslint":"8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-in-case":"^1.0.2","prettier":"^2.8.7","publish-scripts":"0.1.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"@cosmjs/amino":"^0.32.0","@cosmjs/proto-signing":"^0.32.0","@cosmjs/stargate":"^0.32.0","@cosmjs/tendermint-rpc":"^0.32.0"},"_id":"trustlessjs@0.7.4-alpha.5","gitHead":"3a3b78c51fc4b4507a72ce3d4f7361be6e7e81c7","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-po3K9t+OkD3Qxfvgc8K1+I9cVMOpsDktEpK+pkoIR+NwTdx8W4DohZOlEVMoBGC+29XuWZDmju5+sLjS6vE4Pw==","shasum":"4db2d6b7c498f591c5c90f26b59512bd4d746e8a","tarball":"https://registry.npmjs.org/trustlessjs/-/trustlessjs-0.7.4-alpha.5.tgz","fileCount":567,"unpackedSize":9038908,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4m3rLlZ4O7DLAWVd2q8KYvt86fgFvTAwnXzbrgJlb6AIgA2ER5LtU9njWvzZS3iIlKgvUVlJ00JIcP0s+i6h8PSY="}]},"_npmUser":{"name":"trstlabs","email":"info@trstlabs.xyz"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trustlessjs_0.7.4-alpha.5_1709017824260_0.828825518371042"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-06T18:28:06.106Z","0.17.5":"2022-03-06T18:28:06.346Z","modified":"2024-02-27T07:10:24.938Z","0.17.6":"2022-03-17T14:06:23.197Z","0.17.7":"2022-03-17T15:34:54.108Z","1.2.0-alpha.7":"2022-03-23T17:37:29.597Z","1.2.0-alpha.9":"2022-03-24T12:10:52.637Z","1.2.0-alpha.10":"2022-03-24T13:17:16.017Z","1.2.0-alpha.11":"2022-03-24T13:27:38.049Z","1.2.0-alpha.13":"2022-03-24T15:02:54.459Z","1.2.0-alpha.14":"2022-03-24T18:48:00.836Z","1.2.0-alpha.16":"2022-03-25T12:27:26.391Z","1.2.0-alpha.4":"2022-03-25T17:41:30.844Z","1.2.0-alpha.5":"2022-03-25T18:42:24.823Z","1.2.0-alpha.6":"2022-03-26T12:42:27.166Z","1.2.0-alpha.8":"2022-03-26T12:46:47.775Z","1.2.2-alpha.2":"2022-07-03T17:25:36.382Z","1.2.2-alpha.3":"2022-08-01T13:32:43.856Z","1.2.2-alpha.4":"2022-08-01T14:04:25.057Z","1.2.2-alpha.5":"2022-08-01T14:05:24.038Z","1.2.2-alpha.6":"2022-11-03T12:10:57.899Z","1.2.2-beta.0":"2022-11-03T12:54:13.426Z","1.2.2-alpha.0":"2022-11-03T14:45:49.233Z","1.2.2-alpha.1":"2022-11-03T15:37:41.591Z","1.2.3-alpha.2":"2022-11-27T13:22:22.678Z","1.2.3-alpha.3":"2022-12-06T12:43:14.715Z","1.2.3-alpha.4":"2022-12-08T17:41:06.765Z","1.2.3-alpha.5":"2022-12-08T17:55:29.530Z","1.2.3-alpha.6":"2022-12-20T10:30:38.273Z","1.2.3-alpha.7":"2023-01-15T12:41:57.055Z","1.2.3-beta.0":"2023-01-22T09:11:48.650Z","1.2.3-alpha.0":"2023-01-22T12:18:05.710Z","1.2.3-alpha.1":"2023-01-28T11:48:54.653Z","1.2.3-beta.1":"2023-01-28T12:03:55.011Z","1.2.4-alpha.2":"2023-01-28T13:27:20.783Z","1.2.4-alpha.3":"2023-02-05T10:37:21.902Z","1.2.4-alpha.4":"2023-02-05T14:08:51.319Z","1.2.4-alpha.5":"2023-02-05T17:48:10.923Z","1.2.4-alpha.6":"2023-02-20T09:03:12.094Z","1.2.4-alpha.7":"2023-02-20T16:47:04.780Z","1.2.4-alpha.8":"2023-02-20T16:56:31.590Z","1.2.4-alpha.9":"2023-02-21T09:50:52.734Z","1.2.4-alpha.10":"2023-03-31T17:10:33.722Z","1.2.4-alpha.11":"2023-04-01T09:09:28.999Z","1.2.4-alpha.12":"2023-04-02T09:49:56.012Z","0.7.0-alpha.1":"2023-07-29T17:31:28.285Z","0.7.0-alpha.2":"2023-07-29T17:34:15.879Z","0.7.0-alpha.3":"2023-07-30T08:29:01.973Z","0.7.1-alpha.1":"2023-07-31T16:51:45.740Z","0.7.1-alpha.2":"2023-07-31T18:25:09.113Z","0.7.1-alpha.3":"2023-08-01T08:36:16.978Z","0.7.1-alpha.4":"2023-08-01T08:41:33.841Z","0.7.1-alpha.5":"2023-08-01T10:14:48.715Z","0.7.2-alpha.1":"2023-08-01T11:25:47.337Z","0.7.2-alpha.2":"2023-08-01T11:37:43.724Z","0.7.2-alpha.3":"2023-08-01T11:54:00.861Z","0.7.2-alpha.4":"2023-08-01T16:48:05.248Z","0.7.2-alpha.5":"2023-08-03T11:21:24.160Z","0.7.2-alpha.6":"2023-08-14T17:12:27.798Z","0.7.2-alpha.8":"2024-01-13T16:11:15.218Z","0.7.3-alpha.1":"2024-01-28T11:25:17.293Z","0.7.3-alpha.2":"2024-01-28T11:49:48.002Z","0.7.3-alpha.3":"2024-01-28T13:12:39.789Z","0.7.3-alpha.4":"2024-01-28T16:10:44.667Z","0.7.4-alpha.2":"2024-02-16T16:45:17.343Z","0.7.4-alpha.3":"2024-02-16T16:52:38.578Z","0.7.4-alpha.4":"2024-02-16T18:53:30.257Z","0.7.4-alpha.5":"2024-02-27T07:10:24.539Z"},"maintainers":[{"name":"trstlabs","email":"info@trstlabs.xyz"}],"description":"package to interact with TrustlessHub","license":"SEE LICENSE IN LICENSE","readme":"# trustlessjs\n\n<img src=\"https://docs.trustlesshub.com/assets/img/banner.05ada057.png\" width=\"400\">\n\n## install\n\n```sh\nnpm install trustlessjs\n```\n\n## Connecting with Wallets and Signing Messages\n\n⚡️ For web interfaces, we recommend using [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit). To sign and broadcast messages, you can create signers with a variety of options:\n\n- [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit/tree/main/packages/react#signing-clients) (recommended)\n- [keplr](https://docs.keplr.app/api/cosmjs.html)\n- [cosmjs](https://gist.github.com/webmaster128/8444d42a7eceeda2544c8a59fbd7e1d9)\n\n### Initializing the Stargate Client\n\nWe recommend manually making the `SigningStargateClient` instance yourself by using `getTrstSigningClientOptions`:\n\n```ts\nimport { getTrstSigningClientOptions, trstAccountParser } from \"@trustlessjs\";\n\nconst { registry, aminoTypes } = getTrstSigningClientOptions();\n\nconst client = await SigningStargateClient.connectWithSigner(\n  rpc,\n  offlineSigner,\n  {\n    registry,\n    aminoTypes,\n    accountParser: trstAccountParser,\n  }\n);\n```\n\n## Usage\n\nWe strongly recommend that you check the generated files in `src/codegen/trst` and use it as source of truth for which functions you could use.\n\nThe rest of our documentation will cover only the tip of the iceberg &mdash; examples you can take ideas from.\n\n### RPC Client\n\n```ts\nimport { trst } from \"trustlessjs\";\n\nconst client = await trst.ClientFactory.createRPCQueryClient({\n  rpcEndpoint: RPC_ENDPOINT,\n});\n\nconst balance = await client.cosmos.bank.v1beta1.allBalances({\n  address: \"trst1addresshere\",\n});\n```\n\n### Composing & Broadcasting Trst Messages\n\n```ts\nimport { trst } from \"trustlessjs\";\n\nconst msgClaimFreeAmount =\n  trst.claim.MessageComposer.withTypeUrl.claimFreeAmount({\n    user: \"trst1addresshere\",\n  });\n\nconst fee = {\n  amount: [\n    {\n      amount: \"0\",\n      denom: \"utrst\",\n    },\n  ],\n  gas: 250_000,\n};\n\nconst tx = await trstAccount.client.signAndBroadcast(\n  \"trst1addresshere\",\n  [msgClaimFreeAmount],\n  fee,\n  \"\"\n);\n\nassertIsDeliverTxSuccess(tx);\n```\n\nIf you're unfamiliar with Stargate, you can read their guide [here](https://gist.github.com/webmaster128/8444d42a7eceeda2544c8a59fbd7e1d9).\n\n#### Composing IBC Messages\n\n```js\nimport { ibc } from \"trustlessjs\";\n\nconst { transfer } =\n  ibc.applications.transfer.v1.MessageComposer.withTypeUrl.transfer({\n    // Redacted (check internal types for the message parameters)\n  });\n```\n\n## Developing & Publishing\n\nWhen first cloning the repo:\n\n```bash\ngit submodule update --init\ntelescope install\ntelescope transpile\n```\n\n### Codegen\n\nUpdate the generated ts files:\n\n```bash\nyarn codegen\n```\n\nBuild the module and types:\n\n```bash\nyarn build\n```\n\n### Publishing\n\nIf you haven't logged to npm cli, run:\n\n```bash\nnpm login\n```\n\nAfterwards, update package.json version.\n\n```bash\n# Example: <version> = v0.4.1\ngit tag <version>\ngit push origin <version>\ngit push origin main\nnpm publish\n```\n\n## Credits\n\n🛠 Built by Cosmology — if you like our tools, please consider delegating to [their validator ⚛️](https://cosmology.tech/validator)\n\nCode built with the help of these related projects:\n\n- [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) for generated CosmWasm contract Typescript classes\n- [@cosmology/telescope](https://github.com/cosmology/telescope) a \"babel for the Cosmos\", Telescope is a TypeScript Transpiler for Cosmos Protobufs.\n- [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos ⚛️\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/trstlabs/trustlessjs/issues"},"homepage":"https://github.com/trstlabs/trustlessjs#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/trstlabs/trustlessjs.git"},"author":{"name":"danieljdd","email":"info@trstlabs.xyz"}}