From b26d28e60517616da8dba8253e5cd6b2d172c1d3 Mon Sep 17 00:00:00 2001 From: soaryong-stamper Date: Mon, 27 Nov 2023 15:06:32 +0900 Subject: [PATCH] Updates --- 404.html | 2 +- _next/static/chunks/nextra-data-en-US.json | 2 +- .../pages/mintstation/cli-62e132973e0ccd0e.js | 1 + .../pages/mintstation/cli-eca5d973bc213845.js | 1 - ...63f0c382.js => module-eecbcf0fbfb0e53d.js} | 2 +- ...fb863aa.js => command-a87c231c26fd423b.js} | 2 +- .../validator/mainnet-11314afa1dd3693c.js | 1 + .../validator/mainnet-a8558d5a7cb1f976.js | 1 - .../_buildManifest.js | 2 +- .../_ssgManifest.js | 0 apis.html | 4 +- .../builder/tx-builder/broadcast.html | 4 +- apis/reference/builder/tx-builder/build.html | 4 +- .../builder/tx-builder/make-signature.html | 4 +- apis/reference/custom/account.html | 4 +- .../historical/account/account-balances.html | 4 +- .../historical/account/account-richlist.html | 4 +- .../account/account-transactions.html | 4 +- .../historical/account/account-votes.html | 4 +- .../validator/validator-block-sign.html | 4 +- .../validator/validator-commissions.html | 4 +- .../validator/validator-delegators.html | 4 +- .../validator/validator-power-events.html | 4 +- .../validator/validator-proposed-blocks.html | 4 +- .../historical/validator/validator-votes.html | 4 +- apis/reference/proxy/lcd.html | 4 +- apis/reference/statistics/messages.html | 4 +- apis/reference/statistics/transactions.html | 4 +- apis/reference/utilities/assets.html | 4 +- apis/reference/utilities/inflation.html | 4 +- apis/reference/utilities/node-info.html | 4 +- apis/reference/utilities/prices.html | 4 +- apis/reference/utilities/staking-apr.html | 4 +- extension.html | 4 +- extension/guide/account/add-account.html | 4 +- .../guide/account/add-ledger-account.html | 4 +- extension/guide/account/intro.html | 4 +- extension/guide/chains.html | 4 +- extension/guide/dapps.html | 4 +- extension/guide/settings.html | 4 +- extension/guide/transfer-coins.html | 4 +- .../aptos/connect-and-account.html | 4 +- extension/integration/aptos/event.html | 4 +- extension/integration/aptos/network.html | 4 +- extension/integration/aptos/provider.html | 4 +- .../aptos/sign-and-submit-transaction.html | 4 +- .../cosmos/Deprecated/accounts.html | 4 +- .../integration/cosmos/Deprecated/chains.html | 4 +- .../cosmos/Deprecated/cw20-token.html | 4 +- .../cosmos/Deprecated/disconnect.html | 4 +- .../integration/cosmos/Deprecated/error.html | 4 +- .../integration/cosmos/Deprecated/event.html | 4 +- .../cosmos/Deprecated/provider.html | 4 +- .../cosmos/Deprecated/send-tx.html | 4 +- .../cosmos/Deprecated/sign-message.html | 4 +- .../cosmos/Deprecated/sign-tx.html | 4 +- .../integration/cosmos/integrate-cosmjs.html | 4 +- .../integration/cosmos/integrate-keplr.html | 4 +- extension/integration/cosmos/proto.html | 4 +- extension/integration/cosmos/react-hook.html | 4 +- extension/integration/cosmos/typescript.html | 4 +- extension/integration/cosmos/vanilla.html | 4 +- extension/integration/cosmos/wallet.html | 4 +- extension/integration/evm/event.html | 4 +- extension/integration/evm/provider.html | 4 +- .../evm/supported-rpc-methods.html | 4 +- extension/integration/evm/use-ethers.html | 4 +- extension/integration/evm/use-web3-js.html | 4 +- .../sui/connect-and-get-accounts.html | 4 +- .../integration/sui/execute-move-call.html | 4 +- extension/integration/sui/provider.html | 4 +- .../sui/sign-and-execute-transaction.html | 4 +- index.html | 4 +- mintscan.html | 4 +- mintscan/registry/assets.html | 4 +- mintscan/registry/cw20.html | 4 +- mintscan/registry/ecosystem.html | 4 +- mintscan/registry/erc20.html | 4 +- mintscan/registry/moniker.html | 4 +- mintstation.html | 4 +- mintstation/cli.html | 6 +-- mintstation/cli/command.html | 4 +- mintstation/cli/setup.html | 4 +- mintstation/contracts/compile.html | 4 +- mintstation/contracts/create.html | 4 +- mintstation/contracts/deploy.html | 4 +- mintstation/contracts/execute.html | 4 +- mintstation/contracts/query.html | 4 +- mintstation/module.html | 6 +-- mintstation/playground.html | 4 +- mintstation/validator/command.html | 6 +-- mintstation/validator/delegations.html | 4 +- mintstation/validator/localnet.html | 4 +- mintstation/validator/mainnet.html | 41 ++++++++++++++++--- mintstation/validator/upgrade.html | 4 +- mobile.html | 4 +- mobile/article.html | 4 +- mobile/integration/cosmjs.html | 4 +- mobile/integration/cosmostation.html | 4 +- .../integration/walletconnect/accounts.html | 4 +- mobile/integration/walletconnect/connect.html | 4 +- mobile/integration/walletconnect/sign-tx.html | 4 +- mobile/integration/walletconnect2.html | 4 +- mobile/listing.html | 4 +- 104 files changed, 231 insertions(+), 202 deletions(-) create mode 100644 _next/static/chunks/pages/mintstation/cli-62e132973e0ccd0e.js delete mode 100644 _next/static/chunks/pages/mintstation/cli-eca5d973bc213845.js rename _next/static/chunks/pages/mintstation/{module-2046048363f0c382.js => module-eecbcf0fbfb0e53d.js} (99%) rename _next/static/chunks/pages/mintstation/validator/{command-bf77bf78efb863aa.js => command-a87c231c26fd423b.js} (65%) create mode 100644 _next/static/chunks/pages/mintstation/validator/mainnet-11314afa1dd3693c.js delete mode 100644 _next/static/chunks/pages/mintstation/validator/mainnet-a8558d5a7cb1f976.js rename _next/static/{uibo7OMlxKWX5Suts7dPd => fn2HshcLr_CMIWD_3GNCD}/_buildManifest.js (98%) rename _next/static/{uibo7OMlxKWX5Suts7dPd => fn2HshcLr_CMIWD_3GNCD}/_ssgManifest.js (100%) diff --git a/404.html b/404.html index 362dca77..ae0a1d9c 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/_next/static/chunks/nextra-data-en-US.json b/_next/static/chunks/nextra-data-en-US.json index bcb8a9e3..3ad9a02e 100644 --- a/_next/static/chunks/nextra-data-en-US.json +++ b/_next/static/chunks/nextra-data-en-US.json @@ -1 +1 @@ -{"/apis":{"title":"Introduction","data":{"":"Mintscan API, integral to Mintscan 2.0, stems from enterprise-grade onchain data indexing. Through features like tx builder and historical statistics APIs, it offers easy access to dynamic onchain data, including account balances and staking APR. Streamlining raw data processing, Mintscan API simplifies Interchain dapp development, positioning itself as a key piece in the Interchain infrastructure puzzle.For inquery, please contact us api@cosmostation.io","how-to-get-api-key#How to get API Key?":"Get start sign upCurrently in beta, approval is being processed via email(api@cosmostation.io).","features#Features":"RPC Endpoint\nHistorical API\nProto Builder API\nStatistics API\nUtility API\nCustom API","supported-chain-list#Supported chain list":"Akash\nArchway\nCosmos\nCelestia\ndYdX\nEvmos\nInjective\nJuno\nKava\nNeutron\nOsmosis\nStride","api-reference#API Reference":"Type\tAPI\tCredit\tProxy API\tLCD Proxy\t1\tCustom API\tAccount\t5\tStatistics API\tTransaction Statistics\t3\t\tMessage Statistics\t3\tBuilder API\tTransaction Builder\t5 ~ 10\tHistorical API\tAccount Transactions\t5\t\tAccount Votes\t5\t\tAccount Balance History\t7\t\tRichlist\t10\t\tValidator Votes\t5\t\tValidator Commission History\t5\t\tValidator Delegators\t10\t\tValidator Block Sign\t1\t\tValidator Voting Power\t1\t\tValidator Proposed Blocks\t1\tUtility API\tNode Info\t5\t\tInflation\t3\t\tStaking APR\t5\t\tAssets\t3\t\tPrices\t3 ~ 5"}},"/apis/reference/builder/tx-builder/broadcast":{"title":"Broadcast Transaction","data":{"post-v1networktx-builderbroadcast#[POST] /v1/:network/tx-builder/broadcast":"","request#Request":"Authorization: Bearer {access_token}\nContent-Type: application/json\n{\n // Original message of the tx from the result of the Build Transaction API Call\n \"tx\": string,\n // Generated using the user’s private key and the tx from the result of the Build Transaction API Call.\n \"signature\": string\n}","response#Response":"{\n \"tx_response\": {\n \"height\": \"0\",\n \"txhash\": \"\",\n \"codespace\": \"\",\n \"code\": 0,\n \"data\": \"\",\n \"raw_log\": \"[]\",\n \"logs\": [],\n \"info\": \"\",\n \"gas_wanted\": \"0\",\n \"gas_used\": \"0\",\n \"tx\": null,\n \"timestamp\": \"\",\n \"events\": []\n }\n}"}},"/apis/reference/builder/tx-builder/build":{"title":"Build Transactions","data":{"post-v1networktx-builder#[POST] /v1/:network/tx-builder":"This API returns the SignDoc data for broadcasting transactions.\nThe response includes tx for generating the signature, original messages used to create the SignDoc, fee value, and basic information of the account.\nUsers can either generate the signature directly without 0x from the value and broadcast it, or use the provided broadcast API to send the tx.\nMulti sign account is not supported yet.","request#Request":"Authorization: Bearer {access_token}\nContent-Type: application/json","response#Response":"{\n // SignDoc for generating the signature. Use the data without '0x'\n \"tx\": \"\",\n // Original data that user transfer\n \"messages\": [\n {\n \"type\": \"cosmos.staking.v1beta1.MsgDelegate\",\n \"delegatorAddress\": \"osmo1gr0e3pj3y6fqvzyam0qxyw9h5dwfrvh8zv3x9p\",\n \"validatorAddress\": \"\",\n \"amount\": { \"denom\": \"uosmo\", \"amount\": \"1\" }\n }\n ],\n // Transaction fee\n \"fee\": { \"amount\": [{ \"denom\": \"uosmo\", \"amount\": \"760\" }], \"gas\": \"303815\" },\n // Account public key of signer\n \"publicKey\": {\n \"@type\": \"/cosmos.crypto.secp256k1.PubKey\",\n \"key\": \"A00Jvfv1luvAODaiOPIMZpDTWSq7qvoFV8k7ptdsDqLU\"\n },\n // Account number of signer\n \"accountNumber\": \"63277\",\n // Account sequence of signer\n \"sequence\": \"12\"\n}","how-to-make-a-public-key-from-private-key#How to make a public key from private key":"const privateKey = Buffer.from(\n '',\n 'hex',\n);\nconst pubKeyUint8Array = TinySecp256k1.pointFromScalar(privateKey, true);\nif (!pubKeyUint8Array) {\n throw new Error('Invalid private key');\n}\n// Use this publicKey when sending a transaction (tx) for the first time.\nconst publicKey = Buffer.from(pubKeyUint8Array).toString('base64');","send-transaction#Send Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.bank.v1beta1.MsgSend\",\n // Sender Address\n \"fromAddress\": \"string\",\n // Receiver Address\n \"toAddress\": \"string\",\n // Amount Array\n \"amount\": [\n {\n \"denom\": \"string\",\n \"amount\"\": string\"\n }\n ]\n }\n ]\n}","delegate-transaction#Delegate Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.staking.v1beta1.MsgDelegate\",\n // Sender Address\n \"delegatorAddress\": \"string\",\n // Validator Address to delegate\n \"validatorAddress\": \"string\",\n // Amount\n \"amount\": {\n \"denom\": \"string\",\n \"amount\"\": string\"\n }\n }\n ]\n}","undelegate-transaction#Undelegate Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.staking.v1beta1.MsgUndelegate\",\n // Sender Address\n \"delegatorAddress\": \"string\",\n // Validator Address to undelegate\n \"validatorAddress\": \"string\",\n // Amount\n \"amount\": {\n \"denom\": \"string\",\n \"amount\"\": string\"\n }\n }\n ]\n}","begin-redelegate-transaction#Begin Redelegate Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.staking.v1beta1.MsgBeginRedelegate\",\n // Sender Address\n \"delegatorAddress\": \"string\",\n // From Validator Address to redelegate\n \"validatorSrcAddress\": \"string\",\n // To Validator Address to redelegate\n \"validatorDstAddress\": \"string\",\n // Amount\n \"amount\": {\n \"denom\": \"string\",\n \"amount\"\": string\"\n }\n }\n ]\n}","claim-delegate-rewards-transaction#Claim Delegate Rewards Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward\",\n // Sender Address\n \"delegatorAddress\": \"string\",\n // Validator Address to claim rewards\n \"validatorAddress\"\": string\"\n }\n ]\n}","claim-validator-commissions-transaction#Claim Validator Commissions Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission\",\n // Validator Address to withdraw validator commission\n \"validatorAddress\"\": string\"\n }\n ]\n}","governance-vote-transaction#Governance Vote Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.gov.v1beta1.MsgVote\",\n // Proposal ID\n \"proposalId\": \"string\",\n // Voter\n \"voter\": \"string\",\n // Vote Option(\"VOTE_OPTION_UNSPECIFIED\" | \"VOTE_OPTION_YES\" | \"VOTE_OPTION_ABSTAIN\" | \"VOTE_OPTION_NO\" | \"VOTE_OPTION_NO_WITH_VETO\")\n \"option\"\": string\"\n }\n ]\n}","wasm-contract-execute-transaction#Wasm Contract Execute Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{ \"type\": \"string\", \"key\": \"string\" }],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmwasm.wasm.v1.MsgExecuteContract\",\n // Sender\n \"sender\": \"string\",\n // Contract Address\n \"contract\": \"string\",\n // Execute Messages\n \"msg\": {},\n // Funds\n \"funds\": []\n }\n ]\n}","authz-grant-transaction#Authz Grant Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{ \"type\": \"string\", \"key\": \"string\" }],\n // Message Array\n \"messages\": [\n {\n // GeneraicAuthorization\n \"type\": \"cosmos.authz.v1beta1.MsgGrant\",\n \"granter\": \"string\",\n \"grantee\": \"string\",\n \"grant\": {\n \"authorization\": {\n // Auth Type(\"GenericAuthorization\" | \"StakeAuthorization\" | \"SendAuthorization\")\n \"type\": \"GenericAuthorization\",\n \"msg\": \"string\"\n },\n \"expiration\": \"datetime\"\n }\n },\n {\n // StakeAuthorization\n \"type\": \"cosmos.authz.v1beta1.MsgGrant\",\n \"granter\": \"string\",\n \"grantee\": \"string\",\n \"grant\": {\n \"authorization\": {\n // Auth Type(\"GenericAuthorization\" | \"StakeAuthorization\" | \"SendAuthorization\")\n \"type\": \"StakeAuthorization\",\n \"maxTokens\": { \"denom\": \"string\", \"amount\": \"string\" },\n // When used in conjunction with a denyList, the allowList is not applied\n \"allowList\": { \"address\": [\"string\"] },\n \"denyList\": { \"address\": [\"string\"] },\n // Authorization Type(\"AUTHORIZATION_TYPE_DELEGATE\" | \"AUTHORIZATION_TYPE_UNDELEGATE\" | \"AUTHORIZATION_TYPE_REDELEGATE\")\n \"authorizationType\": \"string\"\n },\n \"expiration\": \"datetime\"\n }\n },\n {\n // SendAuthorization\n \"type\": \"cosmos.authz.v1beta1.MsgGrant\",\n \"granter\": \"string\",\n \"grantee\": \"string\",\n \"grant\": {\n \"authorization\": {\n // Auth Type(\"GenericAuthorization\" | \"StakeAuthorization\" | \"SendAuthorization\")\n \"type\": \"SendAuthorization\",\n \"spendLimit\": [{ \"denom\": \"string\", \"amount\": \"string\" }]\n },\n \"expiration\": \"datetime\"\n }\n }\n ]\n}","authz-execute-transaction#Authz Execute Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{ \"type\": \"string\", \"key\": \"string\" }],\n // Message Array\n \"messages\": [\n {\n \"type\": \"cosmos.authz.v1beta1.MsgExec\",\n \"grantee\": \"string\",\n \"msgs\": [\n {\n // type_url excluding '/' (ex: cosmos.bank.v1beta1.MsgSend)\n \"type\": \"string\"\n // the values included in the corresponding type message\n }\n ]\n }\n ]\n}","authz-revoke-transaction#Authz Revoke Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{ \"type\": \"string\", \"key\": \"string\" }],\n // Message Array\n \"messages\": [\n {\n \"type\": \"cosmos.authz.v1beta1.MsgRevoke\",\n \"granter\": \"string\",\n \"grantee\": \"string\",\n // msgTypeUrl\n // GenericAuthorization, you can simply use the msg value of that authorization as it is\n // SendAuthorization, you should use /cosmos.bank.v1beta1.MsgSend\n // StakeAuthorization, you should provide values based on the Authorization Type granted.\n // - AUTHORIZATION_TYPE_DELEGATE, use /cosmos.staking.v1beta1.MsgDelegate.\n // - AUTHORIZATION_TYPE_UNDELEGATE, use /cosmos.staking.v1beta1.MsgUndelegate\n // - AUTHORIZATION_TYPE_REDELEGATE, use /cosmos.staking.v1beta1.MsgBeginRedelegate\n \"msgTypeUrl\": \"string\"\n }\n ]\n}","multiple-message-type-of-transaction#Multiple Message Type of Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{ \"type\": \"string\", \"key\": \"string\" }],\n // Message Array\n \"messages\": [\n // The message types within the messages defined above\n ]\n}"}},"/apis/reference/builder/tx-builder/make-signature":{"title":"How Make Signature","data":{"":"This documentation page provides an example of generating a signature using the tx (SignDoc) produced in the Build Transaction process.\nThe example code in this document is written in Node.js. Users can implement the sign logic based on their respective programming language.\n// Import packages for sign\nimport * as TinySecp256k1 from 'tiny-secp256k1';\nimport * as encHex from 'crypto-js/enc-hex';\nimport * as sha256 from 'crypto-js/sha256';\n// Define a custom function to execute the logic described on the Build Transaction page.\n// Each user can implement their own version of this function and use it accordingly\nconst buildResult = await buildTx();\n/* Example of result\n {\n \"tx\": \"\",\n \"messages\": [\n {\n \"type\": \"cosmos.staking.v1beta1.MsgDelegate\",\n \"delegatorAddress\": \"osmo1gr0e3pj3y6fqvzyam0qxyw9h5dwfrvh8zv3x9p\",\n \"validatorAddress\": \"\",\n \"amount\": { \"denom\": \"uosmo\", \"amount\": \"1\" }\n }\n ],\n \"fee\": { \"amount\": [{ \"denom\": \"uosmo\", \"amount\": \"760\" }], \"gas\": \"303815\" },\n \"publicKey\": {\n \"@type\": \"/cosmos.crypto.secp256k1.PubKey\",\n \"key\": \"A00Jvfv1luvAODaiOPIMZpDTWSq7qvoFV8k7ptdsDqLU\"\n },\n \"accountNumber\": \"63277\",\n \"sequence\": \"12\"\n}\n*/\n// Removes the '0x' string from the beginning of the tx.\nconst signDoc = buildResult.tx.replace(/^0x(.*)/, '$1');\n// SignDoc Example: \n// The part that creates a Buffer using the user's Private Key.\n// If the Private Key starts with '0x', the '0x' prefix is removed and the value is used.\nconst privateKey = Buffer.from(\n '',\n 'hex',\n);\nconst hashedSignDoc = sha256(encHex.parse(signDoc)).toString(encHex);\nconst signResult = TinySecp256k1.sign(Buffer.from(hashedSignDoc, 'hex'), privateKey);\nconst signatureHex = Buffer.from(signResult).toString('hex');\n// Use this to broadcast the transaction\nconst signature = `0x${signatureHex}`;\n// Example: "}},"/apis/reference/custom/account":{"title":"Account","data":{"get-v1networkaccountsaddress#[GET] /v1/:network/accounts/:address":"Get account information with current balances","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\naddress: cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q"}},"/apis/reference/historical/account/account-richlist":{"title":"Account Balance History","data":{"get-v1networkaccountsrichlistsymbol#[GET] /v1/:network/accounts/richlist/:symbol":"Get richlist for the given symbol","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Symbol of the asset to be queried\n# (string, required)\nsymbol: uatom\n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4OTc1NTU4NjAwMA==\n# To display detailed information of the balance\n# (boolean, optional, default: false)\ndetail: true"}},"/apis/reference/historical/account/account-transactions":{"title":"Account Transactions","data":{"get-v1networkaccountsaddresstransactions#[GET] /v1/:network/accounts/:address/transactions":"Get transactions of an account","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\naddress: cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q\n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Array of strings for filtering by message type\n# (array of string, optional)\nmessageTypes[]: /cosmos.staking.v1beta1.MsgDelegate\n# Search start datetime\n# (datetime, optional)\nfromDateTime: 2023-04-20\n# Search end datetime\n# (datetime, optional)\ntoDateTime: 2023-04-21 23:59:59\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4MDUxNjI5NjAwMHwxNDczMjU5OQ=="}},"/apis/reference/historical/validator/validator-delegators":{"title":"Validator Delegators","data":{"get-v1networkvalidatorsvalidatoraddressdelegators#[GET] /v1/:network/validators/:validatorAddress/delegators":"Get a list of richlist of a symbol","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\nvalidatorAddress: \n# Request per page\n# (number, optional, default: 20)\ntake: 10\n# Value of skip amount for pagination\n# (number, optional, default: 0)\nfrom: 20"}},"/apis/reference/historical/validator/validator-power-events":{"title":"Validator Voting Power Events","data":{"get-v1networkvalidatorsvalidatoraddresspowerevents#[GET] /v1/:network/validators/:validatorAddress/powerEvents":"Get voting power events of validator","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\nvalidatorAddress: \n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4OTc1NTU4NjAwMA=="}},"/apis/reference/historical/account/account-votes":{"title":"Account Votes","data":{"get-v1networkaccountsaddressvotes#[GET] /v1/:network/accounts/:address/votes":"Get a list of votes of an account","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\naddress: cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q\n# Whether to remove duplicates for the same proposal\n# (boolean, optional, default: false)\ndistinct: true"}},"/apis/reference/historical/validator/validator-block-sign":{"title":"Validator Latest Block Sign","data":{"get-v1networkvalidatorsvalidatoraddresslatestuptime#[GET] /v1/:network/validators/:validatorAddress/latestUptime":"Get latest blocks signature of validator","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\nvalidatorAddress: "}},"/apis/reference/historical/validator/validator-proposed-blocks":{"title":"Validator Voting Power Events","data":{"get-v1networkvalidatorsvalidatoraddressproposed#[GET] /v1/:network/validators/:validatorAddress/proposed":"Get blocks proposed by the validator","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\nvalidatorAddress: \n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4OTc1NTU4NjAwMA=="}},"/apis/reference/historical/validator/validator-votes":{"title":"Validator Votes","data":{"get-v1networkvalidatorsvalidatoraddresstransactions#[GET] /v1/:network/validators/:validatorAddress/transactions":"Get a list of votes of a validator","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of validator\n# (string, required)\nvalidatorAddress: \n# Whether to remove duplicates for the same proposal\n# (boolean, optional, default: false)\ndistinct: true"}},"/apis/reference/historical/validator/validator-commissions":{"title":"Validator Commission Balance History","data":{"get-v1networkvalidatorsvalidatoraddresscommissions#[GET] /v1/:network/validators/:validatorAddress/commissions":"Get commission balance history of an account","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\nvalidatorAddress: \n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4OTc1NTU4NjAwMA==\n# Search start datetime\n# (datetime, optional, default: 30 days ago)\nfromDateTime: 2023-07-20\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59"}},"/apis/reference/proxy/lcd":{"title":"LCD Proxy","data":{"":"Proxy API for making LCD requests to BlockChain Node","getpost-v1networklcd#[GET][POST] /v1/:network/lcd/*":"You can directly access the Node LCD API by referring to the Swagger or document of the Network you want to make requests to.\nHowever, please note that certain requests are blocked as they may have a negative impact on the server.","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The url of lcd API. See details in Swagger or document of the network\n# (string, required)\n*: /cosmos/bank/v1beta1/balances/cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q"}},"/apis/reference/utilities/inflation":{"title":"Chain Inflation","data":{"get-v1networkinflation#[GET] /v1/:network/inflation":"Get inflation data from the chain","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos"}},"/apis/reference/utilities/assets":{"title":"Assets","data":{"get-v1networkassets#[GET] /v1/:network/assets":"Get all assets of the current chain","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos","get-v1networkassetssymbol#[GET] /v1/:network/assets/:symbol":"Get asset of specific symbol","request-1#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Symbol of the asset to be queried\n# (string, required)\nsymbol: uatom"}},"/apis/reference/statistics/messages":{"title":"Message Counts","data":{"get-v1networkstatisticsmessages#[GET] /v1/:network/statistics/messages":"Get The Number of Transactions per each message type over the last 30 days","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59"}},"/apis/reference/utilities/prices":{"title":"Prices","data":{"get-v1pricessymbolcoingeckoid#[GET] /v1/prices/:symbol/coingeckoId":"Get coingecko ID via symbol","request#Request":"Authorization: Bearer {access_token}\n# Symbol of the asset to be queried\n# (string, required)\nsymbol: uatom","get-v1pricessymbolsymbol#[GET] /v1/prices/symbol/:symbol":"Get hourly prices via symbol","request-1#Request":"Authorization: Bearer {access_token}\n# Symbol of the asset to be queried\n# (string, required)\nsymbol: uatom\n# End datetime for obtaining prices\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-04-21 23:59:59\n# Request per page\n# (number, optional, default: 24)\nticks: 24","get-v1pricescoingeckoidgeckoid#[GET] /v1/prices/coingeckoId/:geckoId":"Get hourly prices via coingeckoId","request-2#Request":"Authorization: Bearer {access_token}\n# CoingeckoId of the asset to be queried\n# (string, required)\ngeckoId: cosmos\n# End datetime for obtaining prices\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-04-21 23:59:59\n# Request per page\n# (number, optional, default: 24)\nticks: 24"}},"/apis/reference/utilities/staking-apr":{"title":"Chain Staking APR","data":{"get-v1networkapr#[GET] /v1/:network/apr":"Get default staking APR of the chain","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos","get-v1networkaprvalidatoraddress#[GET] /v1/:network/apr/:validatorAddress":"Get staking APR when delegating to a specific validator","request-1#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Validator address to delegate\n# (string, required)\nvalidatorAddress: "}},"/apis/reference/utilities/node-info":{"title":"Node Info","data":{"get-v1networknode_info#[GET] /v1/:network/node_info":"Get node informations with chain parameters","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos"}},"/extension/guide/account/add-account":{"title":"Add Account","data":{"":"Create a new wallet, restore with an existing mnemonic phrase, or restore with a private key.","create-wallet#Create wallet":"The following process is for users who do not have a wallet and wish to create a new wallet.'Create wallet' will import a new wallet with a mnemonic phrase.\nStep 1 Click 'Create wallet'Step 2 Enter 'Account name'. Account name will be used for users to easily distinguish wallets imported on the extension.Step 3 Your mnemonic phrase will be displayed. Cosmostation Wallet Extension supports both 12 words and 24 words mnemonic phrases.\nPlease make sure to back up your mnemonic phrase and save it in a safe location only accessible by you. If the mnemonic phrase is lost, you will not be able to regain access to your account.DO NOT share your Secret Recovery Phrase with anyone! If someone has access to your secret phrase, they will have access to your wallet. Cosmostation support will NEVER ask you for your secret phrase or your private key.\nStep 4 (Optional) Choose the HD path you wish to import. Cosmostation Wallet Extension supports HD paths designated/unique to each network by default.Step 5 Enter your seed phrase in correct order. This process is to confirm that you have saved the correct mnemonic phrase.Step 6 Choose networks to display in your Cosmostation Wallet Extension. You must select at least 1 chain in order to proceed.Step 7 Enter your password for Cosmostation Wallet Extension. Password must be more than 8 characters.","restore-wallet-with-a-mnemonic-phrase#Restore wallet with a mnemonic phrase":"The following process is for users who already have a mnemonic phrase.\nStep 1 Click 'Restore with mnemonics'Step 2 Enter 'Account name' and 'Mnemonic phrases'. Account name will be used for you to easily distinguish wallets.Step 3 (Optional) Choose the HD path you wish to import. Cosmostation Wallet Extension supports HD paths designated/unique to each network by default.Step 4 Choose networks to display in your Cosmostation Wallet Extension. You must select at least 1 chain in order to proceed.Step 5 Enter your password for Cosmostation Wallet Extension. Password must be more than 8 characters.","restore-wallet-with-a-private-key#Restore wallet with a private key":"The following process is for users that already have a private key.\nStep 1 Click 'Import wallet'.Step 2 Click 'Restore with private key'.Step 3 Enter your 'Account name' and 'Private key'. (Private keys start with 0x and consists of a 66 digit string)Step 4 Choose networks to display in your Cosmostation Wallet Extension. You must select at least 1 chain in order to proceed.Step 5 Enter your password for Cosmostation Wallet Extension. Password must be more than 8 characters."}},"/extension/guide/account/add-ledger-account":{"title":"Add Ledger Account","data":{"":"Create a new ledger wallet","supported-devices--connection-method#Supported Devices & Connection Method":"Ledger S, X\nUSB, HID","adding-ledger-account#Adding Ledger Account":"Account icon → setting icon → Add account → Create a new ledger account → Account name → HD path setting → Done","hd-path-setting#HD path setting":"Up to 101 Ledger accounts and wallets can be derived from a single set of mnemonics in a Ledger by assigning any number smaller than 101 to HD paths when creating a Ledger account.","connecting-ledger#Connecting Ledger":"Select the new Ledger account to connect on home screen.","cosmos-networks#Cosmos Networks":"Cosmostation extension wallet supports Cosmos SDK chain wallets derived from HD paths 44'/118'/0'/0/n. Connecting to any Cosmos SDK chain with a Ledger automatically derives all the Cosmos SDK chain wallets supported by a Ledger account.","evm-networks#EVM Networks":"Cosmostation extension wallet supports EVM wallets derived from HD paths 44'/60'/0'/0/n. Connecting to any EVM network with a Ledger automatically derives all the EVM network wallets supported by a Ledger account.","not-supported-networks#Not Supported Networks":"44'/118'/0'/0/n is a generic HD path for Cosmos SDK chains, but some networks use custom HD paths assigned by their network foundations. For example, a Cosmos SDK chain Crypto.org’s official HD path used by the foundation and Ledger is 44'/394'/0'/0/n.\nIn an effort to sync with the network foundations and Ledger, Cosmostation extension wallet derives wallets solely from HD paths used by the foundations and Ledger. Instead of deriving all the Cosmos SDK chain wallets from 44'/118'/0'/0/n path, Cosmostation only supports the wallets of Cosmos SDK chains whose official HD path is 44'/118'/0'/0/n for now.\nCustom HD path wallets will be supported in future updates.","signing-transactions#Signing Transactions":"","cosmos-sdk-chains#Cosmos SDK Chains":"Open the Cosmos app on Ledger\nCheck the review message on Ledger\nApprove or reject a transaction\nAll the Cosmos SDK chains' transactions can be signed from the Cosmos app.","ethereum--evm#Ethereum & EVM":"Open the Ethereum app on Ledger\nCheck the review message on Ledger\nApprove or reject a transaction\nAll the EVM chains' transactions can be signed from the Ethereum app."}},"/extension/guide/account/intro":{"title":"Introduction","data":{"":"Cosmostation Wallet Extension allows you to add and manage multiple accounts.\nSecurely manage your accounts in a convenient user interface.","add-account#Add Account":"'Add Account' has three options. [Creat a new account], [Import mnemonics], and [Import private key]. Please refer to each page for detailed instructions.\nStep 1 Click 'Add account' under 'Account Management'.Step 2 You will see three options to choose from. Please refer to the following link for detailed instructions.","manage-keys#Manage keys":"Under 'Account Management', you are able to see all the accounts that are registered on Cosmostation Extension.If you created a new account or restored a wallet with a mnemonic phrase, you will be able to see the option to [View mnemonics], [View private key], and [Delete account].If you restored a wallet with a private key, then you will only be able to choose [View private key].","delete-account#Delete Account":"You can delete accounts from Cosmostation Extension.Once deleted, you can restore your account again by importing the same mnemonic phrase or private key.\nYou are required to enter your password before deleting your account.Once deleted, if you lose your mnemonic phrase or private key you will not be able to gain access to the account again."}},"/apis/reference/statistics/transactions":{"title":"Transactions Counts","data":{"get-v1networkstatisticstxshourly#[GET] /v1/:network/statistics/txs/hourly":"Get The Number of Transactions Per Hour","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59","get-v1networkstatisticstxsdaily#[GET] /v1/:network/statistics/txs/daily":"Get The Number of Transactions Per Day","request-1#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59","get-v1networkstatisticstxsweekly#[GET] /v1/:network/statistics/txs/weekly":"Get The Number of Transactions Per Week","request-2#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59"}},"/extension/guide/dapps":{"title":"dApp","data":{"":"Cosmostation Wallet Exntension supports various dApps deployed on PoS networks.","connection-status#Connection status":"Easily check if the wallet extension is connect to the dApp.If you wish to disconnect, click the connection status under your account name.","disconnect-with-just-a-click#Disconnect with just a click.":"Easily disconnect from dApps by clicking the connecting status under your account name."}},"/extension/guide/chains":{"title":"Chains","data":{"":"Cosmostation Wallet Extension supports various PoS networks.","addremove-chains#Add/Remove Chains":"Add/remove chains to efficiently manage your wallet.Select chains you want to display on the list. Only selected chains will be displayed on both the dashboard and wallet detail page.\nStep 1 View chains that are added to your list. Click 'Add chain' to add/remove chains from the list.Step 2 By toggling on/off, you can choose chains that you want to display on Cosmostation Wallet Extension.Step 3 Selected chains are also visible on the top right side of wallet details."}},"/extension/guide/settings":{"title":"Settings","data":{"":"Customize the wallet extension in wallet settings.","dark-mode#Dark mode":"Toggle back and forth to choose between Dark or Light mode.","address-book#Address Book":"Create different address books for each chain. You can use the address book when using the 'Send' function.\nStep 1 View / Add addresses to the chain you selected.Step 2 Enter address information and click 'Save'.\nLabel your address to distinguish them from one another.\nMemo is optional but required to transfer assets to centralized cryptocurrency\nexchanges. Centralized exchanges will ask you to enter a memo for\nidentification when you make a deposit.\nIf you add addresses in the address book, you can use the address book feature when sending assets.","change-password#Change password":"Enter your current password and to change it to a new password. Enter the new password once more to confirm.\nMake sure that you enter more than 8 characters for the password.","currency--language#Currency & Language":"Cosmostation Wallet Extension supports 2 languages and 5 currencies.\nWe plan to support more currencies and languages in the near future.","lock-screen#Lock screen":"Lock your screen to secure your wallet.\n!"}},"/extension/guide/transfer-coins":{"title":"Transfer coins","data":{"":"Transfer coins with just one click via Cosmostation Wallet Extension.\nCosmostation Wallet Extension currently DOES NOT SUPPORT IBC TRANSFERS.If you are trying to send assets to a different chain, the send button will be deactivated.","receive#Receive":"Click 'Deposit' to copy the address to the clipboard or scan the QR code.","send#Send":"The following process is for users sending assets to a different address.\nStep 1 Enter 'Recipient address', 'Amount,' and 'Memo.' The memo field is optional but required for sending to specific centralized cryptocurrency exchanges. Centralized exchanges will ask you to enter a memo for identification when you make a deposit.\nMake sure that you enter the correct recipient address.Entering an incorrect address may result in loss of funds and responsibility of entering the correct address is on the user.\nStep 2, 3 Check the transaction information and confirm."}},"/extension":{"title":"Introduction","data":{"":"Cosmostation Wallet Extension is a non-custodial chrome extension wallet that supports multiple sovereign networks and inter-blockchain bridges. The wallet extension allows users to easily interact with networks and decentralized applications with just a few clicks.To download Cosmostation Wallet Extension, click this link to download from the chrome webstore.","wallet#Wallet":"","dashboard#Dashboard":""}},"/extension/integration/aptos/connect-and-account":{"title":"Connect, Account","data":{"":"connect and get Account via Cosmostation Extension","connect#Connect":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n const account = await provider.connect();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","vanilla-code#Vanilla Code":"const provider = aptos();\ntry {\n const account = await provider.connect();\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","response#Response":"export type AptosConnectResponse = {\n address: string;\n publicKey: string;\n};\n{\n \"address\": \"\",\n \"publicKey\": \"\"\n}","account#Account":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n const account = await provider.account();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","vanilla-code-1#Vanilla Code":"try {\n const provider = aptos();\n const account = await provider.account(payload);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","response-1#Response":"export type AptosAccountResponse = {\n address: string;\n publicKey: string;\n};\n{\n \"address\": \"\",\n \"publicKey\": \"\"\n}"}},"/extension/integration/aptos/network":{"title":"Network","data":{"":"Get Network via Cosmostation Extension","network#Network":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n const network = await provider.network();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","vanilla-code#Vanilla Code":"try {\n const provider = aptos();\n const network = await provider.network(payload);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","response#Response":"export type AptosNetworkResponse = string;\n\"Mainnet\""}},"/extension/integration/aptos/provider":{"title":"Provider","data":{"":"Cosmostation extension support various chains.","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n}","vanilla-code#Vanilla Code":"const isCosmostation = \"cosmostation\" in window;\nconst aptos = () => {\n if (\"cosmostation\" in window) {\n return window.cosmostation.aptos;\n } else {\n window.open(\"https://cosmostation.io/wallet/#extension\");\n /**\n * or window.open(\"https://chrome.google.com/webstore/detail/cosmostation/fpkhgmpbidmiogeglndfbkegfdlnajnf\");\n * */\n }\n};\nconst provider = aptos();"}},"/extension/integration/aptos/sign-and-submit-transaction":{"title":"Sign And Submit Transaction","data":{"":"Sign And Submit transcation via Cosmostation Extension","signandsubmittransaction#SignAndSubmitTransaction":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n // e.g. send payload\n const payload = {\n arguments: [\n \"\",\n \"100000000\",\n ],\n function: \"0x1::aptos_account::transfer\",\n type: \"entry_function_payload\",\n type_arguments: [],\n };\n const pendingTransaction = await provider.signAndSubmitTransaction(payload);\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","vanilla-code#Vanilla Code":"// e.g. send payload\nconst payload = {\n arguments: [\n \"\",\n \"100000000\",\n ],\n function: \"0x1::aptos_account::transfer\",\n type: \"entry_function_payload\",\n type_arguments: [],\n};\ntry {\n const provider = aptos();\n const pendingTransaction = await provider.signAndSubmitTransaction(payload);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","request#request":"export type AptosSignPayload = {\n function: string;\n type: string;\n type_arguments: string[];\n arguments: T[];\n};","response#Response":"export type AptosSignAndSubmitTransactionResponse = {\n hash: string;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: AptosSignPayload;\n signature?: {\n type: string;\n public_key: string;\n signature: string;\n };\n};\n{\n \"hash\": \"\",\n \"sender\": \"\",\n \"sequence_number\": \"15\",\n \"max_gas_amount\": \"1016\",\n \"gas_unit_price\": \"100\",\n \"expiration_timestamp_secs\": \"1668137878\",\n \"payload\": {\n \"function\": \"0x1::coin::transfer\",\n \"type_arguments\": [\"0x1::aptos_coin::AptosCoin\"],\n \"arguments\": [\n \"\",\n \"1000000\"\n ],\n \"type\": \"entry_function_payload\"\n },\n \"signature\": {\n \"public_key\": \"\",\n \"signature\": \"\",\n \"type\": \"ed25519_signature\"\n }\n}","signtransaction#SignTransaction":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n const signature = await provider.signTransaction(payload);\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","vanilla-code-1#Vanilla Code":"const cosmostation = provider();\n// e.g. send payload\nconst payload = {\n arguments: [\n \"\",\n \"100000000\",\n ],\n function: \"0x1::aptos_account::transfer\",\n type: \"entry_function_payload\",\n type_arguments: [],\n};\ntry {\n const provider = aptos();\n const signature = await provider.signTransaction(payload);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","request-1#request":"export type AptosSignPayload = {\n function: string;\n type: string;\n type_arguments: string[];\n arguments: T[];\n};","response-1#Response":"export type AptosSignTransactionResponse = string;\n\"\""}},"/extension/integration/aptos/event":{"title":"Event","data":{"accountchange#AccountChange":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\nconst handler = (account) => console.log(account);\ntry {\n const provider = await aptos();\n provider.onAccountChange(handler);\n // if you want to remove the listener\n provider.offAccountChange(handler);\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n}","vanilla-code#Vanilla Code":"const handler = (account) => console.log(account);\ntry {\n const provider = aptos();\n provider.onAccountChange(handler);\n // if you want to remove the listener\n provider.offAccountChange(handler);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","networkchange#NetworkChange":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\nconst handler = (network) => console.log(network);\ntry {\n const provider = await aptos();\n provider.onNetworkChange(handler);\n // if you want to remove the listener\n provider.offNetworkChange(handler);\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n}","vanilla-code-1#Vanilla Code":"const handler = (network) => console.log(network);\ntry {\n const provider = aptos();\n provider.onNetworkChange(handler);\n // if you want to remove the listener\n provider.offNetworkChange(handler);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}"}},"/extension/integration/cosmos/Deprecated/accounts":{"title":"Accounts","data":{"":"Using Cosmostation Extension accounts.","get-accounts#Get Accounts":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"const account = await provider.getAccount(\"cosmoshub-4\");","vanilla-code#Vanilla Code":"const account = await window.cosmostation.cosmos.request({\n method: \"cos_account\",\n params: { chainName: \"cosmoshub-4\" },\n});","if-connected-successfully-it-will-look-like-below#If connected successfully, it will look like below.":"","response#Response":"type AccountResponse = {\n name: string;\n address: string;\n publicKey: Uint8Array;\n isLedger: boolean;\n};\n{\n \"name\": \"account name\",\n \"address\": \"cosmos1wgeoiheoighwoighwioeghoweghoiweghiow\",\n \"publicKey\": [\n 3, 77, 9, 189, 251, 249, 150, 235, 192, 56, 51, 98, 56, 242, 12, 102, 144,\n 211, 89, 42, 187, 170\n ],\n \"isLedger\": false\n}","request-account-popup#Request Account (Popup)":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"try {\n // ...\n const account = await provider.requestAccount(\"cosmoshub-4\");\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code-1#Vanilla Code":"const account = await window.cosmostation.cosmos.request({\n method: \"cos_requestAccount\",\n params: { chainName: \"cosmoshub-4\" },\n});","response-1#Response":"type RequestAccountResponse = {\n name: string;\n address: string;\n publicKey: Uint8Array;\n isLedger: boolean;\n};\n{\n \"name\": \"account name\",\n \"address\": \"cosmos1wgeoiheoighwoighwioeghoweghoiweghiow\",\n \"publicKey\": [\n 3, 77, 9, 189, 251, 249, 150, 235, 192, 56, 51, 98, 56, 242, 12, 102, 144,\n 211, 89, 42, 187, 170\n ],\n \"isLedger\": false\n}"}},"/extension/integration/cosmos/Deprecated/cw20-token":{"title":"CW20 token","data":{"":"@cosmostation/extension-client >= 0.1.7CW20 token via Cosmostation Extension","add-cw20-tokens#Add CW20 Tokens":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"// ...\nconst response = await provider.addCW20Tokens('mint', [\n {\n contractAddress: '',\n imageURL: 'https://pbs.twimg.com/profile_images/1465777324859826197/RUXx0equ_400x400.jpg', // optional\n coinGeckoId: 'neta', // optional\n },\n {\n contractAddress: '',\n },\n]);","vanilla-code#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: 'cos_addTokensCW20',\n params: {\n chainName: 'mint',\n tokens: [\n {\n contractAddress: '',\n imageURL: 'https://pbs.twimg.com/profile_images/1465777324859826197/RUXx0equ_400x400.jpg', // optional\n coinGeckoId: 'neta', // optional\n },\n {\n contractAddress: '',\n },\n ],\n },\n});","response#Response":"export type AddCW20TokenResponse = null;\nnull","get-cw20-token-balance#Get CW20 Token Balance":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"// ...\nconst response = await provider.getCW20TokenBalance(\n 'mint',\n '', // contract address\n 'mint14xgdfdnpjtulj6p7rkc75ekxqjq8hc5cg5evx3', // address\n);","vanilla-code-1#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: 'cos_getBalanceCW20',\n params: {\n chainName: 'mint',\n contractAddress: '',\n address: 'mint14xgdfdnpjtulj6p7rkc75ekxqjq8hc5cg5evx3',\n },\n});","response-1#Response":"export type getCW20TokenBalanceResponse = string;\n\"1331775394\"","get-cw20-token-info#Get CW20 Token Info":"","code-using-cosmostationextension-client-2#Code using @cosmostation/extension-client":"// ...\nconst response = await provider.getCW20TokenInfo(\n 'mint',\n '', // contract address\n);","vanilla-code-2#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: 'cos_getTokenInfoCW20',\n params: {\n chainName: 'mint',\n contractAddress: '',\n },\n});","response-2#Response":"export type getCW20TokenInfoResponse = {\n decimals: number;\n name: string;\n symbol: string;\n total_supply: string;\n};\n{\n \"name\": \"NETA\",\n \"symbol\": \"NETA\",\n \"decimals\": 6,\n \"total_supply\": \"31886600000\"\n}"}},"/extension/integration/cosmos/Deprecated/chains":{"title":"Chains","data":{"":"Get supported chains and add specific chains for using Cosmostation Extension.","add-chains#Add chains":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"try {\n // ...\n await provider.addChain({\n chainId: \"cerberus-chain-1\",\n chainName: \"cerberus\",\n addressPrefix: \"cre\",\n baseDenom: \"ucrbrus\",\n displayDenom: \"CRBRUS\",\n restURL: \"https://lcd-office.cosmostation.io/mooncat-1-1\",\n coinType: \"118\", // optional (default: '118')\n decimals: 6, // optional (default: 6)\n gasRate: {\n // optional (default: { average: '0.025', low: '0.0025', tiny: '0.00025' })\n average: \"0.2\",\n low: \"0.02\",\n tiny: \"0.002\",\n },\n sendGas: \"80000\", // optional (default: '100000')\n type: \"ETHERMINT\", // optional (default: '')\n });\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code#Vanilla Code":"await window.cosmostation.cosmos.request({\n method: \"cos_addChain\",\n params: {\n chainId: \"cerberus-chain-1\",\n chainName: \"cerberus\",\n addressPrefix: \"cre\",\n baseDenom: \"ucrbrus\",\n displayDenom: \"CRBRUS\",\n restURL: \"https://lcd-office.cosmostation.io/mooncat-1-1\",\n coinType: \"118\", // optional (default: '118')\n decimals: 6, // optional (default: 6)\n gasRate: {\n // optional (default: { average: '0.025', low: '0.0025', tiny: '0.00025' })\n average: \"0.2\",\n low: \"0.02\",\n tiny: \"0.002\",\n },\n sendGas: \"80000\", // optional (default: '100000')\n type: \"ETHERMINT\", // optional (default: '')\n },\n});","response#Response":"type addChainResponse = boolean;\ntrue","keplr-to-cosmostation#keplr to cosmostation":"{\n chainId: chainInfo.chainId,\n addressPrefix: chainInfo.bech32Config.bech32PrefixAccAddr,\n baseDenom: chainInfo.currencies[0].coinMinimalDenom,\n chainName: chainInfo.chainName || chainInfo.chainId,\n displayDenom: chainInfo.currencies[0].coinDenom,\n decimals: chainInfo.currencies[0].coinDecimals,\n restURL: chainInfo.rest,\n coinType: String(chainInfo.bip44.coinType),\n gasRate: chainInfo.gasPriceStep\n ? {\n tiny: String(chainInfo.gasPriceStep.low),\n low: String(chainInfo.gasPriceStep.average),\n average: String(chainInfo.gasPriceStep.high),\n }\n : undefined,\n}\nexport interface KeplrChainInfo {\n readonly rpc: string;\n readonly rpcConfig?: AxiosRequestConfig;\n readonly rest: string;\n readonly restConfig?: AxiosRequestConfig;\n readonly chainId: string;\n readonly chainName: string;\n readonly stakeCurrency: Currency;\n readonly walletUrl?: string;\n readonly walletUrlForStaking?: string;\n readonly bip44: BIP44;\n readonly alternativeBIP44s?: BIP44[];\n readonly bech32Config: Bech32Config;\n readonly currencies: AppCurrency[];\n readonly feeCurrencies: FeeCurrency[];\n readonly features?: string[];\n readonly beta?: boolean;\n}","supported-chains#Supported chains":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"const supportedChains = await provider.getSupportedChains();","vanilla-code-1#Vanilla Code":"const supportedChains = await window.cosmostation.cosmos.request({\n method: \"cos_supportedChainNames\",\n});","response-1#Response":"type SupportedChainNamesResponse = {\n official: string[]; // lowercase\n unofficial: string[]; // lowercase\n};\n{\n \"official\": [\"cosmos\", \"osmosis\"],\n \"unofficial\": [\"test\"]\n}","supported-chainids#Supported chainIds":"","code-using-cosmostationextension-client-2#Code using @cosmostation/extension-client":"const supportedChains = await provider.getSupportedChainIds();","vanilla-code-2#Vanilla Code":"const supportedChainIds = await window.cosmostation.cosmos.request({\n method: \"cos_supportedChainIds\",\n});","response-2#Response":"type SupportedChainIdsResponse = {\n official: string[];\n unofficial: string[];\n};\n{\n \"official\": [\"cosmoshub-4\", \"gravity-bridge-3\"],\n \"unofficial\": [\"columbus-5\", \"agoric-3\"]\n}","activated-chains#Activated chains":"","code-using-cosmostationextension-client-3#Code using @cosmostation/extension-client":"const activatedChains = await provider.getActivatedChains();","vanilla-code-3#Vanilla Code":"const activatedChains = await window.cosmostation.cosmos.request({\n method: \"cos_activatedChainNames\",\n});","response-3#Response":"type ActivatedChainNamesResponse = string[]; // lowercase\n[\"cosmos\", \"osmosis\"]","activated-chainids#Activated chainIds":"","code-using-cosmostationextension-client-4#Code using @cosmostation/extension-client":"const activatedChainIds = await provider.getActivatedChainIds();","vanilla-code-4#Vanilla Code":"const activatedChainIds = await window.cosmostation.cosmos.request({\n method: \"cos_activatedChainIds\",\n});","response-4#Response":"type ActivatedChainIdsResponse = string[];\n[\"cosmoshub-4\", \"gravity-bridge-3\"]"}},"/extension/integration/cosmos/Deprecated/error":{"title":"Error","data":{"":"Error description\nCode\tModel\tDescription\t4001\t-\tUser rejected request\t4100\t-\tThe requested account and/or method has not been authorized by the user.\t4200\t-\tThe requested method is not supported\t-32000\t-\tInvalid input.\t-32600\t-\tThe JSON sent is not a valid Request object.\t-32602\t-\tInvalid method parameter(s).\t-32603\t-\tInternal JSON-RPC error."}},"/extension/integration/cosmos/Deprecated/event":{"title":"Event","data":{"":"Account change event","onaccountchanged#onAccountChanged":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"provider.onAccountChanged(() => console.log(\"changed\"));","vanilla-code#Vanilla Code":"window.addEventListener(\"cosmostation_keystorechange\", () => {\n console.log(\"Key store in Cosmostation is changed. You may need to refetch the account info.\")\n})","offaccountchanged#offAccountChanged":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"const event = provider.onAccountChanged(() => console.log(\"changed\"));\nprovider.offAccountChanged(event);","vanilla-code-1#Vanilla Code":"window.removeEventListener(\"cosmostation_keystorechange\", handler)"}},"/extension/integration/cosmos/Deprecated/provider":{"title":"Provider","data":{"":"Cosmostation extension support various chains.","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { cosmos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await cosmos();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n}","vanilla-code#Vanilla Code":"window.onload = async () => {\n if (!window.cosmostation) {\n alert(\"Please install cosmostation extension\");\n } else {\n // logic\n }\n};"}},"/extension/integration/cosmos/Deprecated/sign-message":{"title":"Sign Message","data":{"":"Sign Message via Cosmostation Extension","sign-message#Sign Message":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"try {\n // ...\n const response = await provider.signMessage(\n \"cosmoshub-4\",\n \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\", // signer\n \"message!!!!\" // message\n );\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_signMessage\",\n params: {\n chainName: \"cosmoshub-4\",\n signer: \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n message: \"message!!!!\",\n },\n});","response#Response":"export type SignMessageResponse = {\n signature: string;\n pub_key: { type: string; value: string };\n};\n{\n \"pub_key\": {\n \"type\": \"tendermint/PubKeySecp256k1\",\n \"value\": \"A00Jvfv5luvAODNiOPIMZpDTWSq7qvoFV8k7ptdsDqLU\"\n },\n \"signature\": \"signature==\"\n}","verifymessage#VerifyMessage":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"try {\n const response = await provider.signMessage(\n \"cosmoshub-4\",\n \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n \"message!!!!\"\n );\n const result = await provider.verifyMessage(\n \"cosmoshub-4\",\n \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n \"message!!!!\",\n response\n );\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code-1#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_signMessage\",\n params: {\n chainName: \"cosmoshub-4\",\n signer: \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n message: \"message!!!!\",\n },\n});\nconst result = await window.cosmostation.cosmos.request({\n method: \"cos_verifyMessage\",\n params: {\n chainName: \"cosmoshub-4\",\n signer: \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n message: \"message!!!!\",\n publicKey: response.pub_key.value,\n signature: response.signature,\n },\n});","response-1#Response":"export type VerifyMessageResponse = boolean;\ntrue"}},"/extension/integration/cosmos/integrate-cosmjs":{"title":"Integrate cosmjs","data":{"":"Integrate cosmjs.","add-package#Add package":"yarn add @cosmostation/cosmos-client\nnpm install @cosmostation/cosmos-client","offline-signer#Offline Signer":"import { getOfflineSigner } from \"@cosmostation/cosmos-client\";\nconst offlineSigner = await getOfflineSigner(CHAIN_ID);\nimport { getOfflineSigner } from \"@cosmostation/cosmos-client\";\nimport { GasPrice, calculateFee } from \"@cosmjs/stargate\";\nimport { SigningCosmWasmClient } from \"@cosmjs/cosmwasm-stargate\";\nconst offlineSigner = await getOfflineSigner(CHAIN_ID);\nconst rpcEndpoint = RPC_END_POINT;\nconst client = await SigningCosmWasmClient.connectWithSigner(\n rpcEndpoint,\n offlineSigner\n);\n//getAccounts\nconst accounts = await offlineSigner.getAccounts();\n//execute\nconst gasPrice = GasPrice.fromString(\"0.01denom\");\nconst fees = {\n upload: calculateFee(1500000, gasPrice),\n init: calculateFee(500000, gasPrice),\n exec: calculateFee(500000, gasPrice),\n};\nconst result = await client.execute(\n accounts[0].address,\n RECEIPT_ADDRESS,\n MESSAGE,\n fees.exec\n);"}},"/extension/integration/cosmos/integrate-keplr":{"title":"Use Cosmostation with Keplr Interface","data":{"":"Cosmostation is providing Keplr's interface. The purpose is to make it easier for the developers to integrate Cosmostation to dApps that have Keplr integrated already.Supported functions/variables are as belows:\ndefaultOptions\nenable\ngetKey\nexperimentalSuggestChain\ngetOfflineSigner\ngetOfflineSignerAuto\ngetOfflineSignerOnlyAmino\nsendTx\nsignAmino\nsignDirect\nsignArbitrary\nverifyArbitrary\nIn case of an error, use the Cosmostation interface.You need to use methods provided by Cosmostation for the event handling and defaultOptions change.\nHere's the guide:","guide#Guide":"Use window.cosmostation.providers.keplr instead of window.keplr.\nwindow.onload = async () => {\n if (!window.cosmostation) {\n alert(\"Please install cosmostation extension\");\n } else {\n const chainId = \"cosmoshub-4\";\n await window.cosmostation.providers.keplr.enable(chainId);\n const offlineSigner =\n window.cosmostation.providers.keplr.getOfflineSigner(chainId);\n const accounts = await offlineSigner.getAccounts();\n }\n};\nasync getKeplr(): Promise {\n if (window.cosmostation) {\n return window.cosmostation.providers.keplr;\n }\n if (document.readyState === \"complete\") {\n return window.cosmostation.providers.keplr;\n }\n return new Promise((resolve) => {\n const documentStateChange = (event: Event) => {\n if (\n event.target &&\n (event.target as Document).readyState === \"complete\"\n ) {\n resolve(window.cosmostation.providers.keplr);\n document.removeEventListener(\"readystatechange\", documentStateChange);\n }\n };\n document.addEventListener(\"readystatechange\", documentStateChange);\n });\n}","defaultoptions#defaultOptions":"window.cosmostation.providers.keplr.defaultOptions = {\n sign: {\n preferNoSetFee: true,\n preferNoSetMemo: true,\n },\n};","event#Event":"window.addEventListener(\"cosmostation_keystorechange\", () => {\n console.log(\"Key store in Cosmostation is changed. You may need to refetch the account info.\")\n})"}},"/extension/integration/cosmos/Deprecated/sign-tx":{"title":"Sign Transactions","data":{"":"Sign transcation via Cosmostation Extension","sign-amino#Sign Amino":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"try {\n // ...\n const response = await provider.signAmino(\n \"cosmoshub-4\",\n {\n chain_id: \"cosmoshub-4\",\n fee: { amount: [{ denom: \"uatom\", amount: \"5000\" }], gas: \"200000\" },\n memo: \"\",\n msgs: [\n {\n type: \"cosmos-sdk/MsgSend\",\n value: {\n from_address: \"cosmos1wepghweioghweiog\",\n to_address: \"cosmos1weogihweoighweoigheoiw\",\n amount: [{ denom: \"uatom\", amount: \"5000\" }],\n },\n },\n ],\n sequence: \"20\",\n account_number: \"632177\",\n },\n {\n memo: true, // optional\n fee: true, // optional\n gasRate: {\n // optional\n average: \"0.2\",\n low: \"0.02\",\n tiny: \"0.002\",\n },\n }\n );\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_signAmino\",\n params: {\n chainName: \"cosmoshub-4\",\n doc: {\n chain_id: \"cosmoshub-4\",\n fee: { amount: [{ denom: \"uatom\", amount: \"5000\" }], gas: \"200000\" },\n memo: \"\",\n msgs: [\n {\n type: \"cosmos-sdk/MsgSend\",\n value: {\n from_address: \"cosmos1wepghweioghweiog\",\n to_address: \"cosmos1weogihweoighweoigheoiw\",\n amount: [{ denom: \"uatom\", amount: \"5000\" }],\n },\n },\n ],\n sequence: \"20\",\n account_number: \"632177\",\n },\n isEditMemo: true, // optional\n isEditFee: true, // optional\n gasRate: {\n // optional\n average: \"0.2\",\n low: \"0.02\",\n tiny: \"0.002\",\n },\n },\n});","response#Response":"export type SignAminoResponse = {\n signature: string;\n pub_key: { type: string; value: string };\n signed_doc: SignAminoDoc;\n};\nexport type SignAminoDoc = {\n chain_id: string;\n sequence: string;\n account_number: string;\n fee: Fee;\n memo: string;\n msgs: Msg[];\n};\nexport type Amount = {\n denom: string;\n amount: string;\n};\nexport type Msg = {\n type: string;\n value: T;\n};\nexport type Fee = { amount: Amount[]; gas: string };\n{\n \"pub_key\": {\n \"type\": \"tendermint/PubKeySecp256k1\",\n \"value\": \"A00Jvfv5luvAODNiOPIMZpDTWSq7qvoFV8k7ptdsDqLU\"\n },\n \"signature\": \"signature==\",\n \"signed_doc\": {\n \"chain_id\": \"cosmoshub-4\",\n \"fee\": {\n \"amount\": [{ \"denom\": \"uatom\", \"amount\": \"5000\" }],\n \"gas\": \"200000\"\n },\n \"memo\": \"\",\n \"msgs\": [\n {\n \"type\": \"cosmos-sdk/MsgSend\",\n \"value\": {\n \"from_address\": \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n \"to_address\": \"cosmos1ursv4z57pw8ly2jsgn09dyjha4qrk7aen987ld\",\n \"amount\": [{ \"denom\": \"uatom\", \"amount\": \"5000\" }]\n }\n }\n ],\n \"sequence\": \"20\",\n \"account_number\": \"632177\"\n }\n}","sign-direct#Sign Direct":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"try {\n // ...\n const response = await provider.signDirect(\n \"cosmos\",\n {\n chain_id: \"cosmoshub-4\",\n account_number: \"1\",\n auth_info_bytes: [\n 10, 80, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114,\n 121, 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80,\n 117, 98, 75, 101, 121, 18, 35, 10, 33, 3, 77, 9, 189, 251, 249, 150,\n 235, 192, 56, 51, 98, 56, 242, 12, 102, 144, 211, 89, 42, 187, 170, 250,\n 5, 87, 201, 59, 166, 215, 108, 14, 162, 212, 18, 4, 10, 2, 8, 127, 24,\n 14, 18, 19, 10, 13, 10, 5, 117, 97, 116, 111, 109, 18, 4, 50, 48, 48,\n 48, 16, 128, 241, 4,\n ],\n body_bytes: [\n 10, 133, 1, 10, 28, 47, 99, 111, 115, 109, 111, 115, 46, 98, 97, 110,\n 107, 46, 118, 49, 98, 101, 116, 97, 49, 46, 77, 115, 103, 83, 101, 110,\n 100, 18, 101, 10, 42, 99, 114, 101, 49, 103, 114, 48, 101, 51, 112, 106,\n 51, 121, 54, 102, 113, 118, 122, 121, 102, 109, 48, 113, 120, 121, 119,\n 57, 104, 53, 100, 119, 102, 114, 118, 104, 56, 120, 121, 122, 114, 115,\n 118, 18, 42, 99, 114, 101, 49, 120, 53, 119, 103, 104, 54, 118, 119,\n 121, 101, 54, 48, 119, 118, 51, 100, 116, 115, 104, 115, 57, 100, 109,\n 113, 103, 103, 119, 102, 120, 50, 108, 100, 104, 103, 108, 117, 101,\n 122, 26, 11, 10, 4, 117, 99, 114, 101, 18, 3, 49, 48, 48, 18, 0,\n ],\n },\n { memo: true, fee: true } // edit | optional (default: { memo: false, fee: false }),\n );\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code-1#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_signDirect\",\n params: {\n chainName: \"cosmos\",\n doc: {\n chain_id: \"cosmoshub-4\",\n account_number: \"1\",\n auth_info_bytes: [\n 10, 80, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114,\n 121, 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80,\n 117, 98, 75, 101, 121, 18, 35, 10, 33, 3, 77, 9, 189, 251, 249, 150,\n 235, 192, 56, 51, 98, 56, 242, 12, 102, 144, 211, 89, 42, 187, 170, 250,\n 5, 87, 201, 59, 166, 215, 108, 14, 162, 212, 18, 4, 10, 2, 8, 127, 24,\n 14, 18, 19, 10, 13, 10, 5, 117, 97, 116, 111, 109, 18, 4, 50, 48, 48,\n 48, 16, 128, 241, 4,\n ],\n body_bytes: [\n 10, 133, 1, 10, 28, 47, 99, 111, 115, 109, 111, 115, 46, 98, 97, 110,\n 107, 46, 118, 49, 98, 101, 116, 97, 49, 46, 77, 115, 103, 83, 101, 110,\n 100, 18, 101, 10, 42, 99, 114, 101, 49, 103, 114, 48, 101, 51, 112, 106,\n 51, 121, 54, 102, 113, 118, 122, 121, 102, 109, 48, 113, 120, 121, 119,\n 57, 104, 53, 100, 119, 102, 114, 118, 104, 56, 120, 121, 122, 114, 115,\n 118, 18, 42, 99, 114, 101, 49, 120, 53, 119, 103, 104, 54, 118, 119,\n 121, 101, 54, 48, 119, 118, 51, 100, 116, 115, 104, 115, 57, 100, 109,\n 113, 103, 103, 119, 102, 120, 50, 108, 100, 104, 103, 108, 117, 101,\n 122, 26, 11, 10, 4, 117, 99, 114, 101, 18, 3, 49, 48, 48, 18, 0,\n ],\n },\n isEditFee: true,\n isEditMemo: true,\n },\n});","response-1#Response":"export type SignDirectDoc = {\n chain_id: string;\n body_bytes: Uint8Array;\n auth_info_bytes: Uint8Array;\n account_number: string;\n};\nexport type SignDirectResponse = {\n signature: string;\n pub_key: { type: string; value: string };\n signed_doc: SignDirectDoc;\n};\n{\n \"pub_key\": {\n \"type\": \"tendermint/PubKeySecp256k1\",\n \"value\": \"A00Jvfv5luvAODNiOPIMZpDTWSq7qvoFV8k7ptdsDqLU\"\n },\n \"signature\": \"signature==\",\n \"signed_doc\": {\n \"chain_id\": \"cosmoshub-4\",\n \"account_number\": \"1\",\n \"auth_info_bytes\": [\n 10, 80, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114, 121,\n 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80, 117,\n 98, 75, 101, 121, 18, 35, 10, 33, 3, 77, 9, 189, 251, 249, 150, 235, 192,\n 56, 51, 98, 56, 242, 12, 102, 144, 211, 89, 42, 187, 170, 250, 5, 87, 201,\n 59, 166, 215, 108, 14, 162, 212, 18, 4, 10, 2, 8, 127, 24, 14, 18, 19, 10,\n 13, 10, 5, 117, 97, 116, 111, 109, 18, 4, 50, 48, 48, 48, 16, 128, 241, 4\n ],\n \"body_bytes\": [\n 10, 133, 1, 10, 28, 47, 99, 111, 115, 109, 111, 115, 46, 98, 97, 110, 107,\n 46, 118, 49, 98, 101, 116, 97, 49, 46, 77, 115, 103, 83, 101, 110, 100,\n 18, 101, 10, 42, 99, 114, 101, 49, 103, 114, 48, 101, 51, 112, 106, 51,\n 121, 54, 102, 113, 118, 122, 121, 102, 109, 48, 113, 120, 121, 119, 57,\n 104, 53, 100, 119, 102, 114, 118, 104, 56, 120, 121, 122, 114, 115, 118,\n 18, 42, 99, 114, 101, 49, 120, 53, 119, 103, 104, 54, 118, 119, 121, 101,\n 54, 48, 119, 118, 51, 100, 116, 115, 104, 115, 57, 100, 109, 113, 103,\n 103, 119, 102, 120, 50, 108, 100, 104, 103, 108, 117, 101, 122, 26, 11,\n 10, 4, 117, 99, 114, 101, 18, 3, 49, 48, 48, 18, 0\n ]\n }\n}"}},"/extension/integration/cosmos/Deprecated/disconnect":{"title":"Disconnect","data":{"":"Disconnect from Dapp","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"const response = await provider.disconnect();","vanilla-code#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_disconnect\",\n});","response#Response":"type DisconnectResponse = null;\nnull"}},"/extension/integration/cosmos/typescript":{"title":"Typescript","data":{"installation#Installation":"The Cosmostation wallet package lives in npm. To install the latest stable version, run the following command:\nnpm install @cosmostation/extension\nOr if you're using yarn:\nyarn add @cosmostation/extension","account#Account":"","request-account#Request account":"Get account information\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const account = await provider.requestAccount();\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Request Account\n;","disconnect#Disconnect":"Disconnect from the extension\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const account = await provider.requestAccount();\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Disconnect\n;","sign#Sign":"","signamino#SignAmino":"Signing with amino in the legacy way.\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const doc = {\n // ...\n };\n const response = await provider.signAmino(doc);\n console.log(response.signatures);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Amino\n;","signdirect#SignDirect":"Signing based on protobuf\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const doc = {\n // ...\n };\n const response = await provider.signDirect(doc);\n console.log(response.signatures);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Direct\n;","signandsendtransaction#SignAndSendTransaction":"A method that combines sign and send using signDirect\nReceives message as json and automates creation of protobufJSON e.g.\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const account = await provider.requestAccount();\n const response = await provider.signAndSendTransaction({\n messages: [\n {\n type_url: '/cosmos.bank.v1beta1.MsgSend',\n value: {\n from_address: account.address,\n to_address: account.address,\n amount: [\n {\n denom: 'uatom',\n amount: '1',\n },\n ],\n },\n },\n ],\n memo: 'Test (Sign And Send Transaction)',\n });\n console.log(response);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign And Send Transaction\n;","signmessage#SignMessage":"sign arbitrary bytes\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const response = await provider.signMessage('Test (Sign Message)');\n console.log(response.signature);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Message\n;","verifymessage#verifyMessage":"verify arbitrary bytes\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const text = 'Test (Sign Message)';\n const signResponse = await provider.signMessage(text);\n const verifyResponse = await provider.verifyMessage(text, signResponse.signature);\n console.log(verifyResponse ? 'verified' : 'not verified');\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign & Verify Message\n;","addcustomchain#AddCustomChain":"Add a chain or testnet chain that is not officially provided by the extension.\nimport { cosmosFunctions } from '@cosmostation/extension';\n {\n try {\n const response = cosmosFunctions.addCosmosChain({\n chainId: 'custom-chain-1',\n chainName: 'custom-chain',\n addressPrefix: 'custom',\n baseDenom: 'ucustom',\n displayDenom: 'CUSTOM',\n restURL: 'https://rpc.custom-chain.com',\n decimals: 6, // optional\n coinType: \"118'\", // optional\n });\n console.log(response.tx_response.txhash);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Add a custom chain\n;","event#Event":"","addeventlistener#addEventListener":"window.addEventListener('cosmostation_keystorechange', () => {\n console.log('Key store in Cosmostation is changed. You may need to refetch the account info.');\n});","removeeventlistener#removeEventListener":"window.removeEventListener('cosmostation_keystorechange', handler);"}},"/extension/integration/cosmos/proto":{"title":"Protobuf JSON","data":{"":"Automatically creates json as a transaction in protobuf format.\nWhen using signAndTransaction, send a message as shown below.This is an example. You can request it by filling in the value in [input].","test#Test":"You can test it by connecting directly to your wallet. Please refer to the example below and send a transaction.\nIt will be sent directly to the cosmoshub-4 mainnet, so don't sign if you don't want to.","1-connect#1. Connect":"","2-get-account#2. Get Account":"","3-sign-and-send-transaction#3. Sign And Send Transaction":"It is editable.\nYou can send multiple messages.","example#Example":"","send#Send":"{\n \"type_url\": \"/cosmos.bank.v1beta1.MsgSend\",\n \"value\": {\n \"from_address\": \"from_address\", // [input]: string\n \"to_address\": \"to_address\", // [input]: string\n \"amount\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ]\n }\n}","multisend#MultiSend":"{\n \"type_url\": \"/cosmos.bank.v1beta1.MsgMultiSend\",\n \"value\": {\n \"inputs\": [\n {\n \"address\": \"address\", // [input]: string\n \"coins\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ]\n }\n ],\n \"outputs\": [\n {\n \"address\": \"address\", // [input]: string\n \"coins\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ]\n }\n ]\n }\n}","delegate#Delegate":"{\n \"type_url\": \"/cosmos.staking.v1beta1.MsgDelegate\",\n \"value\": {\n \"delegator_address\": \"delegator_address\", // [input]: string\n \"validator_address\": \"validator_address\", // [input]: string\n \"amount\": {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n }\n}","redelegate#Redelegate":"{\n \"type_url\": \"/cosmos.staking.v1beta1.MsgBeginRedelegate\",\n \"value\": {\n \"delegator_address\": \"[input]\", // [input]: string\n \"validator_src_address\": \"[input]\", // [input]: string\n \"validator_dst_address\": \"[input]\", // [input]: string\n \"amount\": {\n \"denom\": \"[input]\", // [input]: string\n \"amount\": \"[input]\" // [input]: string\n }\n }\n}","undelegate#Undelegate":"{\n \"type_url\": \"/cosmos.staking.v1beta1.MsgUndelegate\",\n \"value\": {\n \"delegator_address\": \"delegator_address\", // [input]: string\n \"validator_address\": \"validator_address\", // [input]: string\n \"amount\": {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n }\n}","reward#Reward":"{\n \"type_url\": \"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward\",\n \"value\": {\n \"delegator_address\": \"delegator_address\", // [input]: string\n \"validator_address\": \"validator_address\" // [input]: string\n }\n}","vote#Vote":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgVote\",\n \"value\": {\n \"proposal_id\": 823, // [input]: number\n \"voter\": \"voter\", // [input]: string\n \"option\": 1 // [input]: number (yes: 1, abstain: 2, no: 3, no_with_veto: 4)\n }\n}","vote-options#Vote Options":"enum VoteOption {\n VOTE_OPTION_UNSPECIFIED = 0,\n VOTE_OPTION_YES = 1,\n VOTE_OPTION_ABSTAIN = 2,\n VOTE_OPTION_NO = 3,\n VOTE_OPTION_NO_WITH_VETO = 4\n}","ibc-transfer#IBC Transfer":"{\n \"type_url\": \"/ibc.applications.transfer.v1.MsgTransfer\",\n \"value\": {\n \"source_port\": \"source_port\", // [input]: string\n \"source_channel\": \"source_channel\", // [input]: string\n \"token\": {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n },\n \"sender\": \"sender\", // [input]: string\n \"receiver\": \"receiver\", // [input]: string\n \"timeout_height\": {\n \"revision_height\": 13594714, // [input]: number\n \"revision_number\": 2 // [input]: number\n },\n \"memo\": \"\" // [input]: string\n }\n}","cosmwasm-executecontract#Cosmwasm ExecuteContract":"{\n \"type_url\": \"/cosmwasm.wasm.v1.MsgExecuteContract\",\n \"value\": {\n \"sender\": \"sender\", // [input]: string\n \"contract\": \"contract\", // [input]: string\n \"funds\": [], // [input]: unknown[]\n \"msg\": [1, 2] // [input]: Buffer or Uint8Array\n }\n}","proposal#Proposal":"","textproposal#TextProposal":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgSubmitProposal\",\n \"value\": {\n \"content\": {\n \"type_url\": \"/cosmos.gov.v1beta1.TextProposal\",\n \"value\": {\n \"title\": \"title\", // [input]: string\n \"description\": \"description\" // [input]: string\n }\n },\n \"initial_deposit\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ],\n \"proposer\": \"proposer\" // [input]: string\n }\n}","clientupdateproposal#ClientUpdateProposal":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgSubmitProposal\",\n \"value\": {\n \"content\": {\n \"type_url\": \"/ibc.core.client.v1.ClientUpdateProposal\",\n \"value\": {\n \"title\": \"title\", // [input]: string\n \"description\": \"description\", // [input]: string\n \"subject_client_id\": \"subject_client_id\", // [input]: string\n \"substitute_client_id\": \"substitute_client_id\" // [input]: string\n }\n },\n \"initial_deposit\": [],\n \"proposer\": \"proposer\" // [input]: string\n }\n}","communitypoolspendproposal#CommunityPoolSpendProposal":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgSubmitProposal\",\n \"value\": {\n \"content\": {\n \"type_url\": \"/cosmos.distribution.v1beta1.CommunityPoolSpendProposal\",\n \"value\": {\n \"title\": \"title\", // [input]: string\n \"description\": \"description\", // [input]: string\n \"recipient\": \"recipient\", // [input]: string\n \"amount\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ]\n }\n },\n \"initial_deposit\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ],\n \"proposer\": \"proposer\" // [input]: string\n }\n}","parameterchangeproposal#ParameterChangeProposal":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgSubmitProposal\",\n \"value\": {\n \"content\": {\n \"type_url\": \"/cosmos.params.v1beta1.ParameterChangeProposal\",\n \"value\": {\n \"title\": \"title\", // [input]: string\n \"description\": \"description\", // [input]: string\n \"changes\": [\n {\n \"subspace\": \"subspace\", // [input]: string\n \"key\": \"key\", // [input]: string\n \"value\": \"value\" // [input]: string\n }\n ]\n }\n },\n \"initial_deposit\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ],\n \"proposer\": \"proposer\" // [input]: string\n }\n}","softwareupgradeproposal#SoftwareUpgradeProposal":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgSubmitProposal\",\n \"value\": {\n \"content\": {\n \"type_url\": \"/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal\",\n \"value\": {\n \"title\": \"title\", // [input]: string\n \"description\": \"description\", // [input]: string\n \"plan\": {\n \"name\": \"name\", // [input]: string\n \"height\": \"height\", // [input]: string\n \"info\": \"info\", // [input]: string\n \"upgraded_client_state\": null // [input]: null or IAny\n }\n }\n },\n \"initial_deposit\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ],\n \"proposer\": \"proposer\" // [input]: string\n }\n}","grant#Grant":"","delegate-grant#Delegate Grant":"{\n \"type_url\": \"/cosmos.authz.v1beta1.MsgGrant\",\n \"value\": {\n \"granter\": \"granter\", // [input]: string\n \"grantee\": \"grantee\", // [input]: string\n \"grant\": {\n \"authorization\": {\n \"type_url\": \"/cosmos.staking.v1beta1.StakeAuthorization\",\n \"value\": {\n \"allow_list\": {\n \"address\": [\"address\", \"address\"] // [input]: string[]\n },\n \"authorization_type\": 1 // [input]: number\n }\n },\n \"expiration\": {\n \"type_url\": \"/google.protobuf.Timestamp\",\n \"value\": {\n \"seconds\": 5325252355 // [input]: number (unix time)\n }\n }\n }\n }\n}","revoke-delegate-grant#Revoke Delegate Grant":"{\n \"type_url\": \"/cosmos.authz.v1beta1.MsgRevoke\",\n \"value\": {\n \"granter\": \"granter\", // [input]: string\n \"grantee\": \"grantee\", // [input]: string\n \"msg_type_url\": \"/cosmos.staking.v1beta1.MsgDelegate\"\n }\n}","authorization-type#Authorization Type":"type AuthorizationType = {\n AUTHORIZATION_TYPE_UNSPECIFIED = 0,\n AUTHORIZATION_TYPE_DELEGATE = 1,\n AUTHORIZATION_TYPE_UNDELEGATE = 2,\n AUTHORIZATION_TYPE_REDELEGATE = 3\n}"}},"/extension/integration/cosmos/react-hook":{"title":"React hook","data":{"installation#Installation":"The Cosmostation wallet hook package lives in npm. To install the latest stable version, run the following command:\nnpm install @cosmostation/use-wallets\nOr if you're using yarn:\nyarn add @cosmostation/use-wallets","cosmosprovider#CosmosProvider":"Components that use cosmos wallet state need CosmosProvider to appear somewhere in the parent tree. A good place to put this is in your root component:\nimport { CosmosProvider } from '@cosmostation/use-wallets';\nfunction App() {\n return (\n \n \n \n );\n}","usecosmoswallets#useCosmosWallets":"With useCosmosWallets, you can select a list of wallets, the wallet you are currently using, and the wallet you want to use.\nThe wallet list is automatically inserted in extensions.If you would like to add a wallet, click here","selectwallet#selectWallet":"import { useCosmosWallets } from '@cosmostation/use-wallets';\nfunction Connect() {\n const { cosmosWallets, selectWallet } = useCosmosWallets();\n return (\n
\n {cosmosWallets.map((wallet) => (\n {\n selectWallet(wallet.id);\n }}\n key={wallet.id}\n >\n {wallet.name} {wallet.name}\n \n ))}\n
\n );\n}","addchain#addChain":"import { useCosmosWallets } from '@cosmostation/use-wallets';\nfunction AddCustomChain() {\n const { currentWallet } = useCosmosWallets();\n return (\n
\n {\n try {\n if (!currentWallet) {\n throw new Error('No Selected Wallet');\n }\n await currentWallet.methods.addChain({\n chain_id: 'custom-chain-1',\n chain_name: 'custom-chain',\n address_prefix: 'custom',\n base_denom: 'ucustom',\n display_denom: 'CUSTOM',\n lcd_url: 'https://rpc.custom-chain.com',\n decimals: 6, // optional\n coin_type: \"118'\", // optional\n });\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Add Custom Chain\n \n
\n );\n}","usecosmosaccount#useCosmosAccount":"With useCosmosAccount, you can get the account information of the wallet you are currently using.","account#Account":"Account automatically requests account information the moment a wallet is selected. If you want to request more manually, you can use 'mutate'.\nType\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function Account() {\n const { data, error, mutate } = useCosmosAccount('cosmoshub-4');\n useEffect(() => {\n console.log('address', data?.account);\n console.log('error', error);\n }, [data, error]);\n return ;\n}","methods#Methods":"the available methods in the selected account. (e.g. sign)\nType","disconnect#disconnect":"import { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function Account() {\n const { data } = useCosmosAccount('cosmoshub-4');\n return ;\n}","signamino#signAmino":"Amino Doc Type\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function SignAmino() {\n const { data } = useCosmosAccount('cosmoshub-4');\n const sendExampleDoc = {\n // ...\n };\n return (\n {\n try {\n if (!data) {\n throw new Error('No data');\n }\n console.dir(await data?.methods.signAmino(sendExampleDoc), { depth: 100 });\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Sign Amino\n \n );\n}","signdirect#signDirect":"Direct Doc Type\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function SignDirect() {\n const { data } = useCosmosAccount('cosmoshub-4');\n const sendExampleDoc = {\n // ...\n };\n return (\n {\n try {\n if (!data) {\n throw new Error('No data');\n }\n const result = await data.methods.signDirect(sendExampleDoc);\n console.dir(result, { depth: 100 });\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Sign Direct\n \n );\n}","signandsendtransaction#signAndSendTransaction":"A method that combines sign and send using signDirect\nReceives message as json and automates creation of protobufJSON e.g.\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function SignAndSendTransaction() {\n const { data } = useCosmosAccount('cosmoshub-4');\n return (\n {\n try {\n if (!data) {\n throw new Error('No data');\n }\n console.dir(\n await data?.methods.signAndSendTransaction({\n messages: [\n {\n type_url: '/cosmos.bank.v1beta1.MsgSend',\n value: {\n from_address: data?.account.address,\n to_address: data?.account.address,\n amount: [\n {\n denom: 'uatom',\n amount: '1',\n },\n ],\n },\n },\n ],\n memo: 'Test (Sign And Send Transaction)',\n }),\n { depth: 100 },\n );\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Sign And Send Transaction\n \n );\n}","signmessage#signMessage":"sign arbitrary bytes\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function SignAndSendTransaction() {\n const { data } = useCosmosAccount('cosmoshub-4');\n return (\n {\n try {\n if (!data) {\n throw new Error('No data');\n }\n if (!data.methods.signMessage) {\n throw new Error('No signMessage method');\n }\n const message = '(test) sign message';\n console.dir(await data.methods.signMessage(message));\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Sign Message\n \n );\n}","verifymessage#verifyMessage":"verify arbitrary bytes\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function SignAndSendTransaction() {\n const { data } = useCosmosAccount('cosmoshub-4');\n return (\n {\n try {\n if (!data) {\n throw new Error('No data');\n }\n if (!data.methods.signMessage) {\n throw new Error('No signMessage method');\n }\n if (!data.methods.verifyMessage) {\n throw new Error('No verifyMessage method');\n }\n const message = '(test) sign message';\n const response = await data.methods.signMessage(message);\n const verify = await data.methods.verifyMessage(message, response.signature);\n console.log(verify ? 'verified' : 'not verified');\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Verify Message\n \n );\n}","type#Type":"","account-1#Account":"interface Account {\n data?: {\n account: CosmosAccount;\n methods: CosmosMethods;\n };\n error?: string;\n mutate: () => void;\n}","cosmosaccount#CosmosAccount":"interface CosmosAccount {\n address: string;\n public_key: {\n type: CosmosPublicKeyType;\n value: string;\n };\n name?: string;\n is_ledger?: boolean;\n}","cosmospublickeytype#CosmosPublicKeyType":"type CosmosPublicKeyType = 'secp256k1' | 'ethsecp256k1';","cosmosmethods#CosmosMethods":"interface CosmosMethods {\n signAndSendTransaction: (\n props: SignAndSendTransactionProps,\n options?: SignOptions,\n ) => Promise;\n signAmino: (\n document: CosmosSignAminoDoc,\n options?: SignOptions,\n ) => Promise;\n signDirect: (\n document: CosmosSignDirectDoc,\n options?: SignOptions,\n ) => Promise;\n sendTransaction: (\n tx_bytes: Uint8Array | string,\n mode?: number,\n ) => Promise;\n getSupportedChainIds: () => Promise;\n signMessage?: (message: string, signer: string) => Promise;\n verifyMessage?: (message: string, signature: string) => Promise;\n}","cosmossignaminodoc#CosmosSignAminoDoc":"interface CosmosSignAminoDoc {\n sequence: string;\n account_number: string;\n fee: {\n amount?: {\n denom: string;\n amount: string;\n }[];\n gas: string;\n };\n memo: string;\n msgs: {\n type: string;\n value: any;\n }[];\n}","cosmossignaminoresponse#CosmosSignAminoResponse":"interface CosmosSignAminoResponse {\n signature: string;\n signed_doc: any;\n}","cosmossigndirectdoc#CosmosSignDirectDoc":"interface CosmosSignDirectDoc {\n account_number: string;\n body_bytes: string | Uint8Array;\n auth_info_bytes: string | Uint8Array;\n}","cosmossigndirectresponse#CosmosSignDirectResponse":"interface CosmosSignDirectResponse {\n signature: string;\n signed_doc: CosmosSignedDoc;\n}","signandsendtransactionprops#SignAndSendTransactionProps":"interface CosmosSignAndSendTransactionProps {\n messages: Message[];\n memo?: string;\n fee?: Fee;\n sequence?: number;\n lcd_url?: string;\n fee_denom?: string;\n gas_rate?: number;\n payer?: string;\n granter?: string;\n}\ninterface CosmosMessage {\n type_url: string;\n value?: unknown;\n}","cosmosfee#CosmosFee":"interface CosmosFee {\n amount: Amount[];\n gas_limit: number;\n payer?: string;\n granter?: string;\n}\ninterface CosmosAmount {\n denom: string;\n amount: number;\n}"}},"/extension/integration/cosmos/vanilla":{"title":"Vanilla","data":{"":"This code can be used without any installation.","account#Account":"Get account information\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const account = await window.cosmostation.cosmos.request({\n method: 'cos_requestAccount',\n params: { chainName: 'cosmoshub-4' },\n });\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Request Account\n","sign#Sign":"","signamino#SignAmino":"Signing with amino in the legacy way.\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const doc = {\n //...\n };\n const response = await window.cosmostation.cosmos.request({\n method: 'cos_signAmino',\n params: { chainName: 'cosmoshub-4', doc },\n });\n console.log(response.signature);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Amino\n","signdirect#SignDirect":"Signing based on protobuf\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const doc = {\n // ...\n };\n const response = await window.cosmostation.cosmos.request({\n method: 'cos_signDirect',\n params: {\n chainName: 'cosmoshub-4',\n doc,\n },\n });\n console.log(response.signatures);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Direct\n","signmessage#SignMessage":"sign arbitrary bytes\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const account = await window.cosmostation.cosmos.request({\n method: 'cos_requestAccount',\n params: { chainName: 'cosmoshub-4' },\n });\n const response = await window.cosmostation.cosmos.request({\n method: 'cos_signMessage',\n params: {\n chainName: 'cosmoshub-4',\n message: 'Test (Sign Message)',\n signer: account.address,\n },\n });\n console.log(response.signature);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Message\n","verifymessage#VerifyMessage":"verify arbitrary bytes\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const message = 'Test (Sign Message)';\n const account = await window.cosmostation.cosmos.request({\n method: 'cos_requestAccount',\n params: { chainName: 'cosmoshub-4' },\n });\n const signResponse = await window.cosmostation.cosmos.request({\n method: 'cos_signMessage',\n params: {\n chainName: 'cosmoshub-4',\n message,\n signer: account.address,\n },\n });\n const verifyResponse = await window.cosmostation.cosmos.request({\n method: 'cos_verifyMessage',\n params: {\n chainName: 'cosmoshub-4',\n message,\n signer: account.address,\n publicKey: signResponse.pub_key.value,\n signature: signResponse.signature,\n },\n });\n console.log(verifyResponse ? 'verified' : 'not verified');\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign & Verify Message\n","addcw20token#AddCW20Token":" {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n await window.cosmostation.cosmos.request({\n method: 'cos_addTokensCW20',\n params: {\n chainName: 'juno-1',\n tokens: [\n {\n contractAddress: '',\n },\n ],\n },\n });\n console.log('added');\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Add CW20 Tokens\n","addcustomchain#AddCustomChain":"Add a chain or testnet chain that is not officially provided by the extension.\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const response = await window.cosmostation.cosmos.request({\n method: 'cos_addChain',\n params: {\n chainId: 'custom-chain-1',\n chainName: 'custom-chain',\n addressPrefix: 'custom',\n baseDenom: 'ucustom',\n displayDenom: 'CUSTOM',\n restURL: 'https://rpc.custom-chain.com',\n decimals: 6, // optional\n coinType: '118', // optional\n },\n });\n console.log(response.tx_response.txhash);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Add a custom chain\n","event#Event":"","addeventlistener#addEventListener":"window.addEventListener('cosmostation_keystorechange', () => {\n console.log('Key store in Cosmostation is changed. You may need to refetch the account info.');\n});","removeeventlistener#removeEventListener":"window.removeEventListener('cosmostation_keystorechange', handler);"}},"/extension/integration/evm/event":{"title":"Event","data":{"accountschanged#accountsChanged":"If current account is connected to the dApp, return an array of address. Otherwise, return an empty array.\nimport { ethers } from \"ethers\";\nimport { ethereum, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await ethereum();\n const handler = provider.on(\"accountsChanged\", (accounts) => {\n if(accounts.length === 0 ) {\n console.log(provider.request({'eth_requestAccounts'}))\n } else {\n console.log(accounts)\n }\n });\n provider.off(handler)\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n // exception\n}","chainchanged#chainChanged":"import { ethers } from \"ethers\";\nimport { ethereum, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await ethereum();\n const handler = provider.on(\"chainChanged\", (chainId) => {\n console.log(chainId);\n });\n provider.off(handler);\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n // exception\n}"}},"/extension/integration/evm/provider":{"title":"Provider","data":{"":"Cosmostation extension support various chains.","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { ethereum, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await ethereum();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n}","vanilla-code#Vanilla Code":"const ethereum = () => {\n if (\"cosmostation\" in window) {\n return window.cosmostation.ethereum;\n } else {\n window.open(\"https://cosmostation.io/wallet/#extension\");\n /**\n * or window.open(\"https://chrome.google.com/webstore/detail/cosmostation/fpkhgmpbidmiogeglndfbkegfdlnajnf\");\n * */\n }\n};\nconst provider = ethereum();"}},"/extension/integration/cosmos/wallet":{"title":"Wallet","data":{"":"The interface of each Cosmos wallet is different, and in order to solve the problem of having to manually attach each wallet to the Dapp, it was developed to automatically add the same interface and wallet.","installation#Installation":"npm install @cosmostation/wallets\nOr if you're using yarn:\nyarn add @cosmostation/wallets","add-wallet#Add Wallet":"To detect a wallet, it is ideal to inject it directly from the extension, but it is also possible to manually inject a wallet that has not been injected into a dapp.Example\nimport { registerCosmosWallet, CosmosRegisterWallet } from '@cosmostation/wallets';\n {\n const wallet: CosmosRegisterWallet = {\n // ...\n };\n registerCosmosWallet(wallet);\n }}\n>\n Register Wallet\n;\ngo to test","example#Example":"This is an example of adding keplr and leap wallet.","keplr#Keplr":"import { registerCosmosWallet, CosmosRegisterWallet } from '@cosmostation/wallets';\n {\n if (!window.keplr) {\n alert('Keplr extension is not installed');\n return;\n }\n const wallet: CosmosRegisterWallet = {\n name: 'Keplr',\n logo: 'https://wallet.keplr.app/keplr-brand-assets/keplr-logo.svg',\n events: {\n on(type, listener) {\n if (type === 'AccountChanged') {\n window.addEventListener('keplr_keystorechange', listener);\n }\n },\n off(type, listener) {\n if (type === 'AccountChanged') {\n window.removeEventListener('keplr_keystorechange', listener);\n }\n },\n },\n methods: {\n getSupportedChainIds: async () => {\n return ['cosmoshub-4'];\n },\n connect: async (chainIds) => {\n const cIds = typeof chainIds === 'string' ? [chainIds] : chainIds;\n const supportedChainIds = await wallet.methods.getSupportedChainIds();\n if (!cIds.every((cId) => supportedChainIds.includes(cId))) {\n throw new Error('Unsupported chainId is exist');\n }\n await window.keplr.enable(chainIds);\n },\n getAccount: async (chainId) => {\n const response = await window.keplr.getKey(chainId);\n return {\n address: response.bech32Address,\n name: response.name,\n public_key: {\n type: response.algo,\n value: Buffer.from(response.pubKey).toString('base64'),\n },\n is_ledger: response.isNanoLedger,\n };\n },\n signAmino: async (chainId, document, options) => {\n if (typeof options?.edit_mode?.fee === 'boolean') {\n window.keplr.defaultOptions.sign.preferNoSetFee = options.edit_mode.fee;\n }\n if (typeof options?.edit_mode?.memo === 'boolean') {\n window.keplr.defaultOptions.sign.preferNoSetMemo = options.edit_mode.memo;\n }\n if (typeof options?.is_check_balance === 'boolean') {\n window.keplr.defaultOptions.sign.disableBalanceCheck = options.is_check_balance;\n }\n const signer = options?.signer || (await wallet.methods.getAccount(chainId)).address;\n const response = await window.keplr.signAmino(chainId, signer, document);\n return {\n signature: response.signature.signature,\n signed_doc: response.signed,\n };\n },\n signDirect: async (chainId, document, options) => {\n if (typeof options?.edit_mode?.fee === 'boolean') {\n window.keplr.defaultOptions.sign.preferNoSetFee = options.edit_mode.fee;\n }\n if (typeof options?.edit_mode?.memo === 'boolean') {\n window.keplr.defaultOptions.sign.preferNoSetMemo = options.edit_mode.memo;\n }\n if (typeof options?.is_check_balance === 'boolean') {\n window.keplr.defaultOptions.sign.disableBalanceCheck = !options.is_check_balance;\n }\n const account = await wallet.methods.getAccount(chainId);\n if (account.is_ledger) {\n throw new Error('Ledger is not supported');\n }\n const signer = options?.signer || account.address;\n const signingDoc = {\n accountNumber: document.account_number,\n authInfoBytes: document.auth_info_bytes,\n chainId: document.chain_id,\n bodyBytes: document.body_bytes,\n };\n const response = await window.keplr.signDirect(chainId, signer, signingDoc);\n return {\n signature: response.signature.signature,\n signed_doc: {\n auth_info_bytes: response.signed.authInfoBytes,\n body_bytes: response.signed.bodyBytes,\n },\n };\n },\n sendTransaction: async (chainId, tx_bytes, mode) => {\n const broadcastMode =\n mode === 1 ? 'block' : mode === 2 ? 'sync' : mode === 3 ? 'async' : 'sync';\n const txBytes =\n typeof tx_bytes === 'string'\n ? new Uint8Array(Buffer.from(tx_bytes, 'base64'))\n : tx_bytes;\n const response = await window.keplr.sendTx(chainId, txBytes, broadcastMode);\n const txHash = Buffer.from(response).toString('hex').toUpperCase();\n return txHash;\n },\n addChain: async (chain) => {\n const coinType = chain.coin_type ? Number(chain.coin_type.replaceAll(\"'\", '')) : 118;\n await window.keplr.experimentalSuggestChain({\n chainId: chain.chain_id,\n chainName: chain.chain_name,\n rpc: chain.lcd_url,\n rest: chain.lcd_url,\n bip44: {\n coinType,\n },\n bech32Config: {\n bech32PrefixAccAddr: chain.address_prefix,\n bech32PrefixAccPub: chain.address_prefix + 'pub',\n bech32PrefixValAddr: chain.address_prefix + 'valoper',\n bech32PrefixValPub: chain.address_prefix + 'valoperpub',\n bech32PrefixConsAddr: chain.address_prefix + 'valcons',\n bech32PrefixConsPub: chain.address_prefix + 'valconspub',\n },\n currencies: [\n {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n },\n ],\n feeCurrencies: [\n {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n gasPriceStep: {\n low: chain?.gas_rate?.tiny ? Number(chain?.gas_rate?.tiny) : 0.01,\n average: chain?.gas_rate?.low ? Number(chain?.gas_rate?.low) : 0.025,\n high: chain?.gas_rate?.average ? Number(chain?.gas_rate?.average) : 0.04,\n },\n },\n ],\n stakeCurrency: {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n },\n });\n },\n },\n };\n registerCosmosWallet(wallet);\n }}\n>\n Register Keplr Wallet\n;","leap#Leap":"import { registerCosmosWallet, CosmosRegisterWallet } from '@cosmostation/wallets';\n {\n if (!window.leap) {\n alert('Leap extension is not installed');\n return;\n }\n const wallet: CosmosRegisterWallet = {\n name: 'Leap',\n logo: 'https://miro.medium.com/v2/resize:fill:176:176/1*2jNLyjIPuU8HBbayPapwcQ.png',\n events: {\n on(type, listener) {\n if (type === 'AccountChanged') {\n window.addEventListener('leap_keystorechange', listener);\n }\n },\n off(type, listener) {\n if (type === 'AccountChanged') {\n window.removeEventListener('leap_keystorechange', listener);\n }\n },\n },\n methods: {\n getSupportedChainIds: async () => {\n return ['cosmoshub-4'];\n },\n connect: async (chainIds) => {\n const cIds = typeof chainIds === 'string' ? [chainIds] : chainIds;\n const supportedChainIds = await wallet.methods.getSupportedChainIds();\n if (!cIds.every((cId) => supportedChainIds.includes(cId))) {\n throw new Error('Unsupported chainId is exist');\n }\n await window.leap.enable(chainIds);\n },\n getAccount: async (chainId) => {\n const response = await window.leap.getKey(chainId);\n return {\n address: response.bech32Address,\n name: response.name,\n public_key: {\n type: response.algo,\n value: Buffer.from(response.pubKey).toString('base64'),\n },\n is_ledger: response.isNanoLedger,\n };\n },\n signAmino: async (chainId, document, options) => {\n if (typeof options?.edit_mode?.fee === 'boolean') {\n window.leap.defaultOptions.sign.preferNoSetFee = options.edit_mode.fee;\n }\n if (typeof options?.edit_mode?.memo === 'boolean') {\n window.leap.defaultOptions.sign.preferNoSetMemo = options.edit_mode.memo;\n }\n if (typeof options?.is_check_balance === 'boolean') {\n window.leap.defaultOptions.sign.disableBalanceCheck = options.is_check_balance;\n }\n const signer = options?.signer || (await wallet.methods.getAccount(chainId)).address;\n const response = await window.leap.signAmino(chainId, signer, document);\n return {\n signature: response.signature.signature,\n signed_doc: response.signed,\n };\n },\n signDirect: async (chainId, document, options) => {\n if (typeof options?.edit_mode?.fee === 'boolean') {\n window.leap.defaultOptions.sign.preferNoSetFee = options.edit_mode.fee;\n }\n if (typeof options?.edit_mode?.memo === 'boolean') {\n window.leap.defaultOptions.sign.preferNoSetMemo = options.edit_mode.memo;\n }\n if (typeof options?.is_check_balance === 'boolean') {\n window.leap.defaultOptions.sign.disableBalanceCheck = !options.is_check_balance;\n }\n const account = await wallet.methods.getAccount(chainId);\n if (account.is_ledger) {\n throw new Error('Ledger is not supported');\n }\n const signer = options?.signer || account.address;\n const signingDoc = {\n accountNumber: document.account_number,\n authInfoBytes: document.auth_info_bytes,\n chainId: document.chain_id,\n bodyBytes: document.body_bytes,\n };\n const response = await window.leap.signDirect(chainId, signer, signingDoc);\n return {\n signature: response.signature.signature,\n signed_doc: {\n auth_info_bytes: response.signed.authInfoBytes,\n body_bytes: response.signed.bodyBytes,\n },\n };\n },\n sendTransaction: async (chainId, tx_bytes, mode) => {\n const broadcastMode =\n mode === 1 ? 'block' : mode === 2 ? 'sync' : mode === 3 ? 'async' : 'sync';\n const txBytes =\n typeof tx_bytes === 'string'\n ? new Uint8Array(Buffer.from(tx_bytes, 'base64'))\n : tx_bytes;\n const response = await window.leap.sendTx(chainId, txBytes, broadcastMode);\n const txHash = Buffer.from(response).toString('hex').toUpperCase();\n return txHash;\n },\n addChain: async (chain) => {\n const coinType = chain.coin_type ? Number(chain.coin_type.replaceAll(\"'\", '')) : 118;\n await window.leap.experimentalSuggestChain({\n chainId: chain.chain_id,\n chainName: chain.chain_name,\n rpc: chain.lcd_url,\n rest: chain.lcd_url,\n bip44: {\n coinType,\n },\n bech32Config: {\n bech32PrefixAccAddr: chain.address_prefix,\n bech32PrefixAccPub: chain.address_prefix + 'pub',\n bech32PrefixValAddr: chain.address_prefix + 'valoper',\n bech32PrefixValPub: chain.address_prefix + 'valoperpub',\n bech32PrefixConsAddr: chain.address_prefix + 'valcons',\n bech32PrefixConsPub: chain.address_prefix + 'valconspub',\n },\n currencies: [\n {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n },\n ],\n feeCurrencies: [\n {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n gasPriceStep: {\n low: chain?.gas_rate?.tiny ? Number(chain?.gas_rate?.tiny) : 0.01,\n average: chain?.gas_rate?.low ? Number(chain?.gas_rate?.low) : 0.025,\n high: chain?.gas_rate?.average ? Number(chain?.gas_rate?.average) : 0.04,\n },\n },\n ],\n stakeCurrency: {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n },\n });\n },\n },\n };\n registerCosmosWallet(wallet);\n }}\n>\n Register Leap Wallet\n;"}},"/extension/integration/evm/use-ethers":{"title":"Use ethers","data":{"":"npmjs\ndocs\nimport { ethers } from \"ethers\";\nimport { ethereum, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await ethereum();\n const ethersProvider = new ethers.providers.Web3Provider(provider);\n // requestAccounts\n const accounts = ethersProvider.send(\"eth_requestAccounts\", []);\n // If you want more info, please check out ethers docs (https://docs.ethers.io)\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n // exception\n}"}},"/extension/integration/evm/use-web3-js":{"title":"Use web3.js","data":{"":"npmjs\ndocs\nimport Web3 from \"web3\";\nimport { ethereum, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await ethereum();\n const web3 = new Web3(provider);\n // requestAccounts\n const accounts = web3.eth.requestAccounts();\n // If you want more info, please check out web3.js docs (https://web3js.readthedocs.io)\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n // exception\n}","signtypeddata#signTypedData":"const provider = await ethereum();\nconst web3 = new Web3(provider);\nconst msgParams = JSON.stringify({\n domain: {\n // Defining the chain aka Rinkeby testnet or Ethereum Main Net\n chainId: 1,\n // Give a user friendly name to the specific contract you are signing for.\n name: \"Ether Mail\",\n // If name isn't enough add verifying contract to make sure you are establishing contracts with the proper entity\n verifyingContract: \"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\",\n // Just let's you know the latest version. Definitely make sure the field name is correct.\n version: \"1\",\n },\n // Defining the message signing data content.\n message: {\n /*\n - Anything you want. Just a JSON Blob that encodes the data you want to send\n - No required fields\n - This is DApp Specific\n - Be as explicit as possible when building out the message schema.\n */\n contents: \"Hello, Bob!\",\n attachedMoneyInEth: 4.2,\n from: {\n name: \"Cow\",\n wallets: [\n \"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\",\n \"0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF\",\n ],\n },\n to: [\n {\n name: \"Bob\",\n wallets: [\n \"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\",\n \"0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57\",\n \"0xB0B0b0b0b0b0B000000000000000000000000000\",\n ],\n },\n ],\n },\n // Refers to the keys of the *types* object below.\n primaryType: \"Mail\",\n types: {\n // TODO: Clarify if EIP712Domain refers to the domain the contract is hosted on\n EIP712Domain: [\n { name: \"name\", type: \"string\" },\n { name: \"version\", type: \"string\" },\n { name: \"chainId\", type: \"uint256\" },\n { name: \"verifyingContract\", type: \"address\" },\n ],\n // Not an EIP712Domain definition\n Group: [\n { name: \"name\", type: \"string\" },\n { name: \"members\", type: \"Person[]\" },\n ],\n // Refer to PrimaryType\n Mail: [\n { name: \"from\", type: \"Person\" },\n { name: \"to\", type: \"Person[]\" },\n { name: \"contents\", type: \"string\" },\n ],\n // Not an EIP712Domain definition\n Person: [\n { name: \"name\", type: \"string\" },\n { name: \"wallets\", type: \"address[]\" },\n ],\n },\n});\nconst from = \"\"; // signer address\nconst params = [from, msgParams];\nconst method = \"eth_signTypedData_v4\";\nconst result = web3.currentProvider.request({\n method,\n params,\n});"}},"/extension/integration/evm/supported-rpc-methods":{"title":"Supported RPC methods","data":{"ethereum-json-rpc-methods#Ethereum JSON-RPC Methods":"For the Ethereum JSON-RPC API, please see the Ethereum wikiImportant methods from this API include:\neth_accounts\neth_call\neth_getBalance\neth_sign\neth_sendTransaction\neth_signTransaction","eth_requestaccounts-eip-1102#eth_requestAccounts (EIP-1102)":"Link","returns#Returns":"string[] - An array of a single, hexadecimal Ethereum address string.","example#Example":"// provider.request or\nwindow.cosmostation.ethereum.request({\n method: \"eth_requestAccounts\",\n});","wallet_addethereumchain-eip-3085#wallet_addEthereumChain (EIP-3085)":"Link","parameters#Parameters":"type WalletAddEthereumChainParam = [\n {\n chainId: string;\n chainName: string;\n blockExplorerUrls?: string[];\n iconUrls?: string[];\n nativeCurrency: {\n name: string;\n symbol: string;\n decimals: number;\n };\n rpcUrls: string[];\n coinGeckoId?: string;\n }\n];","returns-1#Returns":"null - The method returns null if the request was successful, and an error otherwise.","example-1#Example":"// provider.request or\nwindow.cosmostation.ethereum.request({\n method: \"wallet_addEthereumChain\",\n params: [\n {\n chainId: \"0x38\",\n chainName: \"Binance Smart Chain\",\n rpcUrls: [\"https://bsc-dataseed.binance.org\"],\n iconUrls: [\n \"https://www.coinreaders.com/imgdata/coinreaders_com/202107/2021072701234398.png\",\n ],\n nativeCurrency: {\n name: \"BNB\",\n symbol: \"BNB\",\n decimals: 18,\n },\n blockExplorerUrls: [\"https://bscscan.com\"],\n },\n ],\n});","wallet_switchethereumchain-eip-3326#wallet_switchEthereumChain (EIP-3326)":"Link","parameters-1#Parameters":"type WalletSwitchEthereumChainParam = [\n {\n chainId: string;\n }\n];","returns-2#Returns":"null - The method returns null if the request was successful, and an error otherwise.","example-2#Example":"// provider.request or\nwindow.cosmostation.ethereum.request({\n method: \"wallet_switchEthereumChain\",\n params: [{ chainId: \"0x38\" }],\n});","wallet_watchasset-eip-747#wallet_watchAsset (EIP-747)":"Link","parameters-2#Parameters":"type WalletWatchAssetParam = {\n type: string;\n options: {\n address: string;\n symbol: string;\n decimals: number;\n image?: string;\n coinGeckoId?: string;\n };\n};","returns-3#Returns":"boolean - true if the request was successful, error otherwise.","example-3#Example":"// provider.request or\nwindow.cosmostation.ethereum.request({\n method: \"wallet_watchAsset\",\n params: {\n type: \"ERC20\",\n options: {\n address: \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\",\n symbol: \"WETH\",\n decimals: 18,\n },\n },\n});","eth_signtypeddata_v3--eth_signtypeddata_v4#eth_signTypedData_v3 / eth_signTypedData_v4":"","example-4#Example":"const msgParams = JSON.stringify({\n domain: {\n // Defining the chain aka Rinkeby testnet or Ethereum Main Net\n chainId: 1,\n // Give a user friendly name to the specific contract you are signing for.\n name: \"Ether Mail\",\n // If name isn't enough add verifying contract to make sure you are establishing contracts with the proper entity\n verifyingContract: \"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\",\n // Just let's you know the latest version. Definitely make sure the field name is correct.\n version: \"1\",\n },\n // Defining the message signing data content.\n message: {\n /*\n - Anything you want. Just a JSON Blob that encodes the data you want to send\n - No required fields\n - This is DApp Specific\n - Be as explicit as possible when building out the message schema.\n */\n contents: \"Hello, Bob!\",\n attachedMoneyInEth: 4.2,\n from: {\n name: \"Cow\",\n wallets: [\n \"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\",\n \"0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF\",\n ],\n },\n to: [\n {\n name: \"Bob\",\n wallets: [\n \"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\",\n \"0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57\",\n \"0xB0B0b0b0b0b0B000000000000000000000000000\",\n ],\n },\n ],\n },\n // Refers to the keys of the *types* object below.\n primaryType: \"Mail\",\n types: {\n // TODO: Clarify if EIP712Domain refers to the domain the contract is hosted on\n EIP712Domain: [\n { name: \"name\", type: \"string\" },\n { name: \"version\", type: \"string\" },\n { name: \"chainId\", type: \"uint256\" },\n { name: \"verifyingContract\", type: \"address\" },\n ],\n // Not an EIP712Domain definition\n Group: [\n { name: \"name\", type: \"string\" },\n { name: \"members\", type: \"Person[]\" },\n ],\n // Refer to PrimaryType\n Mail: [\n { name: \"from\", type: \"Person\" },\n { name: \"to\", type: \"Person[]\" },\n { name: \"contents\", type: \"string\" },\n ],\n // Not an EIP712Domain definition\n Person: [\n { name: \"name\", type: \"string\" },\n { name: \"wallets\", type: \"address[]\" },\n ],\n },\n});\nconst from = \"\"; // signer address\nconst params = [from, msgParams];\nconst method = \"eth_signTypedData_v4\";\n// provider.request or\nwindow.cosmostation.ethereum.request({\n method,\n params,\n});"}},"/extension/integration/sui/connect-and-get-accounts":{"title":"Connect And Get Accounts","data":{"":"connect and get Account via Cosmostation Extension\nconst response = await window.cosmostation.sui.connect();\n// or\nconst response = await window.cosmostation.sui.connect([\n \"viewAccount\",\n \"suggestTransactions\",\n]);","response#Response":"export type SuiConnectResponse = boolean;\ntrue","get-accounts#Get Accounts":"","vanilla-code#Vanilla Code":"const response = await window.cosmostation.sui.connect();\nconst accounts = await window.cosmostation.sui.getAccounts();\nconst publicKey = await window.cosmostation.sui.getPublicKey();","response-1#Response":"export type SuiAccountResponse = string[];\n[\"0xd2d030d4339531d9cb442caf4be7bb954fddedb4\"]"}},"/extension/integration/sui/execute-move-call":{"title":"Execute Move Call","data":{"":"Execute Move Call via Cosmostation Extension\nconst payload = {\n packageObjectId: \"0x2\",\n module: \"devnet_nft\",\n function: \"mint\",\n typeArguments: [],\n arguments: [\n \"Cosmostation NFT\",\n \"An NFT created by Cosmostation Wallet\",\n \"https://avatars.githubusercontent.com/u/49175386?s=200&v=4\",\n ],\n gasBudget: 10000,\n};\nawait window.cosmostation.sui.connect();\nconst response = await window.cosmostation.sui.executeMoveCall(payload);","request#request":"MoveCallTransaction\nexport interface MoveCallTransaction {\n packageObjectId: ObjectId;\n module: string;\n function: string;\n typeArguments: string[] | TypeTag[];\n arguments: SuiJsonValue[];\n gasPayment?: ObjectId;\n gasBudget: number;\n}","response#Response":"CertifiedTransaction\nTransactionEffects\nexport type SuiTransactionResponse = {\n certificate: CertifiedTransaction;\n effects: TransactionEffects;\n};\n{\n \"certificate\": {\n \"transactionDigest\": \"QTWZUMmBzPReVUPjxPRPs271Zve7C4rtCRHm8Cisz4x\",\n \"data\": {\n \"transactions\": [\n {\n \"Call\": {\n \"package\": {\n \"objectId\": \"0x0000000000000000000000000000000000000002\",\n \"version\": 1,\n \"digest\": \"BN1R9u+4+jOoGiGagW50eT+EE+JxtYLaveBPxHhgsiE=\"\n },\n \"module\": \"devnet_nft\",\n \"function\": \"mint\",\n \"arguments\": [\n \"Cosmostation NFT\",\n \"An NFT created by Cosmostation Wallet\",\n \"https://avatars.githubusercontent.com/u/49175386?s=200&v=4\"\n ]\n }\n }\n ],\n \"sender\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\",\n \"gasPayment\": {\n \"objectId\": \"0x3be2f11263e4c6d77356ba04f053f38ae917bd23\",\n \"version\": 99,\n \"digest\": \"aw8yjNgqA/siJay1eJWv/axflLvGwSM+RbXOilKWAlo=\"\n },\n \"gasPrice\": 1,\n \"gasBudget\": 10000\n },\n \"txSignature\": \"ALSjaMJTiA34zu/d6nnfBH7SxjQvk988NYcNeW8cHJf0zLvriSbIf3/6q7FDtg/5jCNOBknZ38Hmgg0MAhRs7wdWEU2i63wnssWTOQJmMjz5Wq+PhqtBW+GrkSSWOnRKAA==\",\n \"authSignInfo\": {\n \"epoch\": 0,\n \"signature\": \"qhUPMYuuaMqemq+l5a/rDm7VlFmkzXvxtf1gNdwT1xTuNPGYRE0DYBJ+WNnB/D30\",\n \"signers_map\": [\n 58, 48, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 16, 0, 0, 0, 0, 0, 2, 0, 3, 0\n ]\n }\n },\n \"effects\": {\n \"status\": { \"status\": \"success\" },\n \"gasUsed\": {\n \"computationCost\": 464,\n \"storageCost\": 40,\n \"storageRebate\": 16\n },\n \"transactionDigest\": \"QTWZUMmBzPReVUPjxPRPs271Zve7C4rtCRHm8Cisz4x\",\n \"created\": [\n {\n \"owner\": {\n \"AddressOwner\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\"\n },\n \"reference\": {\n \"objectId\": \"0x1eaadc7b76011f5657821a6aa92eae6098689c9a\",\n \"version\": 100,\n \"digest\": \"jJ99SfS/MZIqudWmXmdXU8GChiXFsej27kWDz6FCNeQ=\"\n }\n }\n ],\n \"mutated\": [\n {\n \"owner\": {\n \"AddressOwner\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\"\n },\n \"reference\": {\n \"objectId\": \"0x3be2f11263e4c6d77356ba04f053f38ae917bd23\",\n \"version\": 100,\n \"digest\": \"wgC6a5w4Xqg4D81bOvBiRjkh0m91srqzZP0kLTkCU6Y=\"\n }\n }\n ],\n \"gasObject\": {\n \"owner\": { \"AddressOwner\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\" },\n \"reference\": {\n \"objectId\": \"0x3be2f11263e4c6d77356ba04f053f38ae917bd23\",\n \"version\": 100,\n \"digest\": \"wgC6a5w4Xqg4D81bOvBiRjkh0m91srqzZP0kLTkCU6Y=\"\n }\n },\n \"events\": [\n {\n \"coinBalanceChange\": {\n \"packageId\": \"0x0000000000000000000000000000000000000002\",\n \"transactionModule\": \"gas\",\n \"sender\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\",\n \"changeType\": \"Gas\",\n \"owner\": {\n \"AddressOwner\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\"\n },\n \"coinType\": \"0x2::sui::SUI\",\n \"coinObjectId\": \"0x3be2f11263e4c6d77356ba04f053f38ae917bd23\",\n \"version\": 99,\n \"amount\": -488\n }\n },\n {\n \"newObject\": {\n \"packageId\": \"0x0000000000000000000000000000000000000002\",\n \"transactionModule\": \"devnet_nft\",\n \"sender\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\",\n \"recipient\": {\n \"AddressOwner\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\"\n },\n \"objectType\": \"0x2::devnet_nft::DevNetNFT\",\n \"objectId\": \"0x1eaadc7b76011f5657821a6aa92eae6098689c9a\",\n \"version\": 100\n }\n },\n {\n \"moveEvent\": {\n \"packageId\": \"0x0000000000000000000000000000000000000002\",\n \"transactionModule\": \"devnet_nft\",\n \"sender\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\",\n \"type\": \"0x2::devnet_nft::MintNFTEvent\",\n \"fields\": {\n \"creator\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\",\n \"name\": \"Cosmostation NFT\",\n \"object_id\": \"0x1eaadc7b76011f5657821a6aa92eae6098689c9a\"\n },\n \"bcs\": \"Hqrce3YBH1ZXghpqqS6uYJhonJrd7iW+41+mNKHUhtFigfMzNw7z8hBDb3Ntb3N0YXRpb24gTkZU\"\n }\n }\n ],\n \"dependencies\": [\"CxQQcJfAyDkhxiLiXxrAkFREikMNnngwoGW7kVouMY7w\"]\n }\n}"}},"/extension/integration/sui/provider":{"title":"Provider","data":{"":"Cosmostation extension support various chains.\nconst sui = () => {\n if (\"cosmostation\" in window) {\n return window.cosmostation.sui;\n } else {\n window.open(\"https://cosmostation.io/wallet/#extension\");\n /**\n * or window.open(\"https://chrome.google.com/webstore/detail/cosmostation/fpkhgmpbidmiogeglndfbkegfdlnajnf\");\n * */\n }\n};\nconst provider = sui();"}},"/extension/integration/sui/sign-and-execute-transaction":{"title":"Sign And Execute Transaction","data":{"":"import { TransactionBlock } from \"@mysten/sui.js\";\n// Send Sui coin\nconst tx = new TransactionBlock();\nconst sampleSendCoinAmount = \"100000\";\nconst sampleReceiverAddress = \"0x...\";\nconst [coin] = tx.splitCoins(tx.gas, [tx.pure(sampleSendCoinAmount)]);\ntx.transferObjects([coin], tx.pure(sampleReceiverAddress));\n// SuiSignAndExecuteTransactionBlockInput\nconst payload = {\n transactionBlock: tx,\n options: {\n showInput: true,\n showEffects: true,\n showEvents: true,\n },\n};\nawait window.cosmostation.sui.connect();\nconst response = await window.cosmostation.sui.signAndExecuteTransaction(\n payload\n);","request#request":"SuiSignAndExecuteTransactionBlockInput\nexport interface SuiSignTransactionBlockInput {\n transactionBlock: TransactionBlock;\n account: WalletAccount;\n chain: IdentifierString;\n}\nexport interface SuiSignAndExecuteTransactionBlockInput\n extends SuiSignTransactionBlockInput {\n requestType?: ExecuteTransactionRequestType;\n options?: SuiTransactionBlockResponseOptions;\n}\nexport type SuiTransactionBlockResponseOptions = {\n showInput?: boolean | undefined;\n showEffects?: boolean | undefined;\n showEvents?: boolean | undefined;\n showObjectChanges?: boolean | undefined;\n showBalanceChanges?: boolean | undefined;\n};","response#Response":"SuiTrasactionResponse\nSuiTransactionBlock\nTransactionEffects\nTransactionEvents\nSuiObjectChange\nBalanceChange\nexport type SuiTransactionResponse = {\n digest: TransactionDigest,\n transaction: optional(SuiTransactionBlock),\n effects: optional(TransactionEffects),\n events: optional(TransactionEvents),\n timestampMs: optional(string()),\n checkpoint: optional(string()),\n confirmedLocalExecution: optional(boolean()),\n objectChanges: optional(array(SuiObjectChange)),\n balanceChanges: optional(array(BalanceChange)),\n /* Errors that occurred in fetching/serializing the transaction. */\n errors: optional(array(string())),\n};\n{\n \"digest\": \"ADxukibq4o4QqiMgr6QqtXnXczh5MGCQqMkgCKUW5NXT\",\n \"transaction\": {\n \"data\": {\n \"messageVersion\": \"v1\",\n \"transaction\": {\n \"kind\": \"ProgrammableTransaction\",\n \"inputs\": [\n {\n \"type\": \"pure\",\n \"valueType\": \"u64\",\n \"value\": \"1000000000\"\n },\n {\n \"type\": \"object\",\n \"objectType\": \"sharedObject\",\n \"objectId\": \"\",\n \"initialSharedVersion\": \"1\",\n \"mutable\": true\n },\n {\n \"type\": \"pure\",\n \"valueType\": \"address\",\n \"value\": \"\"\n }\n ],\n \"transactions\": [\n {\n \"SplitCoins\": [\n \"GasCoin\",\n [\n {\n \"Input\": 0\n }\n ]\n ]\n },\n {\n \"MoveCall\": {\n \"package\": \"\",\n \"module\": \"sui_system\",\n \"function\": \"request_add_stake\",\n \"arguments\": [\n {\n \"Input\": 1\n },\n {\n \"Result\": 0\n },\n {\n \"Input\": 2\n }\n ]\n }\n }\n ]\n },\n \"sender\": \"\",\n \"gasData\": {\n \"payment\": [\n {\n \"objectId\": \"\",\n \"version\": 120,\n \"digest\": \"4eWN3j13gkCgmpF3ino3PyBnBGcr8TM9g7oXyLVcFvDf\"\n }\n ],\n \"owner\": \"\",\n \"price\": \"990\",\n \"budget\": \"10269000\"\n }\n },\n \"txSignatures\": [\n \"AOM7i8tZRt314VYWxtBr5DAUukOZJsRcX6YUZjKVzB/j0gyYqCMZ1mIVPFdM79VNXzEpS2Te8Ez7g878a13Ybwz6TRHL+z8z7uHmh38YqSzeZTJS1AuOfKSpuon1IV17MQ==\"\n ]\n },\n \"effects\": {\n \"messageVersion\": \"v1\",\n \"status\": {\n \"status\": \"success\"\n },\n \"executedEpoch\": \"25\",\n \"gasUsed\": {\n \"computationCost\": \"990000\",\n \"storageCost\": \"721559200\",\n \"storageRebate\": \"713064528\",\n \"nonRefundableStorageFee\": \"7202672\"\n },\n \"modifiedAtVersions\": [\n {\n \"objectId\": \"\",\n \"sequenceNumber\": \"1999135\"\n },\n {\n \"objectId\": \"\",\n \"sequenceNumber\": \"1999135\"\n },\n {\n \"objectId\": \"\",\n \"sequenceNumber\": \"120\"\n }\n ],\n \"sharedObjects\": [\n {\n \"objectId\": \"\",\n \"version\": 1999135,\n \"digest\": \"DwbUaKPdp58kXHhh3WGzSnxv1uuzoEP55mmvrZyRqx8Q\"\n }\n ],\n \"transactionDigest\": \"ADxukibq4o4QqiMgr6QqtXnXczh5MGCQqMkgCKUW5NXT\",\n \"created\": [\n {\n \"owner\": {\n \"AddressOwner\": \"\"\n },\n \"reference\": {\n \"objectId\": \"\",\n \"version\": 1999136,\n \"digest\": \"BEEN82jwzg2gku5meXogNQLz1zSnbv9rEFRVu7RhekPd\"\n }\n }\n ],\n \"mutated\": [\n {\n \"owner\": {\n \"Shared\": {\n \"initial_shared_version\": 1\n }\n },\n \"reference\": {\n \"objectId\": \"\",\n \"version\": 1999136,\n \"digest\": \"CgnEEDYNDnAyFb6GzXwvCTC5X1RqAUEGkLQN59dn86Fn\"\n }\n },\n {\n \"owner\": {\n \"ObjectOwner\": \"\"\n },\n \"reference\": {\n \"objectId\": \"\",\n \"version\": 1999136,\n \"digest\": \"7zdHAR9jtbEuaNroxVUUXGgMBJCVF9RRfQ1ACy4sGr8d\"\n }\n },\n {\n \"owner\": {\n \"AddressOwner\": \"\"\n },\n \"reference\": {\n \"objectId\": \"\",\n \"version\": 1999136,\n \"digest\": \"4uYp4yEhf4kcKmdUSZmxao5nGo38mydK93w9Vj6GdmJy\"\n }\n }\n ],\n \"gasObject\": {\n \"owner\": {\n \"AddressOwner\": \"\"\n },\n \"reference\": {\n \"objectId\": \"\",\n \"version\": 1999136,\n \"digest\": \"4uYp4yEhf4kcKmdUSZmxao5nGo38mydK93w9Vj6GdmJy\"\n }\n },\n \"eventsDigest\": \"5MMMagM2CoBtWGL7x39i2H8FeF75LWfFzgZDpzc5YC1H\",\n \"dependencies\": [\n \"Ui22Hhc6NyVEnAhRWCWVT333JvvBWG75qJx9qBg9VE1\",\n \"53k4PWPByFxMLEYu53coAPiFCoxoz1mkUnv2Nr73UFw1\",\n \"6oLy1FVtkMhuknWGsz7cvyYhn5CZFGPnyLhXZYuBd8kh\"\n ]\n },\n \"events\": [\n {\n \"id\": {\n \"txDigest\": \"ADxukibq4o4QqiMgr6QqtXnXczh5MGCQqMkgCKUW5NXT\",\n \"eventSeq\": \"0\"\n },\n \"packageId\": \"\",\n \"transactionModule\": \"sui_system\",\n \"sender\": \"\",\n \"type\": \"0x3::validator::StakingRequestEvent\",\n \"parsedJson\": {\n \"amount\": \"1000000000\",\n \"epoch\": \"25\",\n \"pool_id\": \"\",\n \"staker_address\": \"\",\n \"validator_address\": \"\"\n },\n \"bcs\": \"\"\n }\n ],\n \"confirmedLocalExecution\": true\n}"}},"/":{"title":"Cosmostation","data":{"":"Cosmostation is a committed interchain service provider in the Cosmos ecosystem, established since its genesis in 2019.\nOur array of tools, including Mintscan, Mintscan API, and Cosmostation wallets showcases our dedication to the community. This developer documentation is your guide to understanding and utilizing our offerings for enhanced protocol development.","mintscan#Mintscan":"Mintscan is the second generation blockchain analytics platform specialized in on-chain data visualization.\nExplorer\nData analyzer\nInterchain Hub","api#API":"First Class Access to Indexed Interchain Data. Streamline your connection to Interchain with Mintscan API.\nRPC Endpoint\nHistorical API\nBuilder API\nStatistics API\nCustom API","extension-wallet#Extension Wallet":"Cosmostation is a non-custodial multi-chain cryptocurrency browser extension wallet that supports 50+ chains including Ethereum, Cosmos, Sui, and more.","mobile-wallet#Mobile Wallet":"Industry leading non-custodial mobile wallet supporting 50+ interchain networks. Enjoy native staking, IBC send, voting, and token swap on mobile."}},"/mintscan/registry/cw20":{"title":"How to add your CW20 token info","data":{"":"To add CW20 asset metadata on mintscan assets.\nJuno Cw20 list supporting\nFork this repo to your own github account\\\nClone fork and create new branch\ngit clone git@github.com:YOUR_ACCOUNT/chainlist.git\ncd chainlist\ngit branch \ngit checkout \nAdd the info of your token in the chain that your token needs to be displayed\nIf there is no chain in the list, create a folder for the chain and add info in the folder\nThen add the name of the folder in: supports.json\nChanges will be updated within 24 hours after merged to master\nkey\tvalue\tchainId\t-1\tchainName\tChain with the token\taddress\tToken's contract_address\tsymbol\tName of token's symbol\tdescription\tA brief summary of the token\tdecimals\tDecimal of the token\timage\tImage route of the token /${targetChain}/asset add image in the folder Make sure to upload a png file\tdefault\tdefault value is false\tcoinGeckoId\tCoin gecko site's API ID Empty string if none\t\nCw20 Token\n/${targetChain}/contract.json\n// example JUNO\n[\n {\n \"chainId\": -1,\n \"chainName\": \"juno\",\n \"address\": \"\",\n \"symbol\": \"DAO\",\n \"description\": \"DAO DAO\",\n \"decimals\": 6,\n \"image\": \"juno/asset/dao.png\",\n \"default\": false,\n \"coinGeckoId\": \"\"\n },\n {\n \"chainId\": -1,\n \"chainName\": \"juno\",\n \"address\": \"\",\n \"symbol\": \"NETA\",\n \"description\": \"NETA\",\n \"decimals\": 6,\n \"image\": \"juno/asset/neta.png\",\n \"default\": true,\n \"coinGeckoId\": \"neta\"\n }\n]\nCommit and push to your fork\n git add -A\n git commit -m “Add ”\n git push origin \nFrom your repository, make pull request (PR)"}},"/mintscan":{"title":"Introduction","data":{"":"Mintscan can easily provide information such as validators and assets publicly through Github","to-provide-information#To provide information":"Folk chainlist repository\nAdd the data\nCreate a pull request\nReview and Merge","registry#Registry":"Validator > Moniker\nAssets > Native\nAssets > CW20\nAssets > ERC20\nEcosystem"}},"/mintscan/registry/assets":{"title":"How to add your token info","data":{"":"To add asset metadata on mintscan.\n‼️ Please note that tokens of Testnets and unverified networks may not be merged to master.\nFork this repo to your own github account\nClone fork and create new branch\ngit clone git@github.com:YOUR_ACCOUNT/chainlist.git\ncd chainlist\ngit branch \ngit checkout \nAdd the info of your token in the chain that your token needs to be displayed\nCommon info to fill\nField\tDescription\tdenom\tToken's denom.\ttype\tType of the token:\t\t- staking: Native staking token of a chain.\t\t- native: Native token issued on a chain, not the staking token.\t\t- ibc: Token transferred via IBC.\t\t- pool: Token representing a liquidity pool.\t\t- bridge: Token bridged from another network.\t\t- cw20: CW20 token type.\t\t- erc20: ERC20 token type.\torigin_chain\tThe origin chain where this token was issued.\torigin_denom\tOriginal denom of the token.\torigin_type\tOriginal type of the token (staking, native, pool, ibc, bridge, cw20, erc20).\tsymbol\tDisplayed name of the token in the list.\tdecimals\tToken's decimals.\timage\tImage route of the token (optional).\t\tPlace image in ${targetchain}/asset folder. Ensure it's a png file.\tcoinGeckoId\tCoinGecko site's API ID. Leave empty if none.\t\nIf the type is staking, provide the info below\nField\tDescription\tdescription\tA brief summary of the token\t\nIf the type is ibc, provide the info below:\nField\tDescription\tenable\ttrue if IBC transmission is possible (optional).\tchannel\tToken's IBC channel (optional).\tport\tToken's IBC port (optional).\t\tAdd the token's channel and port.\tcounter_party\tCounter party's IBC channel and port (optional).\t\t- channel.\t\t- port.\t\t- denom: Token's denom before IBC transfer.\tpath\tPath of token transfer (optional).\t\tProvide full details if transferred via IBC, bridge, or other path.\tpath\tPath details for bridge tokens (optional).\t\tProvide details if transferred via IBC, bridge, or other path.\tcontract\tContract address for token transfer via contract (optional).\t\nNative Token\n/assets/v2/${chain}/assets.json\n// example OSMOSIS\n[\n {\n \"denom\": \"uosmo\",\n \"type\": \"staking\",\n \"origin_chain\": \"osmosis\",\n \"origin_denom\": \"uosmo\",\n \"origin_type\": \"staking\",\n \"symbol\": \"OSMO\",\n \"decimals\": 6,\n \"description\": \"Osmosis Staking Coin\",\n \"image\": \"osmosis/asset/osmo.png\",\n \"coinGeckoId\": \"osmosis\"\n },\n {\n \"denom\": \"uion\",\n \"type\": \"native\",\n \"origin_chain\": \"osmosis\",\n \"origin_denom\": \"uion\",\n \"origin_type\": \"native\",\n \"symbol\": \"ION\",\n \"decimals\": 6,\n \"description\": \"Native Coin\",\n \"image\": \"osmosis/asset/ion.png\",\n \"coinGeckoId\": \"ion\"\n },\n // example KUJIRA\n {\n \"denom\": \"factory//uusk\",\n \"type\": \"native\",\n \"origin_chain\": \"kujira\",\n \"origin_denom\": \"factory//uusk\",\n \"origin_type\": \"native\",\n \"symbol\": \"USK\",\n \"decimals\": 6,\n \"description\": \"USK Stable Asset\",\n \"image\": \"kujira/asset/usk.png\",\n \"coinGeckoId\": \"usk\"\n }\n]\nIBC Token\n[\n // example COSMOS\n {\n \"denom\": \"ibc/\",\n \"type\": \"ibc\",\n \"origin_chain\": \"osmosis\",\n \"origin_denom\": \"uosmo\",\n \"origin_type\": \"staking\",\n \"symbol\": \"OSMO\",\n \"decimals\": 6,\n \"enable\": true,\n \"path\": \"osmosis>cosmos\",\n \"channel\": \"channel-141\",\n \"port\": \"transfer\",\n \"counter_party\": {\n \"channel\": \"channel-0\",\n \"port\": \"transfer\",\n \"denom\": \"uosmo\"\n },\n \"image\": \"osmosis/asset/osmo.png\", // Set image route for base_denom\n \"coinGeckoId\": \"osmosis\"\n },\n // example IRIS\n {\n \"denom\": \"ibc/\",\n \"type\": \"ibc\",\n \"origin_denom\": \"weth\",\n \"origin_type\": \"erc20\",\n \"symbol\": \"WETH\",\n \"origin_chain\": \"ethereum\",\n \"decimals\": 18,\n \"enable\": true,\n \"path\": \"ethereum>gravity-bridge>iris\",\n \"channel\": \"channel-29\",\n \"port\": \"transfer\",\n \"counter_party\": {\n \"channel\": \"channel-47\",\n \"port\": \"transfer\",\n \"denom\": \"gravity0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\"\n },\n \"image\": \"ethereum/asset/weth.png\", // Set image route for base_denom\n \"coinGeckoId\": \"weth\",\n \"contract\": \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\"\n }\n]\nBridge Token\n[\n // example GRAVITY-BRIDGE\n {\n \"denom\": \"gravity0x2260fac5e5542a773aa44fbcfedf7c193bc2c599\",\n \"type\": \"bridge\",\n \"origin_chain\": \"ethereum\",\n \"origin_denom\": \"wbtc\",\n \"origin_type\": \"erc20\",\n \"symbol\": \"WBTC\",\n \"decimals\": 8,\n \"path\": \"ethereum>gravity-bridge\",\n \"image\": \"ethereum/asset/wbtc.png\",\n \"coinGeckoId\": \"wrapped-bitcoin\",\n \"contract\": \"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599\"\n },\n // example IRIS\n {\n \"denom\": \"htltbcbusd\",\n \"type\": \"bridge\",\n \"origin_chain\": \"bnb-beacon-chain\",\n \"origin_denom\": \"busd\",\n \"origin_type\": \"bep2\",\n \"symbol\": \"BUSD\",\n \"decimals\": 8,\n \"path\": \"bnb-beacon-chain>iris\",\n \"image\": \"bnb-beacon-chain/asset/busd.png\",\n \"coinGeckoId\": \"binance-usd\"\n }\n]\nPool Token\n// example COSMOS\n[\n {\n \"denom\": \"\",\n \"type\": \"pool\",\n \"origin_chain\": \"cosmos\",\n \"origin_denom\": \"\",\n \"origin_type\": \"pool\",\n \"symbol\": \"GDEX-1\",\n \"decimals\": 6,\n \"description\": \"pool/1\",\n \"image\": \"cosmos/asset/pool.png\", // Add pool image in the target chain’s folder\n \"coinGeckoId\": \"\"\n }\n]\nCommit and push to your fork\ngit add -A\ngit commit -m “Add ”\ngit push origin \nFrom your repository, make pull request (PR)"}},"/mintscan/registry/ecosystem":{"title":"How to add your project on Ecosystem","data":{"":"To add ecosystem on mintscan.\nPlease contact us and provide us with the information below.\nChain\nProject name\nDescription\nUrl\nToken(Optional)\nContact(Optional) : twitter, telegram, discord\nReference(Optional) : Docs, Github, Blog, Reddit\nType : Cosmwasm, EVM, Module\nBanner : 1125 x 600 px"}},"/mintscan/registry/erc20":{"title":"How to add your ERC20 token info","data":{"":"To add erc20 asset metadata on mintscan assets.\nEvmos Erc20 list supporting\nFork this repo to your own github account\nClone fork and create new branch\ngit clone git@github.com:YOUR_ACCOUNT/chainlist.git\ncd chainlist\ngit branch \ngit checkout \nAdd the info of your token in the chain that your token needs to be displayed\nIf there is no chain in the list, create a folder for the chain and add info in the folder\nThen add the name of the folder in: supports.json\nChanges will be updated within 24 hours after merged to master\nkey\tvalue\tchainId\tChainId of the chain\taddress\tToken's contract_address\tchainName\tName of the displayed token\tsymbol\tName of token's symbol\tdecimals\tDecimal of the token\timage\tImage route of the token/${targetChain}/asset add image in the folder Make sure to upload a pngfile\tdefault\tdefault value is false\tcoinGeckoId (optional)\tCoin gecko site's API ID Empty string if none\t\nERC20 Token\n/${targetChain}/contract.json\n[\n {\n \"chainId\": 9001,\n \"chainName\": \"evmos\",\n \"address\": \"0xD4949664cD82660AaE99bEdc034a0deA8A0bd517\",\n \"symbol\": \"WEVMOS\",\n \"description\": \"Wrapped Evmos\",\n \"decimals\": 18,\n \"image\": \"evmos/asset/wevmos.png\",\n \"default\": true,\n \"coinGeckoId\": \"evmos\"\n },\n {\n \"chainId\": 9001,\n \"chainName\": \"evmos\",\n \"address\": \"0xb72A7567847abA28A2819B855D7fE679D4f59846\",\n \"symbol\": \"ceUSDT\",\n \"description\": \"Tether USD (Celer)\",\n \"decimals\": 6,\n \"image\": \"ethereum/asset/usdt.png\",\n \"default\": false,\n \"coinGeckoId\": \"tether\"\n }\n]\nCommit and push to your fork\ngit add -A\ngit commit -m “Add ”\ngit push origin \nFrom your repository, make pull request (PR)"}},"/mintscan/registry/moniker":{"title":"How to add your validator moniker image","data":{"":"To add moniker image on mintscan validator tab.\nAdd your image to ${targetchain}/moniker folder\nImage with png format and validator address name\nExample will display cosmostation validator moniker logo for cosmos"}},"/mintstation/cli":{"title":"CLI Introduction","data":{"introduction#Introduction":"mintstaiond is a command line client for the Mintstation. Mintstation users can use mintstationd to send transactions to the Mintstation network and query the blockchain data.See here for instructions on installing mintstationd.","working-directory-a-hrefworking-directory-idworking-directorya#Working Directory ":"The default working directory for the mintstationd is $HOME/.mintstation, which is mainly used to store configuration files and blockchain data. The Mintstation key data is saved in the working directory of mintstationd. You can also specify the mintstationd working directory by using the --home flag when executing mintstationd.","connecting-to-a-full-node#Connecting to a Full-Node":"By default, mintstationd uses tcp://localhost:26657 as the RPC address to connect to the Mintstation network. This default configuration assumes that the machine executing mintstationd is running as a full-node.The RPC address can be specified to connect to any full-node with an exposed RPC port by adding the --node flag when executing mintstationd"}},"/mintstation/cli/command":{"title":"Useful CLI Commands","data":{"":"Get standard debug info from the mint daemon:\nmintstationd status\nCheck if your node is catching up:\n# Query via the RPC (default port: 26657)\ncurl http://localhost:26657/status | jq .result.sync_info.catching_up\nGet your node ID:\nmintstationd tendermint show-node-id\nCheck if you are jailed or tombstoned:\nmintstationd query slashing signing-info $(mintstationd tendermint show-validator)\nSet the default chain for commands to use:\nmintstationd config chain-id mintstation-1\nGet your valoper address:\nmintstationd keys show -a --bech val\nSee keys on the current box:\nmintstationd keys list\nImport a key from a mnemonic:\nmintstationd keys add --recover\nExport a private key (warning: don't do this unless you know what you're doing!)\nmintstationd keys export --unsafe --unarmored-hex\nWithdraw rewards (including validator commission), where mintvaloper1... is the validator address:\nmintstationd tx distribution withdraw-rewards --from --commission\nStake:\nmintstationd tx staking delegate umint --from \nFind out what the JSON for a command would be using --generate-only:\nmintstationd tx bank send $(mintstationd keys show -a) umint --generate-only\nQuery the results of a gov vote that has ended, from a remote RPC (NB - you have to specify a height before the vote ended):\n mintstationd q gov votes 1 --height --node https://rpc-archive.mintnetwork.io:443\nTransfer mint to another chain (osmosis) with IBC\nmintstationd tx ibc-transfer transfer transfer channel-0 1000000umint --from --node https://rpc-archive.mintnetwork.io:443 --packet-timeout-height 0-0\nQuery the validator set (and jailed status) via CLI:\nmintstationd query staking validators --limit 1000 -o json | jq -r '.validators[] | [.operator_address, (.tokens|tonumber / pow(10; 6)), .description.moniker, .jail, .status] | @csv' | column -t -s\",\" | sort -k2 -n -r | nl\nGet contract state:\nmintstationd q wasm contract-state all "}},"/mintstation/cli/setup":{"title":"Setup CLI","data":{"build#Build":"Build Requirements\nGo 1.20.+\nClone source from repository:\ngit clone https://github.com/cosmostation/mintstation\ncd mintstation\ngit checkout {SET_CURRENT_VERSION}\nOnce you're on the correct tag, you can build:\n# from mintstation dir\nmake install\nTo confirm that the installation has succeeded, you can run:\nmintstationd version\n#v0.0.1","configure#Configure":"Set the chain-id & node,\n#Update config.toml\nmintstationd config chain-id mintstation-1\nmintstationd config node {NODE_RPC_ENDPOINT:PORT}"}},"/mintstation/contracts/compile":{"title":"Compile Contracts","data":{"":"This guide is from the official CosmWasm/rust-optimizer repository. This method of compiling the contract will optimize the final build so that it reduces gas consumption.Example contracts for this can be found at https://github.com/CosmWasm/cw-examples. This repository requires this section to compile since multiple contracts are involved in a single repository.","single-contract-repository#Single Contract Repository":"The easiest way is to simply use the published docker image. You must run this in the root of the smart contract repository you wish to compile. It will produce an artifacts directory with .wasm and contracts.txt containing the hashes. This is just one file.\ndocker run --rm -v \"$(pwd)\":/code \\\n --mount type=volume,source=\"$(basename \"$(pwd)\")_cache\",target=/code/target \\\n --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\\n cosmwasm/rust-optimizer:0.12.11\n# If you you use an ARM machine (Ex: Mac M1), you need to use the following\n# This is experimental and should not be used for production use\ndocker run --rm -v \"$(pwd)\":/code \\\n --mount type=volume,source=\"$(basename \"$(pwd)\")_cache\",target=/code/target \\\n --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\\n cosmwasm/rust-optimizer-arm64:0.12.11\nBy running this in the root of your project, it will compile your contract into an artifacts/ folder. From here you can upload it to chain, collect the store code, and interact with it as you design","multiple-contract-repository-mono-repo#Multiple Contract Repository (Mono Repo)":"Sometime you want many contracts to be related and import common functionality. This is exactly the case of cosmwasm-plus. In such a case, we can often not just compile from root, as the compile order is not deterministic and there are feature flags shared among the repos. This has lead to issues in the past.For this use-case there is second docker image, which will compile all the contracts/* folders inside the workspace and do so one-by-one in alphabetical order. It will then add all the generated wasm files to an artifacts directory with a checksum, just like the basic docker image (same output format).To compile all contracts in the workspace deterministically, you can run:\ndocker run --rm -v \"$(pwd)\":/code \\\n --mount type=volume,source=\"$(basename \"$(pwd)\")_cache\",target=/code/target \\\n --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\\n cosmwasm/workspace-optimizer:0.12.11\n# If you you use an ARM machine (Ex: Mac M1), you need to use the following\n# This is experimental and should not be used for production use\ndocker run --rm -v \"$(pwd)\":/code \\\n --mount type=volume,source=\"$(basename \"$(pwd)\")_cache\",target=/code/target \\\n --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\\n cosmwasm/workspace-optimizer-arm64:0.12.11\nNOTE: See the difference with workspace-optimizer vs rust-optimizer in the previous single contract example.\\"}},"/mintstation/contracts/deploy":{"title":"Deploy Contracts","data":{"prerequisite#PreRequisite":"Make sure you follow the create a contract guide first for your project. Once you have a contract compiled in the artifacts/*.wasm directory, you are ready for this guide.","upload#Upload":"You need to upload the contract via the CLI to chain. To do this, perform the following\nTXFLAGS=\"--chain-id=mintstation-1 --gas-prices=0.025umint --gas=auto --gas-adjustment 1.3\"\nmintstationd tx wasm store artifacts/CONRTACT_NAME.wasm \\\n --from $TXFLAGS -y --broadcast-mode=block\nThis will then return a transaction hash. With this data, you need to query it to get the code id of the contract on chain\nmintstationd q tx --output=json\nThis will return the data about the transaction, and give us the code id of our contract\n{\n \"height\": \"294601\",\n \"txhash\": \"\",\n \"codespace\": \"\",\n \"code\": 0,\n \"data\": \"\",\n \"raw_log\": \"[{\\\"events\\\":[{\\\"type\\\":\\\"message\\\",\\\"attributes\\\":[{\\\"key\\\":\\\"action\\\",\\\"value\\\":\\\"/cosmwasm.wasm.v1.MsgStoreCode\\\"},{\\\"key\\\":\\\"module\\\",\\\"value\\\":\\\"wasm\\\"},{\\\"key\\\":\\\"sender\\\",\\\"value\\\":\\\"mint1hj5fveer5cjtn4wd6wstzugjfdxzl0xps73ftl\\\"}]},{\\\"type\\\":\\\"store_code\\\",\\\"attributes\\\":[{\\\"key\\\":\\\"code_checksum\\\",\\\"value\\\":\\\"\\\"},{\\\"key\\\":\\\"code_id\\\",\\\"value\\\":\\\"13\\\"}]}]}]\",\n \"logs\": [\n {\n \"msg_index\": 0,\n \"log\": \"\",\n \"events\": [\n {\n \"type\": \"message\",\n \"attributes\": [\n {\n \"key\": \"action\",\n \"value\": \"/cosmwasm.wasm.v1.MsgStoreCode\"\n },\n {\n \"key\": \"module\",\n \"value\": \"wasm\"\n },\n {\n \"key\": \"sender\",\n \"value\": \"mint1hj5fveer5cjtn4wd6wstzugjfdxzl0xps73ftl\"\n }\n ]\n },\n {\n \"type\": \"store_code\",\n \"attributes\": [\n {\n \"key\": \"code_checksum\",\n \"value\": \"\"\n },\n {\n \"key\": \"code_id\",\n \"value\": \"13\"\n }\n ]\n }\n ]\n }\n }]\n}\nWe can see both raw_log and also logs[0].events[1].store_code shows the code_id being 13. If you wish the automate this return code in bash to a variable, you can \n# ensure jq is installed\nUPLOAD_TX_HASH=\nCODE_ID=$(mintstationd q tx $UPLOAD_TX_HASH --output json | jq -r '.logs[0].events[] | select(.type == \"store_code\").attributes[] | select(.key == \"code_id\").value') && echo \"Code Id: $CODE_ID\"","instantiate#Instantiate":"With the code now being up on chain, we can now run logic to setup our own copy of the contract which we control. This will then give us a unique contract address for others to interact with in accordance with the contract logic. This example is from the cosmwasm/cw-template.Ensure you change CODE_ID to match your code id from the store code\nFLAGS=\"--chain-id=mintstation-1 --gas-prices=0.025umint --gas=auto --gas-adjustment 1.3\"\n#Example1\nCODE_ID=1\nmintstationd tx wasm instantiate \"$CODE_ID\" '{\"count\":0}' --label \"contract\" $FLAGS -y --admin \n#cw20\nCODE_ID=2\nINIT='{\"name\":\"CW20\",\"symbol\":\"TOKEN\",\"decimals\":2,\"initial_balances\":[{\"amount\":\"1000000\",\"address\":
}]}'\nmintstationd tx wasm instantiate \"$CODE_ID\" \"$INIT\" --from --label \"cw-token\" $FLAGS -y --admin "}},"/mintstation/contracts/create":{"title":"Create Contracts","data":{"":"To implement a wasm smart contract, it is highly recommended to learn Rust first. Rust is the language commonly used for wasm development and is well-regarded for its stability and performance. You can begin your Rust learning journey by referring to the following link:Rust Language Learning GuideFor smart contract development, you can follow the structure provided by CosmWasm's template. This template will help you understand the project's architecture and enable you to develop your contract more systematically. You can find the template at the following link:CosmWasm Template, book.cosmwasm.comAmong the popular smart contract samples, there are cw20 and cw721 implementations. cw20 represents a widely-used token contract, while cw721 implements a Non-Fungible Token (NFT) contract. These samples can be valuable references during your development process. You can explore the code for each sample through the links below:cw20, cw721For all great CosmWasm tools, https://github.com/CosmWasm/awesome-cosmwasmAlthough smart contract development can be complex, leveraging the provided resources will increase your chances of successfully completing your project. Additionally, make sure to actively engage with the community and online resources to continue your learning journey and receive ongoing support. Best of luck!"}},"/mintstation/contracts/execute":{"title":"Execute Contracts","data":{"command-line-interface#Command Line Interface":"When you execute a message, a user can also pass through a flag which sends funds from their account to the contract to do logic. You can check if a user sends any funds in your contract's execute endpoint with the info.funds array of Coins sent by the user. These funds then get added to the contracts balance just like any other account. So it is up to you as the developer to ensure to save how many funds each user has sent via a BTreeMap or other object storage in state (if they can redeem funds back at a later time).To send funds to a contract with some arbitrary endpoint, you use the --amount flag.\nmintstationd tx wasm execute CONTRACT '{\"some_endpoint\":{}}' --amount 1000000umint\nIf the \"some_endpoint\" execute errors on the contract, the funds will remain in the users account.","typescript#Typescript":"import type { Coin } from '@cosmjs/stargate';\nimport { SigningStargateClient, StargateClient, type StdFee } from '@cosmjs/stargate';\nimport type { OfflineAminoSigner } from '@cosmjs/amino';\nimport type { OfflineDirectSigner } from '@cosmjs/proto-signing';\nimport { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate';\nlet RPC = '';\nconst get_wallet_for_chain = async (\n chain_id: string,\n): Promise => {\n // open keplr\n const cosmostation = window as CosmostationWindow;\n if (keplr === undefined) {\n throw new Error('Cosmostation not found');\n }\n let signer = cosmostation.getOfflineSignerAuto;\n if (signer === undefined) {\n throw new Error('Cosmostation not found');\n }\n return signer(chain_id);\n};\nlet wallet = await get_wallet_for_chain('mintstation-1');\nlet address = (await wallet.getAccounts())[0].address;\nlet from_client = await SigningCosmWasmClient.connectWithSigner(RPC, wallet, {\n prefix: 'mint',\n});\nconst msg = { some_endpoint: {} };\nlet fee: StdFee = {\n amount: [{ amount: '5000', denom: 'umint' }],\n gas: '500000',\n};\nlet send_amount: Coin = {\n amount: '100000',\n denom: 'umint',\n};\nawait from_client\n .execute(address, REVIEWS_CONTRACT_ADDRESS, msg, fee, 'memo', send_amount)\n .then((res) => {\n console.log(`Success @ height ${res.height}\\n\\nTxHash: ${res.transactionHash}`);\n });"}},"/mintstation/contracts/query":{"title":"Query Contracts","data":{"command-line-interface#Command Line Interface":"The most common way to query a cosmwasm smart contract is within the mintstationd wasm smart query command. This follows the following format where query is a JSON string with no spaces. By default, the least amount of data this can be is an empty JSON payload '{}'.\nmintstationd query wasm contract-state smart [contract_bech32] [query] [flags]\nFor this example, we are going to use a random NFT contract on the mint chain. This will show you how to brute force query a contract if you have no idea what the query schema of the contract is. At this time, there is no way to query the format of a contract's requests, but this is something many are actively working on.Now we attempt to query this contract address and extract some data from it and get which queries are allowed. As you can see, we pass through a random payload for abcde so that the contract will return actual valid query requestsNOTE: A Query can never be empty such as '{}' given you need to specify the path of data you want to reach.{% hint style=\"info\" %}\nThe query shows CW721 Base is this contracts name. As this is a standard contract, all messages can be found in the CosmWasm/cw-nfts repository on github\nhttps://github.com/CosmWasm/cw-nfts/blob/main/contracts/cw721-base/src/msg.rs\n{% endhint %}From this, we now know all of the query endpoints and can requests something more specific from the contract for our usage. Let's get\nCONTRACT=\nmintstationd q wasm contract-state smart $CONTRACT '{\"all_tokens\":{}}'\ndata:\n tokens:\n - \"0\"\n - \"1\"\n - \"2\"\n - \"3\"\n - \"4\"\n - \"5\"\n - \"6\"\n - \"7\"\n - \"8\"\n# You can use --output=json to read it via JSON form\n# mintstationd q wasm contract-state smart $CONTRACT '{\"all_tokens\":{}}' --output=json | jq .data\nHere we can see there are 8 tokens in this set. Lets query one of the NFTs information\nCONTRACT=\nmintstationd q wasm contract-state smart $CONTRACT '{\"nft_info\":{}}'\n# missing field `token_id`: query wasm contract failed\nJust like the first query, we can see that the payload needs more information. It returned an error that we need to specify the token_id we want the nft_info for. Note, Uint128 sized numbers are read as a string\nCONTRACT=\nmintstationd q wasm contract-state smart $CONTRACT '{\"nft_info\":{\"token_id\":\"8\"}}'\n# data:\n# extension: null\n# token_uri: ipfs:///metadata.json","rest-api-query#Rest API Query":"If you wish to query the data more programmatically with an application such as Python, you may be better suited to use the rest API. You can find these endpoints on https://cosmos.directory/mint/nodes in the REST section.This query endpoint can be found via Mintstation's SwaggerUI. However, some modules you will not be able to easily find the endpoint. To do this, you will need to search through the proto files. Here we know we want to query the cosmwasm module, which is called wasmd on chain. This repo is found at https://github.com/cosmwasm/wasmd.\nIn this module, you can see the proto folder in the root of the repo. This will house the endpoints the module exposes so we can find the above path which. This is a query so we find the query proto file\nhttps://github.com/CosmWasm/wasmd/blob/main/proto/cosmwasm/wasm/v1/query.proto\\\noption go_package = \"github.com/CosmWasm/wasmd/x/wasm/types\";\noption (gogoproto.goproto_getters_all) = false;\noption (gogoproto.equal_all) = false;\n// Query provides defines the gRPC querier service\nservice Query {\n ...\n // SmartContractState get smart query result from the contract\n rpc SmartContractState(QuerySmartContractStateRequest)\n returns (QuerySmartContractStateResponse) {\n option (google.api.http).get =\n \"/cosmwasm/wasm/v1/contract/{address}/smart/{query_data}\";\n }\n ...\n{% hint style=\"info\" %}\nYou must base64 encode the JSON payload for REST API Request. Just take your JSON payload and\n- put it into https://www.base64encode.org/\n- or use Mac / Linux built in command\necho '{\"all_tokens\":{}}' | base64\n# eyJhbGxfdG9rZW5zIjp7fX0K\n{% endhint %}With this, we can now query the contract and gather the data. You can use your web browser, or a library like httpx / requests in Python for automated bots. Be aware that many API providers will late limit the number of requests you can make.\nhttps://api.mint.strange.love/cosmwasm/wasm/v1/contract//smart/eyJhbGxfdG9rZW5zIjp7fX0K\n{\n \"data\": {\n \"tokens\": [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\"]\n }\n}","cosmology-smart-contract-query#Cosmology Smart Contract Query":"Using CosmWasm/ts-codegen, you can create an NPM module to make interactions and queries into dev-friendly Typescript classes to allow you to focus on shipping code.Here are a few tutorials from cosmology:\nts-codegen overview for CosmWasm\nCosmWasm Contract to Typescript npm module\nConfigure CosmWasm ts-codegen in your Contracts repo\nQuery a CosmWasm smart contract from ts-codegen\nEnable React Query\nEnable Recoil\nIntegrate Telescope with ts-codegen"}},"/mintstation/playground":{"title":"Playground","data":{"":"Welcome to Mintstation Playground, it makes easy to connect your wallet to the Mintstation blockchain and build your projects seamlessly.With this project, you can easily connect your wallet in any environment, be it on a PC or mobile device. Using the Mintscan API, you can conveniently build your products with ease.\nMintscan API\nCosmostation Docs\nMintstation provides an environment where you can test and utilize the cosmos-sdk and smart contracts. You can test various features and see the results immediately without the need for setting up a separate network.\nMintstation Mintscan\nMintstation Github","how-to-use#How to use":"Take a look at the code in Mintstation Playground to experience the easiest way to understand the Cosmos SDK and develop a DApp. This is the simplest way to grasp the Cosmos ecosystem.\nGithub : https://github.com/comostation/mintstation-playground\nDemo : https://play-mintstation.web.app/","support-features#Support features":"","dashboard#Dashboard":"Using the Mintscan API, you can easily get history or create a dashboard where you can view asset information at a glance.","faucet#Faucet":"Easily access the Faucet feature to obtain Mintstation tokens for testing and development purposes.","bank-module#Bank Module":"You can easily implement a function that allows you to easily send tokens within Mintstation.","validator-list#Validator List":"Get information about validators within Mintstation.","staking-module#Staking Module":"You can easily implement the function to easily stake and unstake tokens within Mintstation.","tbd--governance-smart-contracts-swap#TBD : Governance, Smart Contracts, Swap":""}},"/mintstation":{"title":"Introduction","data":{"":"Mintstation is a network designed for testing the Cosmos SDK. It provides access to the latest features of the Cosmos ecosystem, allowing users to leverage CosmWasm smart contracts.In this documentation, the following topics are covered:\nLocal network installation\nCLI usage\nRunning a full node and participating as a validator\nUtilizing Cosmwasm for smart contract development\nCustom module development\nMintstation offers a testing ground for developers and users to explore and experiment with the capabilities of the Cosmos SDK while having the ability to interact with CosmWasm smart contracts. The documentation provides comprehensive guidance on setting up a local network, utilizing the CLI, engaging as a validator, and leveraging Cosmwasm for smart contract deployment. Additionally, developers are encouraged to explore custom module development to tailor the network to their specific needs.By providing an environment that maintains the latest features of the Cosmos SDK and supports Cosmwasm smart contracts, Mintstation facilitates a dynamic and insightful experience for individuals and teams working within the Cosmos ecosystem."}},"/mintstation/validator/delegations":{"title":"Delegations","data":{"":"If you wish to perform more extensive testing and require additional delegations, please don't hesitate to get in touch with us at mintstation@cosmostation.io.We are more than happy to provide you with the necessary delegations to support your testing efforts. Our delegation services aim to help you thoroughly evaluate and explore the features and capabilities of our platform.By reaching out to us, you can access a wide range of resources and support to make the most out of your testing experience. Whether you are testing staking, governance, or any other aspects of our system, we want to ensure that you have a beautiful and seamless experience.Feel free to contact us with any specific requirements or questions you may have. Our team at mintstation@cosmostation.io is ready to assist you, and we look forward to supporting your testing journey!"}},"/mintstation/validator/command":{"title":"Useful commands","data":{"upgrade-to-a-validator#Upgrade to a validator":"Do not attempt to upgrade your node to a validator until the node is fully in sync as per the previous step.To upgrade the node to a validator, you will need to submit a create-validator transaction:\nmintstationd tx staking create-validator \\\n --amount 1000000umint \\\n --commission-max-change-rate \"0.1\" \\\n --commission-max-rate \"0.20\" \\\n --commission-rate \"0.1\" \\\n --min-self-delegation \"1\" \\\n --details \"validators write bios too\" \\\n --pubkey=$(mintstationd tendermint show-validator) \\\n --moniker \"$MONIKER_NAME\" \\\n --chain-id $CHAIN_ID \\\n --gas-prices 0.025umint \\\n --from \nThe above transaction is just an example. There are many more flags that can be set to customise your validator, such as your validator website, or keybase.io id, etc. To see a full list:\nmintstationd tx staking create-validator --help\nUnjail\nstationed tx slashing unjail --from --chain-id mintstation-1 --fees 100umint\nTo track your validator's signing history, copy the validator public key:\nmintstationd tendermint show-validator\nUse your validators public key queried above as the validator-pubkey below:\nmintstationd query slashing signing-info \nExample:\nmintstationd query slashing signing-info '{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"HlixoxNZBPq4pBOYEimtSq9Ak4peBISVsIbI5ZHrEAU=\"}'"}},"/mobile":{"title":"Introduction","data":{"":"Mobile wallets support various types of services.\nAccess dApps on desktop/mobile via QR code scanning.\nConnect with dApps from your mobile browser via Deep Link.\nIn-app browser support on mobile wallets.\nCosmostation Mobile Wallet supports dApps through various methods.\nCosmostation(Same way as Extension)\nCosmos-Kit\nWalletConnect 1.0(Deprecated), WalletConnect 2.0\nConnections using Cosmostation and WalletConnect also implement the Keplr and Web3j specifications."}},"/mobile/article":{"title":"Articles","data":{"":"How to Derive(Add) & Manage WalletsWallet Management“dApp” on Cosmostation Mobile WalletIntroducing AuthZ on Cosmostation MobileGas OptimizationKava DeFiOsmosis and Sifchain DEXNFT on Cosmostation MobileStarname Service"}},"/mintstation/validator/localnet":{"title":"Localnet","data":{"setup-local-network#Setup Local Network":"To set up a single local network easily, you can directly run the script below, and it will start working immediately:To get up and running with the mintstationd binary, please follow the instructions here.\nAPP_HOME=\"$HOME/.mintstation\"\nRPC=\"http://localhost:26657\"\nCHAIN_ID=\"localnet-1\"\nMONIKER=\"Moniker\"\nmintstationd init ${MONIKER} --chain-id ${CHAIN_ID} --home ${APP_HOME}\nsed -i -r 's/minimum-gas-prices = \"0stake\"/minimum-gas-prices = \"0.0001umint\"/' ${APP_HOME}/config/app.toml\nsed -i -e 's/\\\"stake\\\"/\\\"umint\\\"/g' ${APP_HOME}/config/genesis.json\nmintstationd keys add validator --keyring-backend test\nMY_VALIDATOR_ADDRESS=$(mintstationd keys show validator --keyring-backend test -a)\nmintstationd add-genesis-account $MY_VALIDATOR_ADDRESS 10000000000umint\nmintstationd gentx validator 10000000umint --chain-id localnet-1 --keyring-backend test\nmintstationd collect-gentxs\nmintstationd start --home ${APP_HOME}"}},"/mobile/integration/walletconnect/accounts":{"title":"Accounts","data":{"":"Use account on Cosmostation Mobile Wallet via WalletConnect.","get-accounts#Get Accounts":"Select an account after checking unsupported chains or empty accounts.The response only contains selected account.\nexport function getAccountRequest(chainIds) {\n return {\n id: payloadId(),\n jsonrpc: \"2.0\",\n method: \"cosmostation_wc_accounts_v1\",\n params: chainIds,\n };\n}\nconst request = getAccountRequest([CHAIN_ID, NOT_SUPPORTED_CHAIN_ID]);\nconnector\n .sendCustomRequest(request)\n .then((accounts) => {\n setAccounts(accounts);\n console.log(accounts.length == 1);\n })\n .catch((error) => {\n console.error(error);\n });\ntype AccountResponse = {\n name: string;\n algo: string;\n address: Uint8Array;\n pubKey: string;\n bech32Address: string;\n};"}},"/mobile/integration/cosmjs":{"title":"Integrate cosmjs","data":{"":"Cosmjs TutorialCosmjs Example CodeCosmjs Example Page","add-package#Add package":"yarn add @cosmostation/cosmos-client\nnpm install @cosmostation/cosmos-client","offline-signer#Offline Signer":"import { getOfflineSigner } from \"@cosmostation/cosmos-client\";\nconst offlineSigner = await getOfflineSigner(CHAIN_ID);\nimport { getOfflineSigner } from \"@cosmostation/cosmos-client\";\nimport { GasPrice, calculateFee } from \"@cosmjs/stargate\";\nimport { SigningCosmWasmClient } from \"@cosmjs/cosmwasm-stargate\";\nconst offlineSigner = await getOfflineSigner(CHAIN_ID);\nconst rpcEndpoint = RPC_END_POINT;\nconst client = await SigningCosmWasmClient.connectWithSigner(\n rpcEndpoint,\n offlineSigner\n);\n//getAccounts\nconst accounts = await offlineSigner.getAccounts();\n//execute\nconst gasPrice = GasPrice.fromString(\"0.01denom\");\nconst fees = {\n upload: calculateFee(1500000, gasPrice),\n init: calculateFee(500000, gasPrice),\n exec: calculateFee(500000, gasPrice),\n};\nconst result = await client.execute(\n accounts[0].address,\n RECEIPT_ADDRESS,\n MESSAGE,\n fees.exec\n);"}},"/mintstation/validator/mainnet":{"title":"Joining Mainnet","data":{"":"To get up and running with the mintstationd binary, please follow the instructions here.","setting-up-the-node#Setting up the Node":"These instructions will direct you on how to initialize your node, synchronize to the network and upgrade your node to a validator.","initialize-the-chain#Initialize the chain":"CHAIN_ID=mintstation-1\nMONIKER_NAME=\nmintstationd init \"$MONIKER_NAME\" --chain-id $CHAIN_ID\nThis will generate the following files in ~/.mintstation/config/\ngenesis.json\nnode_key.json\npriv_validator_key.json","download-the-genesis-file#Download the genesis file":"Download the the geneis file.\n# Download genesis.json file (https://github.com/cosmostation/mintstation)\nrm ~/.mintstation/config/genesis.json\nmv genesis.json $HOME/.mintstation/config/genesis.json\nThis will replace the genesis file created using mintstationd init command with the mainnet genesis.json.","set-seeds#Set seeds":"We can set the seeds by retrieving the list of seeds from the mintstation repo and using sed to inject into ~/.mintstation/config/config.toml:\n# Set the base repo URL for mainnet & retrieve seeds\nCHAIN_ID=mintstation-1\nCHAIN_REPO=\"https://raw.githubusercontent.com/cosmostation/mintstation/main/$CHAIN_ID\" && \\\nexport SEEDS=\"$(curl -sL \"$CHAIN_REPO/seeds.txt\")\"\n# Add seeds to config.toml\nsed -i.bak -e \"s/^seeds *=.*/seeds = \\\"$SEEDS\\\"/\" ~/.mintstation/config/config.toml","set-minimum-gas-prices#Set minimum gas prices":"For RPC nodes and Validator nodes we recommend setting the following minimum-gas-prices. As we are a permissionless wasm chain, this setting will help protect against contract spam and potential wasm contract attack vectors.In $HOME/.mintstation/config/app.toml, set minimum gas prices:\nsed -i.bak -e \"s/^minimum-gas-prices *=.*/minimum-gas-prices = \\\"0.0025umint\\\"/\" ~/.mintstation/config/app.toml","create-or-restore-a-local-key-pair#Create (or restore) a local key pair":"Either create a new key pair, or restore an existing wallet for your validator:\nmintstationd keys add \n# OR\n# Restore existing mint wallet with mnemonic seed phrase.\n# You will be prompted to enter mnemonic seed.\nmintstationd keys add --recover\n# Query the keystore for your public address\nmintstationd keys show --bech val -a\nReplace with a key name of your choosing.After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys.","get-some-tokens#Get some tokens":"Delegations here.","syncing-the-node#Syncing the node":"There are methods to sync a node to the network:","from-genesis#From genesis":"After starting the mintstationd daemon, the chain will begin to sync to the network. The time to sync to the network will vary depending on your setup and the current size of the blockchain, but could take a very long time. To query the status of your node:\n# Query via the RPC (default port: 26657)\ncurl http://localhost:26657/status | jq .result.sync_info.catching_up\nIf this command returns true then your node is still catching up. If it returns false then your node has caught up to the network current block and you are safe to proceed to upgrade to a validator node.When syncing from genesis, you will need to perform upgrades while catching up to the head. mintstation-1 upgrades are detailed in node-upgrade.md along with a description of each type of upgrade.","backup-critical-files#Backup critical files":"There are certain files that you need to backup to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in ~/.mintstation/config/:\npriv_validator_key.json\nnode_key.json\nIt is recommended that you encrypt the backup of these files."}},"/mobile/integration/cosmostation":{"title":"Cosmostation","data":{"":"Using @cosmostation/extension-client to support both Mobile and PC in the same way as extensions.\nIf your project's dApp works well in Cosmostation Extension, it will work well in mobile too.\nFor more detailed explanation, please refer to the Cosmostation Extension Guide."}},"/mobile/integration/walletconnect2":{"title":"WalletConnect 2.0","data":{"":"Cosmostation Mobile Wallet implement WalletConnect 2.0 specs.WalletConnect 2.0 Cosmos GuideWalletConnect 2.0 Example CodeWalletConnect 2.0 Example Page","connect#Connect":"import Client from \"@walletconnect/sign-client\";\nimport {\n PairingTypes,\n ProposalTypes,\n SessionTypes,\n} from \"@walletconnect/types\";\nfunction App() {\n const [client, setClient] = useState();\n const [pairings, setPairings] = useState([]);\n const [session, setSession] = useState();\n const [chains, setChains] = useState([]);\n const [accounts, setAccounts] = useState([]);\n useEffect(() => {\n if (client === undefined) {\n createClient();\n }\n }, [client]);\n const createClient = async () => {\n try {\n const _client = await Client.init({...});\n setClient(_client);\n } catch (err) {\n throw err;\n } finally {\n }\n };\n async function connect() {\n const modal = new Modal();\n if (typeof client === \"undefined\") {\n throw new Error(\"WalletConnect is not initialized\");\n }\n try {\n const requiredNamespaces = getRequiredNamespaces();\n const { uri, approval } = await client.connect({\n pairingTopic: undefined,\n requiredNamespaces: {\n cosmos: {\n methods: [\"cosmos_signDirect\", \"cosmos_signAmino\"],\n chains: [\"cosmos:cosmoshub-4\"],\n events: [],\n },\n },\n });\n if (uri) {\n const standaloneChains = Object.values(requiredNamespaces)\n .map((namespace) => namespace.chains)\n .flat();\n modal.open(uri, standaloneChains);\n }\n const session = await approval();\n console.log(\"Established session:\", session);\n await onSessionConnected(session);\n setPairings(client.pairing.getAll({ active: true }));\n } catch (e) {\n console.error(e);\n } finally {\n modal.close();\n }\n }\n const getRequiredNamespaces = (): ProposalTypes.RequiredNamespaces => {\n return Object.fromEntries(\n chains.map((namespace) => [\n namespace,\n {\n methods: [\"cosmos_signDirect\", \"cosmos_signAmino\"],\n chains: chains.filter((chain) => chain.startsWith(namespace)),\n events: [],\n },\n ])\n );\n };\n const onSessionConnected = useCallback(\n async (_session: SessionTypes.Struct) => {\n const allNamespaceAccounts = Object.values(_session.namespaces)\n .map((namespace) => namespace.accounts)\n .flat();\n const allNamespaceChains = Object.keys(_session.namespaces);\n setSession(_session);\n setChains(allNamespaceChains);\n setAccounts(allNamespaceAccounts);\n },\n []\n );\n}"}},"/mobile/integration/walletconnect/sign-tx":{"title":"Sign Transactions","data":{"":"Sign transcation using Cosmostation Mobile Wallet via WalletConnect.\nexport function getSignTxRequest(chainId, signer, signDoc) {\n return {\n id: payloadId(),\n jsonrpc: \"2.0\",\n method: \"cosmostation_wc_sign_tx_v1\",\n params: [chainId, signer, signDoc],\n };\n}\nconst signDoc = makeAminoSignDoc(\n [message],\n fee,\n CHAIN_ID,\n \"\",\n accountNumber,\n sequence\n);\nconst request = getSignAminoRequest(CHAIN_ID, address, signDoc);\nconnector\n .sendCustomRequest(request)\n .then((response) => {\n const signed = _.get(response, \"0.signed\");\n const signature = _.get(response, \"0.signature\");\n return broadcastTx(signed, signature);\n })\n .then((result) => {\n const code = _.get(result, \"code\");\n if (code === 0) {\n const txHash = _.get(result, \"txhash\");\n console.log(txHash);\n } else {\n const rawLog = _.get(result, \"raw_log\");\n console.error(rawLog);\n }\n });\ntype SignTxResponse = {\n signed: StdSignDoc;\n signature: { signature: string; pub_key: { type: string; value: string } };\n};"}},"/apis/reference/historical/account/account-balances":{"title":"Account Balance History","data":{"get-v1networkaccountsaddressbalances#[GET] /v1/:network/accounts/:address/balances":"Get balance history of an account","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\naddress: cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q\n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4OTc1NTU4NjAwMA==\n# Search start datetime\n# (datetime, optional, default: 30 days ago)\nfromDateTime: 2023-07-20\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59"}},"/mintstation/validator/upgrade":{"title":"Node Upgrades","data":{"upgrades#Upgrades":"Release procedures for validators and node operators are explained here.","upgrade-types#Upgrade types":"There are two types of upgrades that happen on Mintstation Network. They are:\nPlanned feature upgrades or planned patches\nUnplanned security upgrades.","planned-upgrade-via-governance#Planned upgrade (via governance)":"Planned upgrades, as the name suggests, are upgrades that are developed and proposed via governance. If approved by the community, these upgrades are undertaken by the chain automatically halting at the planned upgrade height.Node operators are then required to swap the binary for the planned upgrade binary. After all node operators have upgraded and started their nodes the network will continue in the upgraded state.","unplanned-upgrade#Unplanned upgrade":"Where emergency security patches are required node operators will be required to halt their nodes manually at the required upgrade height, swap the patched binary and restart their nodes. After all node operators have upgraded and started their nodes the network will continue in the upgraded state."}},"/mobile/integration/walletconnect/connect":{"title":"Connect","data":{"":"Cosmostation Mobile Wallet supports dApps via WalletConnect.(Deprecated)WalletConnect Example CodeWalletConnect Example Page\nimport WalletConnect from \"@walletconnect/client\";\nexport async function connect() {\n const connector = new WalletConnect({\n bridge: \"https://bridge.walletconnect.org\",\n signingMethods: [\n \"cosmostation_wc_accounts_v1\",\n \"cosmostation_wc_sign_tx_v1\",\n ],\n qrcodeModal: new CosmostationWCModal(),\n });\n await connector.createSession();\n return connector;\n}","modal#Modal":"Use CosmostationModal when initializing WalletConnect to use DeepLink and QRCode connect.\nyarn add @cosmostation/wc-modal\nimport CosmostationWCModal from \"@cosmostation/wc-modal\";","event#Event":"By implementing connect/disconnect event, handle connect state event.\nconst connector = await connect();\nconnector.on(\"connect\", (error, payload) => {\n if (error) {\n setConnected(false);\n throw error;\n }\n setConnected(true);\n});\nconnector.on(\"disconnect\", (error, payload) => {\n setConnected(false);\n});"}},"/mobile/listing":{"title":"How to dApp listing?","data":{"":"For add your dapp to Mobile Wallet.Create a pull request from the link below.https://github.com/cosmostation/chainlist/blob/main/dapp/README.md"}},"/extension/integration/cosmos/Deprecated/send-tx":{"title":"Send Transcation","data":{"":"Send transcation via Cosmostation Extension","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { SEND_TRANSACTION_MODE } from \"@cosmostation/extension-client/cosmos\";\n// ...\nconst response = await provider.sendTransaction(\n \"cosmos\",\n \"abc=\", // base64 string or Uint8Array\n SEND_TRANSACTION_MODE.ASYNC /* SEND_TRANSACTION_MODE or one of [0, 1, 2, 3] */\n);","vanilla-code#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_sendTransaction\",\n params: { chainName: \"cosmos\", txBytes: \"abc=\", mode: 0 },\n});","response#Response":"export type SendTransactionResponse = {\n tx_response: SendTransaction;\n};\nexport type SendTransaction = {\n code: number;\n txhash: string;\n raw_log?: unknown;\n codespace?: unknown;\n tx?: unknown;\n log?: unknown;\n info?: unknown;\n height?: unknown;\n gas_wanted?: unknown;\n gas_used?: unknown;\n events?: unknown;\n data?: unknown;\n timestamp?: unknown;\n};\nexport const SEND_TRANSACTION_MODE = {\n UNSPECIFIED: 0,\n BLOCK: 1,\n SYNC: 2,\n ASYNC: 3,\n};\n{\n \"tx_response\": {\n \"code\": 0,\n \"codespace\": \"\",\n \"data\": \"\",\n \"events\": [],\n \"gas_used\": \"0\",\n \"gas_wanted\": \"0\",\n \"height\": \"0\",\n \"info\": \"\",\n \"logs\": [],\n \"raw_log\": \"[]\",\n \"timestamp\": \"\",\n \"tx\": null,\n \"txhash\": \"\"\n }\n}"}},"/mintstation/module":{"title":"Building Modules","data":{"":"In this tutorial we will be going over building a module in Mintstation to show how easy it is to build on top of the Mintstation ecosystem. This module will be simple in nature but will show how to set up and connect a module to Mintstation and can be used as a starting point for more complex modules.","set-up#Set up":"git clone https://github.com/cosmostation/mintstation.git","defining-protocol-buffer-types#Defining Protocol Buffer Types":"The first step in building a new Mintstation Module is to define our Module's types. To do that we use Protocol Buffers which is a used for serializing structured data and generating code for multiple target languages, Protocol Buffers are also smaller than JSON & XML so sending data around the network will be less expensive. Learn More.Our Protobuf files will all live in proto/mintstation directory. we will create a new directory with the new module greet and add the following files in the proto/greet/v1beta1/ directory\ngenesis.proto\ngreet.proto\nquery.proto\ntx.proto","defining-the-greet-type#Defining The Greet Type":"Inside the proto/greet/v1beta1/greet.proto file lets define our greet type:\nsyntax = \"proto3\";\npackage mintstation.greet.v1beta1;\nimport \"cosmos_proto/cosmos.proto\";\nimport \"gogoproto/gogo.proto\";\noption go_package = \"github.com/cosmostation/mintstation/x/greet/types\";\nmessage Greet {\nstring owner = 1;\nstring id = 2;\nstring message = 3;\n}\nHere we are saying that we have a Greet type that will have an owner, an id and a message that will contain the greet string. Once we have that defined we are ready to set up a way to create this greet message and query it.","creating-a-new-greeting#Creating a new Greeting":"Inside the proto/greet/v1beta1/tx.proto file lets define our Msg Type:\nsyntax = \"proto3\";\npackage mintstation.greet.v1beta1;\nimport \"gogoproto/gogo.proto\";\nimport \"cosmos_proto/cosmos.proto\";\noption go_package = \"github.com/cosmostation/mintstation/x/greet/types\";\nservice Msg {\n\trpc CreateGreet(MsgCreateGreet) returns (MsgCreateGreetResponse);\n}\nmessage MsgCreateGreet {\nstring message = 1;\nstring owner = 2;\n}\nmessage MsgCreateGreetResponse {}\nNow that we have defined how to create a new Greeting let's finish up by setting up our queries to view a specific greeting or all of them.One thing to note here is that any state changing actions are transactions and for that reason we put them in our tx.proto files, we essentially said we are creating a new state changing message & defined the types for that message in our proto file, we will later add clients to trigger state change, which in our case will be adding a new message to our chain.","querying-greetings#Querying Greetings":"Code inside the proto/greet/v1beta1/query.proto :\nsyntax = \"proto3\";\npackage mintstation.greet.v1beta1;\noption go_package = \"github.com/cosmostation/mintstation/x/greet/types\";\nimport \"gogoproto/gogo.proto\";\nimport \"google/api/annotations.proto\";\nimport \"cosmos/base/query/v1beta1/pagination.proto\";\nimport \"cosmos_proto/cosmos.proto\";\nimport \"mintstation/greet/v1beta1/greet.proto\";\nservice Query {\n\trpc Greet(QueryGetGreetRequest) returns (QueryGetGreetResponse) {\n\toption (google.api.http).get = \"/mintstation/greet/v1beta1/greetings/{id}\";\n\t}\n\trpc GreetAll(QueryAllGreetRequest) returns (QueryAllGreetResponse) {\n\toption (google.api.http).get = \"/mintstation/swap/v1beta1/greetings\";\n\t}\n}\nmessage QueryGetGreetRequest {\nstring id = 1;\n}\nmessage QueryGetGreetResponse {\nGreet greeting = 1;\n}\nmessage QueryAllGreetRequest {\ncosmos.base.query.v1beta1.PageRequest pagination = 1;\n}\nmessage QueryAllGreetResponse {\nrepeated Greet greetings = 1;\ncosmos.base.query.v1beta1.PageResponse pagination = 2;\n}\nOur query.proto now contains the types for our queries, we have defined a request type & a response type and those types will be returned once we trigger a query through the CLI, REST API, or Grpc. The response will follow the same structure regardless of the type of client initiating the request.We defined our query, tx, and greet proto files we finally need to set up the genesis file and then we are ready to generate these types. In the genesis file we will create a minimal genesis.proto for this tutorial to keep things simple.\nsyntax = \"proto3\";\npackage mintstation.greet.v1beta1;\nimport \"mintstation/greet/v1beta1/greet.proto\";\nimport \"gogoproto/gogo.proto\";\nimport \"google/protobuf/timestamp.proto\";\nimport \"cosmos_proto/cosmos.proto\";\noption go_package = \"github.com/cosmostation/mintstation/x/greet/types\";\n// our gensis state message will be empty for this tutorial\nmessage GenesisState {}\nOnce all the files are filled in we are ready to generate our proto types. in the Mintstation Directory run make proto-gen to generate the types, this will create a folder inside the x/greet and will contain the auto-generated proto types.","developing-our-greet-module#Developing Our Greet Module":"we have successfully set up our Proto files & generated them, we now have a x/greet directory generated, this is where we will write our module's code. For starters we will define our module's types in a new file inside x/greet/types/greet.go.","setting-up-constants--importing-packages#Setting up constants & importing packages":"Let's set up some basic constants for our module to help with routing, & fetching items from our store.\npackage types\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"github.com/cosmos/cosmos-sdk/codec\"\n\t\"github.com/cosmos/cosmos-sdk/codec/types\"\n\tsdk \"github.com/cosmos/cosmos-sdk/types\"\n\tsdkerrors \"github.com/cosmos/cosmos-sdk/types/errors\"\n\t\"github.com/cosmos/cosmos-sdk/types/msgservice\"\n)\n// defined our module's constants such as name, routerkey\n// and prefixes for getting items from the store\nconst (\n\tModuleName = \"greet\"\n\tStoreKey = ModuleName\n\tRouterKey = ModuleName\n\tQuerierRoute = ModuleName\n\tGreetKey = \"greet-value-\" // used for getting a greeting from our store\n\tGreetCountKey = \"greet-count-\" // used for getting count from out store\n\tQueryGetGreeting = \"get-greeting\" // used for legacy querier routing\n\tQueryListGreetings = \"list-greetings\"// used for legacy querier routing\n)\n// heler function simply returns []byte out of a prefix string\nfunc KeyPrefix(p string) []byte {\n\treturn []byte(p)\n}\n// returns default genesis state\nfunc DefaultGenesisState() GenesisState {\n\treturn GenesisState{}\n}\n// validates genesis state\nfunc (gs GenesisState) Validate() error {\n\treturn nil\n}","setting-up-our-msg-for-creating-a-new-greeting#Setting up our Msg for creating a new greeting":"Our MsgCreateGreet struct was created when we generated our Proto Types, we now need to use that struct to implement the sdk.Msg interface such that we can create new greetings. the first thing we will do is defined an unnamed variable with the _ syntax and have it implement the sdk.Msg type. This will help us catch unimplemented functions and guide us with syntax highlighting.\n// MsgCreateGreet we defined it here to get type checking\n//to make sure we are immplementing it correctly\nvar _ sdk.Msg = &MsgCreateGreet{}\n// constructor for creating a new greeting\nfunc NewMsgCreateGreet(owner string, message string) *MsgCreateGreet{\n\treturn &MsgCreateGreet{\n\tOwner: owner,\n\tMessage: message,\n\t}\n}\n// does a quick stateless validation on our new greeting\nfunc (m *MsgCreateGreet) ValidateBasic() error {\n\t// ensures address is valid\n\tif _, err := sdk.AccAddressFromBech32(m.Owner); err != nil {\n\t\treturn sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, \"invalid owner address\", err)\n\t}\n\t// ensures the greeting is not empty\n\tif len(strings.TrimSpace(m.Message)) == 0 {\n\t\treturn fmt.Errorf(\"must provide a greeting message\")\n\t}\n\treturn nil\n}\n// gets the signer of the new message which will be the owner of the greeting\nfunc (m *MsgCreateGreet) GetSigners() []sdk.AccAddress {\n\towner, err := sdk.AccAddressFromBech32(m.Owner);\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn []sdk.AccAddress{owner}\n}","registering-our-codec--interfaces#Registering our Codec & interfaces":"now that we have our MsgCreateGreet implement the sdk.Msg interface let's register our codec for marshaling/unmarshaling our greeting we will register both the deprecated legacy amino and the new Interface registry.\n// registers the marshal/unmarsahl for greating a new greeting for our legacy amino codec\nfunc RegisterLegacyAminoCodec(cdc *codec.LegacyAmino){\n\tcdc.RegisterConcrete(&MsgCreateGreet{}, \"greet/CreateGreet\", nil)\n}\n// registers a module's interface types and their concrete implementations as proto.Message.\nfunc RegisterInterfaces(registry types.InterfaceRegistry){\n\tregistry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateGreet{})\n\tmsgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)\n}\nvar amino = codec.NewLegacyAmino()\nvar ModuleCdc = codec.NewAminoCodec(amino)","setting-up-a-basic-keeper#Setting up a basic Keeper":"we have finished up setting up our types, now it's time to implement our greet module's keeper, lets do that in a new folder & package named keeper, create x/greet/keeper/greet_keeper.go .","setting-up-the-keeper-struct--imports#Setting up the Keeper Struct & imports":"keepers are an abstraction over the state defined by a module, every module would have a keeper which would be used to access the state of that module, or if given access a keeper can also use other module's keepers by providing reference to the other module's keeper.\npackage keeper\nimport (\n\t\"context\"\n\t\"strconv\"\n\t\"github.com/cosmos/cosmos-sdk/codec\"\n\t\"github.com/cosmos/cosmos-sdk/store/prefix\"\n\tsdk \"github.com/cosmos/cosmos-sdk/types\"\n\tabci \"github.com/tendermint/tendermint/abci/types\"\n\t\"github.com/cosmostation/mintstation/x/greet/types\"\n\tsdkerrors \"github.com/cosmos/cosmos-sdk/types/errors\"\n)\ntype Keeper struct {\n\tcdc codec.Codec // used to marshall and unmarshall structs from & to []byte\n\tkey sdk.StoreKey // grant access to the store\n}\n// our constructor for creating a new Keeper for this module\nfunc NewKeeper(c codec.Codec, k sdk.StoreKey) Keeper {\n\treturn Keeper{\n\tcdc: c,\n\tkey: k,\n\t}\n}","wiring-up-our-methods-for-handling-new-transactions--queries#Wiring up our methods for handling new transactions & queries":"Now that we have our Keeper Struct written, let's create some receiver functions on our keeper to handle adding a new greeting & looking up a greeting.\n// get greet count will be used for setting an Id when a new greeting is created\nfunc (k Keeper) GetGreetCount(ctx sdk.Context) int64 {\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetCountKey))\n\tbyteKey := types.KeyPrefix(types.GreetCountKey)\n\tbz := store.Get(byteKey)\n\tif bz == nil {\n\t\treturn 0\n\t}\n\tcount, err := strconv.ParseInt(string(bz), 10, 64)\n\tif err != nil {\n\t\tpanic(\"cannot decode count\")\n\t}\n\treturn count\n}\n// sets the greet count\nfunc (k Keeper) SetGreetCount(ctx sdk.Context, count int64){\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetCountKey))\n\tkey := types.KeyPrefix(types.GreetCountKey)\n\tvalue := []byte(strconv.FormatInt(count, 10))\n\tstore.Set(key, value)\n}\n// creates a new greeting\nfunc (k Keeper) CreateGreet(ctx sdk.Context, m types.MsgCreateGreet){\n\tcount := k.GetGreetCount(ctx)\n\tgreet := types.Greet{\n\tId: strconv.FormatInt(count, 10),\n\tOwner: m.Owner,\n\tMessage: m.Message,\n\t}\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))\n\tkey := types.KeyPrefix(types.GreetKey + greet.Id)\n\tvalue := k.cdc.MustMarshal(&greet)\n\tstore.Set(key, value)\n\tk.SetGreetCount(ctx, count + 1)\n}\n// gets a greeting from the store\nfunc (k Keeper) GetGreeting(ctx sdk.Context, key string) types.Greet {\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))\n\tvar Greet types.Greet\n\tk.cdc.Unmarshal(store.Get(types.KeyPrefix(types.GreetKey + key)), &Greet)\n\treturn Greet\n}\n// checks if a greeting exists by an id\nfunc (k Keeper) HasGreet(ctx sdk.Context, id string) bool {\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))\n\treturn store.Has(types.KeyPrefix(types.GreetKey + id))\n}\n// gets the owner of a greeting\nfunc (k Keeper) GetGreetOwner(ctx sdk.Context, key string) string {\n\treturn k.GetGreeting(ctx, key).Owner\n}\n// gets a list of all greetings in the store\nfunc (k Keeper) GetAllGreetings(ctx sdk.Context) (msgs []types.Greet){\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))\n\titerator := sdk.KVStorePrefixIterator(store, types.KeyPrefix(types.GreetKey))\n\tdefer iterator.Close()\n\tfor ; iterator.Valid(); iterator.Next() {\n\t\tvar msg types.Greet\n\t\tk.cdc.Unmarshal(iterator.Value(), &msg)\n\t\tmsgs = append(msgs, msg)\n\t}\n\treturn\n}","handling-queries#Handling queries":"We have added methods for interacting with greetings such as creating or reading them, now let's set up our two query services so we can route them to the correct method, we will set up our legacy Querier & gRPC querier below the methods we defined above on our keeper.\nfunc (k Keeper) GreetAll(c context.Context, req *types.QueryAllGreetRequest) (*types.QueryAllGreetResponse, error){\n\tctx := sdk.UnwrapSDKContext(c)\n\tvar greetings []*types.Greet\n\tfor _, g := range k.GetAllGreetings(ctx) {\n\t\tvar greeting = &g\n\t\tgreetings = append(greetings,greeting)\n\t}\n\treturn &types.QueryAllGreetResponse{Greetings: greetings, Pagination: nil}, nil\n}\nfunc (k Keeper) Greet(c context.Context, req *types.QueryGetGreetRequest) (*types.QueryGetGreetResponse, error){\n\tsdk.UnwrapSDKContext(c)\n\tvar greeting = k.GetGreeting(sdk.UnwrapSDKContext(c), req.Id)\n\treturn &types.QueryGetGreetResponse{Greeting: &greeting}, nil\n}\n// LEGACY QUERIER will be deperacted but for the sake of competeness this is how to set it up\nfunc NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {\n\treturn func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) {\n\tswitch path[0] {\n\t\tcase types.QueryGetGreeting:\n\t\t\tvar getGreetRequest types.QueryGetGreetRequest\n\t\t\terr := legacyQuerierCdc.UnmarshalJSON(req.Data, &getGreetRequest)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())\n\t\t\t}\n\t\t\tval := k.GetGreeting(ctx, getGreetRequest.GetId())\n\t\t\tbz, err := legacyQuerierCdc.MarshalJSON(val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())\n\t\t\t}\n\t\t\treturn bz, nil\n\t\tcase types.QueryListGreetings:\n\t\t\tval := k.GetAllGreetings(ctx)\n\t\t\tbz, err := codec.MarshalJSONIndent(legacyQuerierCdc, val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())\n\t\t\t}\n\t\t\treturn bz, nil\n\t\tdefault:\n\t\t\treturn nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, \"unknow request at %s query endpoint\", types.ModuleName)\n\t\t}\n\t}\n}","setting-up-a-command-to-create-a-new-greeting#Setting up a command to create a new greeting":"let's set up a way for clients to submit a new greeting & query existing greetings, we can do that with a CLI, REST, & gRPC clients. for this tutorial we will focus on setting up our CLI client. create x/greet/client/cli/tx.go.here We will define a command to create a new greeting:\npackage cli\nimport (\n\t\"fmt\"\n\t\"github.com/cosmos/cosmos-sdk/client\"\n\t\"github.com/cosmos/cosmos-sdk/client/flags\"\n\t\"github.com/cosmos/cosmos-sdk/client/tx\"\n\t\"github.com/cosmostation/mintstation/x/greet/types\"\n\t\"github.com/spf13/cobra\"\n)\nfunc GetTxCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\tUse: types.ModuleName,\n\tShort: fmt.Sprintf(\"%s transactions subcommands\", types.ModuleName),\n\tDisableFlagParsing: true,\n\tSuggestionsMinimumDistance: 2,\n\tRunE: client.ValidateCmd,\n\t}\n\tcmd.AddCommand(CmdCreateGreeting())\n\treturn cmd\n}\nfunc CmdCreateGreeting() *cobra.Command {\n\tcmd:= &cobra.Command{\n\tUse: \"create-greeting [message]\",\n\tShort: \"creates a new greetings\",\n\tArgs: cobra.ExactArgs(1),\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tmessage := string(args[0])\n\t\t\tclientCtx, err := client.GetClientTxContext(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tmsg := types.NewMsgCreateGreet(clientCtx.GetFromAddress().String(), string(message))\n\t\t\tif err := msg.ValidateBasic(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)\n\t\t},\n\t}\n\tflags.AddTxFlagsToCmd(cmd)\n\treturn cmd\n}","querying-greetings-1#Querying greetings":"We will now set up two different commands for querying, one will be to list all greetings & the other will be to get a greeting by it's id. inside x/greet/cli/query.go:\npackage cli\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/cosmos/cosmos-sdk/client\"\n\t\"github.com/cosmos/cosmos-sdk/client/flags\"\n\t\"github.com/cosmostation/mintstation/x/greet/types\"\n\t\"github.com/spf13/cobra\"\n)\n// this is the parent query command for the greet module everytime we add a new command we will register it here\nfunc GetQueryCmd(queryRoute string) *cobra.Command {\n// Group todos queries under a subcommand\n\tcmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: fmt.Sprintf(\"Querying commands for the %s module\", types.ModuleName),\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\tcmd.AddCommand(CmdListGreetings())\n\tcmd.AddCommand(CmdShowGreeting())\n\treturn cmd\n}\n// build the list greet command function\nfunc CmdListGreetings() *cobra.Command {\n\tcmd := &cobra.Command{\n\tUse: \"list-greetings\",\n\tShort: \"list all greetings\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tclientCtx, err := client.GetClientTxContext(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpageReq, err := client.ReadPageRequest(cmd.Flags())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tqueryClient := types.NewQueryClient(clientCtx)\n\t\t\tparams := &types.QueryAllGreetRequest{\n\t\t\tPagination: pageReq,\n\t\t\t}\n\t\t\tres, err := queryClient.GreetAll(context.Background(), params)\n\t\t\tif err != nil {\n\t\t\treturn err\n\t\t\t}\n\t\t\treturn clientCtx.PrintProto(res)\n\t\t},\n\t}\n\tflags.AddQueryFlagsToCmd(cmd)\n\treturn cmd\n}\n// build the show greet command function\nfunc CmdShowGreeting() *cobra.Command {\n\tcmd := &cobra.Command{\n\tUse: \"get-greeting [id]\",\n\tShort: \"shows a greeting\",\n\tArgs: cobra.ExactArgs(1),\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tclientCtx, err := client.GetClientTxContext(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tqueryClient := types.NewQueryClient(clientCtx)\n\t\t\tparams := &types.QueryGetGreetRequest{\n\t\t\tId: args[0],\n\t\t\t}\n\t\t\tres, err := queryClient.Greet(context.Background(), params)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn clientCtx.PrintProto(res)\n\t\t},\n\t}\n\tflags.AddQueryFlagsToCmd(cmd)\n\treturn cmd\n}","setting-up-our-modules-package#Setting up our Module's package":"Now that we have all the basic functionality set up for our greet module, let's bring it all together and get our module ready to be used & tested, create a new file x/greet/module.go.Here we will start by implementing our AppModuleBasic && AppModule interfaces.\npackage greet\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"github.com/cosmos/cosmos-sdk/client\"\n\t\"github.com/cosmos/cosmos-sdk/codec\"\n\tcdctypes \"github.com/cosmos/cosmos-sdk/codec/types\"\n\tsdk \"github.com/cosmos/cosmos-sdk/types\"\n\t\"github.com/cosmos/cosmos-sdk/types/module\"\n\t\"github.com/gorilla/mux\"\n\t\"github.com/grpc-ecosystem/grpc-gateway/runtime\"\n\t\"github.com/cosmostation/mintstation/x/greet/client/cli\"\n\t\"github.com/cosmostation/mintstation/x/greet/keeper\"\n\t\"github.com/cosmostation/mintstation/x/greet/types\"\n\t\"github.com/spf13/cobra\"\n\tabci \"github.com/tendermint/tendermint/abci/types\"\n)\nvar (\n\t_ module.AppModule = AppModule{}\n\t_ module.AppModuleBasic = AppModuleBasic{}\n)\n/*\nThe AppModuleBasic interface defines the independent methods modules need to implement\nit follows this interface below\ntype AppModuleBasic interface {\n\tName() string\n\tRegisterLegacyAminoCodec(*codec.LegacyAmino)\n\tRegisterInterfaces(codectypes.InterfaceRegistry)\n\tDefaultGenesis(codec.JSONMarshaler) json.RawMessage\n\tValidateGenesis(codec.JSONMarshaler, client.TxEncodingConfig, json.RawMessage) error\n\t// client functionality\n\tRegisterRESTRoutes(client.Context, *mux.Router)\n\tRegisterGRPCRoutes(client.Context, *runtime.ServeMux)\n\tGetTxCmd() *cobra.Command\n\tGetQueryCmd() *cobra.Command\n}\n*/\ntype AppModuleBasic struct{}\n// Returns the name of the module as a string\nfunc (AppModuleBasic) Name() string {\n\treturn types.ModuleName\n}\nfunc (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {\n\tgs := types.DefaultGenesisState()\n\treturn cdc.MustMarshalJSON(&gs)\n}\nfunc (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error {\n\treturn nil\n}\n// Registers the amino codec for the module, which is used to marshal\n// and unmarshal structs to/from []byte in order to persist them in the module's KVStore.\nfunc (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino){\n\ttypes.RegisterLegacyAminoCodec(cdc)\n}\n// Registers a module's interface types and their concrete implementations as proto.Message\nfunc (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) {\n\ttypes.RegisterInterfaces(registry)\n}\n// Registers gRPC routes for the module.\nfunc (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {\n\tif err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {\n\t\tpanic(err)\n\t}\n}\n// Registers the REST routes for the module. These routes will be used to map REST request to the module in order to process them\nfunc (a AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { }\n// Returns the root Tx command for the module. The subcommands of this root command are used by end-users\n// to generate new transactions containing messages defined in the module\nfunc (AppModuleBasic) GetTxCmd() *cobra.Command {\n\treturn cli.GetTxCmd()\n}\n// Return the root query command for the module. The subcommands of this root command are used by end-users\n// to generate new queries to the subset of the state defined by the module.\nfunc (AppModuleBasic) GetQueryCmd() *cobra.Command {\n\treturn cli.GetQueryCmd(types.StoreKey)\n}\n// -------------------------------------APPMODULE BELOW------------------------------------------------- //\n/*\nThe AppModule interface defines the inter-dependent methods that modules need to implement\nfollows the interface below\n\ttype AppModule interface {\n\t\tAppModuleGenesis\n\t\t// registers\n\t\tRegisterInvariants(sdk.InvariantRegistry)\n\t\t// routes\n\t\tRoute() sdk.Route\n\t\t// Deprecated: use RegisterServices\n\t\tQuerierRoute() string\n\t\t// Deprecated: use RegisterServices\n\t\tLegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier\n\t\t// RegisterServices allows a module to register services\n\t\tRegisterServices(Configurator)\n\t\t// ABCI\n\t\tBeginBlock(sdk.Context, abci.RequestBeginBlock)\n\t\tEndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate\n\t}\n*/\ntype AppModule struct{\n\tAppModuleBasic\n\tkeeper keeper.Keeper\n}\n// constructor\nfunc NewAppModule(keeper keeper.Keeper) AppModule {\n\treturn AppModule{\n\t\tAppModuleBasic: AppModuleBasic{},\n\t\tkeeper: keeper,\n\t}\n}\n// Returns the route for messages to be routed to the module by BaseApp.\nfunc (am AppModule) Name() string {\n\treturn am.AppModuleBasic.Name()\n}\n// registers the invariants of the module. If an invariant deviates from its predicted value,\n// the InvariantRegistry triggers appropriate logic (most often the chain will be halted).\nfunc (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { }\n// Returns the route for messages to be routed to the module by BaseApp.\nfunc (AppModule) Route() sdk.Route {\n\treturn sdk.Route{}\n}\n// Returns the name of the module's query route, for queries to be routes to the module by BaseApp.deprecated\nfunc (AppModule) QuerierRoute() string {\n\treturn types.QuerierRoute\n}\n// Returns a querier given the query path, in order to process the query.\nfunc (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {\n\treturn keeper.NewQuerier(am.keeper, legacyQuerierCdc)\n}\nfunc (AppModule) ConsensusVersion() uint64 {\n\treturn 1\n}\n// Allows a module to register services.\nfunc (am AppModule) RegisterServices(cfg module.Configurator) {\n\ttypes.RegisterMsgServer(cfg.MsgServer(), NewMsgServerImpl(am.keeper))\n\ttypes.RegisterQueryServer(cfg.QueryServer(), am.keeper)\n}\nfunc (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate {\n\treturn []abci.ValidatorUpdate{}\n}\nfunc (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {\n\tgs := types.DefaultGenesisState()\n\treturn cdc.MustMarshalJSON(&gs)\n}\nfunc (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { }\nfunc (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {\n\treturn []abci.ValidatorUpdate{}\n}\n// ----------------------------------MSGSERVER REGISTER------------------------//\nvar _ types.MsgServer = msgServer{}\ntype msgServer struct {\n\tkeeper keeper.Keeper\n}\nfunc (m msgServer) CreateGreet(c context.Context, msg *types.MsgCreateGreet) (*types.MsgCreateGreetResponse, error) {\n\tctx := sdk.UnwrapSDKContext(c)\n\tm.keeper.CreateGreet(ctx, types.MsgCreateGreet{Owner: msg.Owner, Message: msg.Message})\n\treturn &types.MsgCreateGreetResponse{}, nil\n}\nfunc NewMsgServerImpl(keeper keeper.Keeper) types.MsgServer {\n\treturn &msgServer{keeper: keeper}\n}","hooking-up-our-module-inside-appgo#Hooking up our module inside App.go":"inside app/app.go start off importing the greet module, it's types & keeper packages and add them to the following places:\nmodule.NewBasicManager() add greet.AppModuleBasic{}\ntype App struct {} add greetkeeper.Keeper\nsdk.NewKVStoreKeys() inside NewApp func add greettypes.StoreKey\ninside NewApp func add app.greetKeeper = greetKeeper.NewKeeper() and add arguments appCodec & keys[greettypes.StoreKey]\ninside NewApp find where we define app.mm & add greet.NewAppModule(app.greetKeeper),\nfinally add the greet module's name to SetOrderBeginBlockers, SetOrderEndBlockers && SetOrderInitGenesis","testing-our-new-module#Testing our new Module":"inside the root of our directory run docker build -t mintstation/mintstation:tutorial-demo .\nfind the directory for kvtool and open in your favorite code editor\nrun kvtool testnet gen-config mintstation --mintstation.configTemplate upgrade-v44 which will create a bunch of files inside full_configs/generated\nopen up the two docker-compose.yaml files the one inside generated & the one inside generated/mintstation and change the image to point to mintstation/mintstation:tutorial-demo this will point to the local image we just built\nchange into the full_configs/generated directory and run docker compose up -d\nnow run docker compose exec mintstationnode bash to bash into our mintstation cli inside the running container\nWe should now have access to our greet commands that we defined first we will test creating a new greeting, for that we will run the following command:mintstationd tx greet create-greeting \"hello world from mintstation chain\" --from whalenow let's test to see if the greeting message is able to be queried:mintstationd q greet list-greetingsWe should see something like this below:\ngreetings:\n- id: \"0\"\n message: hello world from mintstation chain\n owner: \npagination: null\nNow let's test if we can query the greeting by it's id which in our case will be \"0\", run the following:mintstationd q greet get-greeting 0We should see:\ngreeting:\n id: \"0\"\n message: hello world from mintstation chain\n owner: "}}} \ No newline at end of file +{"/apis":{"title":"Introduction","data":{"":"Mintscan API, integral to Mintscan 2.0, stems from enterprise-grade onchain data indexing. Through features like tx builder and historical statistics APIs, it offers easy access to dynamic onchain data, including account balances and staking APR. Streamlining raw data processing, Mintscan API simplifies Interchain dapp development, positioning itself as a key piece in the Interchain infrastructure puzzle.For inquery, please contact us api@cosmostation.io","how-to-get-api-key#How to get API Key?":"Get start sign upCurrently in beta, approval is being processed via email(api@cosmostation.io).","features#Features":"RPC Endpoint\nHistorical API\nProto Builder API\nStatistics API\nUtility API\nCustom API","supported-chain-list#Supported chain list":"Akash\nArchway\nCosmos\nCelestia\ndYdX\nEvmos\nInjective\nJuno\nKava\nNeutron\nOsmosis\nStride","api-reference#API Reference":"Type\tAPI\tCredit\tProxy API\tLCD Proxy\t1\tCustom API\tAccount\t5\tStatistics API\tTransaction Statistics\t3\t\tMessage Statistics\t3\tBuilder API\tTransaction Builder\t5 ~ 10\tHistorical API\tAccount Transactions\t5\t\tAccount Votes\t5\t\tAccount Balance History\t7\t\tRichlist\t10\t\tValidator Votes\t5\t\tValidator Commission History\t5\t\tValidator Delegators\t10\t\tValidator Block Sign\t1\t\tValidator Voting Power\t1\t\tValidator Proposed Blocks\t1\tUtility API\tNode Info\t5\t\tInflation\t3\t\tStaking APR\t5\t\tAssets\t3\t\tPrices\t3 ~ 5"}},"/apis/reference/builder/tx-builder/broadcast":{"title":"Broadcast Transaction","data":{"post-v1networktx-builderbroadcast#[POST] /v1/:network/tx-builder/broadcast":"","request#Request":"Authorization: Bearer {access_token}\nContent-Type: application/json\n{\n // Original message of the tx from the result of the Build Transaction API Call\n \"tx\": string,\n // Generated using the user’s private key and the tx from the result of the Build Transaction API Call.\n \"signature\": string\n}","response#Response":"{\n \"tx_response\": {\n \"height\": \"0\",\n \"txhash\": \"\",\n \"codespace\": \"\",\n \"code\": 0,\n \"data\": \"\",\n \"raw_log\": \"[]\",\n \"logs\": [],\n \"info\": \"\",\n \"gas_wanted\": \"0\",\n \"gas_used\": \"0\",\n \"tx\": null,\n \"timestamp\": \"\",\n \"events\": []\n }\n}"}},"/apis/reference/builder/tx-builder/make-signature":{"title":"How Make Signature","data":{"":"This documentation page provides an example of generating a signature using the tx (SignDoc) produced in the Build Transaction process.\nThe example code in this document is written in Node.js. Users can implement the sign logic based on their respective programming language.\n// Import packages for sign\nimport * as TinySecp256k1 from 'tiny-secp256k1';\nimport * as encHex from 'crypto-js/enc-hex';\nimport * as sha256 from 'crypto-js/sha256';\n// Define a custom function to execute the logic described on the Build Transaction page.\n// Each user can implement their own version of this function and use it accordingly\nconst buildResult = await buildTx();\n/* Example of result\n {\n \"tx\": \"\",\n \"messages\": [\n {\n \"type\": \"cosmos.staking.v1beta1.MsgDelegate\",\n \"delegatorAddress\": \"osmo1gr0e3pj3y6fqvzyam0qxyw9h5dwfrvh8zv3x9p\",\n \"validatorAddress\": \"\",\n \"amount\": { \"denom\": \"uosmo\", \"amount\": \"1\" }\n }\n ],\n \"fee\": { \"amount\": [{ \"denom\": \"uosmo\", \"amount\": \"760\" }], \"gas\": \"303815\" },\n \"publicKey\": {\n \"@type\": \"/cosmos.crypto.secp256k1.PubKey\",\n \"key\": \"A00Jvfv1luvAODaiOPIMZpDTWSq7qvoFV8k7ptdsDqLU\"\n },\n \"accountNumber\": \"63277\",\n \"sequence\": \"12\"\n}\n*/\n// Removes the '0x' string from the beginning of the tx.\nconst signDoc = buildResult.tx.replace(/^0x(.*)/, '$1');\n// SignDoc Example: \n// The part that creates a Buffer using the user's Private Key.\n// If the Private Key starts with '0x', the '0x' prefix is removed and the value is used.\nconst privateKey = Buffer.from(\n '',\n 'hex',\n);\nconst hashedSignDoc = sha256(encHex.parse(signDoc)).toString(encHex);\nconst signResult = TinySecp256k1.sign(Buffer.from(hashedSignDoc, 'hex'), privateKey);\nconst signatureHex = Buffer.from(signResult).toString('hex');\n// Use this to broadcast the transaction\nconst signature = `0x${signatureHex}`;\n// Example: "}},"/apis/reference/builder/tx-builder/build":{"title":"Build Transactions","data":{"post-v1networktx-builder#[POST] /v1/:network/tx-builder":"This API returns the SignDoc data for broadcasting transactions.\nThe response includes tx for generating the signature, original messages used to create the SignDoc, fee value, and basic information of the account.\nUsers can either generate the signature directly without 0x from the value and broadcast it, or use the provided broadcast API to send the tx.\nMulti sign account is not supported yet.","request#Request":"Authorization: Bearer {access_token}\nContent-Type: application/json","response#Response":"{\n // SignDoc for generating the signature. Use the data without '0x'\n \"tx\": \"\",\n // Original data that user transfer\n \"messages\": [\n {\n \"type\": \"cosmos.staking.v1beta1.MsgDelegate\",\n \"delegatorAddress\": \"osmo1gr0e3pj3y6fqvzyam0qxyw9h5dwfrvh8zv3x9p\",\n \"validatorAddress\": \"\",\n \"amount\": { \"denom\": \"uosmo\", \"amount\": \"1\" }\n }\n ],\n // Transaction fee\n \"fee\": { \"amount\": [{ \"denom\": \"uosmo\", \"amount\": \"760\" }], \"gas\": \"303815\" },\n // Account public key of signer\n \"publicKey\": {\n \"@type\": \"/cosmos.crypto.secp256k1.PubKey\",\n \"key\": \"A00Jvfv1luvAODaiOPIMZpDTWSq7qvoFV8k7ptdsDqLU\"\n },\n // Account number of signer\n \"accountNumber\": \"63277\",\n // Account sequence of signer\n \"sequence\": \"12\"\n}","how-to-make-a-public-key-from-private-key#How to make a public key from private key":"const privateKey = Buffer.from(\n '',\n 'hex',\n);\nconst pubKeyUint8Array = TinySecp256k1.pointFromScalar(privateKey, true);\nif (!pubKeyUint8Array) {\n throw new Error('Invalid private key');\n}\n// Use this publicKey when sending a transaction (tx) for the first time.\nconst publicKey = Buffer.from(pubKeyUint8Array).toString('base64');","send-transaction#Send Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.bank.v1beta1.MsgSend\",\n // Sender Address\n \"fromAddress\": \"string\",\n // Receiver Address\n \"toAddress\": \"string\",\n // Amount Array\n \"amount\": [\n {\n \"denom\": \"string\",\n \"amount\"\": string\"\n }\n ]\n }\n ]\n}","delegate-transaction#Delegate Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.staking.v1beta1.MsgDelegate\",\n // Sender Address\n \"delegatorAddress\": \"string\",\n // Validator Address to delegate\n \"validatorAddress\": \"string\",\n // Amount\n \"amount\": {\n \"denom\": \"string\",\n \"amount\"\": string\"\n }\n }\n ]\n}","undelegate-transaction#Undelegate Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.staking.v1beta1.MsgUndelegate\",\n // Sender Address\n \"delegatorAddress\": \"string\",\n // Validator Address to undelegate\n \"validatorAddress\": \"string\",\n // Amount\n \"amount\": {\n \"denom\": \"string\",\n \"amount\"\": string\"\n }\n }\n ]\n}","begin-redelegate-transaction#Begin Redelegate Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.staking.v1beta1.MsgBeginRedelegate\",\n // Sender Address\n \"delegatorAddress\": \"string\",\n // From Validator Address to redelegate\n \"validatorSrcAddress\": \"string\",\n // To Validator Address to redelegate\n \"validatorDstAddress\": \"string\",\n // Amount\n \"amount\": {\n \"denom\": \"string\",\n \"amount\"\": string\"\n }\n }\n ]\n}","claim-delegate-rewards-transaction#Claim Delegate Rewards Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward\",\n // Sender Address\n \"delegatorAddress\": \"string\",\n // Validator Address to claim rewards\n \"validatorAddress\"\": string\"\n }\n ]\n}","claim-validator-commissions-transaction#Claim Validator Commissions Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission\",\n // Validator Address to withdraw validator commission\n \"validatorAddress\"\": string\"\n }\n ]\n}","governance-vote-transaction#Governance Vote Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{\"type\": \"string\", \"key\": \"string\"}],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmos.gov.v1beta1.MsgVote\",\n // Proposal ID\n \"proposalId\": \"string\",\n // Voter\n \"voter\": \"string\",\n // Vote Option(\"VOTE_OPTION_UNSPECIFIED\" | \"VOTE_OPTION_YES\" | \"VOTE_OPTION_ABSTAIN\" | \"VOTE_OPTION_NO\" | \"VOTE_OPTION_NO_WITH_VETO\")\n \"option\"\": string\"\n }\n ]\n}","wasm-contract-execute-transaction#Wasm Contract Execute Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{ \"type\": \"string\", \"key\": \"string\" }],\n // Message Array\n \"messages\": [\n {\n // Message Type\n \"type\": \"cosmwasm.wasm.v1.MsgExecuteContract\",\n // Sender\n \"sender\": \"string\",\n // Contract Address\n \"contract\": \"string\",\n // Execute Messages\n \"msg\": {},\n // Funds\n \"funds\": []\n }\n ]\n}","authz-grant-transaction#Authz Grant Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{ \"type\": \"string\", \"key\": \"string\" }],\n // Message Array\n \"messages\": [\n {\n // GeneraicAuthorization\n \"type\": \"cosmos.authz.v1beta1.MsgGrant\",\n \"granter\": \"string\",\n \"grantee\": \"string\",\n \"grant\": {\n \"authorization\": {\n // Auth Type(\"GenericAuthorization\" | \"StakeAuthorization\" | \"SendAuthorization\")\n \"type\": \"GenericAuthorization\",\n \"msg\": \"string\"\n },\n \"expiration\": \"datetime\"\n }\n },\n {\n // StakeAuthorization\n \"type\": \"cosmos.authz.v1beta1.MsgGrant\",\n \"granter\": \"string\",\n \"grantee\": \"string\",\n \"grant\": {\n \"authorization\": {\n // Auth Type(\"GenericAuthorization\" | \"StakeAuthorization\" | \"SendAuthorization\")\n \"type\": \"StakeAuthorization\",\n \"maxTokens\": { \"denom\": \"string\", \"amount\": \"string\" },\n // When used in conjunction with a denyList, the allowList is not applied\n \"allowList\": { \"address\": [\"string\"] },\n \"denyList\": { \"address\": [\"string\"] },\n // Authorization Type(\"AUTHORIZATION_TYPE_DELEGATE\" | \"AUTHORIZATION_TYPE_UNDELEGATE\" | \"AUTHORIZATION_TYPE_REDELEGATE\")\n \"authorizationType\": \"string\"\n },\n \"expiration\": \"datetime\"\n }\n },\n {\n // SendAuthorization\n \"type\": \"cosmos.authz.v1beta1.MsgGrant\",\n \"granter\": \"string\",\n \"grantee\": \"string\",\n \"grant\": {\n \"authorization\": {\n // Auth Type(\"GenericAuthorization\" | \"StakeAuthorization\" | \"SendAuthorization\")\n \"type\": \"SendAuthorization\",\n \"spendLimit\": [{ \"denom\": \"string\", \"amount\": \"string\" }]\n },\n \"expiration\": \"datetime\"\n }\n }\n ]\n}","authz-execute-transaction#Authz Execute Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{ \"type\": \"string\", \"key\": \"string\" }],\n // Message Array\n \"messages\": [\n {\n \"type\": \"cosmos.authz.v1beta1.MsgExec\",\n \"grantee\": \"string\",\n \"msgs\": [\n {\n // type_url excluding '/' (ex: cosmos.bank.v1beta1.MsgSend)\n \"type\": \"string\"\n // the values included in the corresponding type message\n }\n ]\n }\n ]\n}","authz-revoke-transaction#Authz Revoke Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{ \"type\": \"string\", \"key\": \"string\" }],\n // Message Array\n \"messages\": [\n {\n \"type\": \"cosmos.authz.v1beta1.MsgRevoke\",\n \"granter\": \"string\",\n \"grantee\": \"string\",\n // msgTypeUrl\n // GenericAuthorization, you can simply use the msg value of that authorization as it is\n // SendAuthorization, you should use /cosmos.bank.v1beta1.MsgSend\n // StakeAuthorization, you should provide values based on the Authorization Type granted.\n // - AUTHORIZATION_TYPE_DELEGATE, use /cosmos.staking.v1beta1.MsgDelegate.\n // - AUTHORIZATION_TYPE_UNDELEGATE, use /cosmos.staking.v1beta1.MsgUndelegate\n // - AUTHORIZATION_TYPE_REDELEGATE, use /cosmos.staking.v1beta1.MsgBeginRedelegate\n \"msgTypeUrl\": \"string\"\n }\n ]\n}","multiple-message-type-of-transaction#Multiple Message Type of Transaction":"{\n // Signer Address\n \"signer\": \"string\",\n // Tx Memo\n \"memo\": \"string\",\n // !!! When sending a transaction (tx) for the first time, must provide the public key\n // pubkey type (\"tendermint/PubKeySecp256k1\" | \"ethermint/PubKeyEthSecp256k1\" | \"injective/PubKeyEthSecp256k1\")\n \"pubkey\": [{ \"type\": \"string\", \"key\": \"string\" }],\n // Message Array\n \"messages\": [\n // The message types within the messages defined above\n ]\n}"}},"/apis/reference/custom/account":{"title":"Account","data":{"get-v1networkaccountsaddress#[GET] /v1/:network/accounts/:address":"Get account information with current balances","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\naddress: cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q"}},"/apis/reference/historical/account/account-richlist":{"title":"Account Balance History","data":{"get-v1networkaccountsrichlistsymbol#[GET] /v1/:network/accounts/richlist/:symbol":"Get richlist for the given symbol","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Symbol of the asset to be queried\n# (string, required)\nsymbol: uatom\n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4OTc1NTU4NjAwMA==\n# To display detailed information of the balance\n# (boolean, optional, default: false)\ndetail: true"}},"/apis/reference/historical/account/account-votes":{"title":"Account Votes","data":{"get-v1networkaccountsaddressvotes#[GET] /v1/:network/accounts/:address/votes":"Get a list of votes of an account","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\naddress: cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q\n# Whether to remove duplicates for the same proposal\n# (boolean, optional, default: false)\ndistinct: true"}},"/apis/reference/historical/validator/validator-block-sign":{"title":"Validator Latest Block Sign","data":{"get-v1networkvalidatorsvalidatoraddresslatestuptime#[GET] /v1/:network/validators/:validatorAddress/latestUptime":"Get latest blocks signature of validator","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\nvalidatorAddress: "}},"/apis/reference/historical/validator/validator-delegators":{"title":"Validator Delegators","data":{"get-v1networkvalidatorsvalidatoraddressdelegators#[GET] /v1/:network/validators/:validatorAddress/delegators":"Get a list of richlist of a symbol","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\nvalidatorAddress: \n# Request per page\n# (number, optional, default: 20)\ntake: 10\n# Value of skip amount for pagination\n# (number, optional, default: 0)\nfrom: 20"}},"/apis/reference/historical/account/account-balances":{"title":"Account Balance History","data":{"get-v1networkaccountsaddressbalances#[GET] /v1/:network/accounts/:address/balances":"Get balance history of an account","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\naddress: cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q\n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4OTc1NTU4NjAwMA==\n# Search start datetime\n# (datetime, optional, default: 30 days ago)\nfromDateTime: 2023-07-20\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59"}},"/apis/reference/historical/validator/validator-proposed-blocks":{"title":"Validator Voting Power Events","data":{"get-v1networkvalidatorsvalidatoraddressproposed#[GET] /v1/:network/validators/:validatorAddress/proposed":"Get blocks proposed by the validator","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\nvalidatorAddress: \n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4OTc1NTU4NjAwMA=="}},"/apis/reference/historical/validator/validator-commissions":{"title":"Validator Commission Balance History","data":{"get-v1networkvalidatorsvalidatoraddresscommissions#[GET] /v1/:network/validators/:validatorAddress/commissions":"Get commission balance history of an account","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\nvalidatorAddress: \n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4OTc1NTU4NjAwMA==\n# Search start datetime\n# (datetime, optional, default: 30 days ago)\nfromDateTime: 2023-07-20\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59"}},"/apis/reference/historical/validator/validator-power-events":{"title":"Validator Voting Power Events","data":{"get-v1networkvalidatorsvalidatoraddresspowerevents#[GET] /v1/:network/validators/:validatorAddress/powerEvents":"Get voting power events of validator","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\nvalidatorAddress: \n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4OTc1NTU4NjAwMA=="}},"/apis/reference/proxy/lcd":{"title":"LCD Proxy","data":{"":"Proxy API for making LCD requests to BlockChain Node","getpost-v1networklcd#[GET][POST] /v1/:network/lcd/*":"You can directly access the Node LCD API by referring to the Swagger or document of the Network you want to make requests to.\nHowever, please note that certain requests are blocked as they may have a negative impact on the server.","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The url of lcd API. See details in Swagger or document of the network\n# (string, required)\n*: /cosmos/bank/v1beta1/balances/cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q"}},"/apis/reference/utilities/assets":{"title":"Assets","data":{"get-v1networkassets#[GET] /v1/:network/assets":"Get all assets of the current chain","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos","get-v1networkassetssymbol#[GET] /v1/:network/assets/:symbol":"Get asset of specific symbol","request-1#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Symbol of the asset to be queried\n# (string, required)\nsymbol: uatom"}},"/apis/reference/statistics/transactions":{"title":"Transactions Counts","data":{"get-v1networkstatisticstxshourly#[GET] /v1/:network/statistics/txs/hourly":"Get The Number of Transactions Per Hour","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59","get-v1networkstatisticstxsdaily#[GET] /v1/:network/statistics/txs/daily":"Get The Number of Transactions Per Day","request-1#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59","get-v1networkstatisticstxsweekly#[GET] /v1/:network/statistics/txs/weekly":"Get The Number of Transactions Per Week","request-2#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59"}},"/apis/reference/historical/validator/validator-votes":{"title":"Validator Votes","data":{"get-v1networkvalidatorsvalidatoraddresstransactions#[GET] /v1/:network/validators/:validatorAddress/transactions":"Get a list of votes of a validator","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of validator\n# (string, required)\nvalidatorAddress: \n# Whether to remove duplicates for the same proposal\n# (boolean, optional, default: false)\ndistinct: true"}},"/apis/reference/utilities/node-info":{"title":"Node Info","data":{"get-v1networknode_info#[GET] /v1/:network/node_info":"Get node informations with chain parameters","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos"}},"/apis/reference/utilities/prices":{"title":"Prices","data":{"get-v1pricessymbolcoingeckoid#[GET] /v1/prices/:symbol/coingeckoId":"Get coingecko ID via symbol","request#Request":"Authorization: Bearer {access_token}\n# Symbol of the asset to be queried\n# (string, required)\nsymbol: uatom","get-v1pricessymbolsymbol#[GET] /v1/prices/symbol/:symbol":"Get hourly prices via symbol","request-1#Request":"Authorization: Bearer {access_token}\n# Symbol of the asset to be queried\n# (string, required)\nsymbol: uatom\n# End datetime for obtaining prices\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-04-21 23:59:59\n# Request per page\n# (number, optional, default: 24)\nticks: 24","get-v1pricescoingeckoidgeckoid#[GET] /v1/prices/coingeckoId/:geckoId":"Get hourly prices via coingeckoId","request-2#Request":"Authorization: Bearer {access_token}\n# CoingeckoId of the asset to be queried\n# (string, required)\ngeckoId: cosmos\n# End datetime for obtaining prices\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-04-21 23:59:59\n# Request per page\n# (number, optional, default: 24)\nticks: 24"}},"/extension/guide/account/add-account":{"title":"Add Account","data":{"":"Create a new wallet, restore with an existing mnemonic phrase, or restore with a private key.","create-wallet#Create wallet":"The following process is for users who do not have a wallet and wish to create a new wallet.'Create wallet' will import a new wallet with a mnemonic phrase.\nStep 1 Click 'Create wallet'Step 2 Enter 'Account name'. Account name will be used for users to easily distinguish wallets imported on the extension.Step 3 Your mnemonic phrase will be displayed. Cosmostation Wallet Extension supports both 12 words and 24 words mnemonic phrases.\nPlease make sure to back up your mnemonic phrase and save it in a safe location only accessible by you. If the mnemonic phrase is lost, you will not be able to regain access to your account.DO NOT share your Secret Recovery Phrase with anyone! If someone has access to your secret phrase, they will have access to your wallet. Cosmostation support will NEVER ask you for your secret phrase or your private key.\nStep 4 (Optional) Choose the HD path you wish to import. Cosmostation Wallet Extension supports HD paths designated/unique to each network by default.Step 5 Enter your seed phrase in correct order. This process is to confirm that you have saved the correct mnemonic phrase.Step 6 Choose networks to display in your Cosmostation Wallet Extension. You must select at least 1 chain in order to proceed.Step 7 Enter your password for Cosmostation Wallet Extension. Password must be more than 8 characters.","restore-wallet-with-a-mnemonic-phrase#Restore wallet with a mnemonic phrase":"The following process is for users who already have a mnemonic phrase.\nStep 1 Click 'Restore with mnemonics'Step 2 Enter 'Account name' and 'Mnemonic phrases'. Account name will be used for you to easily distinguish wallets.Step 3 (Optional) Choose the HD path you wish to import. Cosmostation Wallet Extension supports HD paths designated/unique to each network by default.Step 4 Choose networks to display in your Cosmostation Wallet Extension. You must select at least 1 chain in order to proceed.Step 5 Enter your password for Cosmostation Wallet Extension. Password must be more than 8 characters.","restore-wallet-with-a-private-key#Restore wallet with a private key":"The following process is for users that already have a private key.\nStep 1 Click 'Import wallet'.Step 2 Click 'Restore with private key'.Step 3 Enter your 'Account name' and 'Private key'. (Private keys start with 0x and consists of a 66 digit string)Step 4 Choose networks to display in your Cosmostation Wallet Extension. You must select at least 1 chain in order to proceed.Step 5 Enter your password for Cosmostation Wallet Extension. Password must be more than 8 characters."}},"/apis/reference/utilities/staking-apr":{"title":"Chain Staking APR","data":{"get-v1networkapr#[GET] /v1/:network/apr":"Get default staking APR of the chain","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos","get-v1networkaprvalidatoraddress#[GET] /v1/:network/apr/:validatorAddress":"Get staking APR when delegating to a specific validator","request-1#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Validator address to delegate\n# (string, required)\nvalidatorAddress: "}},"/apis/reference/historical/account/account-transactions":{"title":"Account Transactions","data":{"get-v1networkaccountsaddresstransactions#[GET] /v1/:network/accounts/:address/transactions":"Get transactions of an account","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# The address of account\n# (string, required)\naddress: cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q\n# Request per page\n# (number, optional, default: 20)\ntake: 20\n# Array of strings for filtering by message type\n# (array of string, optional)\nmessageTypes[]: /cosmos.staking.v1beta1.MsgDelegate\n# Search start datetime\n# (datetime, optional)\nfromDateTime: 2023-04-20\n# Search end datetime\n# (datetime, optional)\ntoDateTime: 2023-04-21 23:59:59\n# Value of `pagination.searchAfter` from previous request for pagination\n# (string, optional)\nsearchAfter: MTY4MDUxNjI5NjAwMHwxNDczMjU5OQ=="}},"/extension/guide/account/intro":{"title":"Introduction","data":{"":"Cosmostation Wallet Extension allows you to add and manage multiple accounts.\nSecurely manage your accounts in a convenient user interface.","add-account#Add Account":"'Add Account' has three options. [Creat a new account], [Import mnemonics], and [Import private key]. Please refer to each page for detailed instructions.\nStep 1 Click 'Add account' under 'Account Management'.Step 2 You will see three options to choose from. Please refer to the following link for detailed instructions.","manage-keys#Manage keys":"Under 'Account Management', you are able to see all the accounts that are registered on Cosmostation Extension.If you created a new account or restored a wallet with a mnemonic phrase, you will be able to see the option to [View mnemonics], [View private key], and [Delete account].If you restored a wallet with a private key, then you will only be able to choose [View private key].","delete-account#Delete Account":"You can delete accounts from Cosmostation Extension.Once deleted, you can restore your account again by importing the same mnemonic phrase or private key.\nYou are required to enter your password before deleting your account.Once deleted, if you lose your mnemonic phrase or private key you will not be able to gain access to the account again."}},"/apis/reference/statistics/messages":{"title":"Message Counts","data":{"get-v1networkstatisticsmessages#[GET] /v1/:network/statistics/messages":"Get The Number of Transactions per each message type over the last 30 days","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos\n# Search end datetime\n# (datetime, optional, default: CURRENT_TIMESTAMP)\ntoDateTime: 2023-07-21 23:59:59"}},"/extension/guide/chains":{"title":"Chains","data":{"":"Cosmostation Wallet Extension supports various PoS networks.","addremove-chains#Add/Remove Chains":"Add/remove chains to efficiently manage your wallet.Select chains you want to display on the list. Only selected chains will be displayed on both the dashboard and wallet detail page.\nStep 1 View chains that are added to your list. Click 'Add chain' to add/remove chains from the list.Step 2 By toggling on/off, you can choose chains that you want to display on Cosmostation Wallet Extension.Step 3 Selected chains are also visible on the top right side of wallet details."}},"/extension/guide/settings":{"title":"Settings","data":{"":"Customize the wallet extension in wallet settings.","dark-mode#Dark mode":"Toggle back and forth to choose between Dark or Light mode.","address-book#Address Book":"Create different address books for each chain. You can use the address book when using the 'Send' function.\nStep 1 View / Add addresses to the chain you selected.Step 2 Enter address information and click 'Save'.\nLabel your address to distinguish them from one another.\nMemo is optional but required to transfer assets to centralized cryptocurrency\nexchanges. Centralized exchanges will ask you to enter a memo for\nidentification when you make a deposit.\nIf you add addresses in the address book, you can use the address book feature when sending assets.","change-password#Change password":"Enter your current password and to change it to a new password. Enter the new password once more to confirm.\nMake sure that you enter more than 8 characters for the password.","currency--language#Currency & Language":"Cosmostation Wallet Extension supports 2 languages and 5 currencies.\nWe plan to support more currencies and languages in the near future.","lock-screen#Lock screen":"Lock your screen to secure your wallet.\n!"}},"/extension/guide/dapps":{"title":"dApp","data":{"":"Cosmostation Wallet Exntension supports various dApps deployed on PoS networks.","connection-status#Connection status":"Easily check if the wallet extension is connect to the dApp.If you wish to disconnect, click the connection status under your account name.","disconnect-with-just-a-click#Disconnect with just a click.":"Easily disconnect from dApps by clicking the connecting status under your account name."}},"/extension/integration/aptos/connect-and-account":{"title":"Connect, Account","data":{"":"connect and get Account via Cosmostation Extension","connect#Connect":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n const account = await provider.connect();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","vanilla-code#Vanilla Code":"const provider = aptos();\ntry {\n const account = await provider.connect();\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","response#Response":"export type AptosConnectResponse = {\n address: string;\n publicKey: string;\n};\n{\n \"address\": \"\",\n \"publicKey\": \"\"\n}","account#Account":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n const account = await provider.account();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","vanilla-code-1#Vanilla Code":"try {\n const provider = aptos();\n const account = await provider.account(payload);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","response-1#Response":"export type AptosAccountResponse = {\n address: string;\n publicKey: string;\n};\n{\n \"address\": \"\",\n \"publicKey\": \"\"\n}"}},"/extension/guide/account/add-ledger-account":{"title":"Add Ledger Account","data":{"":"Create a new ledger wallet","supported-devices--connection-method#Supported Devices & Connection Method":"Ledger S, X\nUSB, HID","adding-ledger-account#Adding Ledger Account":"Account icon → setting icon → Add account → Create a new ledger account → Account name → HD path setting → Done","hd-path-setting#HD path setting":"Up to 101 Ledger accounts and wallets can be derived from a single set of mnemonics in a Ledger by assigning any number smaller than 101 to HD paths when creating a Ledger account.","connecting-ledger#Connecting Ledger":"Select the new Ledger account to connect on home screen.","cosmos-networks#Cosmos Networks":"Cosmostation extension wallet supports Cosmos SDK chain wallets derived from HD paths 44'/118'/0'/0/n. Connecting to any Cosmos SDK chain with a Ledger automatically derives all the Cosmos SDK chain wallets supported by a Ledger account.","evm-networks#EVM Networks":"Cosmostation extension wallet supports EVM wallets derived from HD paths 44'/60'/0'/0/n. Connecting to any EVM network with a Ledger automatically derives all the EVM network wallets supported by a Ledger account.","not-supported-networks#Not Supported Networks":"44'/118'/0'/0/n is a generic HD path for Cosmos SDK chains, but some networks use custom HD paths assigned by their network foundations. For example, a Cosmos SDK chain Crypto.org’s official HD path used by the foundation and Ledger is 44'/394'/0'/0/n.\nIn an effort to sync with the network foundations and Ledger, Cosmostation extension wallet derives wallets solely from HD paths used by the foundations and Ledger. Instead of deriving all the Cosmos SDK chain wallets from 44'/118'/0'/0/n path, Cosmostation only supports the wallets of Cosmos SDK chains whose official HD path is 44'/118'/0'/0/n for now.\nCustom HD path wallets will be supported in future updates.","signing-transactions#Signing Transactions":"","cosmos-sdk-chains#Cosmos SDK Chains":"Open the Cosmos app on Ledger\nCheck the review message on Ledger\nApprove or reject a transaction\nAll the Cosmos SDK chains' transactions can be signed from the Cosmos app.","ethereum--evm#Ethereum & EVM":"Open the Ethereum app on Ledger\nCheck the review message on Ledger\nApprove or reject a transaction\nAll the EVM chains' transactions can be signed from the Ethereum app."}},"/extension/guide/transfer-coins":{"title":"Transfer coins","data":{"":"Transfer coins with just one click via Cosmostation Wallet Extension.\nCosmostation Wallet Extension currently DOES NOT SUPPORT IBC TRANSFERS.If you are trying to send assets to a different chain, the send button will be deactivated.","receive#Receive":"Click 'Deposit' to copy the address to the clipboard or scan the QR code.","send#Send":"The following process is for users sending assets to a different address.\nStep 1 Enter 'Recipient address', 'Amount,' and 'Memo.' The memo field is optional but required for sending to specific centralized cryptocurrency exchanges. Centralized exchanges will ask you to enter a memo for identification when you make a deposit.\nMake sure that you enter the correct recipient address.Entering an incorrect address may result in loss of funds and responsibility of entering the correct address is on the user.\nStep 2, 3 Check the transaction information and confirm."}},"/apis/reference/utilities/inflation":{"title":"Chain Inflation","data":{"get-v1networkinflation#[GET] /v1/:network/inflation":"Get inflation data from the chain","request#Request":"Authorization: Bearer {access_token}\n# The name of network\n# (string, required)\nnetwork: cosmos"}},"/extension":{"title":"Introduction","data":{"":"Cosmostation Wallet Extension is a non-custodial chrome extension wallet that supports multiple sovereign networks and inter-blockchain bridges. The wallet extension allows users to easily interact with networks and decentralized applications with just a few clicks.To download Cosmostation Wallet Extension, click this link to download from the chrome webstore.","wallet#Wallet":"","dashboard#Dashboard":""}},"/extension/integration/aptos/event":{"title":"Event","data":{"accountchange#AccountChange":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\nconst handler = (account) => console.log(account);\ntry {\n const provider = await aptos();\n provider.onAccountChange(handler);\n // if you want to remove the listener\n provider.offAccountChange(handler);\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n}","vanilla-code#Vanilla Code":"const handler = (account) => console.log(account);\ntry {\n const provider = aptos();\n provider.onAccountChange(handler);\n // if you want to remove the listener\n provider.offAccountChange(handler);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","networkchange#NetworkChange":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\nconst handler = (network) => console.log(network);\ntry {\n const provider = await aptos();\n provider.onNetworkChange(handler);\n // if you want to remove the listener\n provider.offNetworkChange(handler);\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n}","vanilla-code-1#Vanilla Code":"const handler = (network) => console.log(network);\ntry {\n const provider = aptos();\n provider.onNetworkChange(handler);\n // if you want to remove the listener\n provider.offNetworkChange(handler);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}"}},"/extension/integration/aptos/sign-and-submit-transaction":{"title":"Sign And Submit Transaction","data":{"":"Sign And Submit transcation via Cosmostation Extension","signandsubmittransaction#SignAndSubmitTransaction":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n // e.g. send payload\n const payload = {\n arguments: [\n \"\",\n \"100000000\",\n ],\n function: \"0x1::aptos_account::transfer\",\n type: \"entry_function_payload\",\n type_arguments: [],\n };\n const pendingTransaction = await provider.signAndSubmitTransaction(payload);\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","vanilla-code#Vanilla Code":"// e.g. send payload\nconst payload = {\n arguments: [\n \"\",\n \"100000000\",\n ],\n function: \"0x1::aptos_account::transfer\",\n type: \"entry_function_payload\",\n type_arguments: [],\n};\ntry {\n const provider = aptos();\n const pendingTransaction = await provider.signAndSubmitTransaction(payload);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","request#request":"export type AptosSignPayload = {\n function: string;\n type: string;\n type_arguments: string[];\n arguments: T[];\n};","response#Response":"export type AptosSignAndSubmitTransactionResponse = {\n hash: string;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: AptosSignPayload;\n signature?: {\n type: string;\n public_key: string;\n signature: string;\n };\n};\n{\n \"hash\": \"\",\n \"sender\": \"\",\n \"sequence_number\": \"15\",\n \"max_gas_amount\": \"1016\",\n \"gas_unit_price\": \"100\",\n \"expiration_timestamp_secs\": \"1668137878\",\n \"payload\": {\n \"function\": \"0x1::coin::transfer\",\n \"type_arguments\": [\"0x1::aptos_coin::AptosCoin\"],\n \"arguments\": [\n \"\",\n \"1000000\"\n ],\n \"type\": \"entry_function_payload\"\n },\n \"signature\": {\n \"public_key\": \"\",\n \"signature\": \"\",\n \"type\": \"ed25519_signature\"\n }\n}","signtransaction#SignTransaction":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n const signature = await provider.signTransaction(payload);\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","vanilla-code-1#Vanilla Code":"const cosmostation = provider();\n// e.g. send payload\nconst payload = {\n arguments: [\n \"\",\n \"100000000\",\n ],\n function: \"0x1::aptos_account::transfer\",\n type: \"entry_function_payload\",\n type_arguments: [],\n};\ntry {\n const provider = aptos();\n const signature = await provider.signTransaction(payload);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","request-1#request":"export type AptosSignPayload = {\n function: string;\n type: string;\n type_arguments: string[];\n arguments: T[];\n};","response-1#Response":"export type AptosSignTransactionResponse = string;\n\"\""}},"/extension/integration/aptos/provider":{"title":"Provider","data":{"":"Cosmostation extension support various chains.","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n}","vanilla-code#Vanilla Code":"const isCosmostation = \"cosmostation\" in window;\nconst aptos = () => {\n if (\"cosmostation\" in window) {\n return window.cosmostation.aptos;\n } else {\n window.open(\"https://cosmostation.io/wallet/#extension\");\n /**\n * or window.open(\"https://chrome.google.com/webstore/detail/cosmostation/fpkhgmpbidmiogeglndfbkegfdlnajnf\");\n * */\n }\n};\nconst provider = aptos();"}},"/extension/integration/cosmos/Deprecated/chains":{"title":"Chains","data":{"":"Get supported chains and add specific chains for using Cosmostation Extension.","add-chains#Add chains":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"try {\n // ...\n await provider.addChain({\n chainId: \"cerberus-chain-1\",\n chainName: \"cerberus\",\n addressPrefix: \"cre\",\n baseDenom: \"ucrbrus\",\n displayDenom: \"CRBRUS\",\n restURL: \"https://lcd-office.cosmostation.io/mooncat-1-1\",\n coinType: \"118\", // optional (default: '118')\n decimals: 6, // optional (default: 6)\n gasRate: {\n // optional (default: { average: '0.025', low: '0.0025', tiny: '0.00025' })\n average: \"0.2\",\n low: \"0.02\",\n tiny: \"0.002\",\n },\n sendGas: \"80000\", // optional (default: '100000')\n type: \"ETHERMINT\", // optional (default: '')\n });\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code#Vanilla Code":"await window.cosmostation.cosmos.request({\n method: \"cos_addChain\",\n params: {\n chainId: \"cerberus-chain-1\",\n chainName: \"cerberus\",\n addressPrefix: \"cre\",\n baseDenom: \"ucrbrus\",\n displayDenom: \"CRBRUS\",\n restURL: \"https://lcd-office.cosmostation.io/mooncat-1-1\",\n coinType: \"118\", // optional (default: '118')\n decimals: 6, // optional (default: 6)\n gasRate: {\n // optional (default: { average: '0.025', low: '0.0025', tiny: '0.00025' })\n average: \"0.2\",\n low: \"0.02\",\n tiny: \"0.002\",\n },\n sendGas: \"80000\", // optional (default: '100000')\n type: \"ETHERMINT\", // optional (default: '')\n },\n});","response#Response":"type addChainResponse = boolean;\ntrue","keplr-to-cosmostation#keplr to cosmostation":"{\n chainId: chainInfo.chainId,\n addressPrefix: chainInfo.bech32Config.bech32PrefixAccAddr,\n baseDenom: chainInfo.currencies[0].coinMinimalDenom,\n chainName: chainInfo.chainName || chainInfo.chainId,\n displayDenom: chainInfo.currencies[0].coinDenom,\n decimals: chainInfo.currencies[0].coinDecimals,\n restURL: chainInfo.rest,\n coinType: String(chainInfo.bip44.coinType),\n gasRate: chainInfo.gasPriceStep\n ? {\n tiny: String(chainInfo.gasPriceStep.low),\n low: String(chainInfo.gasPriceStep.average),\n average: String(chainInfo.gasPriceStep.high),\n }\n : undefined,\n}\nexport interface KeplrChainInfo {\n readonly rpc: string;\n readonly rpcConfig?: AxiosRequestConfig;\n readonly rest: string;\n readonly restConfig?: AxiosRequestConfig;\n readonly chainId: string;\n readonly chainName: string;\n readonly stakeCurrency: Currency;\n readonly walletUrl?: string;\n readonly walletUrlForStaking?: string;\n readonly bip44: BIP44;\n readonly alternativeBIP44s?: BIP44[];\n readonly bech32Config: Bech32Config;\n readonly currencies: AppCurrency[];\n readonly feeCurrencies: FeeCurrency[];\n readonly features?: string[];\n readonly beta?: boolean;\n}","supported-chains#Supported chains":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"const supportedChains = await provider.getSupportedChains();","vanilla-code-1#Vanilla Code":"const supportedChains = await window.cosmostation.cosmos.request({\n method: \"cos_supportedChainNames\",\n});","response-1#Response":"type SupportedChainNamesResponse = {\n official: string[]; // lowercase\n unofficial: string[]; // lowercase\n};\n{\n \"official\": [\"cosmos\", \"osmosis\"],\n \"unofficial\": [\"test\"]\n}","supported-chainids#Supported chainIds":"","code-using-cosmostationextension-client-2#Code using @cosmostation/extension-client":"const supportedChains = await provider.getSupportedChainIds();","vanilla-code-2#Vanilla Code":"const supportedChainIds = await window.cosmostation.cosmos.request({\n method: \"cos_supportedChainIds\",\n});","response-2#Response":"type SupportedChainIdsResponse = {\n official: string[];\n unofficial: string[];\n};\n{\n \"official\": [\"cosmoshub-4\", \"gravity-bridge-3\"],\n \"unofficial\": [\"columbus-5\", \"agoric-3\"]\n}","activated-chains#Activated chains":"","code-using-cosmostationextension-client-3#Code using @cosmostation/extension-client":"const activatedChains = await provider.getActivatedChains();","vanilla-code-3#Vanilla Code":"const activatedChains = await window.cosmostation.cosmos.request({\n method: \"cos_activatedChainNames\",\n});","response-3#Response":"type ActivatedChainNamesResponse = string[]; // lowercase\n[\"cosmos\", \"osmosis\"]","activated-chainids#Activated chainIds":"","code-using-cosmostationextension-client-4#Code using @cosmostation/extension-client":"const activatedChainIds = await provider.getActivatedChainIds();","vanilla-code-4#Vanilla Code":"const activatedChainIds = await window.cosmostation.cosmos.request({\n method: \"cos_activatedChainIds\",\n});","response-4#Response":"type ActivatedChainIdsResponse = string[];\n[\"cosmoshub-4\", \"gravity-bridge-3\"]"}},"/extension/integration/aptos/network":{"title":"Network","data":{"":"Get Network via Cosmostation Extension","network#Network":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { aptos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await aptos();\n const network = await provider.network();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","vanilla-code#Vanilla Code":"try {\n const provider = aptos();\n const network = await provider.network(payload);\n} catch (e) {\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n}","response#Response":"export type AptosNetworkResponse = string;\n\"Mainnet\""}},"/extension/integration/cosmos/Deprecated/error":{"title":"Error","data":{"":"Error description\nCode\tModel\tDescription\t4001\t-\tUser rejected request\t4100\t-\tThe requested account and/or method has not been authorized by the user.\t4200\t-\tThe requested method is not supported\t-32000\t-\tInvalid input.\t-32600\t-\tThe JSON sent is not a valid Request object.\t-32602\t-\tInvalid method parameter(s).\t-32603\t-\tInternal JSON-RPC error."}},"/extension/integration/cosmos/Deprecated/accounts":{"title":"Accounts","data":{"":"Using Cosmostation Extension accounts.","get-accounts#Get Accounts":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"const account = await provider.getAccount(\"cosmoshub-4\");","vanilla-code#Vanilla Code":"const account = await window.cosmostation.cosmos.request({\n method: \"cos_account\",\n params: { chainName: \"cosmoshub-4\" },\n});","if-connected-successfully-it-will-look-like-below#If connected successfully, it will look like below.":"","response#Response":"type AccountResponse = {\n name: string;\n address: string;\n publicKey: Uint8Array;\n isLedger: boolean;\n};\n{\n \"name\": \"account name\",\n \"address\": \"cosmos1wgeoiheoighwoighwioeghoweghoiweghiow\",\n \"publicKey\": [\n 3, 77, 9, 189, 251, 249, 150, 235, 192, 56, 51, 98, 56, 242, 12, 102, 144,\n 211, 89, 42, 187, 170\n ],\n \"isLedger\": false\n}","request-account-popup#Request Account (Popup)":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"try {\n // ...\n const account = await provider.requestAccount(\"cosmoshub-4\");\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code-1#Vanilla Code":"const account = await window.cosmostation.cosmos.request({\n method: \"cos_requestAccount\",\n params: { chainName: \"cosmoshub-4\" },\n});","response-1#Response":"type RequestAccountResponse = {\n name: string;\n address: string;\n publicKey: Uint8Array;\n isLedger: boolean;\n};\n{\n \"name\": \"account name\",\n \"address\": \"cosmos1wgeoiheoighwoighwioeghoweghoiweghiow\",\n \"publicKey\": [\n 3, 77, 9, 189, 251, 249, 150, 235, 192, 56, 51, 98, 56, 242, 12, 102, 144,\n 211, 89, 42, 187, 170\n ],\n \"isLedger\": false\n}"}},"/extension/integration/cosmos/Deprecated/provider":{"title":"Provider","data":{"":"Cosmostation extension support various chains.","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { cosmos, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await cosmos();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n}","vanilla-code#Vanilla Code":"window.onload = async () => {\n if (!window.cosmostation) {\n alert(\"Please install cosmostation extension\");\n } else {\n // logic\n }\n};"}},"/extension/integration/cosmos/Deprecated/disconnect":{"title":"Disconnect","data":{"":"Disconnect from Dapp","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"const response = await provider.disconnect();","vanilla-code#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_disconnect\",\n});","response#Response":"type DisconnectResponse = null;\nnull"}},"/extension/integration/cosmos/Deprecated/cw20-token":{"title":"CW20 token","data":{"":"@cosmostation/extension-client >= 0.1.7CW20 token via Cosmostation Extension","add-cw20-tokens#Add CW20 Tokens":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"// ...\nconst response = await provider.addCW20Tokens('mint', [\n {\n contractAddress: '',\n imageURL: 'https://pbs.twimg.com/profile_images/1465777324859826197/RUXx0equ_400x400.jpg', // optional\n coinGeckoId: 'neta', // optional\n },\n {\n contractAddress: '',\n },\n]);","vanilla-code#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: 'cos_addTokensCW20',\n params: {\n chainName: 'mint',\n tokens: [\n {\n contractAddress: '',\n imageURL: 'https://pbs.twimg.com/profile_images/1465777324859826197/RUXx0equ_400x400.jpg', // optional\n coinGeckoId: 'neta', // optional\n },\n {\n contractAddress: '',\n },\n ],\n },\n});","response#Response":"export type AddCW20TokenResponse = null;\nnull","get-cw20-token-balance#Get CW20 Token Balance":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"// ...\nconst response = await provider.getCW20TokenBalance(\n 'mint',\n '', // contract address\n 'mint14xgdfdnpjtulj6p7rkc75ekxqjq8hc5cg5evx3', // address\n);","vanilla-code-1#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: 'cos_getBalanceCW20',\n params: {\n chainName: 'mint',\n contractAddress: '',\n address: 'mint14xgdfdnpjtulj6p7rkc75ekxqjq8hc5cg5evx3',\n },\n});","response-1#Response":"export type getCW20TokenBalanceResponse = string;\n\"1331775394\"","get-cw20-token-info#Get CW20 Token Info":"","code-using-cosmostationextension-client-2#Code using @cosmostation/extension-client":"// ...\nconst response = await provider.getCW20TokenInfo(\n 'mint',\n '', // contract address\n);","vanilla-code-2#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: 'cos_getTokenInfoCW20',\n params: {\n chainName: 'mint',\n contractAddress: '',\n },\n});","response-2#Response":"export type getCW20TokenInfoResponse = {\n decimals: number;\n name: string;\n symbol: string;\n total_supply: string;\n};\n{\n \"name\": \"NETA\",\n \"symbol\": \"NETA\",\n \"decimals\": 6,\n \"total_supply\": \"31886600000\"\n}"}},"/extension/integration/cosmos/integrate-keplr":{"title":"Use Cosmostation with Keplr Interface","data":{"":"Cosmostation is providing Keplr's interface. The purpose is to make it easier for the developers to integrate Cosmostation to dApps that have Keplr integrated already.Supported functions/variables are as belows:\ndefaultOptions\nenable\ngetKey\nexperimentalSuggestChain\ngetOfflineSigner\ngetOfflineSignerAuto\ngetOfflineSignerOnlyAmino\nsendTx\nsignAmino\nsignDirect\nsignArbitrary\nverifyArbitrary\nIn case of an error, use the Cosmostation interface.You need to use methods provided by Cosmostation for the event handling and defaultOptions change.\nHere's the guide:","guide#Guide":"Use window.cosmostation.providers.keplr instead of window.keplr.\nwindow.onload = async () => {\n if (!window.cosmostation) {\n alert(\"Please install cosmostation extension\");\n } else {\n const chainId = \"cosmoshub-4\";\n await window.cosmostation.providers.keplr.enable(chainId);\n const offlineSigner =\n window.cosmostation.providers.keplr.getOfflineSigner(chainId);\n const accounts = await offlineSigner.getAccounts();\n }\n};\nasync getKeplr(): Promise {\n if (window.cosmostation) {\n return window.cosmostation.providers.keplr;\n }\n if (document.readyState === \"complete\") {\n return window.cosmostation.providers.keplr;\n }\n return new Promise((resolve) => {\n const documentStateChange = (event: Event) => {\n if (\n event.target &&\n (event.target as Document).readyState === \"complete\"\n ) {\n resolve(window.cosmostation.providers.keplr);\n document.removeEventListener(\"readystatechange\", documentStateChange);\n }\n };\n document.addEventListener(\"readystatechange\", documentStateChange);\n });\n}","defaultoptions#defaultOptions":"window.cosmostation.providers.keplr.defaultOptions = {\n sign: {\n preferNoSetFee: true,\n preferNoSetMemo: true,\n },\n};","event#Event":"window.addEventListener(\"cosmostation_keystorechange\", () => {\n console.log(\"Key store in Cosmostation is changed. You may need to refetch the account info.\")\n})"}},"/extension/integration/cosmos/proto":{"title":"Protobuf JSON","data":{"":"Automatically creates json as a transaction in protobuf format.\nWhen using signAndTransaction, send a message as shown below.This is an example. You can request it by filling in the value in [input].","test#Test":"You can test it by connecting directly to your wallet. Please refer to the example below and send a transaction.\nIt will be sent directly to the cosmoshub-4 mainnet, so don't sign if you don't want to.","1-connect#1. Connect":"","2-get-account#2. Get Account":"","3-sign-and-send-transaction#3. Sign And Send Transaction":"It is editable.\nYou can send multiple messages.","example#Example":"","send#Send":"{\n \"type_url\": \"/cosmos.bank.v1beta1.MsgSend\",\n \"value\": {\n \"from_address\": \"from_address\", // [input]: string\n \"to_address\": \"to_address\", // [input]: string\n \"amount\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ]\n }\n}","multisend#MultiSend":"{\n \"type_url\": \"/cosmos.bank.v1beta1.MsgMultiSend\",\n \"value\": {\n \"inputs\": [\n {\n \"address\": \"address\", // [input]: string\n \"coins\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ]\n }\n ],\n \"outputs\": [\n {\n \"address\": \"address\", // [input]: string\n \"coins\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ]\n }\n ]\n }\n}","delegate#Delegate":"{\n \"type_url\": \"/cosmos.staking.v1beta1.MsgDelegate\",\n \"value\": {\n \"delegator_address\": \"delegator_address\", // [input]: string\n \"validator_address\": \"validator_address\", // [input]: string\n \"amount\": {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n }\n}","redelegate#Redelegate":"{\n \"type_url\": \"/cosmos.staking.v1beta1.MsgBeginRedelegate\",\n \"value\": {\n \"delegator_address\": \"[input]\", // [input]: string\n \"validator_src_address\": \"[input]\", // [input]: string\n \"validator_dst_address\": \"[input]\", // [input]: string\n \"amount\": {\n \"denom\": \"[input]\", // [input]: string\n \"amount\": \"[input]\" // [input]: string\n }\n }\n}","undelegate#Undelegate":"{\n \"type_url\": \"/cosmos.staking.v1beta1.MsgUndelegate\",\n \"value\": {\n \"delegator_address\": \"delegator_address\", // [input]: string\n \"validator_address\": \"validator_address\", // [input]: string\n \"amount\": {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n }\n}","reward#Reward":"{\n \"type_url\": \"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward\",\n \"value\": {\n \"delegator_address\": \"delegator_address\", // [input]: string\n \"validator_address\": \"validator_address\" // [input]: string\n }\n}","vote#Vote":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgVote\",\n \"value\": {\n \"proposal_id\": 823, // [input]: number\n \"voter\": \"voter\", // [input]: string\n \"option\": 1 // [input]: number (yes: 1, abstain: 2, no: 3, no_with_veto: 4)\n }\n}","vote-options#Vote Options":"enum VoteOption {\n VOTE_OPTION_UNSPECIFIED = 0,\n VOTE_OPTION_YES = 1,\n VOTE_OPTION_ABSTAIN = 2,\n VOTE_OPTION_NO = 3,\n VOTE_OPTION_NO_WITH_VETO = 4\n}","ibc-transfer#IBC Transfer":"{\n \"type_url\": \"/ibc.applications.transfer.v1.MsgTransfer\",\n \"value\": {\n \"source_port\": \"source_port\", // [input]: string\n \"source_channel\": \"source_channel\", // [input]: string\n \"token\": {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n },\n \"sender\": \"sender\", // [input]: string\n \"receiver\": \"receiver\", // [input]: string\n \"timeout_height\": {\n \"revision_height\": 13594714, // [input]: number\n \"revision_number\": 2 // [input]: number\n },\n \"memo\": \"\" // [input]: string\n }\n}","cosmwasm-executecontract#Cosmwasm ExecuteContract":"{\n \"type_url\": \"/cosmwasm.wasm.v1.MsgExecuteContract\",\n \"value\": {\n \"sender\": \"sender\", // [input]: string\n \"contract\": \"contract\", // [input]: string\n \"funds\": [], // [input]: unknown[]\n \"msg\": [1, 2] // [input]: Buffer or Uint8Array\n }\n}","proposal#Proposal":"","textproposal#TextProposal":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgSubmitProposal\",\n \"value\": {\n \"content\": {\n \"type_url\": \"/cosmos.gov.v1beta1.TextProposal\",\n \"value\": {\n \"title\": \"title\", // [input]: string\n \"description\": \"description\" // [input]: string\n }\n },\n \"initial_deposit\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ],\n \"proposer\": \"proposer\" // [input]: string\n }\n}","clientupdateproposal#ClientUpdateProposal":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgSubmitProposal\",\n \"value\": {\n \"content\": {\n \"type_url\": \"/ibc.core.client.v1.ClientUpdateProposal\",\n \"value\": {\n \"title\": \"title\", // [input]: string\n \"description\": \"description\", // [input]: string\n \"subject_client_id\": \"subject_client_id\", // [input]: string\n \"substitute_client_id\": \"substitute_client_id\" // [input]: string\n }\n },\n \"initial_deposit\": [],\n \"proposer\": \"proposer\" // [input]: string\n }\n}","communitypoolspendproposal#CommunityPoolSpendProposal":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgSubmitProposal\",\n \"value\": {\n \"content\": {\n \"type_url\": \"/cosmos.distribution.v1beta1.CommunityPoolSpendProposal\",\n \"value\": {\n \"title\": \"title\", // [input]: string\n \"description\": \"description\", // [input]: string\n \"recipient\": \"recipient\", // [input]: string\n \"amount\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ]\n }\n },\n \"initial_deposit\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ],\n \"proposer\": \"proposer\" // [input]: string\n }\n}","parameterchangeproposal#ParameterChangeProposal":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgSubmitProposal\",\n \"value\": {\n \"content\": {\n \"type_url\": \"/cosmos.params.v1beta1.ParameterChangeProposal\",\n \"value\": {\n \"title\": \"title\", // [input]: string\n \"description\": \"description\", // [input]: string\n \"changes\": [\n {\n \"subspace\": \"subspace\", // [input]: string\n \"key\": \"key\", // [input]: string\n \"value\": \"value\" // [input]: string\n }\n ]\n }\n },\n \"initial_deposit\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ],\n \"proposer\": \"proposer\" // [input]: string\n }\n}","softwareupgradeproposal#SoftwareUpgradeProposal":"{\n \"type_url\": \"/cosmos.gov.v1beta1.MsgSubmitProposal\",\n \"value\": {\n \"content\": {\n \"type_url\": \"/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal\",\n \"value\": {\n \"title\": \"title\", // [input]: string\n \"description\": \"description\", // [input]: string\n \"plan\": {\n \"name\": \"name\", // [input]: string\n \"height\": \"height\", // [input]: string\n \"info\": \"info\", // [input]: string\n \"upgraded_client_state\": null // [input]: null or IAny\n }\n }\n },\n \"initial_deposit\": [\n {\n \"denom\": \"denom\", // [input]: string\n \"amount\": \"amount\" // [input]: string\n }\n ],\n \"proposer\": \"proposer\" // [input]: string\n }\n}","grant#Grant":"","delegate-grant#Delegate Grant":"{\n \"type_url\": \"/cosmos.authz.v1beta1.MsgGrant\",\n \"value\": {\n \"granter\": \"granter\", // [input]: string\n \"grantee\": \"grantee\", // [input]: string\n \"grant\": {\n \"authorization\": {\n \"type_url\": \"/cosmos.staking.v1beta1.StakeAuthorization\",\n \"value\": {\n \"allow_list\": {\n \"address\": [\"address\", \"address\"] // [input]: string[]\n },\n \"authorization_type\": 1 // [input]: number\n }\n },\n \"expiration\": {\n \"type_url\": \"/google.protobuf.Timestamp\",\n \"value\": {\n \"seconds\": 5325252355 // [input]: number (unix time)\n }\n }\n }\n }\n}","revoke-delegate-grant#Revoke Delegate Grant":"{\n \"type_url\": \"/cosmos.authz.v1beta1.MsgRevoke\",\n \"value\": {\n \"granter\": \"granter\", // [input]: string\n \"grantee\": \"grantee\", // [input]: string\n \"msg_type_url\": \"/cosmos.staking.v1beta1.MsgDelegate\"\n }\n}","authorization-type#Authorization Type":"type AuthorizationType = {\n AUTHORIZATION_TYPE_UNSPECIFIED = 0,\n AUTHORIZATION_TYPE_DELEGATE = 1,\n AUTHORIZATION_TYPE_UNDELEGATE = 2,\n AUTHORIZATION_TYPE_REDELEGATE = 3\n}"}},"/extension/integration/cosmos/Deprecated/event":{"title":"Event","data":{"":"Account change event","onaccountchanged#onAccountChanged":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"provider.onAccountChanged(() => console.log(\"changed\"));","vanilla-code#Vanilla Code":"window.addEventListener(\"cosmostation_keystorechange\", () => {\n console.log(\"Key store in Cosmostation is changed. You may need to refetch the account info.\")\n})","offaccountchanged#offAccountChanged":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"const event = provider.onAccountChanged(() => console.log(\"changed\"));\nprovider.offAccountChanged(event);","vanilla-code-1#Vanilla Code":"window.removeEventListener(\"cosmostation_keystorechange\", handler)"}},"/extension/integration/cosmos/Deprecated/sign-message":{"title":"Sign Message","data":{"":"Sign Message via Cosmostation Extension","sign-message#Sign Message":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"try {\n // ...\n const response = await provider.signMessage(\n \"cosmoshub-4\",\n \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\", // signer\n \"message!!!!\" // message\n );\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_signMessage\",\n params: {\n chainName: \"cosmoshub-4\",\n signer: \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n message: \"message!!!!\",\n },\n});","response#Response":"export type SignMessageResponse = {\n signature: string;\n pub_key: { type: string; value: string };\n};\n{\n \"pub_key\": {\n \"type\": \"tendermint/PubKeySecp256k1\",\n \"value\": \"A00Jvfv5luvAODNiOPIMZpDTWSq7qvoFV8k7ptdsDqLU\"\n },\n \"signature\": \"signature==\"\n}","verifymessage#VerifyMessage":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"try {\n const response = await provider.signMessage(\n \"cosmoshub-4\",\n \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n \"message!!!!\"\n );\n const result = await provider.verifyMessage(\n \"cosmoshub-4\",\n \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n \"message!!!!\",\n response\n );\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code-1#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_signMessage\",\n params: {\n chainName: \"cosmoshub-4\",\n signer: \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n message: \"message!!!!\",\n },\n});\nconst result = await window.cosmostation.cosmos.request({\n method: \"cos_verifyMessage\",\n params: {\n chainName: \"cosmoshub-4\",\n signer: \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n message: \"message!!!!\",\n publicKey: response.pub_key.value,\n signature: response.signature,\n },\n});","response-1#Response":"export type VerifyMessageResponse = boolean;\ntrue"}},"/extension/integration/cosmos/Deprecated/sign-tx":{"title":"Sign Transactions","data":{"":"Sign transcation via Cosmostation Extension","sign-amino#Sign Amino":"","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"try {\n // ...\n const response = await provider.signAmino(\n \"cosmoshub-4\",\n {\n chain_id: \"cosmoshub-4\",\n fee: { amount: [{ denom: \"uatom\", amount: \"5000\" }], gas: \"200000\" },\n memo: \"\",\n msgs: [\n {\n type: \"cosmos-sdk/MsgSend\",\n value: {\n from_address: \"cosmos1wepghweioghweiog\",\n to_address: \"cosmos1weogihweoighweoigheoiw\",\n amount: [{ denom: \"uatom\", amount: \"5000\" }],\n },\n },\n ],\n sequence: \"20\",\n account_number: \"632177\",\n },\n {\n memo: true, // optional\n fee: true, // optional\n gasRate: {\n // optional\n average: \"0.2\",\n low: \"0.02\",\n tiny: \"0.002\",\n },\n }\n );\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_signAmino\",\n params: {\n chainName: \"cosmoshub-4\",\n doc: {\n chain_id: \"cosmoshub-4\",\n fee: { amount: [{ denom: \"uatom\", amount: \"5000\" }], gas: \"200000\" },\n memo: \"\",\n msgs: [\n {\n type: \"cosmos-sdk/MsgSend\",\n value: {\n from_address: \"cosmos1wepghweioghweiog\",\n to_address: \"cosmos1weogihweoighweoigheoiw\",\n amount: [{ denom: \"uatom\", amount: \"5000\" }],\n },\n },\n ],\n sequence: \"20\",\n account_number: \"632177\",\n },\n isEditMemo: true, // optional\n isEditFee: true, // optional\n gasRate: {\n // optional\n average: \"0.2\",\n low: \"0.02\",\n tiny: \"0.002\",\n },\n },\n});","response#Response":"export type SignAminoResponse = {\n signature: string;\n pub_key: { type: string; value: string };\n signed_doc: SignAminoDoc;\n};\nexport type SignAminoDoc = {\n chain_id: string;\n sequence: string;\n account_number: string;\n fee: Fee;\n memo: string;\n msgs: Msg[];\n};\nexport type Amount = {\n denom: string;\n amount: string;\n};\nexport type Msg = {\n type: string;\n value: T;\n};\nexport type Fee = { amount: Amount[]; gas: string };\n{\n \"pub_key\": {\n \"type\": \"tendermint/PubKeySecp256k1\",\n \"value\": \"A00Jvfv5luvAODNiOPIMZpDTWSq7qvoFV8k7ptdsDqLU\"\n },\n \"signature\": \"signature==\",\n \"signed_doc\": {\n \"chain_id\": \"cosmoshub-4\",\n \"fee\": {\n \"amount\": [{ \"denom\": \"uatom\", \"amount\": \"5000\" }],\n \"gas\": \"200000\"\n },\n \"memo\": \"\",\n \"msgs\": [\n {\n \"type\": \"cosmos-sdk/MsgSend\",\n \"value\": {\n \"from_address\": \"cosmos1gr0e3pj3y6fqvzyfm0qxyw9h5dwfrvh8zv3x9p\",\n \"to_address\": \"cosmos1ursv4z57pw8ly2jsgn09dyjha4qrk7aen987ld\",\n \"amount\": [{ \"denom\": \"uatom\", \"amount\": \"5000\" }]\n }\n }\n ],\n \"sequence\": \"20\",\n \"account_number\": \"632177\"\n }\n}","sign-direct#Sign Direct":"","code-using-cosmostationextension-client-1#Code using @cosmostation/extension-client":"try {\n // ...\n const response = await provider.signDirect(\n \"cosmos\",\n {\n chain_id: \"cosmoshub-4\",\n account_number: \"1\",\n auth_info_bytes: [\n 10, 80, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114,\n 121, 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80,\n 117, 98, 75, 101, 121, 18, 35, 10, 33, 3, 77, 9, 189, 251, 249, 150,\n 235, 192, 56, 51, 98, 56, 242, 12, 102, 144, 211, 89, 42, 187, 170, 250,\n 5, 87, 201, 59, 166, 215, 108, 14, 162, 212, 18, 4, 10, 2, 8, 127, 24,\n 14, 18, 19, 10, 13, 10, 5, 117, 97, 116, 111, 109, 18, 4, 50, 48, 48,\n 48, 16, 128, 241, 4,\n ],\n body_bytes: [\n 10, 133, 1, 10, 28, 47, 99, 111, 115, 109, 111, 115, 46, 98, 97, 110,\n 107, 46, 118, 49, 98, 101, 116, 97, 49, 46, 77, 115, 103, 83, 101, 110,\n 100, 18, 101, 10, 42, 99, 114, 101, 49, 103, 114, 48, 101, 51, 112, 106,\n 51, 121, 54, 102, 113, 118, 122, 121, 102, 109, 48, 113, 120, 121, 119,\n 57, 104, 53, 100, 119, 102, 114, 118, 104, 56, 120, 121, 122, 114, 115,\n 118, 18, 42, 99, 114, 101, 49, 120, 53, 119, 103, 104, 54, 118, 119,\n 121, 101, 54, 48, 119, 118, 51, 100, 116, 115, 104, 115, 57, 100, 109,\n 113, 103, 103, 119, 102, 120, 50, 108, 100, 104, 103, 108, 117, 101,\n 122, 26, 11, 10, 4, 117, 99, 114, 101, 18, 3, 49, 48, 48, 18, 0,\n ],\n },\n { memo: true, fee: true } // edit | optional (default: { memo: false, fee: false }),\n );\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n if (e.code === 4001) {\n console.log(\"user rejected request\");\n }\n // exception\n}","vanilla-code-1#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_signDirect\",\n params: {\n chainName: \"cosmos\",\n doc: {\n chain_id: \"cosmoshub-4\",\n account_number: \"1\",\n auth_info_bytes: [\n 10, 80, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114,\n 121, 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80,\n 117, 98, 75, 101, 121, 18, 35, 10, 33, 3, 77, 9, 189, 251, 249, 150,\n 235, 192, 56, 51, 98, 56, 242, 12, 102, 144, 211, 89, 42, 187, 170, 250,\n 5, 87, 201, 59, 166, 215, 108, 14, 162, 212, 18, 4, 10, 2, 8, 127, 24,\n 14, 18, 19, 10, 13, 10, 5, 117, 97, 116, 111, 109, 18, 4, 50, 48, 48,\n 48, 16, 128, 241, 4,\n ],\n body_bytes: [\n 10, 133, 1, 10, 28, 47, 99, 111, 115, 109, 111, 115, 46, 98, 97, 110,\n 107, 46, 118, 49, 98, 101, 116, 97, 49, 46, 77, 115, 103, 83, 101, 110,\n 100, 18, 101, 10, 42, 99, 114, 101, 49, 103, 114, 48, 101, 51, 112, 106,\n 51, 121, 54, 102, 113, 118, 122, 121, 102, 109, 48, 113, 120, 121, 119,\n 57, 104, 53, 100, 119, 102, 114, 118, 104, 56, 120, 121, 122, 114, 115,\n 118, 18, 42, 99, 114, 101, 49, 120, 53, 119, 103, 104, 54, 118, 119,\n 121, 101, 54, 48, 119, 118, 51, 100, 116, 115, 104, 115, 57, 100, 109,\n 113, 103, 103, 119, 102, 120, 50, 108, 100, 104, 103, 108, 117, 101,\n 122, 26, 11, 10, 4, 117, 99, 114, 101, 18, 3, 49, 48, 48, 18, 0,\n ],\n },\n isEditFee: true,\n isEditMemo: true,\n },\n});","response-1#Response":"export type SignDirectDoc = {\n chain_id: string;\n body_bytes: Uint8Array;\n auth_info_bytes: Uint8Array;\n account_number: string;\n};\nexport type SignDirectResponse = {\n signature: string;\n pub_key: { type: string; value: string };\n signed_doc: SignDirectDoc;\n};\n{\n \"pub_key\": {\n \"type\": \"tendermint/PubKeySecp256k1\",\n \"value\": \"A00Jvfv5luvAODNiOPIMZpDTWSq7qvoFV8k7ptdsDqLU\"\n },\n \"signature\": \"signature==\",\n \"signed_doc\": {\n \"chain_id\": \"cosmoshub-4\",\n \"account_number\": \"1\",\n \"auth_info_bytes\": [\n 10, 80, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114, 121,\n 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80, 117,\n 98, 75, 101, 121, 18, 35, 10, 33, 3, 77, 9, 189, 251, 249, 150, 235, 192,\n 56, 51, 98, 56, 242, 12, 102, 144, 211, 89, 42, 187, 170, 250, 5, 87, 201,\n 59, 166, 215, 108, 14, 162, 212, 18, 4, 10, 2, 8, 127, 24, 14, 18, 19, 10,\n 13, 10, 5, 117, 97, 116, 111, 109, 18, 4, 50, 48, 48, 48, 16, 128, 241, 4\n ],\n \"body_bytes\": [\n 10, 133, 1, 10, 28, 47, 99, 111, 115, 109, 111, 115, 46, 98, 97, 110, 107,\n 46, 118, 49, 98, 101, 116, 97, 49, 46, 77, 115, 103, 83, 101, 110, 100,\n 18, 101, 10, 42, 99, 114, 101, 49, 103, 114, 48, 101, 51, 112, 106, 51,\n 121, 54, 102, 113, 118, 122, 121, 102, 109, 48, 113, 120, 121, 119, 57,\n 104, 53, 100, 119, 102, 114, 118, 104, 56, 120, 121, 122, 114, 115, 118,\n 18, 42, 99, 114, 101, 49, 120, 53, 119, 103, 104, 54, 118, 119, 121, 101,\n 54, 48, 119, 118, 51, 100, 116, 115, 104, 115, 57, 100, 109, 113, 103,\n 103, 119, 102, 120, 50, 108, 100, 104, 103, 108, 117, 101, 122, 26, 11,\n 10, 4, 117, 99, 114, 101, 18, 3, 49, 48, 48, 18, 0\n ]\n }\n}"}},"/extension/integration/cosmos/integrate-cosmjs":{"title":"Integrate cosmjs","data":{"":"Integrate cosmjs.","add-package#Add package":"yarn add @cosmostation/cosmos-client\nnpm install @cosmostation/cosmos-client","offline-signer#Offline Signer":"import { getOfflineSigner } from \"@cosmostation/cosmos-client\";\nconst offlineSigner = await getOfflineSigner(CHAIN_ID);\nimport { getOfflineSigner } from \"@cosmostation/cosmos-client\";\nimport { GasPrice, calculateFee } from \"@cosmjs/stargate\";\nimport { SigningCosmWasmClient } from \"@cosmjs/cosmwasm-stargate\";\nconst offlineSigner = await getOfflineSigner(CHAIN_ID);\nconst rpcEndpoint = RPC_END_POINT;\nconst client = await SigningCosmWasmClient.connectWithSigner(\n rpcEndpoint,\n offlineSigner\n);\n//getAccounts\nconst accounts = await offlineSigner.getAccounts();\n//execute\nconst gasPrice = GasPrice.fromString(\"0.01denom\");\nconst fees = {\n upload: calculateFee(1500000, gasPrice),\n init: calculateFee(500000, gasPrice),\n exec: calculateFee(500000, gasPrice),\n};\nconst result = await client.execute(\n accounts[0].address,\n RECEIPT_ADDRESS,\n MESSAGE,\n fees.exec\n);"}},"/extension/integration/cosmos/react-hook":{"title":"React hook","data":{"installation#Installation":"The Cosmostation wallet hook package lives in npm. To install the latest stable version, run the following command:\nnpm install @cosmostation/use-wallets\nOr if you're using yarn:\nyarn add @cosmostation/use-wallets","cosmosprovider#CosmosProvider":"Components that use cosmos wallet state need CosmosProvider to appear somewhere in the parent tree. A good place to put this is in your root component:\nimport { CosmosProvider } from '@cosmostation/use-wallets';\nfunction App() {\n return (\n \n \n \n );\n}","usecosmoswallets#useCosmosWallets":"With useCosmosWallets, you can select a list of wallets, the wallet you are currently using, and the wallet you want to use.\nThe wallet list is automatically inserted in extensions.If you would like to add a wallet, click here","selectwallet#selectWallet":"import { useCosmosWallets } from '@cosmostation/use-wallets';\nfunction Connect() {\n const { cosmosWallets, selectWallet } = useCosmosWallets();\n return (\n
\n {cosmosWallets.map((wallet) => (\n {\n selectWallet(wallet.id);\n }}\n key={wallet.id}\n >\n {wallet.name} {wallet.name}\n \n ))}\n
\n );\n}","addchain#addChain":"import { useCosmosWallets } from '@cosmostation/use-wallets';\nfunction AddCustomChain() {\n const { currentWallet } = useCosmosWallets();\n return (\n
\n {\n try {\n if (!currentWallet) {\n throw new Error('No Selected Wallet');\n }\n await currentWallet.methods.addChain({\n chain_id: 'custom-chain-1',\n chain_name: 'custom-chain',\n address_prefix: 'custom',\n base_denom: 'ucustom',\n display_denom: 'CUSTOM',\n lcd_url: 'https://rpc.custom-chain.com',\n decimals: 6, // optional\n coin_type: \"118'\", // optional\n });\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Add Custom Chain\n \n
\n );\n}","usecosmosaccount#useCosmosAccount":"With useCosmosAccount, you can get the account information of the wallet you are currently using.","account#Account":"Account automatically requests account information the moment a wallet is selected. If you want to request more manually, you can use 'mutate'.\nType\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function Account() {\n const { data, error, mutate } = useCosmosAccount('cosmoshub-4');\n useEffect(() => {\n console.log('address', data?.account);\n console.log('error', error);\n }, [data, error]);\n return ;\n}","methods#Methods":"the available methods in the selected account. (e.g. sign)\nType","disconnect#disconnect":"import { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function Account() {\n const { data } = useCosmosAccount('cosmoshub-4');\n return ;\n}","signamino#signAmino":"Amino Doc Type\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function SignAmino() {\n const { data } = useCosmosAccount('cosmoshub-4');\n const sendExampleDoc = {\n // ...\n };\n return (\n {\n try {\n if (!data) {\n throw new Error('No data');\n }\n console.dir(await data?.methods.signAmino(sendExampleDoc), { depth: 100 });\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Sign Amino\n \n );\n}","signdirect#signDirect":"Direct Doc Type\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function SignDirect() {\n const { data } = useCosmosAccount('cosmoshub-4');\n const sendExampleDoc = {\n // ...\n };\n return (\n {\n try {\n if (!data) {\n throw new Error('No data');\n }\n const result = await data.methods.signDirect(sendExampleDoc);\n console.dir(result, { depth: 100 });\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Sign Direct\n \n );\n}","signandsendtransaction#signAndSendTransaction":"A method that combines sign and send using signDirect\nReceives message as json and automates creation of protobufJSON e.g.\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function SignAndSendTransaction() {\n const { data } = useCosmosAccount('cosmoshub-4');\n return (\n {\n try {\n if (!data) {\n throw new Error('No data');\n }\n console.dir(\n await data?.methods.signAndSendTransaction({\n messages: [\n {\n type_url: '/cosmos.bank.v1beta1.MsgSend',\n value: {\n from_address: data?.account.address,\n to_address: data?.account.address,\n amount: [\n {\n denom: 'uatom',\n amount: '1',\n },\n ],\n },\n },\n ],\n memo: 'Test (Sign And Send Transaction)',\n }),\n { depth: 100 },\n );\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Sign And Send Transaction\n \n );\n}","signmessage#signMessage":"sign arbitrary bytes\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function SignAndSendTransaction() {\n const { data } = useCosmosAccount('cosmoshub-4');\n return (\n {\n try {\n if (!data) {\n throw new Error('No data');\n }\n if (!data.methods.signMessage) {\n throw new Error('No signMessage method');\n }\n const message = '(test) sign message';\n console.dir(await data.methods.signMessage(message));\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Sign Message\n \n );\n}","verifymessage#verifyMessage":"verify arbitrary bytes\nimport { useCosmosAccount } from '@cosmostation/use-wallets';\nexport default function SignAndSendTransaction() {\n const { data } = useCosmosAccount('cosmoshub-4');\n return (\n {\n try {\n if (!data) {\n throw new Error('No data');\n }\n if (!data.methods.signMessage) {\n throw new Error('No signMessage method');\n }\n if (!data.methods.verifyMessage) {\n throw new Error('No verifyMessage method');\n }\n const message = '(test) sign message';\n const response = await data.methods.signMessage(message);\n const verify = await data.methods.verifyMessage(message, response.signature);\n console.log(verify ? 'verified' : 'not verified');\n } catch (e) {\n console.log(e.message);\n }\n }}\n >\n Verify Message\n \n );\n}","type#Type":"","account-1#Account":"interface Account {\n data?: {\n account: CosmosAccount;\n methods: CosmosMethods;\n };\n error?: string;\n mutate: () => void;\n}","cosmosaccount#CosmosAccount":"interface CosmosAccount {\n address: string;\n public_key: {\n type: CosmosPublicKeyType;\n value: string;\n };\n name?: string;\n is_ledger?: boolean;\n}","cosmospublickeytype#CosmosPublicKeyType":"type CosmosPublicKeyType = 'secp256k1' | 'ethsecp256k1';","cosmosmethods#CosmosMethods":"interface CosmosMethods {\n signAndSendTransaction: (\n props: SignAndSendTransactionProps,\n options?: SignOptions,\n ) => Promise;\n signAmino: (\n document: CosmosSignAminoDoc,\n options?: SignOptions,\n ) => Promise;\n signDirect: (\n document: CosmosSignDirectDoc,\n options?: SignOptions,\n ) => Promise;\n sendTransaction: (\n tx_bytes: Uint8Array | string,\n mode?: number,\n ) => Promise;\n getSupportedChainIds: () => Promise;\n signMessage?: (message: string, signer: string) => Promise;\n verifyMessage?: (message: string, signature: string) => Promise;\n}","cosmossignaminodoc#CosmosSignAminoDoc":"interface CosmosSignAminoDoc {\n sequence: string;\n account_number: string;\n fee: {\n amount?: {\n denom: string;\n amount: string;\n }[];\n gas: string;\n };\n memo: string;\n msgs: {\n type: string;\n value: any;\n }[];\n}","cosmossignaminoresponse#CosmosSignAminoResponse":"interface CosmosSignAminoResponse {\n signature: string;\n signed_doc: any;\n}","cosmossigndirectdoc#CosmosSignDirectDoc":"interface CosmosSignDirectDoc {\n account_number: string;\n body_bytes: string | Uint8Array;\n auth_info_bytes: string | Uint8Array;\n}","cosmossigndirectresponse#CosmosSignDirectResponse":"interface CosmosSignDirectResponse {\n signature: string;\n signed_doc: CosmosSignedDoc;\n}","signandsendtransactionprops#SignAndSendTransactionProps":"interface CosmosSignAndSendTransactionProps {\n messages: Message[];\n memo?: string;\n fee?: Fee;\n sequence?: number;\n lcd_url?: string;\n fee_denom?: string;\n gas_rate?: number;\n payer?: string;\n granter?: string;\n}\ninterface CosmosMessage {\n type_url: string;\n value?: unknown;\n}","cosmosfee#CosmosFee":"interface CosmosFee {\n amount: Amount[];\n gas_limit: number;\n payer?: string;\n granter?: string;\n}\ninterface CosmosAmount {\n denom: string;\n amount: number;\n}"}},"/extension/integration/evm/event":{"title":"Event","data":{"accountschanged#accountsChanged":"If current account is connected to the dApp, return an array of address. Otherwise, return an empty array.\nimport { ethers } from \"ethers\";\nimport { ethereum, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await ethereum();\n const handler = provider.on(\"accountsChanged\", (accounts) => {\n if(accounts.length === 0 ) {\n console.log(provider.request({'eth_requestAccounts'}))\n } else {\n console.log(accounts)\n }\n });\n provider.off(handler)\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n // exception\n}","chainchanged#chainChanged":"import { ethers } from \"ethers\";\nimport { ethereum, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await ethereum();\n const handler = provider.on(\"chainChanged\", (chainId) => {\n console.log(chainId);\n });\n provider.off(handler);\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n // exception\n}"}},"/extension/integration/evm/provider":{"title":"Provider","data":{"":"Cosmostation extension support various chains.","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { ethereum, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await ethereum();\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n}","vanilla-code#Vanilla Code":"const ethereum = () => {\n if (\"cosmostation\" in window) {\n return window.cosmostation.ethereum;\n } else {\n window.open(\"https://cosmostation.io/wallet/#extension\");\n /**\n * or window.open(\"https://chrome.google.com/webstore/detail/cosmostation/fpkhgmpbidmiogeglndfbkegfdlnajnf\");\n * */\n }\n};\nconst provider = ethereum();"}},"/extension/integration/cosmos/typescript":{"title":"Typescript","data":{"installation#Installation":"The Cosmostation wallet package lives in npm. To install the latest stable version, run the following command:\nnpm install @cosmostation/extension\nOr if you're using yarn:\nyarn add @cosmostation/extension","account#Account":"","request-account#Request account":"Get account information\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const account = await provider.requestAccount();\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Request Account\n;","disconnect#Disconnect":"Disconnect from the extension\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const account = await provider.requestAccount();\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Disconnect\n;","sign#Sign":"","signamino#SignAmino":"Signing with amino in the legacy way.\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const doc = {\n // ...\n };\n const response = await provider.signAmino(doc);\n console.log(response.signatures);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Amino\n;","signdirect#SignDirect":"Signing based on protobuf\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const doc = {\n // ...\n };\n const response = await provider.signDirect(doc);\n console.log(response.signatures);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Direct\n;","signandsendtransaction#SignAndSendTransaction":"A method that combines sign and send using signDirect\nReceives message as json and automates creation of protobufJSON e.g.\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const account = await provider.requestAccount();\n const response = await provider.signAndSendTransaction({\n messages: [\n {\n type_url: '/cosmos.bank.v1beta1.MsgSend',\n value: {\n from_address: account.address,\n to_address: account.address,\n amount: [\n {\n denom: 'uatom',\n amount: '1',\n },\n ],\n },\n },\n ],\n memo: 'Test (Sign And Send Transaction)',\n });\n console.log(response);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign And Send Transaction\n;","signmessage#SignMessage":"sign arbitrary bytes\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const response = await provider.signMessage('Test (Sign Message)');\n console.log(response.signature);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Message\n;","verifymessage#verifyMessage":"verify arbitrary bytes\nimport { cosmos } from '@cosmostation/extension';\n {\n try {\n const provider = await cosmos('cosmoshub-4');\n const text = 'Test (Sign Message)';\n const signResponse = await provider.signMessage(text);\n const verifyResponse = await provider.verifyMessage(text, signResponse.signature);\n console.log(verifyResponse ? 'verified' : 'not verified');\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign & Verify Message\n;","addcustomchain#AddCustomChain":"Add a chain or testnet chain that is not officially provided by the extension.\nimport { cosmosFunctions } from '@cosmostation/extension';\n {\n try {\n const response = cosmosFunctions.addCosmosChain({\n chainId: 'custom-chain-1',\n chainName: 'custom-chain',\n addressPrefix: 'custom',\n baseDenom: 'ucustom',\n displayDenom: 'CUSTOM',\n restURL: 'https://rpc.custom-chain.com',\n decimals: 6, // optional\n coinType: \"118'\", // optional\n });\n console.log(response.tx_response.txhash);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Add a custom chain\n;","event#Event":"","addeventlistener#addEventListener":"window.addEventListener('cosmostation_keystorechange', () => {\n console.log('Key store in Cosmostation is changed. You may need to refetch the account info.');\n});","removeeventlistener#removeEventListener":"window.removeEventListener('cosmostation_keystorechange', handler);"}},"/extension/integration/cosmos/vanilla":{"title":"Vanilla","data":{"":"This code can be used without any installation.","account#Account":"Get account information\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const account = await window.cosmostation.cosmos.request({\n method: 'cos_requestAccount',\n params: { chainName: 'cosmoshub-4' },\n });\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Request Account\n","sign#Sign":"","signamino#SignAmino":"Signing with amino in the legacy way.\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const doc = {\n //...\n };\n const response = await window.cosmostation.cosmos.request({\n method: 'cos_signAmino',\n params: { chainName: 'cosmoshub-4', doc },\n });\n console.log(response.signature);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Amino\n","signdirect#SignDirect":"Signing based on protobuf\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const doc = {\n // ...\n };\n const response = await window.cosmostation.cosmos.request({\n method: 'cos_signDirect',\n params: {\n chainName: 'cosmoshub-4',\n doc,\n },\n });\n console.log(response.signatures);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Direct\n","signmessage#SignMessage":"sign arbitrary bytes\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const account = await window.cosmostation.cosmos.request({\n method: 'cos_requestAccount',\n params: { chainName: 'cosmoshub-4' },\n });\n const response = await window.cosmostation.cosmos.request({\n method: 'cos_signMessage',\n params: {\n chainName: 'cosmoshub-4',\n message: 'Test (Sign Message)',\n signer: account.address,\n },\n });\n console.log(response.signature);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign Message\n","verifymessage#VerifyMessage":"verify arbitrary bytes\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const message = 'Test (Sign Message)';\n const account = await window.cosmostation.cosmos.request({\n method: 'cos_requestAccount',\n params: { chainName: 'cosmoshub-4' },\n });\n const signResponse = await window.cosmostation.cosmos.request({\n method: 'cos_signMessage',\n params: {\n chainName: 'cosmoshub-4',\n message,\n signer: account.address,\n },\n });\n const verifyResponse = await window.cosmostation.cosmos.request({\n method: 'cos_verifyMessage',\n params: {\n chainName: 'cosmoshub-4',\n message,\n signer: account.address,\n publicKey: signResponse.pub_key.value,\n signature: signResponse.signature,\n },\n });\n console.log(verifyResponse ? 'verified' : 'not verified');\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Sign & Verify Message\n","addcw20token#AddCW20Token":" {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n await window.cosmostation.cosmos.request({\n method: 'cos_addTokensCW20',\n params: {\n chainName: 'juno-1',\n tokens: [\n {\n contractAddress: '',\n },\n ],\n },\n });\n console.log('added');\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Add CW20 Tokens\n","addcustomchain#AddCustomChain":"Add a chain or testnet chain that is not officially provided by the extension.\n {\n try {\n if (!window.cosmostation) {\n throw new Error('Cosmostation extension not installed');\n }\n const response = await window.cosmostation.cosmos.request({\n method: 'cos_addChain',\n params: {\n chainId: 'custom-chain-1',\n chainName: 'custom-chain',\n addressPrefix: 'custom',\n baseDenom: 'ucustom',\n displayDenom: 'CUSTOM',\n restURL: 'https://rpc.custom-chain.com',\n decimals: 6, // optional\n coinType: '118', // optional\n },\n });\n console.log(response.tx_response.txhash);\n } catch (e) {\n console.log(e.message);\n }\n }}\n>\n Add a custom chain\n","event#Event":"","addeventlistener#addEventListener":"window.addEventListener('cosmostation_keystorechange', () => {\n console.log('Key store in Cosmostation is changed. You may need to refetch the account info.');\n});","removeeventlistener#removeEventListener":"window.removeEventListener('cosmostation_keystorechange', handler);"}},"/extension/integration/cosmos/wallet":{"title":"Wallet","data":{"":"The interface of each Cosmos wallet is different, and in order to solve the problem of having to manually attach each wallet to the Dapp, it was developed to automatically add the same interface and wallet.","installation#Installation":"npm install @cosmostation/wallets\nOr if you're using yarn:\nyarn add @cosmostation/wallets","add-wallet#Add Wallet":"To detect a wallet, it is ideal to inject it directly from the extension, but it is also possible to manually inject a wallet that has not been injected into a dapp.Example\nimport { registerCosmosWallet, CosmosRegisterWallet } from '@cosmostation/wallets';\n {\n const wallet: CosmosRegisterWallet = {\n // ...\n };\n registerCosmosWallet(wallet);\n }}\n>\n Register Wallet\n;\ngo to test","example#Example":"This is an example of adding keplr and leap wallet.","keplr#Keplr":"import { registerCosmosWallet, CosmosRegisterWallet } from '@cosmostation/wallets';\n {\n if (!window.keplr) {\n alert('Keplr extension is not installed');\n return;\n }\n const wallet: CosmosRegisterWallet = {\n name: 'Keplr',\n logo: 'https://wallet.keplr.app/keplr-brand-assets/keplr-logo.svg',\n events: {\n on(type, listener) {\n if (type === 'AccountChanged') {\n window.addEventListener('keplr_keystorechange', listener);\n }\n },\n off(type, listener) {\n if (type === 'AccountChanged') {\n window.removeEventListener('keplr_keystorechange', listener);\n }\n },\n },\n methods: {\n getSupportedChainIds: async () => {\n return ['cosmoshub-4'];\n },\n connect: async (chainIds) => {\n const cIds = typeof chainIds === 'string' ? [chainIds] : chainIds;\n const supportedChainIds = await wallet.methods.getSupportedChainIds();\n if (!cIds.every((cId) => supportedChainIds.includes(cId))) {\n throw new Error('Unsupported chainId is exist');\n }\n await window.keplr.enable(chainIds);\n },\n getAccount: async (chainId) => {\n const response = await window.keplr.getKey(chainId);\n return {\n address: response.bech32Address,\n name: response.name,\n public_key: {\n type: response.algo,\n value: Buffer.from(response.pubKey).toString('base64'),\n },\n is_ledger: response.isNanoLedger,\n };\n },\n signAmino: async (chainId, document, options) => {\n if (typeof options?.edit_mode?.fee === 'boolean') {\n window.keplr.defaultOptions.sign.preferNoSetFee = options.edit_mode.fee;\n }\n if (typeof options?.edit_mode?.memo === 'boolean') {\n window.keplr.defaultOptions.sign.preferNoSetMemo = options.edit_mode.memo;\n }\n if (typeof options?.is_check_balance === 'boolean') {\n window.keplr.defaultOptions.sign.disableBalanceCheck = options.is_check_balance;\n }\n const signer = options?.signer || (await wallet.methods.getAccount(chainId)).address;\n const response = await window.keplr.signAmino(chainId, signer, document);\n return {\n signature: response.signature.signature,\n signed_doc: response.signed,\n };\n },\n signDirect: async (chainId, document, options) => {\n if (typeof options?.edit_mode?.fee === 'boolean') {\n window.keplr.defaultOptions.sign.preferNoSetFee = options.edit_mode.fee;\n }\n if (typeof options?.edit_mode?.memo === 'boolean') {\n window.keplr.defaultOptions.sign.preferNoSetMemo = options.edit_mode.memo;\n }\n if (typeof options?.is_check_balance === 'boolean') {\n window.keplr.defaultOptions.sign.disableBalanceCheck = !options.is_check_balance;\n }\n const account = await wallet.methods.getAccount(chainId);\n if (account.is_ledger) {\n throw new Error('Ledger is not supported');\n }\n const signer = options?.signer || account.address;\n const signingDoc = {\n accountNumber: document.account_number,\n authInfoBytes: document.auth_info_bytes,\n chainId: document.chain_id,\n bodyBytes: document.body_bytes,\n };\n const response = await window.keplr.signDirect(chainId, signer, signingDoc);\n return {\n signature: response.signature.signature,\n signed_doc: {\n auth_info_bytes: response.signed.authInfoBytes,\n body_bytes: response.signed.bodyBytes,\n },\n };\n },\n sendTransaction: async (chainId, tx_bytes, mode) => {\n const broadcastMode =\n mode === 1 ? 'block' : mode === 2 ? 'sync' : mode === 3 ? 'async' : 'sync';\n const txBytes =\n typeof tx_bytes === 'string'\n ? new Uint8Array(Buffer.from(tx_bytes, 'base64'))\n : tx_bytes;\n const response = await window.keplr.sendTx(chainId, txBytes, broadcastMode);\n const txHash = Buffer.from(response).toString('hex').toUpperCase();\n return txHash;\n },\n addChain: async (chain) => {\n const coinType = chain.coin_type ? Number(chain.coin_type.replaceAll(\"'\", '')) : 118;\n await window.keplr.experimentalSuggestChain({\n chainId: chain.chain_id,\n chainName: chain.chain_name,\n rpc: chain.lcd_url,\n rest: chain.lcd_url,\n bip44: {\n coinType,\n },\n bech32Config: {\n bech32PrefixAccAddr: chain.address_prefix,\n bech32PrefixAccPub: chain.address_prefix + 'pub',\n bech32PrefixValAddr: chain.address_prefix + 'valoper',\n bech32PrefixValPub: chain.address_prefix + 'valoperpub',\n bech32PrefixConsAddr: chain.address_prefix + 'valcons',\n bech32PrefixConsPub: chain.address_prefix + 'valconspub',\n },\n currencies: [\n {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n },\n ],\n feeCurrencies: [\n {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n gasPriceStep: {\n low: chain?.gas_rate?.tiny ? Number(chain?.gas_rate?.tiny) : 0.01,\n average: chain?.gas_rate?.low ? Number(chain?.gas_rate?.low) : 0.025,\n high: chain?.gas_rate?.average ? Number(chain?.gas_rate?.average) : 0.04,\n },\n },\n ],\n stakeCurrency: {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n },\n });\n },\n },\n };\n registerCosmosWallet(wallet);\n }}\n>\n Register Keplr Wallet\n;","leap#Leap":"import { registerCosmosWallet, CosmosRegisterWallet } from '@cosmostation/wallets';\n {\n if (!window.leap) {\n alert('Leap extension is not installed');\n return;\n }\n const wallet: CosmosRegisterWallet = {\n name: 'Leap',\n logo: 'https://miro.medium.com/v2/resize:fill:176:176/1*2jNLyjIPuU8HBbayPapwcQ.png',\n events: {\n on(type, listener) {\n if (type === 'AccountChanged') {\n window.addEventListener('leap_keystorechange', listener);\n }\n },\n off(type, listener) {\n if (type === 'AccountChanged') {\n window.removeEventListener('leap_keystorechange', listener);\n }\n },\n },\n methods: {\n getSupportedChainIds: async () => {\n return ['cosmoshub-4'];\n },\n connect: async (chainIds) => {\n const cIds = typeof chainIds === 'string' ? [chainIds] : chainIds;\n const supportedChainIds = await wallet.methods.getSupportedChainIds();\n if (!cIds.every((cId) => supportedChainIds.includes(cId))) {\n throw new Error('Unsupported chainId is exist');\n }\n await window.leap.enable(chainIds);\n },\n getAccount: async (chainId) => {\n const response = await window.leap.getKey(chainId);\n return {\n address: response.bech32Address,\n name: response.name,\n public_key: {\n type: response.algo,\n value: Buffer.from(response.pubKey).toString('base64'),\n },\n is_ledger: response.isNanoLedger,\n };\n },\n signAmino: async (chainId, document, options) => {\n if (typeof options?.edit_mode?.fee === 'boolean') {\n window.leap.defaultOptions.sign.preferNoSetFee = options.edit_mode.fee;\n }\n if (typeof options?.edit_mode?.memo === 'boolean') {\n window.leap.defaultOptions.sign.preferNoSetMemo = options.edit_mode.memo;\n }\n if (typeof options?.is_check_balance === 'boolean') {\n window.leap.defaultOptions.sign.disableBalanceCheck = options.is_check_balance;\n }\n const signer = options?.signer || (await wallet.methods.getAccount(chainId)).address;\n const response = await window.leap.signAmino(chainId, signer, document);\n return {\n signature: response.signature.signature,\n signed_doc: response.signed,\n };\n },\n signDirect: async (chainId, document, options) => {\n if (typeof options?.edit_mode?.fee === 'boolean') {\n window.leap.defaultOptions.sign.preferNoSetFee = options.edit_mode.fee;\n }\n if (typeof options?.edit_mode?.memo === 'boolean') {\n window.leap.defaultOptions.sign.preferNoSetMemo = options.edit_mode.memo;\n }\n if (typeof options?.is_check_balance === 'boolean') {\n window.leap.defaultOptions.sign.disableBalanceCheck = !options.is_check_balance;\n }\n const account = await wallet.methods.getAccount(chainId);\n if (account.is_ledger) {\n throw new Error('Ledger is not supported');\n }\n const signer = options?.signer || account.address;\n const signingDoc = {\n accountNumber: document.account_number,\n authInfoBytes: document.auth_info_bytes,\n chainId: document.chain_id,\n bodyBytes: document.body_bytes,\n };\n const response = await window.leap.signDirect(chainId, signer, signingDoc);\n return {\n signature: response.signature.signature,\n signed_doc: {\n auth_info_bytes: response.signed.authInfoBytes,\n body_bytes: response.signed.bodyBytes,\n },\n };\n },\n sendTransaction: async (chainId, tx_bytes, mode) => {\n const broadcastMode =\n mode === 1 ? 'block' : mode === 2 ? 'sync' : mode === 3 ? 'async' : 'sync';\n const txBytes =\n typeof tx_bytes === 'string'\n ? new Uint8Array(Buffer.from(tx_bytes, 'base64'))\n : tx_bytes;\n const response = await window.leap.sendTx(chainId, txBytes, broadcastMode);\n const txHash = Buffer.from(response).toString('hex').toUpperCase();\n return txHash;\n },\n addChain: async (chain) => {\n const coinType = chain.coin_type ? Number(chain.coin_type.replaceAll(\"'\", '')) : 118;\n await window.leap.experimentalSuggestChain({\n chainId: chain.chain_id,\n chainName: chain.chain_name,\n rpc: chain.lcd_url,\n rest: chain.lcd_url,\n bip44: {\n coinType,\n },\n bech32Config: {\n bech32PrefixAccAddr: chain.address_prefix,\n bech32PrefixAccPub: chain.address_prefix + 'pub',\n bech32PrefixValAddr: chain.address_prefix + 'valoper',\n bech32PrefixValPub: chain.address_prefix + 'valoperpub',\n bech32PrefixConsAddr: chain.address_prefix + 'valcons',\n bech32PrefixConsPub: chain.address_prefix + 'valconspub',\n },\n currencies: [\n {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n },\n ],\n feeCurrencies: [\n {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n gasPriceStep: {\n low: chain?.gas_rate?.tiny ? Number(chain?.gas_rate?.tiny) : 0.01,\n average: chain?.gas_rate?.low ? Number(chain?.gas_rate?.low) : 0.025,\n high: chain?.gas_rate?.average ? Number(chain?.gas_rate?.average) : 0.04,\n },\n },\n ],\n stakeCurrency: {\n coinDenom: chain.display_denom,\n coinMinimalDenom: chain.base_denom,\n coinDecimals: chain.decimals || 6,\n coinGeckoId: chain.coingecko_id || 'unknown',\n },\n });\n },\n },\n };\n registerCosmosWallet(wallet);\n }}\n>\n Register Leap Wallet\n;"}},"/extension/integration/evm/supported-rpc-methods":{"title":"Supported RPC methods","data":{"ethereum-json-rpc-methods#Ethereum JSON-RPC Methods":"For the Ethereum JSON-RPC API, please see the Ethereum wikiImportant methods from this API include:\neth_accounts\neth_call\neth_getBalance\neth_sign\neth_sendTransaction\neth_signTransaction","eth_requestaccounts-eip-1102#eth_requestAccounts (EIP-1102)":"Link","returns#Returns":"string[] - An array of a single, hexadecimal Ethereum address string.","example#Example":"// provider.request or\nwindow.cosmostation.ethereum.request({\n method: \"eth_requestAccounts\",\n});","wallet_addethereumchain-eip-3085#wallet_addEthereumChain (EIP-3085)":"Link","parameters#Parameters":"type WalletAddEthereumChainParam = [\n {\n chainId: string;\n chainName: string;\n blockExplorerUrls?: string[];\n iconUrls?: string[];\n nativeCurrency: {\n name: string;\n symbol: string;\n decimals: number;\n };\n rpcUrls: string[];\n coinGeckoId?: string;\n }\n];","returns-1#Returns":"null - The method returns null if the request was successful, and an error otherwise.","example-1#Example":"// provider.request or\nwindow.cosmostation.ethereum.request({\n method: \"wallet_addEthereumChain\",\n params: [\n {\n chainId: \"0x38\",\n chainName: \"Binance Smart Chain\",\n rpcUrls: [\"https://bsc-dataseed.binance.org\"],\n iconUrls: [\n \"https://www.coinreaders.com/imgdata/coinreaders_com/202107/2021072701234398.png\",\n ],\n nativeCurrency: {\n name: \"BNB\",\n symbol: \"BNB\",\n decimals: 18,\n },\n blockExplorerUrls: [\"https://bscscan.com\"],\n },\n ],\n});","wallet_switchethereumchain-eip-3326#wallet_switchEthereumChain (EIP-3326)":"Link","parameters-1#Parameters":"type WalletSwitchEthereumChainParam = [\n {\n chainId: string;\n }\n];","returns-2#Returns":"null - The method returns null if the request was successful, and an error otherwise.","example-2#Example":"// provider.request or\nwindow.cosmostation.ethereum.request({\n method: \"wallet_switchEthereumChain\",\n params: [{ chainId: \"0x38\" }],\n});","wallet_watchasset-eip-747#wallet_watchAsset (EIP-747)":"Link","parameters-2#Parameters":"type WalletWatchAssetParam = {\n type: string;\n options: {\n address: string;\n symbol: string;\n decimals: number;\n image?: string;\n coinGeckoId?: string;\n };\n};","returns-3#Returns":"boolean - true if the request was successful, error otherwise.","example-3#Example":"// provider.request or\nwindow.cosmostation.ethereum.request({\n method: \"wallet_watchAsset\",\n params: {\n type: \"ERC20\",\n options: {\n address: \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\",\n symbol: \"WETH\",\n decimals: 18,\n },\n },\n});","eth_signtypeddata_v3--eth_signtypeddata_v4#eth_signTypedData_v3 / eth_signTypedData_v4":"","example-4#Example":"const msgParams = JSON.stringify({\n domain: {\n // Defining the chain aka Rinkeby testnet or Ethereum Main Net\n chainId: 1,\n // Give a user friendly name to the specific contract you are signing for.\n name: \"Ether Mail\",\n // If name isn't enough add verifying contract to make sure you are establishing contracts with the proper entity\n verifyingContract: \"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\",\n // Just let's you know the latest version. Definitely make sure the field name is correct.\n version: \"1\",\n },\n // Defining the message signing data content.\n message: {\n /*\n - Anything you want. Just a JSON Blob that encodes the data you want to send\n - No required fields\n - This is DApp Specific\n - Be as explicit as possible when building out the message schema.\n */\n contents: \"Hello, Bob!\",\n attachedMoneyInEth: 4.2,\n from: {\n name: \"Cow\",\n wallets: [\n \"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\",\n \"0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF\",\n ],\n },\n to: [\n {\n name: \"Bob\",\n wallets: [\n \"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\",\n \"0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57\",\n \"0xB0B0b0b0b0b0B000000000000000000000000000\",\n ],\n },\n ],\n },\n // Refers to the keys of the *types* object below.\n primaryType: \"Mail\",\n types: {\n // TODO: Clarify if EIP712Domain refers to the domain the contract is hosted on\n EIP712Domain: [\n { name: \"name\", type: \"string\" },\n { name: \"version\", type: \"string\" },\n { name: \"chainId\", type: \"uint256\" },\n { name: \"verifyingContract\", type: \"address\" },\n ],\n // Not an EIP712Domain definition\n Group: [\n { name: \"name\", type: \"string\" },\n { name: \"members\", type: \"Person[]\" },\n ],\n // Refer to PrimaryType\n Mail: [\n { name: \"from\", type: \"Person\" },\n { name: \"to\", type: \"Person[]\" },\n { name: \"contents\", type: \"string\" },\n ],\n // Not an EIP712Domain definition\n Person: [\n { name: \"name\", type: \"string\" },\n { name: \"wallets\", type: \"address[]\" },\n ],\n },\n});\nconst from = \"\"; // signer address\nconst params = [from, msgParams];\nconst method = \"eth_signTypedData_v4\";\n// provider.request or\nwindow.cosmostation.ethereum.request({\n method,\n params,\n});"}},"/extension/integration/sui/execute-move-call":{"title":"Execute Move Call","data":{"":"Execute Move Call via Cosmostation Extension\nconst payload = {\n packageObjectId: \"0x2\",\n module: \"devnet_nft\",\n function: \"mint\",\n typeArguments: [],\n arguments: [\n \"Cosmostation NFT\",\n \"An NFT created by Cosmostation Wallet\",\n \"https://avatars.githubusercontent.com/u/49175386?s=200&v=4\",\n ],\n gasBudget: 10000,\n};\nawait window.cosmostation.sui.connect();\nconst response = await window.cosmostation.sui.executeMoveCall(payload);","request#request":"MoveCallTransaction\nexport interface MoveCallTransaction {\n packageObjectId: ObjectId;\n module: string;\n function: string;\n typeArguments: string[] | TypeTag[];\n arguments: SuiJsonValue[];\n gasPayment?: ObjectId;\n gasBudget: number;\n}","response#Response":"CertifiedTransaction\nTransactionEffects\nexport type SuiTransactionResponse = {\n certificate: CertifiedTransaction;\n effects: TransactionEffects;\n};\n{\n \"certificate\": {\n \"transactionDigest\": \"QTWZUMmBzPReVUPjxPRPs271Zve7C4rtCRHm8Cisz4x\",\n \"data\": {\n \"transactions\": [\n {\n \"Call\": {\n \"package\": {\n \"objectId\": \"0x0000000000000000000000000000000000000002\",\n \"version\": 1,\n \"digest\": \"BN1R9u+4+jOoGiGagW50eT+EE+JxtYLaveBPxHhgsiE=\"\n },\n \"module\": \"devnet_nft\",\n \"function\": \"mint\",\n \"arguments\": [\n \"Cosmostation NFT\",\n \"An NFT created by Cosmostation Wallet\",\n \"https://avatars.githubusercontent.com/u/49175386?s=200&v=4\"\n ]\n }\n }\n ],\n \"sender\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\",\n \"gasPayment\": {\n \"objectId\": \"0x3be2f11263e4c6d77356ba04f053f38ae917bd23\",\n \"version\": 99,\n \"digest\": \"aw8yjNgqA/siJay1eJWv/axflLvGwSM+RbXOilKWAlo=\"\n },\n \"gasPrice\": 1,\n \"gasBudget\": 10000\n },\n \"txSignature\": \"ALSjaMJTiA34zu/d6nnfBH7SxjQvk988NYcNeW8cHJf0zLvriSbIf3/6q7FDtg/5jCNOBknZ38Hmgg0MAhRs7wdWEU2i63wnssWTOQJmMjz5Wq+PhqtBW+GrkSSWOnRKAA==\",\n \"authSignInfo\": {\n \"epoch\": 0,\n \"signature\": \"qhUPMYuuaMqemq+l5a/rDm7VlFmkzXvxtf1gNdwT1xTuNPGYRE0DYBJ+WNnB/D30\",\n \"signers_map\": [\n 58, 48, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 16, 0, 0, 0, 0, 0, 2, 0, 3, 0\n ]\n }\n },\n \"effects\": {\n \"status\": { \"status\": \"success\" },\n \"gasUsed\": {\n \"computationCost\": 464,\n \"storageCost\": 40,\n \"storageRebate\": 16\n },\n \"transactionDigest\": \"QTWZUMmBzPReVUPjxPRPs271Zve7C4rtCRHm8Cisz4x\",\n \"created\": [\n {\n \"owner\": {\n \"AddressOwner\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\"\n },\n \"reference\": {\n \"objectId\": \"0x1eaadc7b76011f5657821a6aa92eae6098689c9a\",\n \"version\": 100,\n \"digest\": \"jJ99SfS/MZIqudWmXmdXU8GChiXFsej27kWDz6FCNeQ=\"\n }\n }\n ],\n \"mutated\": [\n {\n \"owner\": {\n \"AddressOwner\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\"\n },\n \"reference\": {\n \"objectId\": \"0x3be2f11263e4c6d77356ba04f053f38ae917bd23\",\n \"version\": 100,\n \"digest\": \"wgC6a5w4Xqg4D81bOvBiRjkh0m91srqzZP0kLTkCU6Y=\"\n }\n }\n ],\n \"gasObject\": {\n \"owner\": { \"AddressOwner\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\" },\n \"reference\": {\n \"objectId\": \"0x3be2f11263e4c6d77356ba04f053f38ae917bd23\",\n \"version\": 100,\n \"digest\": \"wgC6a5w4Xqg4D81bOvBiRjkh0m91srqzZP0kLTkCU6Y=\"\n }\n },\n \"events\": [\n {\n \"coinBalanceChange\": {\n \"packageId\": \"0x0000000000000000000000000000000000000002\",\n \"transactionModule\": \"gas\",\n \"sender\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\",\n \"changeType\": \"Gas\",\n \"owner\": {\n \"AddressOwner\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\"\n },\n \"coinType\": \"0x2::sui::SUI\",\n \"coinObjectId\": \"0x3be2f11263e4c6d77356ba04f053f38ae917bd23\",\n \"version\": 99,\n \"amount\": -488\n }\n },\n {\n \"newObject\": {\n \"packageId\": \"0x0000000000000000000000000000000000000002\",\n \"transactionModule\": \"devnet_nft\",\n \"sender\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\",\n \"recipient\": {\n \"AddressOwner\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\"\n },\n \"objectType\": \"0x2::devnet_nft::DevNetNFT\",\n \"objectId\": \"0x1eaadc7b76011f5657821a6aa92eae6098689c9a\",\n \"version\": 100\n }\n },\n {\n \"moveEvent\": {\n \"packageId\": \"0x0000000000000000000000000000000000000002\",\n \"transactionModule\": \"devnet_nft\",\n \"sender\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\",\n \"type\": \"0x2::devnet_nft::MintNFTEvent\",\n \"fields\": {\n \"creator\": \"0xddee25bee35fa634a1d486d16281f333370ef3f2\",\n \"name\": \"Cosmostation NFT\",\n \"object_id\": \"0x1eaadc7b76011f5657821a6aa92eae6098689c9a\"\n },\n \"bcs\": \"Hqrce3YBH1ZXghpqqS6uYJhonJrd7iW+41+mNKHUhtFigfMzNw7z8hBDb3Ntb3N0YXRpb24gTkZU\"\n }\n }\n ],\n \"dependencies\": [\"CxQQcJfAyDkhxiLiXxrAkFREikMNnngwoGW7kVouMY7w\"]\n }\n}"}},"/extension/integration/evm/use-web3-js":{"title":"Use web3.js","data":{"":"npmjs\ndocs\nimport Web3 from \"web3\";\nimport { ethereum, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await ethereum();\n const web3 = new Web3(provider);\n // requestAccounts\n const accounts = web3.eth.requestAccounts();\n // If you want more info, please check out web3.js docs (https://web3js.readthedocs.io)\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n // exception\n}","signtypeddata#signTypedData":"const provider = await ethereum();\nconst web3 = new Web3(provider);\nconst msgParams = JSON.stringify({\n domain: {\n // Defining the chain aka Rinkeby testnet or Ethereum Main Net\n chainId: 1,\n // Give a user friendly name to the specific contract you are signing for.\n name: \"Ether Mail\",\n // If name isn't enough add verifying contract to make sure you are establishing contracts with the proper entity\n verifyingContract: \"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\",\n // Just let's you know the latest version. Definitely make sure the field name is correct.\n version: \"1\",\n },\n // Defining the message signing data content.\n message: {\n /*\n - Anything you want. Just a JSON Blob that encodes the data you want to send\n - No required fields\n - This is DApp Specific\n - Be as explicit as possible when building out the message schema.\n */\n contents: \"Hello, Bob!\",\n attachedMoneyInEth: 4.2,\n from: {\n name: \"Cow\",\n wallets: [\n \"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\",\n \"0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF\",\n ],\n },\n to: [\n {\n name: \"Bob\",\n wallets: [\n \"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\",\n \"0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57\",\n \"0xB0B0b0b0b0b0B000000000000000000000000000\",\n ],\n },\n ],\n },\n // Refers to the keys of the *types* object below.\n primaryType: \"Mail\",\n types: {\n // TODO: Clarify if EIP712Domain refers to the domain the contract is hosted on\n EIP712Domain: [\n { name: \"name\", type: \"string\" },\n { name: \"version\", type: \"string\" },\n { name: \"chainId\", type: \"uint256\" },\n { name: \"verifyingContract\", type: \"address\" },\n ],\n // Not an EIP712Domain definition\n Group: [\n { name: \"name\", type: \"string\" },\n { name: \"members\", type: \"Person[]\" },\n ],\n // Refer to PrimaryType\n Mail: [\n { name: \"from\", type: \"Person\" },\n { name: \"to\", type: \"Person[]\" },\n { name: \"contents\", type: \"string\" },\n ],\n // Not an EIP712Domain definition\n Person: [\n { name: \"name\", type: \"string\" },\n { name: \"wallets\", type: \"address[]\" },\n ],\n },\n});\nconst from = \"\"; // signer address\nconst params = [from, msgParams];\nconst method = \"eth_signTypedData_v4\";\nconst result = web3.currentProvider.request({\n method,\n params,\n});"}},"/extension/integration/sui/provider":{"title":"Provider","data":{"":"Cosmostation extension support various chains.\nconst sui = () => {\n if (\"cosmostation\" in window) {\n return window.cosmostation.sui;\n } else {\n window.open(\"https://cosmostation.io/wallet/#extension\");\n /**\n * or window.open(\"https://chrome.google.com/webstore/detail/cosmostation/fpkhgmpbidmiogeglndfbkegfdlnajnf\");\n * */\n }\n};\nconst provider = sui();"}},"/extension/integration/sui/connect-and-get-accounts":{"title":"Connect And Get Accounts","data":{"":"connect and get Account via Cosmostation Extension\nconst response = await window.cosmostation.sui.connect();\n// or\nconst response = await window.cosmostation.sui.connect([\n \"viewAccount\",\n \"suggestTransactions\",\n]);","response#Response":"export type SuiConnectResponse = boolean;\ntrue","get-accounts#Get Accounts":"","vanilla-code#Vanilla Code":"const response = await window.cosmostation.sui.connect();\nconst accounts = await window.cosmostation.sui.getAccounts();\nconst publicKey = await window.cosmostation.sui.getPublicKey();","response-1#Response":"export type SuiAccountResponse = string[];\n[\"0xd2d030d4339531d9cb442caf4be7bb954fddedb4\"]"}},"/extension/integration/sui/sign-and-execute-transaction":{"title":"Sign And Execute Transaction","data":{"":"import { TransactionBlock } from \"@mysten/sui.js\";\n// Send Sui coin\nconst tx = new TransactionBlock();\nconst sampleSendCoinAmount = \"100000\";\nconst sampleReceiverAddress = \"0x...\";\nconst [coin] = tx.splitCoins(tx.gas, [tx.pure(sampleSendCoinAmount)]);\ntx.transferObjects([coin], tx.pure(sampleReceiverAddress));\n// SuiSignAndExecuteTransactionBlockInput\nconst payload = {\n transactionBlock: tx,\n options: {\n showInput: true,\n showEffects: true,\n showEvents: true,\n },\n};\nawait window.cosmostation.sui.connect();\nconst response = await window.cosmostation.sui.signAndExecuteTransaction(\n payload\n);","request#request":"SuiSignAndExecuteTransactionBlockInput\nexport interface SuiSignTransactionBlockInput {\n transactionBlock: TransactionBlock;\n account: WalletAccount;\n chain: IdentifierString;\n}\nexport interface SuiSignAndExecuteTransactionBlockInput\n extends SuiSignTransactionBlockInput {\n requestType?: ExecuteTransactionRequestType;\n options?: SuiTransactionBlockResponseOptions;\n}\nexport type SuiTransactionBlockResponseOptions = {\n showInput?: boolean | undefined;\n showEffects?: boolean | undefined;\n showEvents?: boolean | undefined;\n showObjectChanges?: boolean | undefined;\n showBalanceChanges?: boolean | undefined;\n};","response#Response":"SuiTrasactionResponse\nSuiTransactionBlock\nTransactionEffects\nTransactionEvents\nSuiObjectChange\nBalanceChange\nexport type SuiTransactionResponse = {\n digest: TransactionDigest,\n transaction: optional(SuiTransactionBlock),\n effects: optional(TransactionEffects),\n events: optional(TransactionEvents),\n timestampMs: optional(string()),\n checkpoint: optional(string()),\n confirmedLocalExecution: optional(boolean()),\n objectChanges: optional(array(SuiObjectChange)),\n balanceChanges: optional(array(BalanceChange)),\n /* Errors that occurred in fetching/serializing the transaction. */\n errors: optional(array(string())),\n};\n{\n \"digest\": \"ADxukibq4o4QqiMgr6QqtXnXczh5MGCQqMkgCKUW5NXT\",\n \"transaction\": {\n \"data\": {\n \"messageVersion\": \"v1\",\n \"transaction\": {\n \"kind\": \"ProgrammableTransaction\",\n \"inputs\": [\n {\n \"type\": \"pure\",\n \"valueType\": \"u64\",\n \"value\": \"1000000000\"\n },\n {\n \"type\": \"object\",\n \"objectType\": \"sharedObject\",\n \"objectId\": \"\",\n \"initialSharedVersion\": \"1\",\n \"mutable\": true\n },\n {\n \"type\": \"pure\",\n \"valueType\": \"address\",\n \"value\": \"\"\n }\n ],\n \"transactions\": [\n {\n \"SplitCoins\": [\n \"GasCoin\",\n [\n {\n \"Input\": 0\n }\n ]\n ]\n },\n {\n \"MoveCall\": {\n \"package\": \"\",\n \"module\": \"sui_system\",\n \"function\": \"request_add_stake\",\n \"arguments\": [\n {\n \"Input\": 1\n },\n {\n \"Result\": 0\n },\n {\n \"Input\": 2\n }\n ]\n }\n }\n ]\n },\n \"sender\": \"\",\n \"gasData\": {\n \"payment\": [\n {\n \"objectId\": \"\",\n \"version\": 120,\n \"digest\": \"4eWN3j13gkCgmpF3ino3PyBnBGcr8TM9g7oXyLVcFvDf\"\n }\n ],\n \"owner\": \"\",\n \"price\": \"990\",\n \"budget\": \"10269000\"\n }\n },\n \"txSignatures\": [\n \"AOM7i8tZRt314VYWxtBr5DAUukOZJsRcX6YUZjKVzB/j0gyYqCMZ1mIVPFdM79VNXzEpS2Te8Ez7g878a13Ybwz6TRHL+z8z7uHmh38YqSzeZTJS1AuOfKSpuon1IV17MQ==\"\n ]\n },\n \"effects\": {\n \"messageVersion\": \"v1\",\n \"status\": {\n \"status\": \"success\"\n },\n \"executedEpoch\": \"25\",\n \"gasUsed\": {\n \"computationCost\": \"990000\",\n \"storageCost\": \"721559200\",\n \"storageRebate\": \"713064528\",\n \"nonRefundableStorageFee\": \"7202672\"\n },\n \"modifiedAtVersions\": [\n {\n \"objectId\": \"\",\n \"sequenceNumber\": \"1999135\"\n },\n {\n \"objectId\": \"\",\n \"sequenceNumber\": \"1999135\"\n },\n {\n \"objectId\": \"\",\n \"sequenceNumber\": \"120\"\n }\n ],\n \"sharedObjects\": [\n {\n \"objectId\": \"\",\n \"version\": 1999135,\n \"digest\": \"DwbUaKPdp58kXHhh3WGzSnxv1uuzoEP55mmvrZyRqx8Q\"\n }\n ],\n \"transactionDigest\": \"ADxukibq4o4QqiMgr6QqtXnXczh5MGCQqMkgCKUW5NXT\",\n \"created\": [\n {\n \"owner\": {\n \"AddressOwner\": \"\"\n },\n \"reference\": {\n \"objectId\": \"\",\n \"version\": 1999136,\n \"digest\": \"BEEN82jwzg2gku5meXogNQLz1zSnbv9rEFRVu7RhekPd\"\n }\n }\n ],\n \"mutated\": [\n {\n \"owner\": {\n \"Shared\": {\n \"initial_shared_version\": 1\n }\n },\n \"reference\": {\n \"objectId\": \"\",\n \"version\": 1999136,\n \"digest\": \"CgnEEDYNDnAyFb6GzXwvCTC5X1RqAUEGkLQN59dn86Fn\"\n }\n },\n {\n \"owner\": {\n \"ObjectOwner\": \"\"\n },\n \"reference\": {\n \"objectId\": \"\",\n \"version\": 1999136,\n \"digest\": \"7zdHAR9jtbEuaNroxVUUXGgMBJCVF9RRfQ1ACy4sGr8d\"\n }\n },\n {\n \"owner\": {\n \"AddressOwner\": \"\"\n },\n \"reference\": {\n \"objectId\": \"\",\n \"version\": 1999136,\n \"digest\": \"4uYp4yEhf4kcKmdUSZmxao5nGo38mydK93w9Vj6GdmJy\"\n }\n }\n ],\n \"gasObject\": {\n \"owner\": {\n \"AddressOwner\": \"\"\n },\n \"reference\": {\n \"objectId\": \"\",\n \"version\": 1999136,\n \"digest\": \"4uYp4yEhf4kcKmdUSZmxao5nGo38mydK93w9Vj6GdmJy\"\n }\n },\n \"eventsDigest\": \"5MMMagM2CoBtWGL7x39i2H8FeF75LWfFzgZDpzc5YC1H\",\n \"dependencies\": [\n \"Ui22Hhc6NyVEnAhRWCWVT333JvvBWG75qJx9qBg9VE1\",\n \"53k4PWPByFxMLEYu53coAPiFCoxoz1mkUnv2Nr73UFw1\",\n \"6oLy1FVtkMhuknWGsz7cvyYhn5CZFGPnyLhXZYuBd8kh\"\n ]\n },\n \"events\": [\n {\n \"id\": {\n \"txDigest\": \"ADxukibq4o4QqiMgr6QqtXnXczh5MGCQqMkgCKUW5NXT\",\n \"eventSeq\": \"0\"\n },\n \"packageId\": \"\",\n \"transactionModule\": \"sui_system\",\n \"sender\": \"\",\n \"type\": \"0x3::validator::StakingRequestEvent\",\n \"parsedJson\": {\n \"amount\": \"1000000000\",\n \"epoch\": \"25\",\n \"pool_id\": \"\",\n \"staker_address\": \"\",\n \"validator_address\": \"\"\n },\n \"bcs\": \"\"\n }\n ],\n \"confirmedLocalExecution\": true\n}"}},"/mintscan/registry/assets":{"title":"How to add your token info","data":{"":"To add asset metadata on mintscan.\n‼️ Please note that tokens of Testnets and unverified networks may not be merged to master.\nFork this repo to your own github account\nClone fork and create new branch\ngit clone git@github.com:YOUR_ACCOUNT/chainlist.git\ncd chainlist\ngit branch \ngit checkout \nAdd the info of your token in the chain that your token needs to be displayed\nCommon info to fill\nField\tDescription\tdenom\tToken's denom.\ttype\tType of the token:\t\t- staking: Native staking token of a chain.\t\t- native: Native token issued on a chain, not the staking token.\t\t- ibc: Token transferred via IBC.\t\t- pool: Token representing a liquidity pool.\t\t- bridge: Token bridged from another network.\t\t- cw20: CW20 token type.\t\t- erc20: ERC20 token type.\torigin_chain\tThe origin chain where this token was issued.\torigin_denom\tOriginal denom of the token.\torigin_type\tOriginal type of the token (staking, native, pool, ibc, bridge, cw20, erc20).\tsymbol\tDisplayed name of the token in the list.\tdecimals\tToken's decimals.\timage\tImage route of the token (optional).\t\tPlace image in ${targetchain}/asset folder. Ensure it's a png file.\tcoinGeckoId\tCoinGecko site's API ID. Leave empty if none.\t\nIf the type is staking, provide the info below\nField\tDescription\tdescription\tA brief summary of the token\t\nIf the type is ibc, provide the info below:\nField\tDescription\tenable\ttrue if IBC transmission is possible (optional).\tchannel\tToken's IBC channel (optional).\tport\tToken's IBC port (optional).\t\tAdd the token's channel and port.\tcounter_party\tCounter party's IBC channel and port (optional).\t\t- channel.\t\t- port.\t\t- denom: Token's denom before IBC transfer.\tpath\tPath of token transfer (optional).\t\tProvide full details if transferred via IBC, bridge, or other path.\tpath\tPath details for bridge tokens (optional).\t\tProvide details if transferred via IBC, bridge, or other path.\tcontract\tContract address for token transfer via contract (optional).\t\nNative Token\n/assets/v2/${chain}/assets.json\n// example OSMOSIS\n[\n {\n \"denom\": \"uosmo\",\n \"type\": \"staking\",\n \"origin_chain\": \"osmosis\",\n \"origin_denom\": \"uosmo\",\n \"origin_type\": \"staking\",\n \"symbol\": \"OSMO\",\n \"decimals\": 6,\n \"description\": \"Osmosis Staking Coin\",\n \"image\": \"osmosis/asset/osmo.png\",\n \"coinGeckoId\": \"osmosis\"\n },\n {\n \"denom\": \"uion\",\n \"type\": \"native\",\n \"origin_chain\": \"osmosis\",\n \"origin_denom\": \"uion\",\n \"origin_type\": \"native\",\n \"symbol\": \"ION\",\n \"decimals\": 6,\n \"description\": \"Native Coin\",\n \"image\": \"osmosis/asset/ion.png\",\n \"coinGeckoId\": \"ion\"\n },\n // example KUJIRA\n {\n \"denom\": \"factory//uusk\",\n \"type\": \"native\",\n \"origin_chain\": \"kujira\",\n \"origin_denom\": \"factory//uusk\",\n \"origin_type\": \"native\",\n \"symbol\": \"USK\",\n \"decimals\": 6,\n \"description\": \"USK Stable Asset\",\n \"image\": \"kujira/asset/usk.png\",\n \"coinGeckoId\": \"usk\"\n }\n]\nIBC Token\n[\n // example COSMOS\n {\n \"denom\": \"ibc/\",\n \"type\": \"ibc\",\n \"origin_chain\": \"osmosis\",\n \"origin_denom\": \"uosmo\",\n \"origin_type\": \"staking\",\n \"symbol\": \"OSMO\",\n \"decimals\": 6,\n \"enable\": true,\n \"path\": \"osmosis>cosmos\",\n \"channel\": \"channel-141\",\n \"port\": \"transfer\",\n \"counter_party\": {\n \"channel\": \"channel-0\",\n \"port\": \"transfer\",\n \"denom\": \"uosmo\"\n },\n \"image\": \"osmosis/asset/osmo.png\", // Set image route for base_denom\n \"coinGeckoId\": \"osmosis\"\n },\n // example IRIS\n {\n \"denom\": \"ibc/\",\n \"type\": \"ibc\",\n \"origin_denom\": \"weth\",\n \"origin_type\": \"erc20\",\n \"symbol\": \"WETH\",\n \"origin_chain\": \"ethereum\",\n \"decimals\": 18,\n \"enable\": true,\n \"path\": \"ethereum>gravity-bridge>iris\",\n \"channel\": \"channel-29\",\n \"port\": \"transfer\",\n \"counter_party\": {\n \"channel\": \"channel-47\",\n \"port\": \"transfer\",\n \"denom\": \"gravity0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\"\n },\n \"image\": \"ethereum/asset/weth.png\", // Set image route for base_denom\n \"coinGeckoId\": \"weth\",\n \"contract\": \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\"\n }\n]\nBridge Token\n[\n // example GRAVITY-BRIDGE\n {\n \"denom\": \"gravity0x2260fac5e5542a773aa44fbcfedf7c193bc2c599\",\n \"type\": \"bridge\",\n \"origin_chain\": \"ethereum\",\n \"origin_denom\": \"wbtc\",\n \"origin_type\": \"erc20\",\n \"symbol\": \"WBTC\",\n \"decimals\": 8,\n \"path\": \"ethereum>gravity-bridge\",\n \"image\": \"ethereum/asset/wbtc.png\",\n \"coinGeckoId\": \"wrapped-bitcoin\",\n \"contract\": \"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599\"\n },\n // example IRIS\n {\n \"denom\": \"htltbcbusd\",\n \"type\": \"bridge\",\n \"origin_chain\": \"bnb-beacon-chain\",\n \"origin_denom\": \"busd\",\n \"origin_type\": \"bep2\",\n \"symbol\": \"BUSD\",\n \"decimals\": 8,\n \"path\": \"bnb-beacon-chain>iris\",\n \"image\": \"bnb-beacon-chain/asset/busd.png\",\n \"coinGeckoId\": \"binance-usd\"\n }\n]\nPool Token\n// example COSMOS\n[\n {\n \"denom\": \"\",\n \"type\": \"pool\",\n \"origin_chain\": \"cosmos\",\n \"origin_denom\": \"\",\n \"origin_type\": \"pool\",\n \"symbol\": \"GDEX-1\",\n \"decimals\": 6,\n \"description\": \"pool/1\",\n \"image\": \"cosmos/asset/pool.png\", // Add pool image in the target chain’s folder\n \"coinGeckoId\": \"\"\n }\n]\nCommit and push to your fork\ngit add -A\ngit commit -m “Add ”\ngit push origin \nFrom your repository, make pull request (PR)"}},"/":{"title":"Cosmostation","data":{"":"Cosmostation is a committed interchain service provider in the Cosmos ecosystem, established since its genesis in 2019.\nOur array of tools, including Mintscan, Mintscan API, and Cosmostation wallets showcases our dedication to the community. This developer documentation is your guide to understanding and utilizing our offerings for enhanced protocol development.","mintscan#Mintscan":"Mintscan is the second generation blockchain analytics platform specialized in on-chain data visualization.\nExplorer\nData analyzer\nInterchain Hub","api#API":"First Class Access to Indexed Interchain Data. Streamline your connection to Interchain with Mintscan API.\nRPC Endpoint\nHistorical API\nBuilder API\nStatistics API\nCustom API","extension-wallet#Extension Wallet":"Cosmostation is a non-custodial multi-chain cryptocurrency browser extension wallet that supports 50+ chains including Ethereum, Cosmos, Sui, and more.","mobile-wallet#Mobile Wallet":"Industry leading non-custodial mobile wallet supporting 50+ interchain networks. Enjoy native staking, IBC send, voting, and token swap on mobile."}},"/mintscan/registry/cw20":{"title":"How to add your CW20 token info","data":{"":"To add CW20 asset metadata on mintscan assets.\nJuno Cw20 list supporting\nFork this repo to your own github account\\\nClone fork and create new branch\ngit clone git@github.com:YOUR_ACCOUNT/chainlist.git\ncd chainlist\ngit branch \ngit checkout \nAdd the info of your token in the chain that your token needs to be displayed\nIf there is no chain in the list, create a folder for the chain and add info in the folder\nThen add the name of the folder in: supports.json\nChanges will be updated within 24 hours after merged to master\nkey\tvalue\tchainId\t-1\tchainName\tChain with the token\taddress\tToken's contract_address\tsymbol\tName of token's symbol\tdescription\tA brief summary of the token\tdecimals\tDecimal of the token\timage\tImage route of the token /${targetChain}/asset add image in the folder Make sure to upload a png file\tdefault\tdefault value is false\tcoinGeckoId\tCoin gecko site's API ID Empty string if none\t\nCw20 Token\n/${targetChain}/contract.json\n// example JUNO\n[\n {\n \"chainId\": -1,\n \"chainName\": \"juno\",\n \"address\": \"\",\n \"symbol\": \"DAO\",\n \"description\": \"DAO DAO\",\n \"decimals\": 6,\n \"image\": \"juno/asset/dao.png\",\n \"default\": false,\n \"coinGeckoId\": \"\"\n },\n {\n \"chainId\": -1,\n \"chainName\": \"juno\",\n \"address\": \"\",\n \"symbol\": \"NETA\",\n \"description\": \"NETA\",\n \"decimals\": 6,\n \"image\": \"juno/asset/neta.png\",\n \"default\": true,\n \"coinGeckoId\": \"neta\"\n }\n]\nCommit and push to your fork\n git add -A\n git commit -m “Add ”\n git push origin \nFrom your repository, make pull request (PR)"}},"/mintscan":{"title":"Introduction","data":{"":"Mintscan can easily provide information such as validators and assets publicly through Github","to-provide-information#To provide information":"Folk chainlist repository\nAdd the data\nCreate a pull request\nReview and Merge","registry#Registry":"Validator > Moniker\nAssets > Native\nAssets > CW20\nAssets > ERC20\nEcosystem"}},"/mintscan/registry/ecosystem":{"title":"How to add your project on Ecosystem","data":{"":"To add ecosystem on mintscan.\nPlease contact us and provide us with the information below.\nChain\nProject name\nDescription\nUrl\nToken(Optional)\nContact(Optional) : twitter, telegram, discord\nReference(Optional) : Docs, Github, Blog, Reddit\nType : Cosmwasm, EVM, Module\nBanner : 1125 x 600 px"}},"/mintscan/registry/erc20":{"title":"How to add your ERC20 token info","data":{"":"To add erc20 asset metadata on mintscan assets.\nEvmos Erc20 list supporting\nFork this repo to your own github account\nClone fork and create new branch\ngit clone git@github.com:YOUR_ACCOUNT/chainlist.git\ncd chainlist\ngit branch \ngit checkout \nAdd the info of your token in the chain that your token needs to be displayed\nIf there is no chain in the list, create a folder for the chain and add info in the folder\nThen add the name of the folder in: supports.json\nChanges will be updated within 24 hours after merged to master\nkey\tvalue\tchainId\tChainId of the chain\taddress\tToken's contract_address\tchainName\tName of the displayed token\tsymbol\tName of token's symbol\tdecimals\tDecimal of the token\timage\tImage route of the token/${targetChain}/asset add image in the folder Make sure to upload a pngfile\tdefault\tdefault value is false\tcoinGeckoId (optional)\tCoin gecko site's API ID Empty string if none\t\nERC20 Token\n/${targetChain}/contract.json\n[\n {\n \"chainId\": 9001,\n \"chainName\": \"evmos\",\n \"address\": \"0xD4949664cD82660AaE99bEdc034a0deA8A0bd517\",\n \"symbol\": \"WEVMOS\",\n \"description\": \"Wrapped Evmos\",\n \"decimals\": 18,\n \"image\": \"evmos/asset/wevmos.png\",\n \"default\": true,\n \"coinGeckoId\": \"evmos\"\n },\n {\n \"chainId\": 9001,\n \"chainName\": \"evmos\",\n \"address\": \"0xb72A7567847abA28A2819B855D7fE679D4f59846\",\n \"symbol\": \"ceUSDT\",\n \"description\": \"Tether USD (Celer)\",\n \"decimals\": 6,\n \"image\": \"ethereum/asset/usdt.png\",\n \"default\": false,\n \"coinGeckoId\": \"tether\"\n }\n]\nCommit and push to your fork\ngit add -A\ngit commit -m “Add ”\ngit push origin \nFrom your repository, make pull request (PR)"}},"/mintstation/cli/command":{"title":"Useful CLI Commands","data":{"":"Get standard debug info from the mint daemon:\nmintstationd status\nCheck if your node is catching up:\n# Query via the RPC (default port: 26657)\ncurl http://localhost:26657/status | jq .result.sync_info.catching_up\nGet your node ID:\nmintstationd tendermint show-node-id\nCheck if you are jailed or tombstoned:\nmintstationd query slashing signing-info $(mintstationd tendermint show-validator)\nSet the default chain for commands to use:\nmintstationd config chain-id mintstation-1\nGet your valoper address:\nmintstationd keys show -a --bech val\nSee keys on the current box:\nmintstationd keys list\nImport a key from a mnemonic:\nmintstationd keys add --recover\nExport a private key (warning: don't do this unless you know what you're doing!)\nmintstationd keys export --unsafe --unarmored-hex\nWithdraw rewards (including validator commission), where mintvaloper1... is the validator address:\nmintstationd tx distribution withdraw-rewards --from --commission\nStake:\nmintstationd tx staking delegate umint --from \nFind out what the JSON for a command would be using --generate-only:\nmintstationd tx bank send $(mintstationd keys show -a) umint --generate-only\nQuery the results of a gov vote that has ended, from a remote RPC (NB - you have to specify a height before the vote ended):\n mintstationd q gov votes 1 --height --node https://rpc-archive.mintnetwork.io:443\nTransfer mint to another chain (osmosis) with IBC\nmintstationd tx ibc-transfer transfer transfer channel-0 1000000umint --from --node https://rpc-archive.mintnetwork.io:443 --packet-timeout-height 0-0\nQuery the validator set (and jailed status) via CLI:\nmintstationd query staking validators --limit 1000 -o json | jq -r '.validators[] | [.operator_address, (.tokens|tonumber / pow(10; 6)), .description.moniker, .jail, .status] | @csv' | column -t -s\",\" | sort -k2 -n -r | nl\nGet contract state:\nmintstationd q wasm contract-state all "}},"/mintscan/registry/moniker":{"title":"How to add your validator moniker image","data":{"":"To add moniker image on mintscan validator tab.\nAdd your image to ${targetchain}/moniker folder\nImage with png format and validator address name\nExample will display cosmostation validator moniker logo for cosmos"}},"/extension/integration/evm/use-ethers":{"title":"Use ethers","data":{"":"npmjs\ndocs\nimport { ethers } from \"ethers\";\nimport { ethereum, InstallError } from \"@cosmostation/extension-client\";\ntry {\n const provider = await ethereum();\n const ethersProvider = new ethers.providers.Web3Provider(provider);\n // requestAccounts\n const accounts = ethersProvider.send(\"eth_requestAccounts\", []);\n // If you want more info, please check out ethers docs (https://docs.ethers.io)\n} catch (e) {\n if (e instanceof InstallError) {\n console.log(\"not installed\");\n }\n // exception\n}"}},"/mintstation/cli/setup":{"title":"Setup CLI","data":{"build#Build":"Build Requirements\nGo 1.20.+\nClone source from repository:\ngit clone https://github.com/cosmostation/mintstation\ncd mintstation\ngit checkout {SET_CURRENT_VERSION}\nOnce you're on the correct tag, you can build:\n# from mintstation dir\nmake install\nTo confirm that the installation has succeeded, you can run:\nmintstationd version\n#v0.0.1","configure#Configure":"Set the chain-id & node,\n#Update config.toml\nmintstationd config chain-id mintstation-1\nmintstationd config node {NODE_RPC_ENDPOINT:PORT}"}},"/mintstation/contracts/create":{"title":"Create Contracts","data":{"":"To implement a wasm smart contract, it is highly recommended to learn Rust first. Rust is the language commonly used for wasm development and is well-regarded for its stability and performance. You can begin your Rust learning journey by referring to the following link:Rust Language Learning GuideFor smart contract development, you can follow the structure provided by CosmWasm's template. This template will help you understand the project's architecture and enable you to develop your contract more systematically. You can find the template at the following link:CosmWasm Template, book.cosmwasm.comAmong the popular smart contract samples, there are cw20 and cw721 implementations. cw20 represents a widely-used token contract, while cw721 implements a Non-Fungible Token (NFT) contract. These samples can be valuable references during your development process. You can explore the code for each sample through the links below:cw20, cw721For all great CosmWasm tools, https://github.com/CosmWasm/awesome-cosmwasmAlthough smart contract development can be complex, leveraging the provided resources will increase your chances of successfully completing your project. Additionally, make sure to actively engage with the community and online resources to continue your learning journey and receive ongoing support. Best of luck!"}},"/mintstation/cli":{"title":"CLI Introduction","data":{"introduction#Introduction":"mintstationd is a command line client for the Mintstation. Mintstation users can use mintstationd to send transactions to the Mintstation network and query the blockchain data.See here for instructions on installing mintstationd.","working-directory-a-hrefworking-directory-idworking-directorya#Working Directory ":"The default working directory for the mintstationd is $HOME/.mintstation, which is mainly used to store configuration files and blockchain data. The Mintstation key data is saved in the working directory of mintstationd. You can also specify the mintstationd working directory by using the --home flag when executing mintstationd.","connecting-to-a-full-node#Connecting to a Full-Node":"By default, mintstationd uses tcp://localhost:26657 as the RPC address to connect to the Mintstation network. This default configuration assumes that the machine executing mintstationd is running as a full-node.The RPC address can be specified to connect to any full-node with an exposed RPC port by adding the --node flag when executing mintstationd"}},"/mintstation/contracts/deploy":{"title":"Deploy Contracts","data":{"prerequisite#PreRequisite":"Make sure you follow the create a contract guide first for your project. Once you have a contract compiled in the artifacts/*.wasm directory, you are ready for this guide.","upload#Upload":"You need to upload the contract via the CLI to chain. To do this, perform the following\nTXFLAGS=\"--chain-id=mintstation-1 --gas-prices=0.025umint --gas=auto --gas-adjustment 1.3\"\nmintstationd tx wasm store artifacts/CONRTACT_NAME.wasm \\\n --from $TXFLAGS -y --broadcast-mode=block\nThis will then return a transaction hash. With this data, you need to query it to get the code id of the contract on chain\nmintstationd q tx --output=json\nThis will return the data about the transaction, and give us the code id of our contract\n{\n \"height\": \"294601\",\n \"txhash\": \"\",\n \"codespace\": \"\",\n \"code\": 0,\n \"data\": \"\",\n \"raw_log\": \"[{\\\"events\\\":[{\\\"type\\\":\\\"message\\\",\\\"attributes\\\":[{\\\"key\\\":\\\"action\\\",\\\"value\\\":\\\"/cosmwasm.wasm.v1.MsgStoreCode\\\"},{\\\"key\\\":\\\"module\\\",\\\"value\\\":\\\"wasm\\\"},{\\\"key\\\":\\\"sender\\\",\\\"value\\\":\\\"mint1hj5fveer5cjtn4wd6wstzugjfdxzl0xps73ftl\\\"}]},{\\\"type\\\":\\\"store_code\\\",\\\"attributes\\\":[{\\\"key\\\":\\\"code_checksum\\\",\\\"value\\\":\\\"\\\"},{\\\"key\\\":\\\"code_id\\\",\\\"value\\\":\\\"13\\\"}]}]}]\",\n \"logs\": [\n {\n \"msg_index\": 0,\n \"log\": \"\",\n \"events\": [\n {\n \"type\": \"message\",\n \"attributes\": [\n {\n \"key\": \"action\",\n \"value\": \"/cosmwasm.wasm.v1.MsgStoreCode\"\n },\n {\n \"key\": \"module\",\n \"value\": \"wasm\"\n },\n {\n \"key\": \"sender\",\n \"value\": \"mint1hj5fveer5cjtn4wd6wstzugjfdxzl0xps73ftl\"\n }\n ]\n },\n {\n \"type\": \"store_code\",\n \"attributes\": [\n {\n \"key\": \"code_checksum\",\n \"value\": \"\"\n },\n {\n \"key\": \"code_id\",\n \"value\": \"13\"\n }\n ]\n }\n ]\n }\n }]\n}\nWe can see both raw_log and also logs[0].events[1].store_code shows the code_id being 13. If you wish the automate this return code in bash to a variable, you can \n# ensure jq is installed\nUPLOAD_TX_HASH=\nCODE_ID=$(mintstationd q tx $UPLOAD_TX_HASH --output json | jq -r '.logs[0].events[] | select(.type == \"store_code\").attributes[] | select(.key == \"code_id\").value') && echo \"Code Id: $CODE_ID\"","instantiate#Instantiate":"With the code now being up on chain, we can now run logic to setup our own copy of the contract which we control. This will then give us a unique contract address for others to interact with in accordance with the contract logic. This example is from the cosmwasm/cw-template.Ensure you change CODE_ID to match your code id from the store code\nFLAGS=\"--chain-id=mintstation-1 --gas-prices=0.025umint --gas=auto --gas-adjustment 1.3\"\n#Example1\nCODE_ID=1\nmintstationd tx wasm instantiate \"$CODE_ID\" '{\"count\":0}' --label \"contract\" $FLAGS -y --admin \n#cw20\nCODE_ID=2\nINIT='{\"name\":\"CW20\",\"symbol\":\"TOKEN\",\"decimals\":2,\"initial_balances\":[{\"amount\":\"1000000\",\"address\":
}]}'\nmintstationd tx wasm instantiate \"$CODE_ID\" \"$INIT\" --from --label \"cw-token\" $FLAGS -y --admin "}},"/mintstation/contracts/execute":{"title":"Execute Contracts","data":{"command-line-interface#Command Line Interface":"When you execute a message, a user can also pass through a flag which sends funds from their account to the contract to do logic. You can check if a user sends any funds in your contract's execute endpoint with the info.funds array of Coins sent by the user. These funds then get added to the contracts balance just like any other account. So it is up to you as the developer to ensure to save how many funds each user has sent via a BTreeMap or other object storage in state (if they can redeem funds back at a later time).To send funds to a contract with some arbitrary endpoint, you use the --amount flag.\nmintstationd tx wasm execute CONTRACT '{\"some_endpoint\":{}}' --amount 1000000umint\nIf the \"some_endpoint\" execute errors on the contract, the funds will remain in the users account.","typescript#Typescript":"import type { Coin } from '@cosmjs/stargate';\nimport { SigningStargateClient, StargateClient, type StdFee } from '@cosmjs/stargate';\nimport type { OfflineAminoSigner } from '@cosmjs/amino';\nimport type { OfflineDirectSigner } from '@cosmjs/proto-signing';\nimport { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate';\nlet RPC = '';\nconst get_wallet_for_chain = async (\n chain_id: string,\n): Promise => {\n // open keplr\n const cosmostation = window as CosmostationWindow;\n if (keplr === undefined) {\n throw new Error('Cosmostation not found');\n }\n let signer = cosmostation.getOfflineSignerAuto;\n if (signer === undefined) {\n throw new Error('Cosmostation not found');\n }\n return signer(chain_id);\n};\nlet wallet = await get_wallet_for_chain('mintstation-1');\nlet address = (await wallet.getAccounts())[0].address;\nlet from_client = await SigningCosmWasmClient.connectWithSigner(RPC, wallet, {\n prefix: 'mint',\n});\nconst msg = { some_endpoint: {} };\nlet fee: StdFee = {\n amount: [{ amount: '5000', denom: 'umint' }],\n gas: '500000',\n};\nlet send_amount: Coin = {\n amount: '100000',\n denom: 'umint',\n};\nawait from_client\n .execute(address, REVIEWS_CONTRACT_ADDRESS, msg, fee, 'memo', send_amount)\n .then((res) => {\n console.log(`Success @ height ${res.height}\\n\\nTxHash: ${res.transactionHash}`);\n });"}},"/mintstation":{"title":"Introduction","data":{"":"Mintstation is a network designed for testing the Cosmos SDK. It provides access to the latest features of the Cosmos ecosystem, allowing users to leverage CosmWasm smart contracts.In this documentation, the following topics are covered:\nLocal network installation\nCLI usage\nRunning a full node and participating as a validator\nUtilizing Cosmwasm for smart contract development\nCustom module development\nMintstation offers a testing ground for developers and users to explore and experiment with the capabilities of the Cosmos SDK while having the ability to interact with CosmWasm smart contracts. The documentation provides comprehensive guidance on setting up a local network, utilizing the CLI, engaging as a validator, and leveraging Cosmwasm for smart contract deployment. Additionally, developers are encouraged to explore custom module development to tailor the network to their specific needs.By providing an environment that maintains the latest features of the Cosmos SDK and supports Cosmwasm smart contracts, Mintstation facilitates a dynamic and insightful experience for individuals and teams working within the Cosmos ecosystem."}},"/mintstation/contracts/compile":{"title":"Compile Contracts","data":{"":"This guide is from the official CosmWasm/rust-optimizer repository. This method of compiling the contract will optimize the final build so that it reduces gas consumption.Example contracts for this can be found at https://github.com/CosmWasm/cw-examples. This repository requires this section to compile since multiple contracts are involved in a single repository.","single-contract-repository#Single Contract Repository":"The easiest way is to simply use the published docker image. You must run this in the root of the smart contract repository you wish to compile. It will produce an artifacts directory with .wasm and contracts.txt containing the hashes. This is just one file.\ndocker run --rm -v \"$(pwd)\":/code \\\n --mount type=volume,source=\"$(basename \"$(pwd)\")_cache\",target=/code/target \\\n --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\\n cosmwasm/rust-optimizer:0.12.11\n# If you you use an ARM machine (Ex: Mac M1), you need to use the following\n# This is experimental and should not be used for production use\ndocker run --rm -v \"$(pwd)\":/code \\\n --mount type=volume,source=\"$(basename \"$(pwd)\")_cache\",target=/code/target \\\n --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\\n cosmwasm/rust-optimizer-arm64:0.12.11\nBy running this in the root of your project, it will compile your contract into an artifacts/ folder. From here you can upload it to chain, collect the store code, and interact with it as you design","multiple-contract-repository-mono-repo#Multiple Contract Repository (Mono Repo)":"Sometime you want many contracts to be related and import common functionality. This is exactly the case of cosmwasm-plus. In such a case, we can often not just compile from root, as the compile order is not deterministic and there are feature flags shared among the repos. This has lead to issues in the past.For this use-case there is second docker image, which will compile all the contracts/* folders inside the workspace and do so one-by-one in alphabetical order. It will then add all the generated wasm files to an artifacts directory with a checksum, just like the basic docker image (same output format).To compile all contracts in the workspace deterministically, you can run:\ndocker run --rm -v \"$(pwd)\":/code \\\n --mount type=volume,source=\"$(basename \"$(pwd)\")_cache\",target=/code/target \\\n --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\\n cosmwasm/workspace-optimizer:0.12.11\n# If you you use an ARM machine (Ex: Mac M1), you need to use the following\n# This is experimental and should not be used for production use\ndocker run --rm -v \"$(pwd)\":/code \\\n --mount type=volume,source=\"$(basename \"$(pwd)\")_cache\",target=/code/target \\\n --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\\n cosmwasm/workspace-optimizer-arm64:0.12.11\nNOTE: See the difference with workspace-optimizer vs rust-optimizer in the previous single contract example.\\"}},"/mintstation/playground":{"title":"Playground","data":{"":"Welcome to Mintstation Playground, it makes easy to connect your wallet to the Mintstation blockchain and build your projects seamlessly.With this project, you can easily connect your wallet in any environment, be it on a PC or mobile device. Using the Mintscan API, you can conveniently build your products with ease.\nMintscan API\nCosmostation Docs\nMintstation provides an environment where you can test and utilize the cosmos-sdk and smart contracts. You can test various features and see the results immediately without the need for setting up a separate network.\nMintstation Mintscan\nMintstation Github","how-to-use#How to use":"Take a look at the code in Mintstation Playground to experience the easiest way to understand the Cosmos SDK and develop a DApp. This is the simplest way to grasp the Cosmos ecosystem.\nGithub : https://github.com/comostation/mintstation-playground\nDemo : https://play-mintstation.web.app/","support-features#Support features":"","dashboard#Dashboard":"Using the Mintscan API, you can easily get history or create a dashboard where you can view asset information at a glance.","faucet#Faucet":"Easily access the Faucet feature to obtain Mintstation tokens for testing and development purposes.","bank-module#Bank Module":"You can easily implement a function that allows you to easily send tokens within Mintstation.","validator-list#Validator List":"Get information about validators within Mintstation.","staking-module#Staking Module":"You can easily implement the function to easily stake and unstake tokens within Mintstation.","tbd--governance-smart-contracts-swap#TBD : Governance, Smart Contracts, Swap":""}},"/mintstation/validator/command":{"title":"Useful commands","data":{"upgrade-to-a-validator#Upgrade to a validator":"Do not attempt to upgrade your node to a validator until the node is fully in sync as per the previous step.To upgrade the node to a validator, you will need to submit a create-validator transaction:\nmintstationd tx staking create-validator \\\n --amount 1000000umint \\\n --commission-max-change-rate \"0.1\" \\\n --commission-max-rate \"0.20\" \\\n --commission-rate \"0.1\" \\\n --min-self-delegation \"1\" \\\n --details \"validators write bios too\" \\\n --pubkey=$(mintstationd tendermint show-validator) \\\n --moniker \"$MONIKER_NAME\" \\\n --chain-id $CHAIN_ID \\\n --gas-prices 0.025umint \\\n --from \nThe above transaction is just an example. There are many more flags that can be set to customise your validator, such as your validator website, or keybase.io id, etc. To see a full list:\nmintstationd tx staking create-validator --help\nUnjail\nmintstationd tx slashing unjail --from --chain-id mintstation-1 --fees 100umint\nTo track your validator's signing history, copy the validator public key:\nmintstationd tendermint show-validator\nUse your validators public key queried above as the validator-pubkey below:\nmintstationd query slashing signing-info \nExample:\nmintstationd query slashing signing-info '{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"HlixoxNZBPq4pBOYEimtSq9Ak4peBISVsIbI5ZHrEAU=\"}'"}},"/mintstation/validator/delegations":{"title":"Delegations","data":{"":"If you wish to perform more extensive testing and require additional delegations, please don't hesitate to get in touch with us at mintstation@cosmostation.io.We are more than happy to provide you with the necessary delegations to support your testing efforts. Our delegation services aim to help you thoroughly evaluate and explore the features and capabilities of our platform.By reaching out to us, you can access a wide range of resources and support to make the most out of your testing experience. Whether you are testing staking, governance, or any other aspects of our system, we want to ensure that you have a beautiful and seamless experience.Feel free to contact us with any specific requirements or questions you may have. Our team at mintstation@cosmostation.io is ready to assist you, and we look forward to supporting your testing journey!"}},"/mintstation/contracts/query":{"title":"Query Contracts","data":{"command-line-interface#Command Line Interface":"The most common way to query a cosmwasm smart contract is within the mintstationd wasm smart query command. This follows the following format where query is a JSON string with no spaces. By default, the least amount of data this can be is an empty JSON payload '{}'.\nmintstationd query wasm contract-state smart [contract_bech32] [query] [flags]\nFor this example, we are going to use a random NFT contract on the mint chain. This will show you how to brute force query a contract if you have no idea what the query schema of the contract is. At this time, there is no way to query the format of a contract's requests, but this is something many are actively working on.Now we attempt to query this contract address and extract some data from it and get which queries are allowed. As you can see, we pass through a random payload for abcde so that the contract will return actual valid query requestsNOTE: A Query can never be empty such as '{}' given you need to specify the path of data you want to reach.{% hint style=\"info\" %}\nThe query shows CW721 Base is this contracts name. As this is a standard contract, all messages can be found in the CosmWasm/cw-nfts repository on github\nhttps://github.com/CosmWasm/cw-nfts/blob/main/contracts/cw721-base/src/msg.rs\n{% endhint %}From this, we now know all of the query endpoints and can requests something more specific from the contract for our usage. Let's get\nCONTRACT=\nmintstationd q wasm contract-state smart $CONTRACT '{\"all_tokens\":{}}'\ndata:\n tokens:\n - \"0\"\n - \"1\"\n - \"2\"\n - \"3\"\n - \"4\"\n - \"5\"\n - \"6\"\n - \"7\"\n - \"8\"\n# You can use --output=json to read it via JSON form\n# mintstationd q wasm contract-state smart $CONTRACT '{\"all_tokens\":{}}' --output=json | jq .data\nHere we can see there are 8 tokens in this set. Lets query one of the NFTs information\nCONTRACT=\nmintstationd q wasm contract-state smart $CONTRACT '{\"nft_info\":{}}'\n# missing field `token_id`: query wasm contract failed\nJust like the first query, we can see that the payload needs more information. It returned an error that we need to specify the token_id we want the nft_info for. Note, Uint128 sized numbers are read as a string\nCONTRACT=\nmintstationd q wasm contract-state smart $CONTRACT '{\"nft_info\":{\"token_id\":\"8\"}}'\n# data:\n# extension: null\n# token_uri: ipfs:///metadata.json","rest-api-query#Rest API Query":"If you wish to query the data more programmatically with an application such as Python, you may be better suited to use the rest API. You can find these endpoints on https://cosmos.directory/mint/nodes in the REST section.This query endpoint can be found via Mintstation's SwaggerUI. However, some modules you will not be able to easily find the endpoint. To do this, you will need to search through the proto files. Here we know we want to query the cosmwasm module, which is called wasmd on chain. This repo is found at https://github.com/cosmwasm/wasmd.\nIn this module, you can see the proto folder in the root of the repo. This will house the endpoints the module exposes so we can find the above path which. This is a query so we find the query proto file\nhttps://github.com/CosmWasm/wasmd/blob/main/proto/cosmwasm/wasm/v1/query.proto\\\noption go_package = \"github.com/CosmWasm/wasmd/x/wasm/types\";\noption (gogoproto.goproto_getters_all) = false;\noption (gogoproto.equal_all) = false;\n// Query provides defines the gRPC querier service\nservice Query {\n ...\n // SmartContractState get smart query result from the contract\n rpc SmartContractState(QuerySmartContractStateRequest)\n returns (QuerySmartContractStateResponse) {\n option (google.api.http).get =\n \"/cosmwasm/wasm/v1/contract/{address}/smart/{query_data}\";\n }\n ...\n{% hint style=\"info\" %}\nYou must base64 encode the JSON payload for REST API Request. Just take your JSON payload and\n- put it into https://www.base64encode.org/\n- or use Mac / Linux built in command\necho '{\"all_tokens\":{}}' | base64\n# eyJhbGxfdG9rZW5zIjp7fX0K\n{% endhint %}With this, we can now query the contract and gather the data. You can use your web browser, or a library like httpx / requests in Python for automated bots. Be aware that many API providers will late limit the number of requests you can make.\nhttps://api.mint.strange.love/cosmwasm/wasm/v1/contract//smart/eyJhbGxfdG9rZW5zIjp7fX0K\n{\n \"data\": {\n \"tokens\": [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\"]\n }\n}","cosmology-smart-contract-query#Cosmology Smart Contract Query":"Using CosmWasm/ts-codegen, you can create an NPM module to make interactions and queries into dev-friendly Typescript classes to allow you to focus on shipping code.Here are a few tutorials from cosmology:\nts-codegen overview for CosmWasm\nCosmWasm Contract to Typescript npm module\nConfigure CosmWasm ts-codegen in your Contracts repo\nQuery a CosmWasm smart contract from ts-codegen\nEnable React Query\nEnable Recoil\nIntegrate Telescope with ts-codegen"}},"/mintstation/validator/localnet":{"title":"Localnet","data":{"setup-local-network#Setup Local Network":"To set up a single local network easily, you can directly run the script below, and it will start working immediately:To get up and running with the mintstationd binary, please follow the instructions here.\nAPP_HOME=\"$HOME/.mintstation\"\nRPC=\"http://localhost:26657\"\nCHAIN_ID=\"localnet-1\"\nMONIKER=\"Moniker\"\nmintstationd init ${MONIKER} --chain-id ${CHAIN_ID} --home ${APP_HOME}\nsed -i -r 's/minimum-gas-prices = \"0stake\"/minimum-gas-prices = \"0.0001umint\"/' ${APP_HOME}/config/app.toml\nsed -i -e 's/\\\"stake\\\"/\\\"umint\\\"/g' ${APP_HOME}/config/genesis.json\nmintstationd keys add validator --keyring-backend test\nMY_VALIDATOR_ADDRESS=$(mintstationd keys show validator --keyring-backend test -a)\nmintstationd add-genesis-account $MY_VALIDATOR_ADDRESS 10000000000umint\nmintstationd gentx validator 10000000umint --chain-id localnet-1 --keyring-backend test\nmintstationd collect-gentxs\nmintstationd start --home ${APP_HOME}"}},"/mintstation/validator/mainnet":{"title":"Joining Mainnet","data":{"":"To get up and running with the mintstationd binary, please follow the instructions here.","setting-up-the-node#Setting up the Node":"These instructions will direct you on how to initialize your node, synchronize to the network and upgrade your node to a validator.","initialize-the-chain#Initialize the chain":"CHAIN_ID=mintstation-1\nMONIKER_NAME=\nmintstationd init \"$MONIKER_NAME\" --chain-id $CHAIN_ID\nThis will generate the following files in ~/.mintstation/config/\ngenesis.json\nnode_key.json\npriv_validator_key.json","download-the-genesis-file#Download the genesis file":"Download the the geneis file.\n# Download genesis.json file (https://github.com/cosmostation/mintstation)\nrm ~/.mintstation/config/genesis.json\ncurl -sS \"https://rpc-mintstation.cosmostation.io/genesis\" | jq .result.genesis > $HOME/.mintstation/config/genesis.json\nThis will replace the genesis file created using mintstationd init command with the mainnet genesis.json.","set-seeds#Set seeds":"We can set the seeds by retrieving the list of seeds from the mintstation repo and using sed to inject into ~/.mintstation/config/config.toml:\n# Set the base repo URL for mainnet & retrieve seeds\nCHAIN_ID=mintstation-1\nCHAIN_REPO=\"https://raw.githubusercontent.com/cosmostation/mintstation/main/$CHAIN_ID\" && \\\nexport SEEDS=\"$(curl -sL \"$CHAIN_REPO/seeds.txt\")\"\n# Add seeds to config.toml\nsed -i.bak -e \"s/^seeds *=.*/seeds = \\\"$SEEDS\\\"/\" ~/.mintstation/config/config.toml","set-minimum-gas-prices#Set minimum gas prices":"For RPC nodes and Validator nodes we recommend setting the following minimum-gas-prices. As we are a permissionless wasm chain, this setting will help protect against contract spam and potential wasm contract attack vectors.In $HOME/.mintstation/config/app.toml, set minimum gas prices:\nsed -i.bak -e \"s/^minimum-gas-prices *=.*/minimum-gas-prices = \\\"0.0025umint\\\"/\" ~/.mintstation/config/app.toml","create-or-restore-a-local-key-pair#Create (or restore) a local key pair":"Either create a new key pair, or restore an existing wallet for your validator:\nmintstationd keys add \n# OR\n# Restore existing mint wallet with mnemonic seed phrase.\n# You will be prompted to enter mnemonic seed.\nmintstationd keys add --recover\n# Query the keystore for your public address\nmintstationd keys show --bech val -a\nReplace with a key name of your choosing.After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys.","get-some-tokens#Get some tokens":"We are serving only a few tokens for you to test or do somehting what you want.\n# Check your address which you've generated & copy the address\nmintstationd keys show -a\n# Go to minstation faucet and paste your address on it\nhttps://faucet-mintstation.cosmostation.io\nIf you want to get more tokens or delegations, Please contact us from here.","syncing-the-node#Syncing the node":"There are methods to sync a node to the network:","sync-from-genesis#Sync from genesis":"After starting the mintstationd daemon, the chain will begin to sync to the network. The time to sync to the network will vary depending on your setup and the current size of the blockchain, but could take a very long time. To query the status of your node:\n# Start for your node to sync from genesis\nmintstationd start\n# Query via the RPC (default port: 26657)\ncurl http://localhost:26657/status | jq .result.sync_info.catching_up\nIf this command returns true then your node is still catching up. If it returns false then your node has caught up to the network current block and you are safe to proceed to upgrade to a validator node.When syncing from genesis, you will need to perform upgrades while catching up to the head. mintstation-1 upgrades are detailed in node-upgrade.md along with a description of each type of upgrade.","sync-with-statesync#Sync with statesync":"When a cosmos-sdk based chain already started to make a new consensus, you need some time to sync from genesis with your node.So, you can resolve this problem by using statesync functionality, which is general characteristic in cosoms-sdk based chain. And then we recommend to sync with statesync by using our snapshot provider rpc endpoint.\n# Setup statesync in your config.toml\nSNAP_RPC=\"https://rpc-mintstation.cosmostation.io:443\"\nLATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \\\nBLOCK_HEIGHT=$((LATEST_HEIGHT - 1500)); \\\nTRUST_HASH=$(curl -s \"$SNAP_RPC/block?height=$BLOCK_HEIGHT\" | jq -r .result.block_id.hash)\nsed -i.bak -E \"s|^(enable[[:space:]]+=[[:space:]]+).*$|\\1true| ; \\\ns|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\\1\\\"$SNAP_RPC,$SNAP_RPC\\\"| ; \\\ns|^(trust_height[[:space:]]+=[[:space:]]+).*$|\\1$BLOCK_HEIGHT| ; \\\ns|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\\1\\\"$TRUST_HASH\\\"|\" $HOME/.mintstation/config/config.toml\n# Check diff between before and after\ndiff $HOME/.mintstation/config/config.toml $HOME/.mintstation/config/config.toml.bak\n# Start for your node to sync with statesync\nmintstationd start","backup-critical-files#Backup critical files":"There are certain files that you need to backup to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in ~/.mintstation/config/:\npriv_validator_key.json\nnode_key.json\nIt is recommended that you encrypt the backup of these files."}},"/mobile/article":{"title":"Articles","data":{"":"How to Derive(Add) & Manage WalletsWallet Management“dApp” on Cosmostation Mobile WalletIntroducing AuthZ on Cosmostation MobileGas OptimizationKava DeFiOsmosis and Sifchain DEXNFT on Cosmostation MobileStarname Service"}},"/mobile":{"title":"Introduction","data":{"":"Mobile wallets support various types of services.\nAccess dApps on desktop/mobile via QR code scanning.\nConnect with dApps from your mobile browser via Deep Link.\nIn-app browser support on mobile wallets.\nCosmostation Mobile Wallet supports dApps through various methods.\nCosmostation(Same way as Extension)\nCosmos-Kit\nWalletConnect 1.0(Deprecated), WalletConnect 2.0\nConnections using Cosmostation and WalletConnect also implement the Keplr and Web3j specifications."}},"/mobile/integration/cosmjs":{"title":"Integrate cosmjs","data":{"":"Cosmjs TutorialCosmjs Example CodeCosmjs Example Page","add-package#Add package":"yarn add @cosmostation/cosmos-client\nnpm install @cosmostation/cosmos-client","offline-signer#Offline Signer":"import { getOfflineSigner } from \"@cosmostation/cosmos-client\";\nconst offlineSigner = await getOfflineSigner(CHAIN_ID);\nimport { getOfflineSigner } from \"@cosmostation/cosmos-client\";\nimport { GasPrice, calculateFee } from \"@cosmjs/stargate\";\nimport { SigningCosmWasmClient } from \"@cosmjs/cosmwasm-stargate\";\nconst offlineSigner = await getOfflineSigner(CHAIN_ID);\nconst rpcEndpoint = RPC_END_POINT;\nconst client = await SigningCosmWasmClient.connectWithSigner(\n rpcEndpoint,\n offlineSigner\n);\n//getAccounts\nconst accounts = await offlineSigner.getAccounts();\n//execute\nconst gasPrice = GasPrice.fromString(\"0.01denom\");\nconst fees = {\n upload: calculateFee(1500000, gasPrice),\n init: calculateFee(500000, gasPrice),\n exec: calculateFee(500000, gasPrice),\n};\nconst result = await client.execute(\n accounts[0].address,\n RECEIPT_ADDRESS,\n MESSAGE,\n fees.exec\n);"}},"/mobile/integration/cosmostation":{"title":"Cosmostation","data":{"":"Using @cosmostation/extension-client to support both Mobile and PC in the same way as extensions.\nIf your project's dApp works well in Cosmostation Extension, it will work well in mobile too.\nFor more detailed explanation, please refer to the Cosmostation Extension Guide."}},"/mintstation/validator/upgrade":{"title":"Node Upgrades","data":{"upgrades#Upgrades":"Release procedures for validators and node operators are explained here.","upgrade-types#Upgrade types":"There are two types of upgrades that happen on Mintstation Network. They are:\nPlanned feature upgrades or planned patches\nUnplanned security upgrades.","planned-upgrade-via-governance#Planned upgrade (via governance)":"Planned upgrades, as the name suggests, are upgrades that are developed and proposed via governance. If approved by the community, these upgrades are undertaken by the chain automatically halting at the planned upgrade height.Node operators are then required to swap the binary for the planned upgrade binary. After all node operators have upgraded and started their nodes the network will continue in the upgraded state.","unplanned-upgrade#Unplanned upgrade":"Where emergency security patches are required node operators will be required to halt their nodes manually at the required upgrade height, swap the patched binary and restart their nodes. After all node operators have upgraded and started their nodes the network will continue in the upgraded state."}},"/mobile/integration/walletconnect/accounts":{"title":"Accounts","data":{"":"Use account on Cosmostation Mobile Wallet via WalletConnect.","get-accounts#Get Accounts":"Select an account after checking unsupported chains or empty accounts.The response only contains selected account.\nexport function getAccountRequest(chainIds) {\n return {\n id: payloadId(),\n jsonrpc: \"2.0\",\n method: \"cosmostation_wc_accounts_v1\",\n params: chainIds,\n };\n}\nconst request = getAccountRequest([CHAIN_ID, NOT_SUPPORTED_CHAIN_ID]);\nconnector\n .sendCustomRequest(request)\n .then((accounts) => {\n setAccounts(accounts);\n console.log(accounts.length == 1);\n })\n .catch((error) => {\n console.error(error);\n });\ntype AccountResponse = {\n name: string;\n algo: string;\n address: Uint8Array;\n pubKey: string;\n bech32Address: string;\n};"}},"/mobile/integration/walletconnect/connect":{"title":"Connect","data":{"":"Cosmostation Mobile Wallet supports dApps via WalletConnect.(Deprecated)WalletConnect Example CodeWalletConnect Example Page\nimport WalletConnect from \"@walletconnect/client\";\nexport async function connect() {\n const connector = new WalletConnect({\n bridge: \"https://bridge.walletconnect.org\",\n signingMethods: [\n \"cosmostation_wc_accounts_v1\",\n \"cosmostation_wc_sign_tx_v1\",\n ],\n qrcodeModal: new CosmostationWCModal(),\n });\n await connector.createSession();\n return connector;\n}","modal#Modal":"Use CosmostationModal when initializing WalletConnect to use DeepLink and QRCode connect.\nyarn add @cosmostation/wc-modal\nimport CosmostationWCModal from \"@cosmostation/wc-modal\";","event#Event":"By implementing connect/disconnect event, handle connect state event.\nconst connector = await connect();\nconnector.on(\"connect\", (error, payload) => {\n if (error) {\n setConnected(false);\n throw error;\n }\n setConnected(true);\n});\nconnector.on(\"disconnect\", (error, payload) => {\n setConnected(false);\n});"}},"/mobile/integration/walletconnect/sign-tx":{"title":"Sign Transactions","data":{"":"Sign transcation using Cosmostation Mobile Wallet via WalletConnect.\nexport function getSignTxRequest(chainId, signer, signDoc) {\n return {\n id: payloadId(),\n jsonrpc: \"2.0\",\n method: \"cosmostation_wc_sign_tx_v1\",\n params: [chainId, signer, signDoc],\n };\n}\nconst signDoc = makeAminoSignDoc(\n [message],\n fee,\n CHAIN_ID,\n \"\",\n accountNumber,\n sequence\n);\nconst request = getSignAminoRequest(CHAIN_ID, address, signDoc);\nconnector\n .sendCustomRequest(request)\n .then((response) => {\n const signed = _.get(response, \"0.signed\");\n const signature = _.get(response, \"0.signature\");\n return broadcastTx(signed, signature);\n })\n .then((result) => {\n const code = _.get(result, \"code\");\n if (code === 0) {\n const txHash = _.get(result, \"txhash\");\n console.log(txHash);\n } else {\n const rawLog = _.get(result, \"raw_log\");\n console.error(rawLog);\n }\n });\ntype SignTxResponse = {\n signed: StdSignDoc;\n signature: { signature: string; pub_key: { type: string; value: string } };\n};"}},"/mobile/listing":{"title":"How to dApp listing?","data":{"":"For add your dapp to Mobile Wallet.Create a pull request from the link below.https://github.com/cosmostation/chainlist/blob/main/dapp/README.md"}},"/mobile/integration/walletconnect2":{"title":"WalletConnect 2.0","data":{"":"Cosmostation Mobile Wallet implement WalletConnect 2.0 specs.WalletConnect 2.0 Cosmos GuideWalletConnect 2.0 Example CodeWalletConnect 2.0 Example Page","connect#Connect":"import Client from \"@walletconnect/sign-client\";\nimport {\n PairingTypes,\n ProposalTypes,\n SessionTypes,\n} from \"@walletconnect/types\";\nfunction App() {\n const [client, setClient] = useState();\n const [pairings, setPairings] = useState([]);\n const [session, setSession] = useState();\n const [chains, setChains] = useState([]);\n const [accounts, setAccounts] = useState([]);\n useEffect(() => {\n if (client === undefined) {\n createClient();\n }\n }, [client]);\n const createClient = async () => {\n try {\n const _client = await Client.init({...});\n setClient(_client);\n } catch (err) {\n throw err;\n } finally {\n }\n };\n async function connect() {\n const modal = new Modal();\n if (typeof client === \"undefined\") {\n throw new Error(\"WalletConnect is not initialized\");\n }\n try {\n const requiredNamespaces = getRequiredNamespaces();\n const { uri, approval } = await client.connect({\n pairingTopic: undefined,\n requiredNamespaces: {\n cosmos: {\n methods: [\"cosmos_signDirect\", \"cosmos_signAmino\"],\n chains: [\"cosmos:cosmoshub-4\"],\n events: [],\n },\n },\n });\n if (uri) {\n const standaloneChains = Object.values(requiredNamespaces)\n .map((namespace) => namespace.chains)\n .flat();\n modal.open(uri, standaloneChains);\n }\n const session = await approval();\n console.log(\"Established session:\", session);\n await onSessionConnected(session);\n setPairings(client.pairing.getAll({ active: true }));\n } catch (e) {\n console.error(e);\n } finally {\n modal.close();\n }\n }\n const getRequiredNamespaces = (): ProposalTypes.RequiredNamespaces => {\n return Object.fromEntries(\n chains.map((namespace) => [\n namespace,\n {\n methods: [\"cosmos_signDirect\", \"cosmos_signAmino\"],\n chains: chains.filter((chain) => chain.startsWith(namespace)),\n events: [],\n },\n ])\n );\n };\n const onSessionConnected = useCallback(\n async (_session: SessionTypes.Struct) => {\n const allNamespaceAccounts = Object.values(_session.namespaces)\n .map((namespace) => namespace.accounts)\n .flat();\n const allNamespaceChains = Object.keys(_session.namespaces);\n setSession(_session);\n setChains(allNamespaceChains);\n setAccounts(allNamespaceAccounts);\n },\n []\n );\n}"}},"/extension/integration/cosmos/Deprecated/send-tx":{"title":"Send Transcation","data":{"":"Send transcation via Cosmostation Extension","code-using-cosmostationextension-client#Code using @cosmostation/extension-client":"import { SEND_TRANSACTION_MODE } from \"@cosmostation/extension-client/cosmos\";\n// ...\nconst response = await provider.sendTransaction(\n \"cosmos\",\n \"abc=\", // base64 string or Uint8Array\n SEND_TRANSACTION_MODE.ASYNC /* SEND_TRANSACTION_MODE or one of [0, 1, 2, 3] */\n);","vanilla-code#Vanilla Code":"const response = await window.cosmostation.cosmos.request({\n method: \"cos_sendTransaction\",\n params: { chainName: \"cosmos\", txBytes: \"abc=\", mode: 0 },\n});","response#Response":"export type SendTransactionResponse = {\n tx_response: SendTransaction;\n};\nexport type SendTransaction = {\n code: number;\n txhash: string;\n raw_log?: unknown;\n codespace?: unknown;\n tx?: unknown;\n log?: unknown;\n info?: unknown;\n height?: unknown;\n gas_wanted?: unknown;\n gas_used?: unknown;\n events?: unknown;\n data?: unknown;\n timestamp?: unknown;\n};\nexport const SEND_TRANSACTION_MODE = {\n UNSPECIFIED: 0,\n BLOCK: 1,\n SYNC: 2,\n ASYNC: 3,\n};\n{\n \"tx_response\": {\n \"code\": 0,\n \"codespace\": \"\",\n \"data\": \"\",\n \"events\": [],\n \"gas_used\": \"0\",\n \"gas_wanted\": \"0\",\n \"height\": \"0\",\n \"info\": \"\",\n \"logs\": [],\n \"raw_log\": \"[]\",\n \"timestamp\": \"\",\n \"tx\": null,\n \"txhash\": \"\"\n }\n}"}},"/mintstation/module":{"title":"Building Modules","data":{"":"In this tutorial we will be going over building a module in Mintstation to show how easy it is to build on top of the Mintstation ecosystem. This module will be simple in nature but will show how to set up and connect a module to Mintstation and can be used as a starting point for more complex modules.","set-up#Set up":"git clone https://github.com/cosmostation/mintstation.git","defining-protocol-buffer-types#Defining Protocol Buffer Types":"The first step in building a new Mintstation Module is to define our Module's types. To do that we use Protocol Buffers which is a used for serializing structured data and generating code for multiple target languages, Protocol Buffers are also smaller than JSON & XML so sending data around the network will be less expensive. Learn More.Our Protobuf files will all live in proto/mintstation directory. We will create a new directory with the new module greet and add the following files in the proto/greet/v1beta1/ directory\ngenesis.proto\ngreet.proto\nquery.proto\ntx.proto","defining-the-greet-type#Defining The Greet Type":"Inside the proto/greet/v1beta1/greet.proto file lets define our greet type:\nsyntax = \"proto3\";\npackage mintstation.greet.v1beta1;\nimport \"cosmos_proto/cosmos.proto\";\nimport \"gogoproto/gogo.proto\";\noption go_package = \"github.com/cosmostation/mintstation/x/greet/types\";\nmessage Greet {\nstring owner = 1;\nstring id = 2;\nstring message = 3;\n}\nHere we are saying that we have a Greet type that will have an owner, an id and a message that will contain the greet string. Once we have that defined we are ready to set up a way to create this greet message and query it.","creating-a-new-greeting#Creating a new Greeting":"Inside the proto/greet/v1beta1/tx.proto file lets define our Msg Type:\nsyntax = \"proto3\";\npackage mintstation.greet.v1beta1;\nimport \"gogoproto/gogo.proto\";\nimport \"cosmos_proto/cosmos.proto\";\noption go_package = \"github.com/cosmostation/mintstation/x/greet/types\";\nservice Msg {\n\trpc CreateGreet(MsgCreateGreet) returns (MsgCreateGreetResponse);\n}\nmessage MsgCreateGreet {\nstring message = 1;\nstring owner = 2;\n}\nmessage MsgCreateGreetResponse {}\nNow that we have defined how to create a new Greeting let's finish up by setting up our queries to view a specific greeting or all of them.One thing to note here is that any state changing actions are transactions and for that reason we put them in our tx.proto files, we essentially said we are creating a new state changing message & defined the types for that message in our proto file, we will later add clients to trigger state change, which in our case will be adding a new message to our chain.","querying-greetings#Querying Greetings":"Code inside the proto/greet/v1beta1/query.proto :\nsyntax = \"proto3\";\npackage mintstation.greet.v1beta1;\noption go_package = \"github.com/cosmostation/mintstation/x/greet/types\";\nimport \"gogoproto/gogo.proto\";\nimport \"google/api/annotations.proto\";\nimport \"cosmos/base/query/v1beta1/pagination.proto\";\nimport \"cosmos_proto/cosmos.proto\";\nimport \"mintstation/greet/v1beta1/greet.proto\";\nservice Query {\n\trpc Greet(QueryGetGreetRequest) returns (QueryGetGreetResponse) {\n\toption (google.api.http).get = \"/mintstation/greet/v1beta1/greetings/{id}\";\n\t}\n\trpc GreetAll(QueryAllGreetRequest) returns (QueryAllGreetResponse) {\n\toption (google.api.http).get = \"/mintstation/swap/v1beta1/greetings\";\n\t}\n}\nmessage QueryGetGreetRequest {\nstring id = 1;\n}\nmessage QueryGetGreetResponse {\nGreet greeting = 1;\n}\nmessage QueryAllGreetRequest {\ncosmos.base.query.v1beta1.PageRequest pagination = 1;\n}\nmessage QueryAllGreetResponse {\nrepeated Greet greetings = 1;\ncosmos.base.query.v1beta1.PageResponse pagination = 2;\n}\nOur query.proto now contains the types for our queries, we have defined a request type & a response type and those types will be returned once we trigger a query through the CLI, REST API, or Grpc. The response will follow the same structure regardless of the type of client initiating the request.We defined our query, tx, and greet proto files we finally need to set up the genesis file and then we are ready to generate these types. In the genesis file we will create a minimal genesis.proto for this tutorial to keep things simple.\nsyntax = \"proto3\";\npackage mintstation.greet.v1beta1;\nimport \"mintstation/greet/v1beta1/greet.proto\";\nimport \"gogoproto/gogo.proto\";\nimport \"google/protobuf/timestamp.proto\";\nimport \"cosmos_proto/cosmos.proto\";\noption go_package = \"github.com/cosmostation/mintstation/x/greet/types\";\n// our gensis state message will be empty for this tutorial\nmessage GenesisState {}\nOnce all the files are filled in we are ready to generate our proto types. in the Mintstation Directory run make proto-gen to generate the types, this will create a folder inside the x/greet and will contain the auto-generated proto types.","developing-our-greet-module#Developing Our Greet Module":"we have successfully set up our Proto files & generated them, we now have a x/greet directory generated, this is where we will write our module's code. For starters we will define our module's types in a new file inside x/greet/types/greet.go.","setting-up-constants--importing-packages#Setting up constants & importing packages":"Let's set up some basic constants for our module to help with routing, & fetching items from our store.\npackage types\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"github.com/cosmos/cosmos-sdk/codec\"\n\t\"github.com/cosmos/cosmos-sdk/codec/types\"\n\tsdk \"github.com/cosmos/cosmos-sdk/types\"\n\tsdkerrors \"github.com/cosmos/cosmos-sdk/types/errors\"\n\t\"github.com/cosmos/cosmos-sdk/types/msgservice\"\n)\n// defined our module's constants such as name, routerkey\n// and prefixes for getting items from the store\nconst (\n\tModuleName = \"greet\"\n\tStoreKey = ModuleName\n\tRouterKey = ModuleName\n\tQuerierRoute = ModuleName\n\tGreetKey = \"greet-value-\" // used for getting a greeting from our store\n\tGreetCountKey = \"greet-count-\" // used for getting count from out store\n\tQueryGetGreeting = \"get-greeting\" // used for legacy querier routing\n\tQueryListGreetings = \"list-greetings\"// used for legacy querier routing\n)\n// heler function simply returns []byte out of a prefix string\nfunc KeyPrefix(p string) []byte {\n\treturn []byte(p)\n}\n// returns default genesis state\nfunc DefaultGenesisState() GenesisState {\n\treturn GenesisState{}\n}\n// validates genesis state\nfunc (gs GenesisState) Validate() error {\n\treturn nil\n}","setting-up-our-msg-for-creating-a-new-greeting#Setting up our Msg for creating a new greeting":"Our MsgCreateGreet struct was created when we generated our Proto Types, we now need to use that struct to implement the sdk.Msg interface such that we can create new greetings. the first thing we will do is defined an unnamed variable with the _ syntax and have it implement the sdk.Msg type. This will help us catch unimplemented functions and guide us with syntax highlighting.\n// MsgCreateGreet we defined it here to get type checking\n//to make sure we are immplementing it correctly\nvar _ sdk.Msg = &MsgCreateGreet{}\n// constructor for creating a new greeting\nfunc NewMsgCreateGreet(owner string, message string) *MsgCreateGreet{\n\treturn &MsgCreateGreet{\n\tOwner: owner,\n\tMessage: message,\n\t}\n}\n// does a quick stateless validation on our new greeting\nfunc (m *MsgCreateGreet) ValidateBasic() error {\n\t// ensures address is valid\n\tif _, err := sdk.AccAddressFromBech32(m.Owner); err != nil {\n\t\treturn sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, \"invalid owner address\", err)\n\t}\n\t// ensures the greeting is not empty\n\tif len(strings.TrimSpace(m.Message)) == 0 {\n\t\treturn fmt.Errorf(\"must provide a greeting message\")\n\t}\n\treturn nil\n}\n// gets the signer of the new message which will be the owner of the greeting\nfunc (m *MsgCreateGreet) GetSigners() []sdk.AccAddress {\n\towner, err := sdk.AccAddressFromBech32(m.Owner);\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn []sdk.AccAddress{owner}\n}","registering-our-codec--interfaces#Registering our Codec & interfaces":"now that we have our MsgCreateGreet implement the sdk.Msg interface let's register our codec for marshaling/unmarshaling our greeting we will register both the deprecated legacy amino and the new Interface registry.\n// registers the marshal/unmarsahl for greating a new greeting for our legacy amino codec\nfunc RegisterLegacyAminoCodec(cdc *codec.LegacyAmino){\n\tcdc.RegisterConcrete(&MsgCreateGreet{}, \"greet/CreateGreet\", nil)\n}\n// registers a module's interface types and their concrete implementations as proto.Message.\nfunc RegisterInterfaces(registry types.InterfaceRegistry){\n\tregistry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateGreet{})\n\tmsgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)\n}\nvar amino = codec.NewLegacyAmino()\nvar ModuleCdc = codec.NewAminoCodec(amino)","setting-up-a-basic-keeper#Setting up a basic Keeper":"we have finished up setting up our types, now it's time to implement our greet module's keeper, lets do that in a new folder & package named keeper, create x/greet/keeper/greet_keeper.go .","setting-up-the-keeper-struct--imports#Setting up the Keeper Struct & imports":"keepers are an abstraction over the state defined by a module, every module would have a keeper which would be used to access the state of that module, or if given access a keeper can also use other module's keepers by providing reference to the other module's keeper.\npackage keeper\nimport (\n\t\"context\"\n\t\"strconv\"\n\t\"github.com/cosmos/cosmos-sdk/codec\"\n\t\"github.com/cosmos/cosmos-sdk/store/prefix\"\n\tsdk \"github.com/cosmos/cosmos-sdk/types\"\n\tabci \"github.com/tendermint/tendermint/abci/types\"\n\t\"github.com/cosmostation/mintstation/x/greet/types\"\n\tsdkerrors \"github.com/cosmos/cosmos-sdk/types/errors\"\n)\ntype Keeper struct {\n\tcdc codec.Codec // used to marshall and unmarshall structs from & to []byte\n\tkey sdk.StoreKey // grant access to the store\n}\n// our constructor for creating a new Keeper for this module\nfunc NewKeeper(c codec.Codec, k sdk.StoreKey) Keeper {\n\treturn Keeper{\n\tcdc: c,\n\tkey: k,\n\t}\n}","wiring-up-our-methods-for-handling-new-transactions--queries#Wiring up our methods for handling new transactions & queries":"Now that we have our Keeper Struct written, let's create some receiver functions on our keeper to handle adding a new greeting & looking up a greeting.\n// get greet count will be used for setting an Id when a new greeting is created\nfunc (k Keeper) GetGreetCount(ctx sdk.Context) int64 {\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetCountKey))\n\tbyteKey := types.KeyPrefix(types.GreetCountKey)\n\tbz := store.Get(byteKey)\n\tif bz == nil {\n\t\treturn 0\n\t}\n\tcount, err := strconv.ParseInt(string(bz), 10, 64)\n\tif err != nil {\n\t\tpanic(\"cannot decode count\")\n\t}\n\treturn count\n}\n// sets the greet count\nfunc (k Keeper) SetGreetCount(ctx sdk.Context, count int64){\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetCountKey))\n\tkey := types.KeyPrefix(types.GreetCountKey)\n\tvalue := []byte(strconv.FormatInt(count, 10))\n\tstore.Set(key, value)\n}\n// creates a new greeting\nfunc (k Keeper) CreateGreet(ctx sdk.Context, m types.MsgCreateGreet){\n\tcount := k.GetGreetCount(ctx)\n\tgreet := types.Greet{\n\tId: strconv.FormatInt(count, 10),\n\tOwner: m.Owner,\n\tMessage: m.Message,\n\t}\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))\n\tkey := types.KeyPrefix(types.GreetKey + greet.Id)\n\tvalue := k.cdc.MustMarshal(&greet)\n\tstore.Set(key, value)\n\tk.SetGreetCount(ctx, count + 1)\n}\n// gets a greeting from the store\nfunc (k Keeper) GetGreeting(ctx sdk.Context, key string) types.Greet {\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))\n\tvar Greet types.Greet\n\tk.cdc.Unmarshal(store.Get(types.KeyPrefix(types.GreetKey + key)), &Greet)\n\treturn Greet\n}\n// checks if a greeting exists by an id\nfunc (k Keeper) HasGreet(ctx sdk.Context, id string) bool {\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))\n\treturn store.Has(types.KeyPrefix(types.GreetKey + id))\n}\n// gets the owner of a greeting\nfunc (k Keeper) GetGreetOwner(ctx sdk.Context, key string) string {\n\treturn k.GetGreeting(ctx, key).Owner\n}\n// gets a list of all greetings in the store\nfunc (k Keeper) GetAllGreetings(ctx sdk.Context) (msgs []types.Greet){\n\tstore := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))\n\titerator := sdk.KVStorePrefixIterator(store, types.KeyPrefix(types.GreetKey))\n\tdefer iterator.Close()\n\tfor ; iterator.Valid(); iterator.Next() {\n\t\tvar msg types.Greet\n\t\tk.cdc.Unmarshal(iterator.Value(), &msg)\n\t\tmsgs = append(msgs, msg)\n\t}\n\treturn\n}","handling-queries#Handling queries":"We have added methods for interacting with greetings such as creating or reading them, now let's set up our two query services so we can route them to the correct method, we will set up our legacy Querier & gRPC querier below the methods we defined above on our keeper.\nfunc (k Keeper) GreetAll(c context.Context, req *types.QueryAllGreetRequest) (*types.QueryAllGreetResponse, error){\n\tctx := sdk.UnwrapSDKContext(c)\n\tvar greetings []*types.Greet\n\tfor _, g := range k.GetAllGreetings(ctx) {\n\t\tvar greeting = &g\n\t\tgreetings = append(greetings,greeting)\n\t}\n\treturn &types.QueryAllGreetResponse{Greetings: greetings, Pagination: nil}, nil\n}\nfunc (k Keeper) Greet(c context.Context, req *types.QueryGetGreetRequest) (*types.QueryGetGreetResponse, error){\n\tsdk.UnwrapSDKContext(c)\n\tvar greeting = k.GetGreeting(sdk.UnwrapSDKContext(c), req.Id)\n\treturn &types.QueryGetGreetResponse{Greeting: &greeting}, nil\n}\n// LEGACY QUERIER will be deperacted but for the sake of competeness this is how to set it up\nfunc NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {\n\treturn func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) {\n\tswitch path[0] {\n\t\tcase types.QueryGetGreeting:\n\t\t\tvar getGreetRequest types.QueryGetGreetRequest\n\t\t\terr := legacyQuerierCdc.UnmarshalJSON(req.Data, &getGreetRequest)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())\n\t\t\t}\n\t\t\tval := k.GetGreeting(ctx, getGreetRequest.GetId())\n\t\t\tbz, err := legacyQuerierCdc.MarshalJSON(val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())\n\t\t\t}\n\t\t\treturn bz, nil\n\t\tcase types.QueryListGreetings:\n\t\t\tval := k.GetAllGreetings(ctx)\n\t\t\tbz, err := codec.MarshalJSONIndent(legacyQuerierCdc, val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())\n\t\t\t}\n\t\t\treturn bz, nil\n\t\tdefault:\n\t\t\treturn nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, \"unknow request at %s query endpoint\", types.ModuleName)\n\t\t}\n\t}\n}","setting-up-a-command-to-create-a-new-greeting#Setting up a command to create a new greeting":"let's set up a way for clients to submit a new greeting & query existing greetings, we can do that with a CLI, REST, & gRPC clients. for this tutorial we will focus on setting up our CLI client. create x/greet/client/cli/tx.go.here We will define a command to create a new greeting:\npackage cli\nimport (\n\t\"fmt\"\n\t\"github.com/cosmos/cosmos-sdk/client\"\n\t\"github.com/cosmos/cosmos-sdk/client/flags\"\n\t\"github.com/cosmos/cosmos-sdk/client/tx\"\n\t\"github.com/cosmostation/mintstation/x/greet/types\"\n\t\"github.com/spf13/cobra\"\n)\nfunc GetTxCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\tUse: types.ModuleName,\n\tShort: fmt.Sprintf(\"%s transactions subcommands\", types.ModuleName),\n\tDisableFlagParsing: true,\n\tSuggestionsMinimumDistance: 2,\n\tRunE: client.ValidateCmd,\n\t}\n\tcmd.AddCommand(CmdCreateGreeting())\n\treturn cmd\n}\nfunc CmdCreateGreeting() *cobra.Command {\n\tcmd:= &cobra.Command{\n\tUse: \"create-greeting [message]\",\n\tShort: \"creates a new greetings\",\n\tArgs: cobra.ExactArgs(1),\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tmessage := string(args[0])\n\t\t\tclientCtx, err := client.GetClientTxContext(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tmsg := types.NewMsgCreateGreet(clientCtx.GetFromAddress().String(), string(message))\n\t\t\tif err := msg.ValidateBasic(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)\n\t\t},\n\t}\n\tflags.AddTxFlagsToCmd(cmd)\n\treturn cmd\n}","querying-greetings-1#Querying greetings":"We will now set up two different commands for querying, one will be to list all greetings & the other will be to get a greeting by it's id. inside x/greet/cli/query.go:\npackage cli\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/cosmos/cosmos-sdk/client\"\n\t\"github.com/cosmos/cosmos-sdk/client/flags\"\n\t\"github.com/cosmostation/mintstation/x/greet/types\"\n\t\"github.com/spf13/cobra\"\n)\n// this is the parent query command for the greet module everytime we add a new command we will register it here\nfunc GetQueryCmd(queryRoute string) *cobra.Command {\n// Group todos queries under a subcommand\n\tcmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: fmt.Sprintf(\"Querying commands for the %s module\", types.ModuleName),\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\tcmd.AddCommand(CmdListGreetings())\n\tcmd.AddCommand(CmdShowGreeting())\n\treturn cmd\n}\n// build the list greet command function\nfunc CmdListGreetings() *cobra.Command {\n\tcmd := &cobra.Command{\n\tUse: \"list-greetings\",\n\tShort: \"list all greetings\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tclientCtx, err := client.GetClientTxContext(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpageReq, err := client.ReadPageRequest(cmd.Flags())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tqueryClient := types.NewQueryClient(clientCtx)\n\t\t\tparams := &types.QueryAllGreetRequest{\n\t\t\tPagination: pageReq,\n\t\t\t}\n\t\t\tres, err := queryClient.GreetAll(context.Background(), params)\n\t\t\tif err != nil {\n\t\t\treturn err\n\t\t\t}\n\t\t\treturn clientCtx.PrintProto(res)\n\t\t},\n\t}\n\tflags.AddQueryFlagsToCmd(cmd)\n\treturn cmd\n}\n// build the show greet command function\nfunc CmdShowGreeting() *cobra.Command {\n\tcmd := &cobra.Command{\n\tUse: \"get-greeting [id]\",\n\tShort: \"shows a greeting\",\n\tArgs: cobra.ExactArgs(1),\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tclientCtx, err := client.GetClientTxContext(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tqueryClient := types.NewQueryClient(clientCtx)\n\t\t\tparams := &types.QueryGetGreetRequest{\n\t\t\tId: args[0],\n\t\t\t}\n\t\t\tres, err := queryClient.Greet(context.Background(), params)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn clientCtx.PrintProto(res)\n\t\t},\n\t}\n\tflags.AddQueryFlagsToCmd(cmd)\n\treturn cmd\n}","setting-up-our-modules-package#Setting up our Module's package":"Now that we have all the basic functionality set up for our greet module, let's bring it all together and get our module ready to be used & tested, create a new file x/greet/module.go.Here we will start by implementing our AppModuleBasic && AppModule interfaces.\npackage greet\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"github.com/cosmos/cosmos-sdk/client\"\n\t\"github.com/cosmos/cosmos-sdk/codec\"\n\tcdctypes \"github.com/cosmos/cosmos-sdk/codec/types\"\n\tsdk \"github.com/cosmos/cosmos-sdk/types\"\n\t\"github.com/cosmos/cosmos-sdk/types/module\"\n\t\"github.com/gorilla/mux\"\n\t\"github.com/grpc-ecosystem/grpc-gateway/runtime\"\n\t\"github.com/cosmostation/mintstation/x/greet/client/cli\"\n\t\"github.com/cosmostation/mintstation/x/greet/keeper\"\n\t\"github.com/cosmostation/mintstation/x/greet/types\"\n\t\"github.com/spf13/cobra\"\n\tabci \"github.com/tendermint/tendermint/abci/types\"\n)\nvar (\n\t_ module.AppModule = AppModule{}\n\t_ module.AppModuleBasic = AppModuleBasic{}\n)\n/*\nThe AppModuleBasic interface defines the independent methods modules need to implement\nit follows this interface below\ntype AppModuleBasic interface {\n\tName() string\n\tRegisterLegacyAminoCodec(*codec.LegacyAmino)\n\tRegisterInterfaces(codectypes.InterfaceRegistry)\n\tDefaultGenesis(codec.JSONMarshaler) json.RawMessage\n\tValidateGenesis(codec.JSONMarshaler, client.TxEncodingConfig, json.RawMessage) error\n\t// client functionality\n\tRegisterRESTRoutes(client.Context, *mux.Router)\n\tRegisterGRPCRoutes(client.Context, *runtime.ServeMux)\n\tGetTxCmd() *cobra.Command\n\tGetQueryCmd() *cobra.Command\n}\n*/\ntype AppModuleBasic struct{}\n// Returns the name of the module as a string\nfunc (AppModuleBasic) Name() string {\n\treturn types.ModuleName\n}\nfunc (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {\n\tgs := types.DefaultGenesisState()\n\treturn cdc.MustMarshalJSON(&gs)\n}\nfunc (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error {\n\treturn nil\n}\n// Registers the amino codec for the module, which is used to marshal\n// and unmarshal structs to/from []byte in order to persist them in the module's KVStore.\nfunc (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino){\n\ttypes.RegisterLegacyAminoCodec(cdc)\n}\n// Registers a module's interface types and their concrete implementations as proto.Message\nfunc (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) {\n\ttypes.RegisterInterfaces(registry)\n}\n// Registers gRPC routes for the module.\nfunc (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {\n\tif err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {\n\t\tpanic(err)\n\t}\n}\n// Registers the REST routes for the module. These routes will be used to map REST request to the module in order to process them\nfunc (a AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { }\n// Returns the root Tx command for the module. The subcommands of this root command are used by end-users\n// to generate new transactions containing messages defined in the module\nfunc (AppModuleBasic) GetTxCmd() *cobra.Command {\n\treturn cli.GetTxCmd()\n}\n// Return the root query command for the module. The subcommands of this root command are used by end-users\n// to generate new queries to the subset of the state defined by the module.\nfunc (AppModuleBasic) GetQueryCmd() *cobra.Command {\n\treturn cli.GetQueryCmd(types.StoreKey)\n}\n// -------------------------------------APPMODULE BELOW------------------------------------------------- //\n/*\nThe AppModule interface defines the inter-dependent methods that modules need to implement\nfollows the interface below\n\ttype AppModule interface {\n\t\tAppModuleGenesis\n\t\t// registers\n\t\tRegisterInvariants(sdk.InvariantRegistry)\n\t\t// routes\n\t\tRoute() sdk.Route\n\t\t// Deprecated: use RegisterServices\n\t\tQuerierRoute() string\n\t\t// Deprecated: use RegisterServices\n\t\tLegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier\n\t\t// RegisterServices allows a module to register services\n\t\tRegisterServices(Configurator)\n\t\t// ABCI\n\t\tBeginBlock(sdk.Context, abci.RequestBeginBlock)\n\t\tEndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate\n\t}\n*/\ntype AppModule struct{\n\tAppModuleBasic\n\tkeeper keeper.Keeper\n}\n// constructor\nfunc NewAppModule(keeper keeper.Keeper) AppModule {\n\treturn AppModule{\n\t\tAppModuleBasic: AppModuleBasic{},\n\t\tkeeper: keeper,\n\t}\n}\n// Returns the route for messages to be routed to the module by BaseApp.\nfunc (am AppModule) Name() string {\n\treturn am.AppModuleBasic.Name()\n}\n// registers the invariants of the module. If an invariant deviates from its predicted value,\n// the InvariantRegistry triggers appropriate logic (most often the chain will be halted).\nfunc (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { }\n// Returns the route for messages to be routed to the module by BaseApp.\nfunc (AppModule) Route() sdk.Route {\n\treturn sdk.Route{}\n}\n// Returns the name of the module's query route, for queries to be routes to the module by BaseApp.deprecated\nfunc (AppModule) QuerierRoute() string {\n\treturn types.QuerierRoute\n}\n// Returns a querier given the query path, in order to process the query.\nfunc (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {\n\treturn keeper.NewQuerier(am.keeper, legacyQuerierCdc)\n}\nfunc (AppModule) ConsensusVersion() uint64 {\n\treturn 1\n}\n// Allows a module to register services.\nfunc (am AppModule) RegisterServices(cfg module.Configurator) {\n\ttypes.RegisterMsgServer(cfg.MsgServer(), NewMsgServerImpl(am.keeper))\n\ttypes.RegisterQueryServer(cfg.QueryServer(), am.keeper)\n}\nfunc (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate {\n\treturn []abci.ValidatorUpdate{}\n}\nfunc (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {\n\tgs := types.DefaultGenesisState()\n\treturn cdc.MustMarshalJSON(&gs)\n}\nfunc (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { }\nfunc (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {\n\treturn []abci.ValidatorUpdate{}\n}\n// ----------------------------------MSGSERVER REGISTER------------------------//\nvar _ types.MsgServer = msgServer{}\ntype msgServer struct {\n\tkeeper keeper.Keeper\n}\nfunc (m msgServer) CreateGreet(c context.Context, msg *types.MsgCreateGreet) (*types.MsgCreateGreetResponse, error) {\n\tctx := sdk.UnwrapSDKContext(c)\n\tm.keeper.CreateGreet(ctx, types.MsgCreateGreet{Owner: msg.Owner, Message: msg.Message})\n\treturn &types.MsgCreateGreetResponse{}, nil\n}\nfunc NewMsgServerImpl(keeper keeper.Keeper) types.MsgServer {\n\treturn &msgServer{keeper: keeper}\n}","hooking-up-our-module-inside-appgo#Hooking up our module inside App.go":"inside app/app.go start off importing the greet module, it's types & keeper packages and add them to the following places:\nmodule.NewBasicManager() add greet.AppModuleBasic{}\ntype App struct {} add greetkeeper.Keeper\nsdk.NewKVStoreKeys() inside NewApp func add greettypes.StoreKey\ninside NewApp func add app.greetKeeper = greetKeeper.NewKeeper() and add arguments appCodec & keys[greettypes.StoreKey]\ninside NewApp find where we define app.mm & add greet.NewAppModule(app.greetKeeper),\nfinally add the greet module's name to SetOrderBeginBlockers, SetOrderEndBlockers && SetOrderInitGenesis","testing-our-new-module#Testing our new Module":"inside the root of our directory run docker build -t mintstation/mintstation:tutorial-demo .\nfind the directory for kvtool and open in your favorite code editor\nrun kvtool testnet gen-config mintstation --mintstation.configTemplate upgrade-v44 which will create a bunch of files inside full_configs/generated\nopen up the two docker-compose.yaml files the one inside generated & the one inside generated/mintstation and change the image to point to mintstation/mintstation:tutorial-demo this will point to the local image we just built\nchange into the full_configs/generated directory and run docker compose up -d\nnow run docker compose exec mintstationnode bash to bash into our mintstation cli inside the running container\nWe should now have access to our greet commands that we defined first we will test creating a new greeting, for that we will run the following command:mintstationd tx greet create-greeting \"hello world from mintstation chain\" --from whalenow let's test to see if the greeting message is able to be queried:mintstationd q greet list-greetingsWe should see something like this below:\ngreetings:\n- id: \"0\"\n message: hello world from mintstation chain\n owner: \npagination: null\nNow let's test if we can query the greeting by it's id which in our case will be \"0\", run the following:mintstationd q greet get-greeting 0We should see:\ngreeting:\n id: \"0\"\n message: hello world from mintstation chain\n owner: "}}} \ No newline at end of file diff --git a/_next/static/chunks/pages/mintstation/cli-62e132973e0ccd0e.js b/_next/static/chunks/pages/mintstation/cli-62e132973e0ccd0e.js new file mode 100644 index 00000000..ebf62490 --- /dev/null +++ b/_next/static/chunks/pages/mintstation/cli-62e132973e0ccd0e.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4165],{1345:function(n,t,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mintstation/cli",function(){return e(7389)}])},7389:function(n,t,e){"use strict";e.r(t),e.d(t,{__toc:function(){return c}});var i=e(5893),o=e(2673),d=e(2643);let c=[{depth:2,value:"Introduction",id:"introduction"},{depth:3,value:'Working Directory ',id:"working-directory-a-hrefworking-directory-idworking-directorya"},{depth:3,value:"Connecting to a Full-Node",id:"connecting-to-a-full-node"}];function _createMdxContent(n){let t=Object.assign({h1:"h1",h2:"h2",p:"p",code:"code",a:"a",h3:"h3"},(0,d.a)(),n.components);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{children:"CLI Introduction"}),"\n",(0,i.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"mintstationd"})," is a command line client for the Mintstation. Mintstation users can use ",(0,i.jsx)(t.code,{children:"mintstationd"})," to send transactions to the Mintstation network and query the blockchain data."]}),"\n",(0,i.jsxs)(t.p,{children:["See ",(0,i.jsx)(t.a,{href:"cli/setup",children:"here"})," for instructions on installing ",(0,i.jsx)(t.code,{children:"mintstationd"}),"."]}),"\n",(0,i.jsxs)(t.h3,{id:"working-directory-a-hrefworking-directory-idworking-directorya",children:["Working Directory ",(0,i.jsx)(t.a,{href:"#working-directory",id:"working-directory"})]}),"\n",(0,i.jsxs)(t.p,{children:["The default working directory for the ",(0,i.jsx)(t.code,{children:"mintstationd"})," is ",(0,i.jsx)(t.code,{children:"$HOME/.mintstation"}),", which is mainly used to store configuration files and blockchain data. The Mintstation ",(0,i.jsx)(t.code,{children:"key"})," data is saved in the working directory of ",(0,i.jsx)(t.code,{children:"mintstationd"}),". You can also specify the ",(0,i.jsx)(t.code,{children:"mintstationd"})," working directory by using the ",(0,i.jsx)(t.code,{children:"--home"})," flag when executing ",(0,i.jsx)(t.code,{children:"mintstationd"}),"."]}),"\n",(0,i.jsx)(t.h3,{id:"connecting-to-a-full-node",children:"Connecting to a Full-Node"}),"\n",(0,i.jsxs)(t.p,{children:["By default, ",(0,i.jsx)(t.code,{children:"mintstationd"})," uses ",(0,i.jsx)(t.code,{children:"tcp://localhost:26657"})," as the RPC address to connect to the Mintstation network. This default configuration assumes that the machine executing ",(0,i.jsx)(t.code,{children:"mintstationd"})," is running as a full-node."]}),"\n",(0,i.jsxs)(t.p,{children:["The RPC address can be specified to connect to any full-node with an exposed RPC port by adding the ",(0,i.jsx)(t.code,{children:"--node"})," flag when executing ",(0,i.jsx)(t.code,{children:"mintstationd"})]})]})}t.default=(0,o.j)({MDXContent:function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:t}=Object.assign({},(0,d.a)(),n.components);return t?(0,i.jsx)(t,{...n,children:(0,i.jsx)(_createMdxContent,{...n})}):_createMdxContent(n)},pageOpts:{filePath:"pages/mintstation/cli/index.md",route:"/mintstation/cli",timestamp:1700459849e3,title:"CLI Introduction",headings:c},pageNextRoute:"/mintstation/cli"})}},function(n){n.O(0,[2673,9774,2888,179],function(){return n(n.s=1345)}),_N_E=n.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/pages/mintstation/cli-eca5d973bc213845.js b/_next/static/chunks/pages/mintstation/cli-eca5d973bc213845.js deleted file mode 100644 index 8e741c87..00000000 --- a/_next/static/chunks/pages/mintstation/cli-eca5d973bc213845.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4165],{1345:function(n,t,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mintstation/cli",function(){return e(7389)}])},7389:function(n,t,e){"use strict";e.r(t),e.d(t,{__toc:function(){return c}});var i=e(5893),o=e(2673),d=e(2643);let c=[{depth:2,value:"Introduction",id:"introduction"},{depth:3,value:'Working Directory ',id:"working-directory-a-hrefworking-directory-idworking-directorya"},{depth:3,value:"Connecting to a Full-Node",id:"connecting-to-a-full-node"}];function _createMdxContent(n){let t=Object.assign({h1:"h1",h2:"h2",p:"p",code:"code",a:"a",h3:"h3"},(0,d.a)(),n.components);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{children:"CLI Introduction"}),"\n",(0,i.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"mintstaiond"})," is a command line client for the Mintstation. Mintstation users can use ",(0,i.jsx)(t.code,{children:"mintstationd"})," to send transactions to the Mintstation network and query the blockchain data."]}),"\n",(0,i.jsxs)(t.p,{children:["See ",(0,i.jsx)(t.a,{href:"cli/setup",children:"here"})," for instructions on installing ",(0,i.jsx)(t.code,{children:"mintstationd"}),"."]}),"\n",(0,i.jsxs)(t.h3,{id:"working-directory-a-hrefworking-directory-idworking-directorya",children:["Working Directory ",(0,i.jsx)(t.a,{href:"#working-directory",id:"working-directory"})]}),"\n",(0,i.jsxs)(t.p,{children:["The default working directory for the ",(0,i.jsx)(t.code,{children:"mintstationd"})," is ",(0,i.jsx)(t.code,{children:"$HOME/.mintstation"}),", which is mainly used to store configuration files and blockchain data. The Mintstation ",(0,i.jsx)(t.code,{children:"key"})," data is saved in the working directory of ",(0,i.jsx)(t.code,{children:"mintstationd"}),". You can also specify the ",(0,i.jsx)(t.code,{children:"mintstationd"})," working directory by using the ",(0,i.jsx)(t.code,{children:"--home"})," flag when executing ",(0,i.jsx)(t.code,{children:"mintstationd"}),"."]}),"\n",(0,i.jsx)(t.h3,{id:"connecting-to-a-full-node",children:"Connecting to a Full-Node"}),"\n",(0,i.jsxs)(t.p,{children:["By default, ",(0,i.jsx)(t.code,{children:"mintstationd"})," uses ",(0,i.jsx)(t.code,{children:"tcp://localhost:26657"})," as the RPC address to connect to the Mintstation network. This default configuration assumes that the machine executing ",(0,i.jsx)(t.code,{children:"mintstationd"})," is running as a full-node."]}),"\n",(0,i.jsxs)(t.p,{children:["The RPC address can be specified to connect to any full-node with an exposed RPC port by adding the ",(0,i.jsx)(t.code,{children:"--node"})," flag when executing ",(0,i.jsx)(t.code,{children:"mintstationd"})]})]})}t.default=(0,o.j)({MDXContent:function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:t}=Object.assign({},(0,d.a)(),n.components);return t?(0,i.jsx)(t,{...n,children:(0,i.jsx)(_createMdxContent,{...n})}):_createMdxContent(n)},pageOpts:{filePath:"pages/mintstation/cli/index.md",route:"/mintstation/cli",timestamp:1700119354e3,title:"CLI Introduction",headings:c},pageNextRoute:"/mintstation/cli"})}},function(n){n.O(0,[2673,9774,2888,179],function(){return n(n.s=1345)}),_N_E=n.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/pages/mintstation/module-2046048363f0c382.js b/_next/static/chunks/pages/mintstation/module-eecbcf0fbfb0e53d.js similarity index 99% rename from _next/static/chunks/pages/mintstation/module-2046048363f0c382.js rename to _next/static/chunks/pages/mintstation/module-eecbcf0fbfb0e53d.js index 459c5afa..0e1a2ca6 100644 --- a/_next/static/chunks/pages/mintstation/module-2046048363f0c382.js +++ b/_next/static/chunks/pages/mintstation/module-eecbcf0fbfb0e53d.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6644],{1066:function(e,s,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mintstation/module",function(){return n(7348)}])},7348:function(e,s,n){"use strict";n.r(s),n.d(s,{__toc:function(){return a}});var l=n(5893),r=n(2673),i=n(2643);let a=[{depth:2,value:"Set up",id:"set-up"},{depth:2,value:"Defining Protocol Buffer Types",id:"defining-protocol-buffer-types"},{depth:3,value:"Defining The Greet Type",id:"defining-the-greet-type"},{depth:3,value:"Creating a new Greeting",id:"creating-a-new-greeting"},{depth:3,value:"Querying Greetings",id:"querying-greetings"},{depth:2,value:"Developing Our Greet Module",id:"developing-our-greet-module"},{depth:3,value:"Setting up constants & importing packages",id:"setting-up-constants--importing-packages"},{depth:3,value:"Setting up our Msg for creating a new greeting",id:"setting-up-our-msg-for-creating-a-new-greeting"},{depth:3,value:"Registering our Codec & interfaces",id:"registering-our-codec--interfaces"},{depth:3,value:"Setting up a basic Keeper",id:"setting-up-a-basic-keeper"},{depth:3,value:"Setting up the Keeper Struct & imports",id:"setting-up-the-keeper-struct--imports"},{depth:3,value:"Wiring up our methods for handling new transactions & queries",id:"wiring-up-our-methods-for-handling-new-transactions--queries"},{depth:3,value:"Handling queries",id:"handling-queries"},{depth:3,value:"Setting up a command to create a new greeting",id:"setting-up-a-command-to-create-a-new-greeting"},{depth:3,value:"Querying greetings",id:"querying-greetings-1"},{depth:3,value:"Setting up our Module's package",id:"setting-up-our-modules-package"},{depth:3,value:"Hooking up our module inside App.go",id:"hooking-up-our-module-inside-appgo"},{depth:2,value:"Testing our new Module",id:"testing-our-new-module"}];function _createMdxContent(e){let s=Object.assign({h1:"h1",p:"p",h2:"h2",pre:"pre",code:"code",span:"span",a:"a",h3:"h3",ol:"ol",li:"li"},(0,i.a)(),e.components);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.h1,{children:"Building Modules"}),"\n",(0,l.jsx)(s.p,{children:"In this tutorial we will be going over building a module in Mintstation to show how easy it is to build on top of the Mintstation ecosystem. This module will be simple in nature but will show how to set up and connect a module to Mintstation and can be used as a starting point for more complex modules."}),"\n",(0,l.jsx)(s.h2,{id:"set-up",children:"Set up"}),"\n",(0,l.jsx)(s.pre,{"data-language":"bash","data-theme":"default",children:(0,l.jsx)(s.code,{"data-language":"bash","data-theme":"default",children:(0,l.jsxs)(s.span,{className:"line",children:[(0,l.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"git"}),(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"clone"}),(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"https://github.com/cosmostation/mintstation.git"})]})})}),"\n",(0,l.jsx)(s.h2,{id:"defining-protocol-buffer-types",children:"Defining Protocol Buffer Types"}),"\n",(0,l.jsxs)(s.p,{children:["The first step in building a new Mintstation Module is to define our Module's types. To do that we use Protocol Buffers which is a used for serializing structured data and generating code for multiple target languages, Protocol Buffers are also smaller than JSON & XML so sending data around the network will be less expensive. ",(0,l.jsx)(s.a,{href:"https://developers.google.com/protocol-buffers",children:"Learn More"}),"."]}),"\n",(0,l.jsxs)(s.p,{children:["Our Protobuf files will all live in ",(0,l.jsx)(s.code,{children:"proto/mintstation"})," directory. we will create a new directory with the new module ",(0,l.jsx)(s.code,{children:"greet"})," and add the following files in the ",(0,l.jsx)(s.code,{children:"proto/greet/v1beta1/"})," directory"]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"genesis.proto"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"greet.proto"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"query.proto"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"tx.proto"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"defining-the-greet-type",children:"Defining The Greet Type"}),"\n",(0,l.jsxs)(s.p,{children:["Inside the ",(0,l.jsx)(s.code,{children:"proto/greet/v1beta1/greet.proto"})," file lets define our greet type:"]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'syntax = "proto3";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package mintstation.greet.v1beta1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "cosmos_proto/cosmos.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "gogoproto/gogo.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'option go_package = "github.com/cosmostation/mintstation/x/greet/types";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message Greet {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string owner = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string id = 2;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string message = 3;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.p,{children:"Here we are saying that we have a Greet type that will have an owner, an id and a message that will contain the greet string. Once we have that defined we are ready to set up a way to create this greet message and query it."}),"\n",(0,l.jsx)(s.h3,{id:"creating-a-new-greeting",children:"Creating a new Greeting"}),"\n",(0,l.jsxs)(s.p,{children:["Inside the ",(0,l.jsx)(s.code,{children:"proto/greet/v1beta1/tx.proto"})," file lets define our Msg Type:"]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'syntax = "proto3";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package mintstation.greet.v1beta1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "gogoproto/gogo.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "cosmos_proto/cosmos.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'option go_package = "github.com/cosmostation/mintstation/x/greet/types";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"service Msg {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" rpc CreateGreet(MsgCreateGreet) returns (MsgCreateGreetResponse);"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message MsgCreateGreet {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string message = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string owner = 2;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message MsgCreateGreetResponse {}"})})]})}),"\n",(0,l.jsx)(s.p,{children:"Now that we have defined how to create a new Greeting let's finish up by setting up our queries to view a specific greeting or all of them."}),"\n",(0,l.jsxs)(s.p,{children:["One thing to note here is that any state changing actions are transactions and for that reason we put them in our ",(0,l.jsx)(s.code,{children:"tx.proto"})," files, we essentially said we are creating a new state changing message & defined the types for that message in our proto file, we will later add clients to trigger state change, which in our case will be adding a new message to our chain."]}),"\n",(0,l.jsx)(s.h3,{id:"querying-greetings",children:"Querying Greetings"}),"\n",(0,l.jsxs)(s.p,{children:["Code inside the ",(0,l.jsx)(s.code,{children:"proto/greet/v1beta1/query.proto"})," :"]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'syntax = "proto3";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package mintstation.greet.v1beta1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'option go_package = "github.com/cosmostation/mintstation/x/greet/types";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "gogoproto/gogo.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "google/api/annotations.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "cosmos/base/query/v1beta1/pagination.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "cosmos_proto/cosmos.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "mintstation/greet/v1beta1/greet.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"service Query {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" rpc Greet(QueryGetGreetRequest) returns (QueryGetGreetResponse) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' option (google.api.http).get = "/mintstation/greet/v1beta1/greetings/{id}";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" rpc GreetAll(QueryAllGreetRequest) returns (QueryAllGreetResponse) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' option (google.api.http).get = "/mintstation/swap/v1beta1/greetings";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message QueryGetGreetRequest {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string id = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message QueryGetGreetResponse {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"Greet greeting = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message QueryAllGreetRequest {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"cosmos.base.query.v1beta1.PageRequest pagination = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message QueryAllGreetResponse {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"repeated Greet greetings = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"cosmos.base.query.v1beta1.PageResponse pagination = 2;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsxs)(s.p,{children:["Our ",(0,l.jsx)(s.code,{children:"query.proto"})," now contains the types for our queries, we have defined a request type & a response type and those types will be returned once we trigger a query through the CLI, REST API, or Grpc. The response will follow the same structure regardless of the type of client initiating the request."]}),"\n",(0,l.jsxs)(s.p,{children:["We defined our query, tx, and greet proto files we finally need to set up the genesis file and then we are ready to generate these types. In the genesis file we will create a minimal ",(0,l.jsx)(s.code,{children:"genesis.proto"})," for this tutorial to keep things simple."]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'syntax = "proto3";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package mintstation.greet.v1beta1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "mintstation/greet/v1beta1/greet.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "gogoproto/gogo.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "google/protobuf/timestamp.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "cosmos_proto/cosmos.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'option go_package = "github.com/cosmostation/mintstation/x/greet/types";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// our gensis state message will be empty for this tutorial"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message GenesisState {}"})})]})}),"\n",(0,l.jsxs)(s.p,{children:["Once all the files are filled in we are ready to generate our proto types. in the Mintstation Directory run ",(0,l.jsx)(s.code,{children:"make proto-gen "})," to generate the types, this will create a folder inside the ",(0,l.jsx)(s.code,{children:"x/greet"})," and will contain the auto-generated proto types."]}),"\n",(0,l.jsx)(s.h2,{id:"developing-our-greet-module",children:"Developing Our Greet Module"}),"\n",(0,l.jsxs)(s.p,{children:["we have successfully set up our Proto files & generated them, we now have a ",(0,l.jsx)(s.code,{children:"x/greet"})," directory generated, this is where we will write our module's code. For starters we will define our module's types in a new file inside ",(0,l.jsx)(s.code,{children:"x/greet/types/greet.go"}),"."]}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-constants--importing-packages",children:"Setting up constants & importing packages"}),"\n",(0,l.jsx)(s.p,{children:"Let's set up some basic constants for our module to help with routing, & fetching items from our store."}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package types"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"import ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "fmt"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "strings"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/codec"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/codec/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' sdk "github.com/cosmos/cosmos-sdk/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/types/msgservice"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// defined our module's constants such as name, routerkey"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// and prefixes for getting items from the store"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"const ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' ModuleName = "greet"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" StoreKey = ModuleName"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RouterKey = ModuleName"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" QuerierRoute = ModuleName"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' GreetKey = "greet-value-" // used for getting a greeting from our store'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' GreetCountKey = "greet-count-" // used for getting count from out store'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' QueryGetGreeting = "get-greeting" // used for legacy querier routing'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' QueryListGreetings = "list-greetings"// used for legacy querier routing'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// heler function simply returns []byte out of a prefix string"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func KeyPrefix(p string) []byte {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return []byte(p)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// returns default genesis state"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func DefaultGenesisState() GenesisState {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return GenesisState{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// validates genesis state"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (gs GenesisState) Validate() error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-our-msg-for-creating-a-new-greeting",children:"Setting up our Msg for creating a new greeting"}),"\n",(0,l.jsxs)(s.p,{children:["Our ",(0,l.jsx)(s.code,{children:"MsgCreateGreet"})," struct was created when we generated our Proto Types, we now need to use that struct to implement the ",(0,l.jsx)(s.code,{children:"sdk.Msg"})," interface such that we can create new greetings. the first thing we will do is defined an unnamed variable with the ",(0,l.jsx)(s.code,{children:"_"})," syntax and have it implement the ",(0,l.jsx)(s.code,{children:"sdk.Msg"})," type. This will help us catch unimplemented functions and guide us with syntax highlighting."]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// MsgCreateGreet we defined it here to get type checking"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"//to make sure we are immplementing it correctly"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"var _ sdk.Msg = &MsgCreateGreet{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// constructor for creating a new greeting"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func NewMsgCreateGreet(owner string, message string) *MsgCreateGreet{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return &MsgCreateGreet{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Owner: owner,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Message: message,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// does a quick stateless validation on our new greeting"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (m *MsgCreateGreet) ValidateBasic() error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // ensures address is valid"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if _, err := sdk.AccAddressFromBech32(m.Owner); err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address", err)'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // ensures the greeting is not empty"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if len(strings.TrimSpace(m.Message)) == 0 {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' return fmt.Errorf("must provide a greeting message")'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// gets the signer of the new message which will be the owner of the greeting"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (m *MsgCreateGreet) GetSigners() []sdk.AccAddress {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" owner, err := sdk.AccAddressFromBech32(m.Owner);"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" panic(err)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return []sdk.AccAddress{owner}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"registering-our-codec--interfaces",children:"Registering our Codec & interfaces"}),"\n",(0,l.jsxs)(s.p,{children:["now that we have our ",(0,l.jsx)(s.code,{children:"MsgCreateGreet"})," implement the ",(0,l.jsx)(s.code,{children:"sdk.Msg"})," interface let's register our codec for marshaling/unmarshaling our greeting we will register both the deprecated legacy amino and the new Interface registry."]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// registers the marshal/unmarsahl for greating a new greeting for our legacy amino codec"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' cdc.RegisterConcrete(&MsgCreateGreet{}, "greet/CreateGreet", nil)'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// registers a module's interface types and their concrete implementations as proto.Message."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func RegisterInterfaces(registry types.InterfaceRegistry){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateGreet{})"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"var amino = codec.NewLegacyAmino()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"var ModuleCdc = codec.NewAminoCodec(amino)"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-a-basic-keeper",children:"Setting up a basic Keeper"}),"\n",(0,l.jsxs)(s.p,{children:["we have finished up setting up our types, now it's time to implement our greet module's keeper, lets do that in a new folder & package named keeper, create ",(0,l.jsx)(s.code,{children:"x/greet/keeper/greet_keeper.go"})," ."]}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-the-keeper-struct--imports",children:"Setting up the Keeper Struct & imports"}),"\n",(0,l.jsx)(s.p,{children:"keepers are an abstraction over the state defined by a module, every module would have a keeper which would be used to access the state of that module, or if given access a keeper can also use other module's keepers by providing reference to the other module's keeper."}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package keeper"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"import ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "context"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "strconv"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/codec"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/store/prefix"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' sdk "github.com/cosmos/cosmos-sdk/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' abci "github.com/tendermint/tendermint/abci/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"type Keeper struct {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cdc codec.Codec // used to marshall and unmarshall structs from & to []byte"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" key sdk.StoreKey // grant access to the store"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// our constructor for creating a new Keeper for this module"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func NewKeeper(c codec.Codec, k sdk.StoreKey) Keeper {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return Keeper{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cdc: c,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" key: k,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"wiring-up-our-methods-for-handling-new-transactions--queries",children:"Wiring up our methods for handling new transactions & queries"}),"\n",(0,l.jsx)(s.p,{children:"Now that we have our Keeper Struct written, let's create some receiver functions on our keeper to handle adding a new greeting & looking up a greeting."}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// get greet count will be used for setting an Id when a new greeting is created"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) GetGreetCount(ctx sdk.Context) int64 {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetCountKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" byteKey := types.KeyPrefix(types.GreetCountKey)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" bz := store.Get(byteKey)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if bz == nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return 0"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" count, err := strconv.ParseInt(string(bz), 10, 64)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' panic("cannot decode count")'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return count"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// sets the greet count"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) SetGreetCount(ctx sdk.Context, count int64){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetCountKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" key := types.KeyPrefix(types.GreetCountKey)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" value := []byte(strconv.FormatInt(count, 10))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store.Set(key, value)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// creates a new greeting"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) CreateGreet(ctx sdk.Context, m types.MsgCreateGreet){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" count := k.GetGreetCount(ctx)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" greet := types.Greet{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Id: strconv.FormatInt(count, 10),"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Owner: m.Owner,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Message: m.Message,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" key := types.KeyPrefix(types.GreetKey + greet.Id)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" value := k.cdc.MustMarshal(&greet)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store.Set(key, value)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" k.SetGreetCount(ctx, count + 1)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// gets a greeting from the store"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) GetGreeting(ctx sdk.Context, key string) types.Greet {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var Greet types.Greet"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" k.cdc.Unmarshal(store.Get(types.KeyPrefix(types.GreetKey + key)), &Greet)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return Greet"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// checks if a greeting exists by an id"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) HasGreet(ctx sdk.Context, id string) bool {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return store.Has(types.KeyPrefix(types.GreetKey + id))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// gets the owner of a greeting"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) GetGreetOwner(ctx sdk.Context, key string) string {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return k.GetGreeting(ctx, key).Owner"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// gets a list of all greetings in the store"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) GetAllGreetings(ctx sdk.Context) (msgs []types.Greet){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefix(types.GreetKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" defer iterator.Close()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" for ; iterator.Valid(); iterator.Next() {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var msg types.Greet"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" k.cdc.Unmarshal(iterator.Value(), &msg)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" msgs = append(msgs, msg)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"handling-queries",children:"Handling queries"}),"\n",(0,l.jsx)(s.p,{children:"We have added methods for interacting with greetings such as creating or reading them, now let's set up our two query services so we can route them to the correct method, we will set up our legacy Querier & gRPC querier below the methods we defined above on our keeper."}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) GreetAll(c context.Context, req *types.QueryAllGreetRequest) (*types.QueryAllGreetResponse, error){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" ctx := sdk.UnwrapSDKContext(c)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var greetings []*types.Greet"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" for _, g := range k.GetAllGreetings(ctx) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var greeting = &g"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" greetings = append(greetings,greeting)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return &types.QueryAllGreetResponse{Greetings: greetings, Pagination: nil}, nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) Greet(c context.Context, req *types.QueryGetGreetRequest) (*types.QueryGetGreetResponse, error){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" sdk.UnwrapSDKContext(c)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var greeting = k.GetGreeting(sdk.UnwrapSDKContext(c), req.Id)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return &types.QueryGetGreetResponse{Greeting: &greeting}, nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// LEGACY QUERIER will be deperacted but for the sake of competeness this is how to set it up"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" switch path[0] {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" case types.QueryGetGreeting:"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var getGreetRequest types.QueryGetGreetRequest"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" err := legacyQuerierCdc.UnmarshalJSON(req.Data, &getGreetRequest)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" val := k.GetGreeting(ctx, getGreetRequest.GetId())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" bz, err := legacyQuerierCdc.MarshalJSON(val)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return bz, nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" case types.QueryListGreetings:"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" val := k.GetAllGreetings(ctx)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, val)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return bz, nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" default:"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknow request at %s query endpoint", types.ModuleName)'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-a-command-to-create-a-new-greeting",children:"Setting up a command to create a new greeting"}),"\n",(0,l.jsxs)(s.p,{children:["let's set up a way for clients to submit a new greeting & query existing greetings, we can do that with a CLI, REST, & gRPC clients. for this tutorial we will focus on setting up our CLI client. create ",(0,l.jsx)(s.code,{children:"x/greet/client/cli/tx.go"}),"."]}),"\n",(0,l.jsx)(s.p,{children:"here We will define a command to create a new greeting:"}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package cli"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"import ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "fmt"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client/flags"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client/tx"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/spf13/cobra"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func GetTxCmd() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd := &cobra.Command{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Use: types.ModuleName,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName),'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" DisableFlagParsing: true,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" SuggestionsMinimumDistance: 2,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RunE: client.ValidateCmd,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd.AddCommand(CmdCreateGreeting())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cmd"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func CmdCreateGreeting() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd:= &cobra.Command{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Use: "create-greeting [message]",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Short: "creates a new greetings",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Args: cobra.ExactArgs(1),"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RunE: func(cmd *cobra.Command, args []string) error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" message := string(args[0])"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" clientCtx, err := client.GetClientTxContext(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" msg := types.NewMsgCreateGreet(clientCtx.GetFromAddress().String(), string(message))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err := msg.ValidateBasic(); err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" },"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" flags.AddTxFlagsToCmd(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cmd"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"querying-greetings-1",children:"Querying greetings"}),"\n",(0,l.jsxs)(s.p,{children:["We will now set up two different commands for querying, one will be to list all greetings & the other will be to get a greeting by it's id. inside ",(0,l.jsx)(s.code,{children:"x/greet/cli/query.go"}),":"]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package cli"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"import ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "context"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "fmt"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client/flags"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/spf13/cobra"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// this is the parent query command for the greet module everytime we add a new command we will register it here"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func GetQueryCmd(queryRoute string) *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Group todos queries under a subcommand"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd := &cobra.Command{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Use: types.ModuleName,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName),'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" DisableFlagParsing: true,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" SuggestionsMinimumDistance: 2,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RunE: client.ValidateCmd,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd.AddCommand(CmdListGreetings())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd.AddCommand(CmdShowGreeting())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cmd"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// build the list greet command function"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func CmdListGreetings() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd := &cobra.Command{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Use: "list-greetings",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Short: "list all greetings",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RunE: func(cmd *cobra.Command, args []string) error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" clientCtx, err := client.GetClientTxContext(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" pageReq, err := client.ReadPageRequest(cmd.Flags())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" queryClient := types.NewQueryClient(clientCtx)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" params := &types.QueryAllGreetRequest{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Pagination: pageReq,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" res, err := queryClient.GreetAll(context.Background(), params)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return clientCtx.PrintProto(res)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" },"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" flags.AddQueryFlagsToCmd(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cmd"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// build the show greet command function"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func CmdShowGreeting() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd := &cobra.Command{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Use: "get-greeting [id]",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Short: "shows a greeting",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Args: cobra.ExactArgs(1),"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RunE: func(cmd *cobra.Command, args []string) error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" clientCtx, err := client.GetClientTxContext(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" queryClient := types.NewQueryClient(clientCtx)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" params := &types.QueryGetGreetRequest{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Id: args[0],"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" res, err := queryClient.Greet(context.Background(), params)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return clientCtx.PrintProto(res)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" },"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" flags.AddQueryFlagsToCmd(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cmd"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})})]})}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-our-modules-package",children:"Setting up our Module's package"}),"\n",(0,l.jsxs)(s.p,{children:["Now that we have all the basic functionality set up for our greet module, let's bring it all together and get our module ready to be used & tested, create a new file ",(0,l.jsx)(s.code,{children:"x/greet/module.go"}),"."]}),"\n",(0,l.jsxs)(s.p,{children:["Here we will start by implementing our ",(0,l.jsx)(s.code,{children:"AppModuleBasic"})," && ",(0,l.jsx)(s.code,{children:"AppModule"})," interfaces."]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package greet"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"import ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "context"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "encoding/json"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/codec"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' cdctypes "github.com/cosmos/cosmos-sdk/codec/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' sdk "github.com/cosmos/cosmos-sdk/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/types/module"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/gorilla/mux"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/grpc-ecosystem/grpc-gateway/runtime"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/client/cli"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/keeper"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/spf13/cobra"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' abci "github.com/tendermint/tendermint/abci/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"var ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" _ module.AppModule = AppModule{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" _ module.AppModuleBasic = AppModuleBasic{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"/*"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"The AppModuleBasic interface defines the independent methods modules need to implement"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"it follows this interface below"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"type AppModuleBasic interface {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Name() string"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterLegacyAminoCodec(*codec.LegacyAmino)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterInterfaces(codectypes.InterfaceRegistry)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" DefaultGenesis(codec.JSONMarshaler) json.RawMessage"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" ValidateGenesis(codec.JSONMarshaler, client.TxEncodingConfig, json.RawMessage) error"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // client functionality"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterRESTRoutes(client.Context, *mux.Router)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterGRPCRoutes(client.Context, *runtime.ServeMux)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" GetTxCmd() *cobra.Command"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" GetQueryCmd() *cobra.Command"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"*/"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"type AppModuleBasic struct{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns the name of the module as a string"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) Name() string {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return types.ModuleName"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" gs := types.DefaultGenesisState()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cdc.MustMarshalJSON(&gs)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Registers the amino codec for the module, which is used to marshal"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// and unmarshal structs to/from []byte in order to persist them in the module's KVStore."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" types.RegisterLegacyAminoCodec(cdc)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Registers a module's interface types and their concrete implementations as proto.Message"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" types.RegisterInterfaces(registry)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Registers gRPC routes for the module."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" panic(err)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Registers the REST routes for the module. These routes will be used to map REST request to the module in order to process them"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (a AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns the root Tx command for the module. The subcommands of this root command are used by end-users"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// to generate new transactions containing messages defined in the module"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) GetTxCmd() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cli.GetTxCmd()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Return the root query command for the module. The subcommands of this root command are used by end-users"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// to generate new queries to the subset of the state defined by the module."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) GetQueryCmd() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cli.GetQueryCmd(types.StoreKey)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// -------------------------------------APPMODULE BELOW------------------------------------------------- //"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"/*"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"The AppModule interface defines the inter-dependent methods that modules need to implement"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"follows the interface below"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" type AppModule interface {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" AppModuleGenesis"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // registers"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterInvariants(sdk.InvariantRegistry)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // routes"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Route() sdk.Route"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // Deprecated: use RegisterServices"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" QuerierRoute() string"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // Deprecated: use RegisterServices"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // RegisterServices allows a module to register services"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterServices(Configurator)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // ABCI"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" BeginBlock(sdk.Context, abci.RequestBeginBlock)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" EndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"*/"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"type AppModule struct{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" AppModuleBasic"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" keeper keeper.Keeper"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// constructor"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func NewAppModule(keeper keeper.Keeper) AppModule {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return AppModule{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" AppModuleBasic: AppModuleBasic{},"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" keeper: keeper,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns the route for messages to be routed to the module by BaseApp."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) Name() string {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return am.AppModuleBasic.Name()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// registers the invariants of the module. If an invariant deviates from its predicted value,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// the InvariantRegistry triggers appropriate logic (most often the chain will be halted)."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns the route for messages to be routed to the module by BaseApp."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModule) Route() sdk.Route {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return sdk.Route{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns the name of the module's query route, for queries to be routes to the module by BaseApp.deprecated"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModule) QuerierRoute() string {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return types.QuerierRoute"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns a querier given the query path, in order to process the query."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return keeper.NewQuerier(am.keeper, legacyQuerierCdc)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModule) ConsensusVersion() uint64 {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return 1"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Allows a module to register services."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) RegisterServices(cfg module.Configurator) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" types.RegisterMsgServer(cfg.MsgServer(), NewMsgServerImpl(am.keeper))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" types.RegisterQueryServer(cfg.QueryServer(), am.keeper)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return []abci.ValidatorUpdate{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" gs := types.DefaultGenesisState()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cdc.MustMarshalJSON(&gs)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return []abci.ValidatorUpdate{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// ----------------------------------MSGSERVER REGISTER------------------------//"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"var _ types.MsgServer = msgServer{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"type msgServer struct {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" keeper keeper.Keeper"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (m msgServer) CreateGreet(c context.Context, msg *types.MsgCreateGreet) (*types.MsgCreateGreetResponse, error) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" ctx := sdk.UnwrapSDKContext(c)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" m.keeper.CreateGreet(ctx, types.MsgCreateGreet{Owner: msg.Owner, Message: msg.Message})"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return &types.MsgCreateGreetResponse{}, nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func NewMsgServerImpl(keeper keeper.Keeper) types.MsgServer {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return &msgServer{keeper: keeper}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"hooking-up-our-module-inside-appgo",children:"Hooking up our module inside App.go"}),"\n",(0,l.jsxs)(s.p,{children:["inside ",(0,l.jsx)(s.code,{children:"app/app.go"})," start off importing the greet module, it's types & keeper packages and add them to the following places:"]}),"\n",(0,l.jsxs)(s.ol,{children:["\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.code,{children:"module.NewBasicManager()"})," add ",(0,l.jsx)(s.code,{children:"greet.AppModuleBasic{}"})]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.code,{children:"type App struct {}"})," add ",(0,l.jsx)(s.code,{children:"greetkeeper.Keeper"})]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.code,{children:"sdk.NewKVStoreKeys()"})," inside ",(0,l.jsx)(s.code,{children:"NewApp"})," func add ",(0,l.jsx)(s.code,{children:"greettypes.StoreKey"})]}),"\n",(0,l.jsxs)(s.li,{children:["inside ",(0,l.jsx)(s.code,{children:"NewApp"})," func add ",(0,l.jsx)(s.code,{children:"app.greetKeeper = greetKeeper.NewKeeper()"})," and add arguments ",(0,l.jsx)(s.code,{children:"appCodec"})," & ",(0,l.jsx)(s.code,{children:"keys[greettypes.StoreKey]"})]}),"\n",(0,l.jsxs)(s.li,{children:["inside ",(0,l.jsx)(s.code,{children:"NewApp"})," find where we define ",(0,l.jsx)(s.code,{children:"app.mm"})," & add ",(0,l.jsx)(s.code,{children:"greet.NewAppModule(app.greetKeeper),"})]}),"\n",(0,l.jsxs)(s.li,{children:["finally add the greet module's name to ",(0,l.jsx)(s.code,{children:"SetOrderBeginBlockers"}),", ",(0,l.jsx)(s.code,{children:"SetOrderEndBlockers"})," && ",(0,l.jsx)(s.code,{children:"SetOrderInitGenesis"})]}),"\n"]}),"\n",(0,l.jsx)(s.h2,{id:"testing-our-new-module",children:"Testing our new Module"}),"\n",(0,l.jsxs)(s.ol,{children:["\n",(0,l.jsxs)(s.li,{children:["inside the root of our directory run ",(0,l.jsx)(s.code,{children:"docker build -t mintstation/mintstation:tutorial-demo ."})]}),"\n",(0,l.jsxs)(s.li,{children:["find the directory for ",(0,l.jsx)(s.code,{children:"kvtool"})," and open in your favorite code editor"]}),"\n",(0,l.jsxs)(s.li,{children:["run ",(0,l.jsx)(s.code,{children:"kvtool testnet gen-config mintstation --mintstation.configTemplate upgrade-v44"})," which will create a bunch of files inside ",(0,l.jsx)(s.code,{children:"full_configs/generated"})]}),"\n",(0,l.jsxs)(s.li,{children:["open up the two ",(0,l.jsx)(s.code,{children:"docker-compose.yaml"})," files the one inside ",(0,l.jsx)(s.code,{children:"generated"})," & the one inside ",(0,l.jsx)(s.code,{children:"generated/mintstation"})," and change the image to point to ",(0,l.jsx)(s.code,{children:"mintstation/mintstation:tutorial-demo"})," this will point to the local image we just built"]}),"\n",(0,l.jsxs)(s.li,{children:["change into the ",(0,l.jsx)(s.code,{children:"full_configs/generated"})," directory and run ",(0,l.jsx)(s.code,{children:"docker compose up -d"})]}),"\n",(0,l.jsxs)(s.li,{children:["now run ",(0,l.jsx)(s.code,{children:"docker compose exec mintstationnode bash"})," to bash into our ",(0,l.jsx)(s.code,{children:"mintstation"})," cli inside the running container"]}),"\n"]}),"\n",(0,l.jsx)(s.p,{children:"We should now have access to our greet commands that we defined first we will test creating a new greeting, for that we will run the following command:"}),"\n",(0,l.jsx)(s.p,{children:(0,l.jsx)(s.code,{children:'mintstationd tx greet create-greeting "hello world from mintstation chain" --from whale'})}),"\n",(0,l.jsx)(s.p,{children:"now let's test to see if the greeting message is able to be queried:"}),"\n",(0,l.jsx)(s.p,{children:(0,l.jsx)(s.code,{children:"mintstationd q greet list-greetings"})}),"\n",(0,l.jsx)(s.p,{children:"We should see something like this below:"}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"greetings:"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'- id: "0"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" message: hello world from mintstation chain"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" owner: mintstation173w2zz287s36ewnnkf4mjansnthnnsz7rtrxqc"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"pagination: null"})})]})}),"\n",(0,l.jsxs)(s.p,{children:["Now let's test if we can query the greeting by it's id which in our case will be ",(0,l.jsx)(s.code,{children:'"0"'}),", run the following:"]}),"\n",(0,l.jsx)(s.p,{children:(0,l.jsx)(s.code,{children:"mintstationd q greet get-greeting 0"})}),"\n",(0,l.jsx)(s.p,{children:"We should see:"}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"greeting:"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' id: "0"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" message: hello world from mintstation chain"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" owner: mintstation173w2zz287s36ewnnkf4mjansnthnnsz7rtrxqc"})})]})})]})}s.default=(0,r.j)({MDXContent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:s}=Object.assign({},(0,i.a)(),e.components);return s?(0,l.jsx)(s,{...e,children:(0,l.jsx)(_createMdxContent,{...e})}):_createMdxContent(e)},pageOpts:{filePath:"pages/mintstation/module.mdx",route:"/mintstation/module",timestamp:1698218973e3,title:"Building Modules",headings:a},pageNextRoute:"/mintstation/module"})}},function(e){e.O(0,[2673,9774,2888,179],function(){return e(e.s=1066)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6644],{1066:function(e,s,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mintstation/module",function(){return n(7348)}])},7348:function(e,s,n){"use strict";n.r(s),n.d(s,{__toc:function(){return a}});var l=n(5893),r=n(2673),i=n(2643);let a=[{depth:2,value:"Set up",id:"set-up"},{depth:2,value:"Defining Protocol Buffer Types",id:"defining-protocol-buffer-types"},{depth:3,value:"Defining The Greet Type",id:"defining-the-greet-type"},{depth:3,value:"Creating a new Greeting",id:"creating-a-new-greeting"},{depth:3,value:"Querying Greetings",id:"querying-greetings"},{depth:2,value:"Developing Our Greet Module",id:"developing-our-greet-module"},{depth:3,value:"Setting up constants & importing packages",id:"setting-up-constants--importing-packages"},{depth:3,value:"Setting up our Msg for creating a new greeting",id:"setting-up-our-msg-for-creating-a-new-greeting"},{depth:3,value:"Registering our Codec & interfaces",id:"registering-our-codec--interfaces"},{depth:3,value:"Setting up a basic Keeper",id:"setting-up-a-basic-keeper"},{depth:3,value:"Setting up the Keeper Struct & imports",id:"setting-up-the-keeper-struct--imports"},{depth:3,value:"Wiring up our methods for handling new transactions & queries",id:"wiring-up-our-methods-for-handling-new-transactions--queries"},{depth:3,value:"Handling queries",id:"handling-queries"},{depth:3,value:"Setting up a command to create a new greeting",id:"setting-up-a-command-to-create-a-new-greeting"},{depth:3,value:"Querying greetings",id:"querying-greetings-1"},{depth:3,value:"Setting up our Module's package",id:"setting-up-our-modules-package"},{depth:3,value:"Hooking up our module inside App.go",id:"hooking-up-our-module-inside-appgo"},{depth:2,value:"Testing our new Module",id:"testing-our-new-module"}];function _createMdxContent(e){let s=Object.assign({h1:"h1",p:"p",h2:"h2",pre:"pre",code:"code",span:"span",a:"a",h3:"h3",ol:"ol",li:"li"},(0,i.a)(),e.components);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.h1,{children:"Building Modules"}),"\n",(0,l.jsx)(s.p,{children:"In this tutorial we will be going over building a module in Mintstation to show how easy it is to build on top of the Mintstation ecosystem. This module will be simple in nature but will show how to set up and connect a module to Mintstation and can be used as a starting point for more complex modules."}),"\n",(0,l.jsx)(s.h2,{id:"set-up",children:"Set up"}),"\n",(0,l.jsx)(s.pre,{"data-language":"bash","data-theme":"default",children:(0,l.jsx)(s.code,{"data-language":"bash","data-theme":"default",children:(0,l.jsxs)(s.span,{className:"line",children:[(0,l.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"git"}),(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"clone"}),(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"https://github.com/cosmostation/mintstation.git"})]})})}),"\n",(0,l.jsx)(s.h2,{id:"defining-protocol-buffer-types",children:"Defining Protocol Buffer Types"}),"\n",(0,l.jsxs)(s.p,{children:["The first step in building a new Mintstation Module is to define our Module's types. To do that we use Protocol Buffers which is a used for serializing structured data and generating code for multiple target languages, Protocol Buffers are also smaller than JSON & XML so sending data around the network will be less expensive. ",(0,l.jsx)(s.a,{href:"https://developers.google.com/protocol-buffers",children:"Learn More"}),"."]}),"\n",(0,l.jsxs)(s.p,{children:["Our Protobuf files will all live in ",(0,l.jsx)(s.code,{children:"proto/mintstation"})," directory. We will create a new directory with the new module ",(0,l.jsx)(s.code,{children:"greet"})," and add the following files in the ",(0,l.jsx)(s.code,{children:"proto/greet/v1beta1/"})," directory"]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"genesis.proto"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"greet.proto"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"query.proto"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"tx.proto"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"defining-the-greet-type",children:"Defining The Greet Type"}),"\n",(0,l.jsxs)(s.p,{children:["Inside the ",(0,l.jsx)(s.code,{children:"proto/greet/v1beta1/greet.proto"})," file lets define our greet type:"]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'syntax = "proto3";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package mintstation.greet.v1beta1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "cosmos_proto/cosmos.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "gogoproto/gogo.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'option go_package = "github.com/cosmostation/mintstation/x/greet/types";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message Greet {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string owner = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string id = 2;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string message = 3;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.p,{children:"Here we are saying that we have a Greet type that will have an owner, an id and a message that will contain the greet string. Once we have that defined we are ready to set up a way to create this greet message and query it."}),"\n",(0,l.jsx)(s.h3,{id:"creating-a-new-greeting",children:"Creating a new Greeting"}),"\n",(0,l.jsxs)(s.p,{children:["Inside the ",(0,l.jsx)(s.code,{children:"proto/greet/v1beta1/tx.proto"})," file lets define our Msg Type:"]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'syntax = "proto3";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package mintstation.greet.v1beta1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "gogoproto/gogo.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "cosmos_proto/cosmos.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'option go_package = "github.com/cosmostation/mintstation/x/greet/types";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"service Msg {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" rpc CreateGreet(MsgCreateGreet) returns (MsgCreateGreetResponse);"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message MsgCreateGreet {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string message = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string owner = 2;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message MsgCreateGreetResponse {}"})})]})}),"\n",(0,l.jsx)(s.p,{children:"Now that we have defined how to create a new Greeting let's finish up by setting up our queries to view a specific greeting or all of them."}),"\n",(0,l.jsxs)(s.p,{children:["One thing to note here is that any state changing actions are transactions and for that reason we put them in our ",(0,l.jsx)(s.code,{children:"tx.proto"})," files, we essentially said we are creating a new state changing message & defined the types for that message in our proto file, we will later add clients to trigger state change, which in our case will be adding a new message to our chain."]}),"\n",(0,l.jsx)(s.h3,{id:"querying-greetings",children:"Querying Greetings"}),"\n",(0,l.jsxs)(s.p,{children:["Code inside the ",(0,l.jsx)(s.code,{children:"proto/greet/v1beta1/query.proto"})," :"]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'syntax = "proto3";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package mintstation.greet.v1beta1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'option go_package = "github.com/cosmostation/mintstation/x/greet/types";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "gogoproto/gogo.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "google/api/annotations.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "cosmos/base/query/v1beta1/pagination.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "cosmos_proto/cosmos.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "mintstation/greet/v1beta1/greet.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"service Query {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" rpc Greet(QueryGetGreetRequest) returns (QueryGetGreetResponse) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' option (google.api.http).get = "/mintstation/greet/v1beta1/greetings/{id}";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" rpc GreetAll(QueryAllGreetRequest) returns (QueryAllGreetResponse) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' option (google.api.http).get = "/mintstation/swap/v1beta1/greetings";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message QueryGetGreetRequest {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"string id = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message QueryGetGreetResponse {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"Greet greeting = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message QueryAllGreetRequest {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"cosmos.base.query.v1beta1.PageRequest pagination = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message QueryAllGreetResponse {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"repeated Greet greetings = 1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"cosmos.base.query.v1beta1.PageResponse pagination = 2;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsxs)(s.p,{children:["Our ",(0,l.jsx)(s.code,{children:"query.proto"})," now contains the types for our queries, we have defined a request type & a response type and those types will be returned once we trigger a query through the CLI, REST API, or Grpc. The response will follow the same structure regardless of the type of client initiating the request."]}),"\n",(0,l.jsxs)(s.p,{children:["We defined our query, tx, and greet proto files we finally need to set up the genesis file and then we are ready to generate these types. In the genesis file we will create a minimal ",(0,l.jsx)(s.code,{children:"genesis.proto"})," for this tutorial to keep things simple."]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'syntax = "proto3";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package mintstation.greet.v1beta1;"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "mintstation/greet/v1beta1/greet.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "gogoproto/gogo.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "google/protobuf/timestamp.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'import "cosmos_proto/cosmos.proto";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'option go_package = "github.com/cosmostation/mintstation/x/greet/types";'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// our gensis state message will be empty for this tutorial"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"message GenesisState {}"})})]})}),"\n",(0,l.jsxs)(s.p,{children:["Once all the files are filled in we are ready to generate our proto types. in the Mintstation Directory run ",(0,l.jsx)(s.code,{children:"make proto-gen "})," to generate the types, this will create a folder inside the ",(0,l.jsx)(s.code,{children:"x/greet"})," and will contain the auto-generated proto types."]}),"\n",(0,l.jsx)(s.h2,{id:"developing-our-greet-module",children:"Developing Our Greet Module"}),"\n",(0,l.jsxs)(s.p,{children:["we have successfully set up our Proto files & generated them, we now have a ",(0,l.jsx)(s.code,{children:"x/greet"})," directory generated, this is where we will write our module's code. For starters we will define our module's types in a new file inside ",(0,l.jsx)(s.code,{children:"x/greet/types/greet.go"}),"."]}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-constants--importing-packages",children:"Setting up constants & importing packages"}),"\n",(0,l.jsx)(s.p,{children:"Let's set up some basic constants for our module to help with routing, & fetching items from our store."}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package types"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"import ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "fmt"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "strings"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/codec"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/codec/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' sdk "github.com/cosmos/cosmos-sdk/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/types/msgservice"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// defined our module's constants such as name, routerkey"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// and prefixes for getting items from the store"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"const ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' ModuleName = "greet"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" StoreKey = ModuleName"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RouterKey = ModuleName"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" QuerierRoute = ModuleName"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' GreetKey = "greet-value-" // used for getting a greeting from our store'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' GreetCountKey = "greet-count-" // used for getting count from out store'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' QueryGetGreeting = "get-greeting" // used for legacy querier routing'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' QueryListGreetings = "list-greetings"// used for legacy querier routing'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// heler function simply returns []byte out of a prefix string"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func KeyPrefix(p string) []byte {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return []byte(p)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// returns default genesis state"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func DefaultGenesisState() GenesisState {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return GenesisState{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// validates genesis state"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (gs GenesisState) Validate() error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-our-msg-for-creating-a-new-greeting",children:"Setting up our Msg for creating a new greeting"}),"\n",(0,l.jsxs)(s.p,{children:["Our ",(0,l.jsx)(s.code,{children:"MsgCreateGreet"})," struct was created when we generated our Proto Types, we now need to use that struct to implement the ",(0,l.jsx)(s.code,{children:"sdk.Msg"})," interface such that we can create new greetings. the first thing we will do is defined an unnamed variable with the ",(0,l.jsx)(s.code,{children:"_"})," syntax and have it implement the ",(0,l.jsx)(s.code,{children:"sdk.Msg"})," type. This will help us catch unimplemented functions and guide us with syntax highlighting."]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// MsgCreateGreet we defined it here to get type checking"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"//to make sure we are immplementing it correctly"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"var _ sdk.Msg = &MsgCreateGreet{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// constructor for creating a new greeting"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func NewMsgCreateGreet(owner string, message string) *MsgCreateGreet{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return &MsgCreateGreet{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Owner: owner,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Message: message,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// does a quick stateless validation on our new greeting"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (m *MsgCreateGreet) ValidateBasic() error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // ensures address is valid"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if _, err := sdk.AccAddressFromBech32(m.Owner); err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address", err)'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // ensures the greeting is not empty"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if len(strings.TrimSpace(m.Message)) == 0 {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' return fmt.Errorf("must provide a greeting message")'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// gets the signer of the new message which will be the owner of the greeting"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (m *MsgCreateGreet) GetSigners() []sdk.AccAddress {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" owner, err := sdk.AccAddressFromBech32(m.Owner);"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" panic(err)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return []sdk.AccAddress{owner}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"registering-our-codec--interfaces",children:"Registering our Codec & interfaces"}),"\n",(0,l.jsxs)(s.p,{children:["now that we have our ",(0,l.jsx)(s.code,{children:"MsgCreateGreet"})," implement the ",(0,l.jsx)(s.code,{children:"sdk.Msg"})," interface let's register our codec for marshaling/unmarshaling our greeting we will register both the deprecated legacy amino and the new Interface registry."]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// registers the marshal/unmarsahl for greating a new greeting for our legacy amino codec"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' cdc.RegisterConcrete(&MsgCreateGreet{}, "greet/CreateGreet", nil)'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// registers a module's interface types and their concrete implementations as proto.Message."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func RegisterInterfaces(registry types.InterfaceRegistry){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateGreet{})"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"var amino = codec.NewLegacyAmino()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"var ModuleCdc = codec.NewAminoCodec(amino)"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-a-basic-keeper",children:"Setting up a basic Keeper"}),"\n",(0,l.jsxs)(s.p,{children:["we have finished up setting up our types, now it's time to implement our greet module's keeper, lets do that in a new folder & package named keeper, create ",(0,l.jsx)(s.code,{children:"x/greet/keeper/greet_keeper.go"})," ."]}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-the-keeper-struct--imports",children:"Setting up the Keeper Struct & imports"}),"\n",(0,l.jsx)(s.p,{children:"keepers are an abstraction over the state defined by a module, every module would have a keeper which would be used to access the state of that module, or if given access a keeper can also use other module's keepers by providing reference to the other module's keeper."}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package keeper"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"import ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "context"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "strconv"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/codec"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/store/prefix"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' sdk "github.com/cosmos/cosmos-sdk/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' abci "github.com/tendermint/tendermint/abci/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"type Keeper struct {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cdc codec.Codec // used to marshall and unmarshall structs from & to []byte"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" key sdk.StoreKey // grant access to the store"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// our constructor for creating a new Keeper for this module"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func NewKeeper(c codec.Codec, k sdk.StoreKey) Keeper {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return Keeper{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cdc: c,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" key: k,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"wiring-up-our-methods-for-handling-new-transactions--queries",children:"Wiring up our methods for handling new transactions & queries"}),"\n",(0,l.jsx)(s.p,{children:"Now that we have our Keeper Struct written, let's create some receiver functions on our keeper to handle adding a new greeting & looking up a greeting."}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// get greet count will be used for setting an Id when a new greeting is created"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) GetGreetCount(ctx sdk.Context) int64 {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetCountKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" byteKey := types.KeyPrefix(types.GreetCountKey)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" bz := store.Get(byteKey)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if bz == nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return 0"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" count, err := strconv.ParseInt(string(bz), 10, 64)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' panic("cannot decode count")'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return count"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// sets the greet count"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) SetGreetCount(ctx sdk.Context, count int64){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetCountKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" key := types.KeyPrefix(types.GreetCountKey)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" value := []byte(strconv.FormatInt(count, 10))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store.Set(key, value)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// creates a new greeting"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) CreateGreet(ctx sdk.Context, m types.MsgCreateGreet){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" count := k.GetGreetCount(ctx)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" greet := types.Greet{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Id: strconv.FormatInt(count, 10),"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Owner: m.Owner,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Message: m.Message,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" key := types.KeyPrefix(types.GreetKey + greet.Id)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" value := k.cdc.MustMarshal(&greet)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store.Set(key, value)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" k.SetGreetCount(ctx, count + 1)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// gets a greeting from the store"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) GetGreeting(ctx sdk.Context, key string) types.Greet {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var Greet types.Greet"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" k.cdc.Unmarshal(store.Get(types.KeyPrefix(types.GreetKey + key)), &Greet)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return Greet"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// checks if a greeting exists by an id"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) HasGreet(ctx sdk.Context, id string) bool {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return store.Has(types.KeyPrefix(types.GreetKey + id))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// gets the owner of a greeting"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) GetGreetOwner(ctx sdk.Context, key string) string {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return k.GetGreeting(ctx, key).Owner"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// gets a list of all greetings in the store"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) GetAllGreetings(ctx sdk.Context) (msgs []types.Greet){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" store := prefix.NewStore(ctx.KVStore(k.key), types.KeyPrefix(types.GreetKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefix(types.GreetKey))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" defer iterator.Close()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" for ; iterator.Valid(); iterator.Next() {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var msg types.Greet"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" k.cdc.Unmarshal(iterator.Value(), &msg)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" msgs = append(msgs, msg)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"handling-queries",children:"Handling queries"}),"\n",(0,l.jsx)(s.p,{children:"We have added methods for interacting with greetings such as creating or reading them, now let's set up our two query services so we can route them to the correct method, we will set up our legacy Querier & gRPC querier below the methods we defined above on our keeper."}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) GreetAll(c context.Context, req *types.QueryAllGreetRequest) (*types.QueryAllGreetResponse, error){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" ctx := sdk.UnwrapSDKContext(c)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var greetings []*types.Greet"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" for _, g := range k.GetAllGreetings(ctx) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var greeting = &g"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" greetings = append(greetings,greeting)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return &types.QueryAllGreetResponse{Greetings: greetings, Pagination: nil}, nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (k Keeper) Greet(c context.Context, req *types.QueryGetGreetRequest) (*types.QueryGetGreetResponse, error){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" sdk.UnwrapSDKContext(c)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var greeting = k.GetGreeting(sdk.UnwrapSDKContext(c), req.Id)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return &types.QueryGetGreetResponse{Greeting: &greeting}, nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// LEGACY QUERIER will be deperacted but for the sake of competeness this is how to set it up"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" switch path[0] {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" case types.QueryGetGreeting:"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" var getGreetRequest types.QueryGetGreetRequest"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" err := legacyQuerierCdc.UnmarshalJSON(req.Data, &getGreetRequest)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" val := k.GetGreeting(ctx, getGreetRequest.GetId())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" bz, err := legacyQuerierCdc.MarshalJSON(val)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return bz, nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" case types.QueryListGreetings:"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" val := k.GetAllGreetings(ctx)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, val)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return bz, nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" default:"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknow request at %s query endpoint", types.ModuleName)'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-a-command-to-create-a-new-greeting",children:"Setting up a command to create a new greeting"}),"\n",(0,l.jsxs)(s.p,{children:["let's set up a way for clients to submit a new greeting & query existing greetings, we can do that with a CLI, REST, & gRPC clients. for this tutorial we will focus on setting up our CLI client. create ",(0,l.jsx)(s.code,{children:"x/greet/client/cli/tx.go"}),"."]}),"\n",(0,l.jsx)(s.p,{children:"here We will define a command to create a new greeting:"}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package cli"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"import ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "fmt"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client/flags"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client/tx"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/spf13/cobra"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func GetTxCmd() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd := &cobra.Command{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Use: types.ModuleName,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName),'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" DisableFlagParsing: true,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" SuggestionsMinimumDistance: 2,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RunE: client.ValidateCmd,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd.AddCommand(CmdCreateGreeting())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cmd"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func CmdCreateGreeting() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd:= &cobra.Command{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Use: "create-greeting [message]",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Short: "creates a new greetings",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Args: cobra.ExactArgs(1),"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RunE: func(cmd *cobra.Command, args []string) error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" message := string(args[0])"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" clientCtx, err := client.GetClientTxContext(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" msg := types.NewMsgCreateGreet(clientCtx.GetFromAddress().String(), string(message))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err := msg.ValidateBasic(); err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" },"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" flags.AddTxFlagsToCmd(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cmd"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"querying-greetings-1",children:"Querying greetings"}),"\n",(0,l.jsxs)(s.p,{children:["We will now set up two different commands for querying, one will be to list all greetings & the other will be to get a greeting by it's id. inside ",(0,l.jsx)(s.code,{children:"x/greet/cli/query.go"}),":"]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package cli"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"import ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "context"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "fmt"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client/flags"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/spf13/cobra"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// this is the parent query command for the greet module everytime we add a new command we will register it here"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func GetQueryCmd(queryRoute string) *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Group todos queries under a subcommand"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd := &cobra.Command{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Use: types.ModuleName,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName),'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" DisableFlagParsing: true,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" SuggestionsMinimumDistance: 2,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RunE: client.ValidateCmd,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd.AddCommand(CmdListGreetings())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd.AddCommand(CmdShowGreeting())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cmd"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// build the list greet command function"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func CmdListGreetings() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd := &cobra.Command{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Use: "list-greetings",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Short: "list all greetings",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RunE: func(cmd *cobra.Command, args []string) error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" clientCtx, err := client.GetClientTxContext(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" pageReq, err := client.ReadPageRequest(cmd.Flags())"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" queryClient := types.NewQueryClient(clientCtx)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" params := &types.QueryAllGreetRequest{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Pagination: pageReq,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" res, err := queryClient.GreetAll(context.Background(), params)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return clientCtx.PrintProto(res)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" },"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" flags.AddQueryFlagsToCmd(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cmd"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// build the show greet command function"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func CmdShowGreeting() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" cmd := &cobra.Command{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Use: "get-greeting [id]",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' Short: "shows a greeting",'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Args: cobra.ExactArgs(1),"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RunE: func(cmd *cobra.Command, args []string) error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" clientCtx, err := client.GetClientTxContext(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" queryClient := types.NewQueryClient(clientCtx)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" params := &types.QueryGetGreetRequest{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Id: args[0],"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" res, err := queryClient.Greet(context.Background(), params)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return err"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return clientCtx.PrintProto(res)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" },"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" flags.AddQueryFlagsToCmd(cmd)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cmd"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})})]})}),"\n",(0,l.jsx)(s.h3,{id:"setting-up-our-modules-package",children:"Setting up our Module's package"}),"\n",(0,l.jsxs)(s.p,{children:["Now that we have all the basic functionality set up for our greet module, let's bring it all together and get our module ready to be used & tested, create a new file ",(0,l.jsx)(s.code,{children:"x/greet/module.go"}),"."]}),"\n",(0,l.jsxs)(s.p,{children:["Here we will start by implementing our ",(0,l.jsx)(s.code,{children:"AppModuleBasic"})," && ",(0,l.jsx)(s.code,{children:"AppModule"})," interfaces."]}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"package greet"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"import ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "context"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "encoding/json"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/client"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/codec"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' cdctypes "github.com/cosmos/cosmos-sdk/codec/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' sdk "github.com/cosmos/cosmos-sdk/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmos/cosmos-sdk/types/module"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/gorilla/mux"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/grpc-ecosystem/grpc-gateway/runtime"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/client/cli"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/keeper"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/cosmostation/mintstation/x/greet/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' "github.com/spf13/cobra"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' abci "github.com/tendermint/tendermint/abci/types"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"var ("})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" _ module.AppModule = AppModule{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" _ module.AppModuleBasic = AppModuleBasic{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:")"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"/*"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"The AppModuleBasic interface defines the independent methods modules need to implement"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"it follows this interface below"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"type AppModuleBasic interface {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Name() string"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterLegacyAminoCodec(*codec.LegacyAmino)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterInterfaces(codectypes.InterfaceRegistry)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" DefaultGenesis(codec.JSONMarshaler) json.RawMessage"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" ValidateGenesis(codec.JSONMarshaler, client.TxEncodingConfig, json.RawMessage) error"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // client functionality"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterRESTRoutes(client.Context, *mux.Router)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterGRPCRoutes(client.Context, *runtime.ServeMux)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" GetTxCmd() *cobra.Command"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" GetQueryCmd() *cobra.Command"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"*/"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"type AppModuleBasic struct{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns the name of the module as a string"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) Name() string {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return types.ModuleName"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" gs := types.DefaultGenesisState()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cdc.MustMarshalJSON(&gs)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Registers the amino codec for the module, which is used to marshal"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// and unmarshal structs to/from []byte in order to persist them in the module's KVStore."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino){"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" types.RegisterLegacyAminoCodec(cdc)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Registers a module's interface types and their concrete implementations as proto.Message"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" types.RegisterInterfaces(registry)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Registers gRPC routes for the module."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" panic(err)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Registers the REST routes for the module. These routes will be used to map REST request to the module in order to process them"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (a AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns the root Tx command for the module. The subcommands of this root command are used by end-users"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// to generate new transactions containing messages defined in the module"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) GetTxCmd() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cli.GetTxCmd()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Return the root query command for the module. The subcommands of this root command are used by end-users"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// to generate new queries to the subset of the state defined by the module."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModuleBasic) GetQueryCmd() *cobra.Command {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cli.GetQueryCmd(types.StoreKey)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// -------------------------------------APPMODULE BELOW------------------------------------------------- //"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"/*"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"The AppModule interface defines the inter-dependent methods that modules need to implement"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"follows the interface below"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" type AppModule interface {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" AppModuleGenesis"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // registers"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterInvariants(sdk.InvariantRegistry)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // routes"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" Route() sdk.Route"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // Deprecated: use RegisterServices"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" QuerierRoute() string"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // Deprecated: use RegisterServices"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // RegisterServices allows a module to register services"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" RegisterServices(Configurator)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" // ABCI"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" BeginBlock(sdk.Context, abci.RequestBeginBlock)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" EndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"*/"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"type AppModule struct{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" AppModuleBasic"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" keeper keeper.Keeper"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// constructor"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func NewAppModule(keeper keeper.Keeper) AppModule {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return AppModule{"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" AppModuleBasic: AppModuleBasic{},"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" keeper: keeper,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns the route for messages to be routed to the module by BaseApp."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) Name() string {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return am.AppModuleBasic.Name()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// registers the invariants of the module. If an invariant deviates from its predicted value,"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// the InvariantRegistry triggers appropriate logic (most often the chain will be halted)."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns the route for messages to be routed to the module by BaseApp."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModule) Route() sdk.Route {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return sdk.Route{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns the name of the module's query route, for queries to be routes to the module by BaseApp.deprecated"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModule) QuerierRoute() string {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return types.QuerierRoute"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Returns a querier given the query path, in order to process the query."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return keeper.NewQuerier(am.keeper, legacyQuerierCdc)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (AppModule) ConsensusVersion() uint64 {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return 1"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// Allows a module to register services."})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) RegisterServices(cfg module.Configurator) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" types.RegisterMsgServer(cfg.MsgServer(), NewMsgServerImpl(am.keeper))"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" types.RegisterQueryServer(cfg.QueryServer(), am.keeper)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return []abci.ValidatorUpdate{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" gs := types.DefaultGenesisState()"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return cdc.MustMarshalJSON(&gs)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { }"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return []abci.ValidatorUpdate{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"// ----------------------------------MSGSERVER REGISTER------------------------//"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"var _ types.MsgServer = msgServer{}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"type msgServer struct {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" keeper keeper.Keeper"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func (m msgServer) CreateGreet(c context.Context, msg *types.MsgCreateGreet) (*types.MsgCreateGreetResponse, error) {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" ctx := sdk.UnwrapSDKContext(c)"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" m.keeper.CreateGreet(ctx, types.MsgCreateGreet{Owner: msg.Owner, Message: msg.Message})"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return &types.MsgCreateGreetResponse{}, nil"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"func NewMsgServerImpl(keeper keeper.Keeper) types.MsgServer {"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" return &msgServer{keeper: keeper}"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsx)(s.h3,{id:"hooking-up-our-module-inside-appgo",children:"Hooking up our module inside App.go"}),"\n",(0,l.jsxs)(s.p,{children:["inside ",(0,l.jsx)(s.code,{children:"app/app.go"})," start off importing the greet module, it's types & keeper packages and add them to the following places:"]}),"\n",(0,l.jsxs)(s.ol,{children:["\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.code,{children:"module.NewBasicManager()"})," add ",(0,l.jsx)(s.code,{children:"greet.AppModuleBasic{}"})]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.code,{children:"type App struct {}"})," add ",(0,l.jsx)(s.code,{children:"greetkeeper.Keeper"})]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.code,{children:"sdk.NewKVStoreKeys()"})," inside ",(0,l.jsx)(s.code,{children:"NewApp"})," func add ",(0,l.jsx)(s.code,{children:"greettypes.StoreKey"})]}),"\n",(0,l.jsxs)(s.li,{children:["inside ",(0,l.jsx)(s.code,{children:"NewApp"})," func add ",(0,l.jsx)(s.code,{children:"app.greetKeeper = greetKeeper.NewKeeper()"})," and add arguments ",(0,l.jsx)(s.code,{children:"appCodec"})," & ",(0,l.jsx)(s.code,{children:"keys[greettypes.StoreKey]"})]}),"\n",(0,l.jsxs)(s.li,{children:["inside ",(0,l.jsx)(s.code,{children:"NewApp"})," find where we define ",(0,l.jsx)(s.code,{children:"app.mm"})," & add ",(0,l.jsx)(s.code,{children:"greet.NewAppModule(app.greetKeeper),"})]}),"\n",(0,l.jsxs)(s.li,{children:["finally add the greet module's name to ",(0,l.jsx)(s.code,{children:"SetOrderBeginBlockers"}),", ",(0,l.jsx)(s.code,{children:"SetOrderEndBlockers"})," && ",(0,l.jsx)(s.code,{children:"SetOrderInitGenesis"})]}),"\n"]}),"\n",(0,l.jsx)(s.h2,{id:"testing-our-new-module",children:"Testing our new Module"}),"\n",(0,l.jsxs)(s.ol,{children:["\n",(0,l.jsxs)(s.li,{children:["inside the root of our directory run ",(0,l.jsx)(s.code,{children:"docker build -t mintstation/mintstation:tutorial-demo ."})]}),"\n",(0,l.jsxs)(s.li,{children:["find the directory for ",(0,l.jsx)(s.code,{children:"kvtool"})," and open in your favorite code editor"]}),"\n",(0,l.jsxs)(s.li,{children:["run ",(0,l.jsx)(s.code,{children:"kvtool testnet gen-config mintstation --mintstation.configTemplate upgrade-v44"})," which will create a bunch of files inside ",(0,l.jsx)(s.code,{children:"full_configs/generated"})]}),"\n",(0,l.jsxs)(s.li,{children:["open up the two ",(0,l.jsx)(s.code,{children:"docker-compose.yaml"})," files the one inside ",(0,l.jsx)(s.code,{children:"generated"})," & the one inside ",(0,l.jsx)(s.code,{children:"generated/mintstation"})," and change the image to point to ",(0,l.jsx)(s.code,{children:"mintstation/mintstation:tutorial-demo"})," this will point to the local image we just built"]}),"\n",(0,l.jsxs)(s.li,{children:["change into the ",(0,l.jsx)(s.code,{children:"full_configs/generated"})," directory and run ",(0,l.jsx)(s.code,{children:"docker compose up -d"})]}),"\n",(0,l.jsxs)(s.li,{children:["now run ",(0,l.jsx)(s.code,{children:"docker compose exec mintstationnode bash"})," to bash into our ",(0,l.jsx)(s.code,{children:"mintstation"})," cli inside the running container"]}),"\n"]}),"\n",(0,l.jsx)(s.p,{children:"We should now have access to our greet commands that we defined first we will test creating a new greeting, for that we will run the following command:"}),"\n",(0,l.jsx)(s.p,{children:(0,l.jsx)(s.code,{children:'mintstationd tx greet create-greeting "hello world from mintstation chain" --from whale'})}),"\n",(0,l.jsx)(s.p,{children:"now let's test to see if the greeting message is able to be queried:"}),"\n",(0,l.jsx)(s.p,{children:(0,l.jsx)(s.code,{children:"mintstationd q greet list-greetings"})}),"\n",(0,l.jsx)(s.p,{children:"We should see something like this below:"}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"greetings:"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:'- id: "0"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" message: hello world from mintstation chain"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" owner: mintstation173w2zz287s36ewnnkf4mjansnthnnsz7rtrxqc"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"pagination: null"})})]})}),"\n",(0,l.jsxs)(s.p,{children:["Now let's test if we can query the greeting by it's id which in our case will be ",(0,l.jsx)(s.code,{children:'"0"'}),", run the following:"]}),"\n",(0,l.jsx)(s.p,{children:(0,l.jsx)(s.code,{children:"mintstationd q greet get-greeting 0"})}),"\n",(0,l.jsx)(s.p,{children:"We should see:"}),"\n",(0,l.jsx)(s.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsxs)(s.code,{"data-language":"text","data-theme":"default",children:[(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"greeting:"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:' id: "0"'})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" message: hello world from mintstation chain"})}),"\n",(0,l.jsx)(s.span,{className:"line",children:(0,l.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" owner: mintstation173w2zz287s36ewnnkf4mjansnthnnsz7rtrxqc"})})]})})]})}s.default=(0,r.j)({MDXContent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:s}=Object.assign({},(0,i.a)(),e.components);return s?(0,l.jsx)(s,{...e,children:(0,l.jsx)(_createMdxContent,{...e})}):_createMdxContent(e)},pageOpts:{filePath:"pages/mintstation/module.mdx",route:"/mintstation/module",timestamp:1700459849e3,title:"Building Modules",headings:a},pageNextRoute:"/mintstation/module"})}},function(e){e.O(0,[2673,9774,2888,179],function(){return e(e.s=1066)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/pages/mintstation/validator/command-bf77bf78efb863aa.js b/_next/static/chunks/pages/mintstation/validator/command-a87c231c26fd423b.js similarity index 65% rename from _next/static/chunks/pages/mintstation/validator/command-bf77bf78efb863aa.js rename to _next/static/chunks/pages/mintstation/validator/command-a87c231c26fd423b.js index 172bbcbd..96bd1244 100644 --- a/_next/static/chunks/pages/mintstation/validator/command-bf77bf78efb863aa.js +++ b/_next/static/chunks/pages/mintstation/validator/command-a87c231c26fd423b.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6940],{4435:function(s,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mintstation/validator/command",function(){return r(181)}])},181:function(s,e,r){"use strict";r.r(e),r.d(e,{__toc:function(){return o}});var n=r(5893),i=r(2673),l=r(2643);let o=[{depth:2,value:"Upgrade to a validator",id:"upgrade-to-a-validator"}];function _createMdxContent(s){let e=Object.assign({h1:"h1",h2:"h2",p:"p",strong:"strong",code:"code",pre:"pre",span:"span"},(0,l.a)(),s.components);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e.h1,{children:"Useful commands"}),"\n",(0,n.jsx)(e.h2,{id:"upgrade-to-a-validator",children:"Upgrade to a validator"}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.strong,{children:"Do not attempt to upgrade your node to a validator until the node is fully in sync as per the previous step."})}),"\n",(0,n.jsxs)(e.p,{children:["To upgrade the node to a validator, you will need to submit a ",(0,n.jsx)(e.code,{children:"create-validator"})," transaction:"]}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.code,{"data-language":"bash","data-theme":"default",children:[(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"tx"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"staking"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"create-validator"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--amount"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"1000000"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"umint"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--commission-max-change-rate"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"0.1"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--commission-max-rate"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"0.20"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--commission-rate"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"0.1"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--min-self-delegation"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"1"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--details"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"validators write bios too"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--pubkey="}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"$("}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"tendermint"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"show-validator"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:")"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--moniker"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"$MONIKER_NAME"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--chain-id"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" $CHAIN_ID \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--gas-prices"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"0.025"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"umint"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--from"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"})]})]})}),"\n",(0,n.jsx)(e.p,{children:"The above transaction is just an example. There are many more flags that can be set to customise your validator, such as your validator website, or keybase.io id, etc. To see a full list:"}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"tx"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"staking"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"create-validator"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--help"})]})})}),"\n",(0,n.jsx)(e.p,{children:"Unjail"}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"stationed"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"tx"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"slashing"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"unjail"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--from"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--chain-id"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"mintstation-1"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--fees"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"100"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"umint"})]})})}),"\n",(0,n.jsx)(e.p,{children:"To track your validator's signing history, copy the validator public key:"}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"tendermint"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"show-validator"})]})})}),"\n",(0,n.jsx)(e.p,{children:"Use your validators public key queried above as the validator-pubkey below:"}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"query"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"slashing"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"signing-info"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"validator-pubke"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"y"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"})]})})}),"\n",(0,n.jsx)(e.p,{children:"Example:"}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"query"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"slashing"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"signing-info"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'\'{"@type":"/cosmos.crypto.ed25519.PubKey","key":"HlixoxNZBPq4pBOYEimtSq9Ak4peBISVsIbI5ZHrEAU="}\''})]})})})]})}e.default=(0,i.j)({MDXContent:function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:e}=Object.assign({},(0,l.a)(),s.components);return e?(0,n.jsx)(e,{...s,children:(0,n.jsx)(_createMdxContent,{...s})}):_createMdxContent(s)},pageOpts:{filePath:"pages/mintstation/validator/command.mdx",route:"/mintstation/validator/command",timestamp:1700119354e3,title:"Useful commands",headings:o},pageNextRoute:"/mintstation/validator/command"})}},function(s){s.O(0,[2673,9774,2888,179],function(){return s(s.s=4435)}),_N_E=s.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6940],{4435:function(s,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mintstation/validator/command",function(){return r(181)}])},181:function(s,e,r){"use strict";r.r(e),r.d(e,{__toc:function(){return o}});var n=r(5893),i=r(2673),l=r(2643);let o=[{depth:2,value:"Upgrade to a validator",id:"upgrade-to-a-validator"}];function _createMdxContent(s){let e=Object.assign({h1:"h1",h2:"h2",p:"p",strong:"strong",code:"code",pre:"pre",span:"span"},(0,l.a)(),s.components);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e.h1,{children:"Useful commands"}),"\n",(0,n.jsx)(e.h2,{id:"upgrade-to-a-validator",children:"Upgrade to a validator"}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.strong,{children:"Do not attempt to upgrade your node to a validator until the node is fully in sync as per the previous step."})}),"\n",(0,n.jsxs)(e.p,{children:["To upgrade the node to a validator, you will need to submit a ",(0,n.jsx)(e.code,{children:"create-validator"})," transaction:"]}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.code,{"data-language":"bash","data-theme":"default",children:[(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"tx"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"staking"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"create-validator"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--amount"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"1000000"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"umint"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--commission-max-change-rate"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"0.1"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--commission-max-rate"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"0.20"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--commission-rate"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"0.1"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--min-self-delegation"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"1"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--details"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"validators write bios too"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--pubkey="}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"$("}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"tendermint"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"show-validator"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:")"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--moniker"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"$MONIKER_NAME"'}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--chain-id"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" $CHAIN_ID \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--gas-prices"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"0.025"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"umint"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--from"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"})]})]})}),"\n",(0,n.jsx)(e.p,{children:"The above transaction is just an example. There are many more flags that can be set to customise your validator, such as your validator website, or keybase.io id, etc. To see a full list:"}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"tx"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"staking"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"create-validator"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--help"})]})})}),"\n",(0,n.jsx)(e.p,{children:"Unjail"}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"tx"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"slashing"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"unjail"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--from"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--chain-id"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"mintstation-1"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--fees"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"100"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"umint"})]})})}),"\n",(0,n.jsx)(e.p,{children:"To track your validator's signing history, copy the validator public key:"}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"tendermint"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"show-validator"})]})})}),"\n",(0,n.jsx)(e.p,{children:"Use your validators public key queried above as the validator-pubkey below:"}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"query"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"slashing"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"signing-info"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"validator-pubke"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"y"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"})]})})}),"\n",(0,n.jsx)(e.p,{children:"Example:"}),"\n",(0,n.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,n.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"query"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"slashing"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"signing-info"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'\'{"@type":"/cosmos.crypto.ed25519.PubKey","key":"HlixoxNZBPq4pBOYEimtSq9Ak4peBISVsIbI5ZHrEAU="}\''})]})})})]})}e.default=(0,i.j)({MDXContent:function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:e}=Object.assign({},(0,l.a)(),s.components);return e?(0,n.jsx)(e,{...s,children:(0,n.jsx)(_createMdxContent,{...s})}):_createMdxContent(s)},pageOpts:{filePath:"pages/mintstation/validator/command.mdx",route:"/mintstation/validator/command",timestamp:1700459849e3,title:"Useful commands",headings:o},pageNextRoute:"/mintstation/validator/command"})}},function(s){s.O(0,[2673,9774,2888,179],function(){return s(s.s=4435)}),_N_E=s.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/pages/mintstation/validator/mainnet-11314afa1dd3693c.js b/_next/static/chunks/pages/mintstation/validator/mainnet-11314afa1dd3693c.js new file mode 100644 index 00000000..a4f019a3 --- /dev/null +++ b/_next/static/chunks/pages/mintstation/validator/mainnet-11314afa1dd3693c.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5191],{1512:function(s,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mintstation/validator/mainnet",function(){return n(1441)}])},1441:function(s,e,n){"use strict";n.r(e),n.d(e,{__toc:function(){return o}});var i=n(5893),r=n(2673),t=n(2643);let o=[{depth:2,value:"Setting up the Node",id:"setting-up-the-node"},{depth:3,value:"Initialize the chain",id:"initialize-the-chain"},{depth:3,value:"Download the genesis file",id:"download-the-genesis-file"},{depth:3,value:"Set seeds",id:"set-seeds"},{depth:3,value:"Set minimum gas prices",id:"set-minimum-gas-prices"},{depth:3,value:"Create (or restore) a local key pair",id:"create-or-restore-a-local-key-pair"},{depth:3,value:"Get some tokens",id:"get-some-tokens"},{depth:2,value:"Syncing the node",id:"syncing-the-node"},{depth:3,value:"Sync from genesis",id:"sync-from-genesis"},{depth:3,value:"Sync with statesync",id:"sync-with-statesync"},{depth:2,value:"Backup critical files",id:"backup-critical-files"}];function _createMdxContent(s){let e=Object.assign({h1:"h1",p:"p",a:"a",h2:"h2",h3:"h3",strong:"strong",pre:"pre",code:"code",span:"span",ul:"ul",li:"li"},(0,t.a)(),s.components);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.h1,{children:"Joining Mainnet"}),"\n",(0,i.jsxs)(e.p,{children:["To get up and running with the mintstationd binary, please follow the instructions ",(0,i.jsx)(e.a,{href:"/mintstation/cli/setup",children:"here"}),"."]}),"\n",(0,i.jsx)(e.h2,{id:"setting-up-the-node",children:"Setting up the Node"}),"\n",(0,i.jsx)(e.p,{children:"These instructions will direct you on how to initialize your node, synchronize to the network and upgrade your node to a validator."}),"\n",(0,i.jsx)(e.h3,{id:"initialize-the-chain",children:(0,i.jsx)(e.strong,{children:"Initialize the chain"})}),"\n",(0,i.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(e.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"CHAIN_ID"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"mintstation-1"})]}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"MONIKER_NAME"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"=<"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"moniker-nam"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"})]}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"init"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"$MONIKER_NAME"'}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--chain-id"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" $CHAIN_ID"})]})]})}),"\n",(0,i.jsxs)(e.p,{children:["This will generate the following files in ",(0,i.jsx)(e.code,{children:"~/.mintstation/config/"})]}),"\n",(0,i.jsxs)(e.ul,{children:["\n",(0,i.jsx)(e.li,{children:(0,i.jsx)(e.code,{children:"genesis.json"})}),"\n",(0,i.jsx)(e.li,{children:(0,i.jsx)(e.code,{children:"node_key.json"})}),"\n",(0,i.jsx)(e.li,{children:(0,i.jsx)(e.code,{children:"priv_validator_key.json"})}),"\n"]}),"\n",(0,i.jsx)(e.h3,{id:"download-the-genesis-file",children:"Download the genesis file"}),"\n",(0,i.jsx)(e.p,{children:"Download the the geneis file."}),"\n",(0,i.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(e.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Download genesis.json file (https://github.com/cosmostation/mintstation)"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"rm"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"~/.mintstation/config/genesis.json"})]}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"curl"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-sS"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"https://rpc-mintstation.cosmostation.io/genesis"'}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"|"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"jq"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:".result.genesis"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" $HOME"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"/.mintstation/config/genesis.json"})]})]})}),"\n",(0,i.jsxs)(e.p,{children:["This will replace the genesis file created using ",(0,i.jsx)(e.code,{children:"mintstationd init"})," command with the mainnet ",(0,i.jsx)(e.code,{children:"genesis.json"}),"."]}),"\n",(0,i.jsx)(e.h3,{id:"set-seeds",children:(0,i.jsx)(e.strong,{children:"Set seeds"})}),"\n",(0,i.jsxs)(e.p,{children:["We can set the ",(0,i.jsx)(e.code,{children:"seeds"})," by retrieving the list of seeds from the mintstation repo and using ",(0,i.jsx)(e.code,{children:"sed"})," to inject into ",(0,i.jsx)(e.code,{children:"~/.mintstation/config/config.toml"}),":"]}),"\n",(0,i.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(e.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Set the base repo URL for mainnet & retrieve seeds"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"CHAIN_ID"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"mintstation-1"})]}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"CHAIN_REPO"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"https://raw.githubusercontent.com/cosmostation/mintstation/main/$CHAIN_ID"'}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:"&&"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" SEEDS"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"$('}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"curl"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-sL"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:' "$CHAIN_REPO/seeds.txt")"'})]}),"\n",(0,i.jsx)(e.span,{className:"line",children:" "}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Add seeds to config.toml"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"sed"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-i.bak"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-e"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"s/^seeds *=.*/seeds = \\"$SEEDS\\"/"'}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"~/.mintstation/config/config.toml"})]})]})}),"\n",(0,i.jsx)(e.h3,{id:"set-minimum-gas-prices",children:"Set minimum gas prices"}),"\n",(0,i.jsxs)(e.p,{children:["For RPC nodes and Validator nodes we recommend setting the following ",(0,i.jsx)(e.code,{children:"minimum-gas-prices"}),". As we are a permissionless wasm chain, this setting will help protect against contract spam and potential wasm contract attack vectors."]}),"\n",(0,i.jsxs)(e.p,{children:["In ",(0,i.jsx)(e.code,{children:"$HOME/.mintstation/config/app.toml"}),", set minimum gas prices:"]}),"\n",(0,i.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsx)(e.code,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"sed"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-i.bak"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-e"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"s/^minimum-gas-prices *=.*/minimum-gas-prices = \\"0.0025umint\\"/"'}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"~/.mintstation/config/app.toml"})]})})}),"\n",(0,i.jsx)(e.h3,{id:"create-or-restore-a-local-key-pair",children:(0,i.jsx)(e.strong,{children:"Create (or restore) a local key pair"})}),"\n",(0,i.jsx)(e.p,{children:"Either create a new key pair, or restore an existing wallet for your validator:"}),"\n",(0,i.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(e.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"keys"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"add"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"})]}),"\n",(0,i.jsx)(e.span,{className:"line",children:" "}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# OR"})}),"\n",(0,i.jsx)(e.span,{className:"line",children:" "}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Restore existing mint wallet with mnemonic seed phrase."})}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# You will be prompted to enter mnemonic seed."})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"keys"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"add"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--recover"})]}),"\n",(0,i.jsx)(e.span,{className:"line",children:" "}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Query the keystore for your public address"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"keys"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"show"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"--bech"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"val"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-a"})]})]})}),"\n",(0,i.jsxs)(e.p,{children:["Replace ",(0,i.jsx)(e.code,{children:""})," with a key name of your choosing."]}),"\n",(0,i.jsx)(e.p,{children:"After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys."}),"\n",(0,i.jsx)(e.h3,{id:"get-some-tokens",children:(0,i.jsx)(e.strong,{children:"Get some tokens"})}),"\n",(0,i.jsx)(e.p,{children:"We are serving only a few tokens for you to test or do somehting what you want."}),"\n",(0,i.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(e.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Check your address which you've generated & copy the address"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"keys"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"show"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:">"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-a"})]}),"\n",(0,i.jsx)(e.span,{className:"line",children:" "}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Go to minstation faucet and paste your address on it"})}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"https://faucet-mintstation.cosmostation.io"})})]})}),"\n",(0,i.jsxs)(e.p,{children:["If you want to get more tokens or delegations, Please contact us from ",(0,i.jsx)(e.a,{href:"delegations",children:"here"}),"."]}),"\n",(0,i.jsx)(e.h2,{id:"syncing-the-node",children:"Syncing the node"}),"\n",(0,i.jsx)(e.p,{children:"There are methods to sync a node to the network:"}),"\n",(0,i.jsx)(e.h3,{id:"sync-from-genesis",children:"Sync from genesis"}),"\n",(0,i.jsxs)(e.p,{children:["After starting the ",(0,i.jsx)(e.code,{children:"mintstationd"})," daemon, the chain will begin to sync to the network. The time to sync to the network will vary depending on your setup and the current size of the blockchain, but could take a very long time. To query the status of your node:"]}),"\n",(0,i.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(e.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Start for your node to sync from genesis"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"start"})]}),"\n",(0,i.jsx)(e.span,{className:"line",children:" "}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Query via the RPC (default port: 26657)"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"curl"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"http://localhost:26657/status"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"|"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"jq"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:".result.sync_info.catching_up"})]})]})}),"\n",(0,i.jsxs)(e.p,{children:["If this command returns ",(0,i.jsx)(e.code,{children:"true"})," then your node is still catching up. If it returns ",(0,i.jsx)(e.code,{children:"false"})," then your node has caught up to the network current block and you are safe to proceed to upgrade to a validator node."]}),"\n",(0,i.jsxs)(e.p,{children:["When syncing from genesis, you will need to perform upgrades while catching up to the head. ",(0,i.jsx)(e.code,{children:"mintstation-1"})," upgrades are detailed in ",(0,i.jsx)(e.a,{href:"upgrade",children:"node-upgrade.md"})," along with a description of each type of upgrade."]}),"\n",(0,i.jsx)(e.h3,{id:"sync-with-statesync",children:"Sync with statesync"}),"\n",(0,i.jsx)(e.p,{children:"When a cosmos-sdk based chain already started to make a new consensus, you need some time to sync from genesis with your node."}),"\n",(0,i.jsxs)(e.p,{children:["So, you can resolve this problem by using ",(0,i.jsx)(e.a,{href:"https://docs.tendermint.com/v0.34/tendermint-core/state-sync.html",children:"statesync"})," functionality, which is general characteristic in cosoms-sdk based chain. And then we recommend to sync with statesync by using our snapshot provider rpc endpoint."]}),"\n",(0,i.jsx)(e.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(e.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Setup statesync in your config.toml"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"SNAP_RPC"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"https://rpc-mintstation.cosmostation.io:443"'})]}),"\n",(0,i.jsx)(e.span,{className:"line",children:" "}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"LATEST_HEIGHT"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"$("}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"curl"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-s"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" $SNAP_RPC"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"/block"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"|"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"jq"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-r"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:".result.block.header.height"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:")"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; \\"})]}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"BLOCK_HEIGHT"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"$((LATEST_HEIGHT "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"-"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"1500"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"))"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; \\"})]}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"TRUST_HASH"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"$("}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"curl"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-s"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:' "$SNAP_RPC/block?height=$BLOCK_HEIGHT" '}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"|"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"jq"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-r"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:".result.block_id.hash"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:")"})]}),"\n",(0,i.jsx)(e.span,{className:"line",children:" "}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"sed"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-i.bak"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"-E"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"s|^(enable[[:space:]]+=[[:space:]]+).*$|\\1true| ; \\'})]}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\\1\\"$SNAP_RPC,$SNAP_RPC\\"| ; \\'})}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\\1$BLOCK_HEIGHT| ; \\"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:'s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\\1\\"$TRUST_HASH\\"|"'}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" $HOME"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"/.mintstation/config/config.toml"})]}),"\n",(0,i.jsx)(e.span,{className:"line",children:" "}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Check diff between before and after"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"diff"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" $HOME"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"/.mintstation/config/config.toml"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" $HOME"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"/.mintstation/config/config.toml.bak"})]}),"\n",(0,i.jsx)(e.span,{className:"line",children:" "}),"\n",(0,i.jsx)(e.span,{className:"line",children:(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"# Start for your node to sync with statesync"})}),"\n",(0,i.jsxs)(e.span,{className:"line",children:[(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(e.span,{style:{color:"var(--shiki-token-string)"},children:"start"})]})]})}),"\n",(0,i.jsx)(e.h2,{id:"backup-critical-files",children:"Backup critical files"}),"\n",(0,i.jsxs)(e.p,{children:["There are certain files that you need to backup to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in ",(0,i.jsx)(e.code,{children:"~/.mintstation/config/"}),":"]}),"\n",(0,i.jsxs)(e.ul,{children:["\n",(0,i.jsx)(e.li,{children:(0,i.jsx)(e.code,{children:"priv_validator_key.json"})}),"\n",(0,i.jsx)(e.li,{children:(0,i.jsx)(e.code,{children:"node_key.json"})}),"\n"]}),"\n",(0,i.jsx)(e.p,{children:"It is recommended that you encrypt the backup of these files."})]})}e.default=(0,r.j)({MDXContent:function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:e}=Object.assign({},(0,t.a)(),s.components);return e?(0,i.jsx)(e,{...s,children:(0,i.jsx)(_createMdxContent,{...s})}):_createMdxContent(s)},pageOpts:{filePath:"pages/mintstation/validator/mainnet.mdx",route:"/mintstation/validator/mainnet",timestamp:1700464844e3,title:"Joining Mainnet",headings:o},pageNextRoute:"/mintstation/validator/mainnet"})}},function(s){s.O(0,[2673,9774,2888,179],function(){return s(s.s=1512)}),_N_E=s.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/pages/mintstation/validator/mainnet-a8558d5a7cb1f976.js b/_next/static/chunks/pages/mintstation/validator/mainnet-a8558d5a7cb1f976.js deleted file mode 100644 index d63e528e..00000000 --- a/_next/static/chunks/pages/mintstation/validator/mainnet-a8558d5a7cb1f976.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5191],{1512:function(e,s,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mintstation/validator/mainnet",function(){return n(1441)}])},1441:function(e,s,n){"use strict";n.r(s),n.d(s,{__toc:function(){return o}});var i=n(5893),t=n(2673),r=n(2643);let o=[{depth:2,value:"Setting up the Node",id:"setting-up-the-node"},{depth:3,value:"Initialize the chain",id:"initialize-the-chain"},{depth:3,value:"Download the genesis file",id:"download-the-genesis-file"},{depth:3,value:"Set seeds",id:"set-seeds"},{depth:3,value:"Set minimum gas prices",id:"set-minimum-gas-prices"},{depth:3,value:"Create (or restore) a local key pair",id:"create-or-restore-a-local-key-pair"},{depth:3,value:"Get some tokens",id:"get-some-tokens"},{depth:2,value:"Syncing the node",id:"syncing-the-node"},{depth:3,value:"From genesis",id:"from-genesis"},{depth:2,value:"Backup critical files",id:"backup-critical-files"}];function _createMdxContent(e){let s=Object.assign({h1:"h1",p:"p",a:"a",h2:"h2",h3:"h3",strong:"strong",pre:"pre",code:"code",span:"span",ul:"ul",li:"li"},(0,r.a)(),e.components);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{children:"Joining Mainnet"}),"\n",(0,i.jsxs)(s.p,{children:["To get up and running with the mintstationd binary, please follow the instructions ",(0,i.jsx)(s.a,{href:"/mintstation/cli/setup",children:"here"}),"."]}),"\n",(0,i.jsx)(s.h2,{id:"setting-up-the-node",children:"Setting up the Node"}),"\n",(0,i.jsx)(s.p,{children:"These instructions will direct you on how to initialize your node, synchronize to the network and upgrade your node to a validator."}),"\n",(0,i.jsx)(s.h3,{id:"initialize-the-chain",children:(0,i.jsx)(s.strong,{children:"Initialize the chain"})}),"\n",(0,i.jsx)(s.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(s.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"CHAIN_ID"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"mintstation-1"})]}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"MONIKER_NAME"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"=<"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"moniker-nam"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:">"})]}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"init"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"$MONIKER_NAME"'}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"--chain-id"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" $CHAIN_ID"})]})]})}),"\n",(0,i.jsxs)(s.p,{children:["This will generate the following files in ",(0,i.jsx)(s.code,{children:"~/.mintstation/config/"})]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"genesis.json"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"node_key.json"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"priv_validator_key.json"})}),"\n"]}),"\n",(0,i.jsx)(s.h3,{id:"download-the-genesis-file",children:"Download the genesis file"}),"\n",(0,i.jsx)(s.p,{children:"Download the the geneis file."}),"\n",(0,i.jsx)(s.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(s.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsx)(s.span,{className:"line",children:(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"# Download genesis.json file (https://github.com/cosmostation/mintstation)"})}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"rm"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"~/.mintstation/config/genesis.json"})]}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"mv"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"genesis.json"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" $HOME"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"/.mintstation/config/genesis.json"})]})]})}),"\n",(0,i.jsxs)(s.p,{children:["This will replace the genesis file created using ",(0,i.jsx)(s.code,{children:"mintstationd init"})," command with the mainnet ",(0,i.jsx)(s.code,{children:"genesis.json"}),"."]}),"\n",(0,i.jsx)(s.h3,{id:"set-seeds",children:(0,i.jsx)(s.strong,{children:"Set seeds"})}),"\n",(0,i.jsxs)(s.p,{children:["We can set the ",(0,i.jsx)(s.code,{children:"seeds"})," by retrieving the list of seeds from the mintstation repo and using ",(0,i.jsx)(s.code,{children:"sed"})," to inject into ",(0,i.jsx)(s.code,{children:"~/.mintstation/config/config.toml"}),":"]}),"\n",(0,i.jsx)(s.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(s.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsx)(s.span,{className:"line",children:(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"# Set the base repo URL for mainnet & retrieve seeds"})}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"CHAIN_ID"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"mintstation-1"})]}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"CHAIN_REPO"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"https://raw.githubusercontent.com/cosmostation/mintstation/main/$CHAIN_ID"'}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:"&&"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" \\"})]}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" SEEDS"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"$('}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"curl"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"-sL"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:' "$CHAIN_REPO/seeds.txt")"'})]}),"\n",(0,i.jsx)(s.span,{className:"line",children:" "}),"\n",(0,i.jsx)(s.span,{className:"line",children:(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"# Add seeds to config.toml"})}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"sed"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"-i.bak"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"-e"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"s/^seeds *=.*/seeds = \\"$SEEDS\\"/"'}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"~/.mintstation/config/config.toml"})]})]})}),"\n",(0,i.jsx)(s.h3,{id:"set-minimum-gas-prices",children:"Set minimum gas prices"}),"\n",(0,i.jsxs)(s.p,{children:["For RPC nodes and Validator nodes we recommend setting the following ",(0,i.jsx)(s.code,{children:"minimum-gas-prices"}),". As we are a permissionless wasm chain, this setting will help protect against contract spam and potential wasm contract attack vectors."]}),"\n",(0,i.jsxs)(s.p,{children:["In ",(0,i.jsx)(s.code,{children:"$HOME/.mintstation/config/app.toml"}),", set minimum gas prices:"]}),"\n",(0,i.jsx)(s.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsx)(s.code,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"sed"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"-i.bak"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"-e"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"s/^minimum-gas-prices *=.*/minimum-gas-prices = \\"0.0025umint\\"/"'}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"~/.mintstation/config/app.toml"})]})})}),"\n",(0,i.jsx)(s.h3,{id:"create-or-restore-a-local-key-pair",children:(0,i.jsx)(s.strong,{children:"Create (or restore) a local key pair"})}),"\n",(0,i.jsx)(s.p,{children:"Either create a new key pair, or restore an existing wallet for your validator:"}),"\n",(0,i.jsx)(s.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(s.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"keys"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"add"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:">"})]}),"\n",(0,i.jsx)(s.span,{className:"line",children:" "}),"\n",(0,i.jsx)(s.span,{className:"line",children:(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"# OR"})}),"\n",(0,i.jsx)(s.span,{className:"line",children:" "}),"\n",(0,i.jsx)(s.span,{className:"line",children:(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"# Restore existing mint wallet with mnemonic seed phrase."})}),"\n",(0,i.jsx)(s.span,{className:"line",children:(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"# You will be prompted to enter mnemonic seed."})}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"keys"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"add"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:">"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"--recover"})]}),"\n",(0,i.jsx)(s.span,{className:"line",children:" "}),"\n",(0,i.jsx)(s.span,{className:"line",children:(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"# Query the keystore for your public address"})}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"mintstationd"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"keys"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"show"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"key-nam"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"e"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:">"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"--bech"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"val"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"-a"})]})]})}),"\n",(0,i.jsxs)(s.p,{children:["Replace ",(0,i.jsx)(s.code,{children:""})," with a key name of your choosing."]}),"\n",(0,i.jsx)(s.p,{children:"After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys."}),"\n",(0,i.jsx)(s.h3,{id:"get-some-tokens",children:(0,i.jsx)(s.strong,{children:"Get some tokens"})}),"\n",(0,i.jsxs)(s.p,{children:["Delegations ",(0,i.jsx)(s.a,{href:"delegations",children:"here"}),"."]}),"\n",(0,i.jsx)(s.h2,{id:"syncing-the-node",children:"Syncing the node"}),"\n",(0,i.jsx)(s.p,{children:"There are methods to sync a node to the network:"}),"\n",(0,i.jsx)(s.h3,{id:"from-genesis",children:"From genesis"}),"\n",(0,i.jsxs)(s.p,{children:["After starting the ",(0,i.jsx)(s.code,{children:"mintstationd"})," daemon, the chain will begin to sync to the network. The time to sync to the network will vary depending on your setup and the current size of the blockchain, but could take a very long time. To query the status of your node:"]}),"\n",(0,i.jsx)(s.pre,{"data-language":"bash","data-theme":"default",children:(0,i.jsxs)(s.code,{"data-language":"bash","data-theme":"default",children:[(0,i.jsx)(s.span,{className:"line",children:(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"# Query via the RPC (default port: 26657)"})}),"\n",(0,i.jsxs)(s.span,{className:"line",children:[(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"curl"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:"http://localhost:26657/status"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"|"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"jq"}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,i.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:".result.sync_info.catching_up"})]})]})}),"\n",(0,i.jsxs)(s.p,{children:["If this command returns ",(0,i.jsx)(s.code,{children:"true"})," then your node is still catching up. If it returns ",(0,i.jsx)(s.code,{children:"false"})," then your node has caught up to the network current block and you are safe to proceed to upgrade to a validator node."]}),"\n",(0,i.jsxs)(s.p,{children:["When syncing from genesis, you will need to perform upgrades while catching up to the head. ",(0,i.jsx)(s.code,{children:"mintstation-1"})," upgrades are detailed in ",(0,i.jsx)(s.a,{href:"upgrade",children:"node-upgrade.md"})," along with a description of each type of upgrade."]}),"\n",(0,i.jsx)(s.h2,{id:"backup-critical-files",children:"Backup critical files"}),"\n",(0,i.jsxs)(s.p,{children:["There are certain files that you need to backup to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in ",(0,i.jsx)(s.code,{children:"~/.mintstation/config/"}),":"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"priv_validator_key.json"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"node_key.json"})}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:"It is recommended that you encrypt the backup of these files."})]})}s.default=(0,t.j)({MDXContent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:s}=Object.assign({},(0,r.a)(),e.components);return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(_createMdxContent,{...e})}):_createMdxContent(e)},pageOpts:{filePath:"pages/mintstation/validator/mainnet.mdx",route:"/mintstation/validator/mainnet",timestamp:1700119354e3,title:"Joining Mainnet",headings:o},pageNextRoute:"/mintstation/validator/mainnet"})}},function(e){e.O(0,[2673,9774,2888,179],function(){return e(e.s=1512)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/_next/static/uibo7OMlxKWX5Suts7dPd/_buildManifest.js b/_next/static/fn2HshcLr_CMIWD_3GNCD/_buildManifest.js similarity index 98% rename from _next/static/uibo7OMlxKWX5Suts7dPd/_buildManifest.js rename to _next/static/fn2HshcLr_CMIWD_3GNCD/_buildManifest.js index 856100db..7a02a0e8 100644 --- a/_next/static/uibo7OMlxKWX5Suts7dPd/_buildManifest.js +++ b/_next/static/fn2HshcLr_CMIWD_3GNCD/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(e,t,s,i,n,a){return{__rewrites:{afterFiles:[{has:void 0,source:"/:path*/_meta",destination:"/404"}],beforeFiles:[],fallback:[]},"/":[e,"static/chunks/pages/index-8799e515fca95f3d.js"],"/_error":["static/chunks/pages/_error-f2769d6921702be7.js"],"/apis":[e,"static/chunks/pages/apis-b982809d36f8367e.js"],"/apis/reference/builder/tx-builder/broadcast":[e,t,s,i,n,"static/chunks/pages/apis/reference/builder/tx-builder/broadcast-07cddfbc6a05cda9.js"],"/apis/reference/builder/tx-builder/build":[e,t,s,i,n,"static/chunks/pages/apis/reference/builder/tx-builder/build-fc05befe9f97c77b.js"],"/apis/reference/builder/tx-builder/make-signature":[e,t,s,i,n,"static/chunks/pages/apis/reference/builder/tx-builder/make-signature-35836d371338d25e.js"],"/apis/reference/custom/account":[e,t,s,i,n,"static/chunks/pages/apis/reference/custom/account-e6c18223ffedad54.js"],"/apis/reference/historical/account/account-balances":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/account/account-balances-21d46cb997316a69.js"],"/apis/reference/historical/account/account-richlist":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/account/account-richlist-06e0127911b8d599.js"],"/apis/reference/historical/account/account-transactions":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/account/account-transactions-ea6047ca78e6a427.js"],"/apis/reference/historical/account/account-votes":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/account/account-votes-fbc2972bc724ca3b.js"],"/apis/reference/historical/validator/validator-block-sign":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-block-sign-fc276d014bef47c7.js"],"/apis/reference/historical/validator/validator-commissions":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-commissions-348a55851d9c1978.js"],"/apis/reference/historical/validator/validator-delegators":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-delegators-0ff4f2f0d83683d3.js"],"/apis/reference/historical/validator/validator-power-events":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-power-events-3bfca321ba3d8080.js"],"/apis/reference/historical/validator/validator-proposed-blocks":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-proposed-blocks-86b62f5bd99837da.js"],"/apis/reference/historical/validator/validator-votes":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-votes-b42bd4c7ffb5b635.js"],"/apis/reference/proxy/lcd":[e,t,s,i,n,"static/chunks/pages/apis/reference/proxy/lcd-e28c74d45ec77774.js"],"/apis/reference/statistics/messages":[e,t,s,i,n,"static/chunks/pages/apis/reference/statistics/messages-dd684c0f3bd00dd9.js"],"/apis/reference/statistics/transactions":[e,t,s,i,n,"static/chunks/pages/apis/reference/statistics/transactions-931dbbc3f3436972.js"],"/apis/reference/utilities/assets":[e,t,s,i,n,"static/chunks/pages/apis/reference/utilities/assets-e46eb592ac2b8727.js"],"/apis/reference/utilities/inflation":[e,t,s,i,n,"static/chunks/pages/apis/reference/utilities/inflation-21c85c1e36d54829.js"],"/apis/reference/utilities/node-info":[e,t,s,i,n,"static/chunks/pages/apis/reference/utilities/node-info-e7589791aa51cf12.js"],"/apis/reference/utilities/prices":[e,t,s,i,n,"static/chunks/pages/apis/reference/utilities/prices-1aead3ba9d7af381.js"],"/apis/reference/utilities/staking-apr":[e,t,s,i,n,"static/chunks/pages/apis/reference/utilities/staking-apr-64762dc4d64ab662.js"],"/extension":[e,"static/chunks/pages/extension-b19ac24e40025ea0.js"],"/extension/guide/account/add-account":[e,"static/chunks/pages/extension/guide/account/add-account-e97d63ab94a33e30.js"],"/extension/guide/account/add-ledger-account":[e,"static/chunks/pages/extension/guide/account/add-ledger-account-32eff735973ba70b.js"],"/extension/guide/account/intro":[e,"static/chunks/pages/extension/guide/account/intro-80ade08395378562.js"],"/extension/guide/chains":[e,"static/chunks/pages/extension/guide/chains-fc7b17cae89775ba.js"],"/extension/guide/dapps":[e,"static/chunks/pages/extension/guide/dapps-7ce295d726b17279.js"],"/extension/guide/settings":[e,"static/chunks/pages/extension/guide/settings-9f404814af08ad3e.js"],"/extension/guide/transfer-coins":[e,"static/chunks/pages/extension/guide/transfer-coins-9cbf644ffd30d5e7.js"],"/extension/integration/aptos/connect-and-account":[e,"static/chunks/pages/extension/integration/aptos/connect-and-account-87fb48bb2b2808cd.js"],"/extension/integration/aptos/event":[e,"static/chunks/pages/extension/integration/aptos/event-db717b33b7586d5b.js"],"/extension/integration/aptos/network":[e,"static/chunks/pages/extension/integration/aptos/network-cfeac72c7d6476de.js"],"/extension/integration/aptos/provider":[e,"static/chunks/pages/extension/integration/aptos/provider-ceddebe64f3aa1e8.js"],"/extension/integration/aptos/sign-and-submit-transaction":[e,"static/chunks/pages/extension/integration/aptos/sign-and-submit-transaction-f483fc53084aea4e.js"],"/extension/integration/cosmos/Deprecated/accounts":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/accounts-97beab31a0ba7704.js"],"/extension/integration/cosmos/Deprecated/chains":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/chains-4c85a4ea5cab60e5.js"],"/extension/integration/cosmos/Deprecated/cw20-token":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/cw20-token-b2a3c9c33a70a1f5.js"],"/extension/integration/cosmos/Deprecated/disconnect":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/disconnect-282124a859b46846.js"],"/extension/integration/cosmos/Deprecated/error":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/error-f7c196e668dd4c11.js"],"/extension/integration/cosmos/Deprecated/event":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/event-11916b8b0954dfbd.js"],"/extension/integration/cosmos/Deprecated/provider":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/provider-63cba436373b62ae.js"],"/extension/integration/cosmos/Deprecated/send-tx":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/send-tx-b5bd1870281af392.js"],"/extension/integration/cosmos/Deprecated/sign-message":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/sign-message-28eef63429caa033.js"],"/extension/integration/cosmos/Deprecated/sign-tx":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/sign-tx-e989564af8d65c7b.js"],"/extension/integration/cosmos/integrate-cosmjs":[e,"static/chunks/pages/extension/integration/cosmos/integrate-cosmjs-0b4adc5cce99abcb.js"],"/extension/integration/cosmos/integrate-keplr":[e,"static/chunks/pages/extension/integration/cosmos/integrate-keplr-7b17397d69eac51a.js"],"/extension/integration/cosmos/proto":["static/chunks/4ad82c5e-41a8269e9a9413de.js",e,"static/chunks/3248-b7e8af1a14065f4e.js","static/css/452d35adf31273a3.css","static/chunks/pages/extension/integration/cosmos/proto-67afe08431eceee5.js"],"/extension/integration/cosmos/react-hook":[e,"static/css/395a9d5eab9ca9fe.css","static/chunks/pages/extension/integration/cosmos/react-hook-7a12628b3f8be016.js"],"/extension/integration/cosmos/typescript":[e,t,a,"static/chunks/pages/extension/integration/cosmos/typescript-c37756cc5e6d2716.js"],"/extension/integration/cosmos/vanilla":[e,a,"static/chunks/pages/extension/integration/cosmos/vanilla-18ca85ff1e27b4a3.js"],"/extension/integration/cosmos/wallet":[e,t,"static/css/ca123d28da23ee56.css","static/chunks/pages/extension/integration/cosmos/wallet-1aaa84b0b3e41194.js"],"/extension/integration/evm/event":[e,"static/chunks/pages/extension/integration/evm/event-2b680ad131bc11d7.js"],"/extension/integration/evm/provider":[e,"static/chunks/pages/extension/integration/evm/provider-9e0d58d3e2cf944f.js"],"/extension/integration/evm/supported-rpc-methods":[e,"static/chunks/pages/extension/integration/evm/supported-rpc-methods-0077b8458e939640.js"],"/extension/integration/evm/use-ethers":[e,"static/chunks/pages/extension/integration/evm/use-ethers-cf10004e421b12db.js"],"/extension/integration/evm/use-web3-js":[e,"static/chunks/pages/extension/integration/evm/use-web3-js-9856175021add6a3.js"],"/extension/integration/sui/connect-and-get-accounts":[e,"static/chunks/pages/extension/integration/sui/connect-and-get-accounts-714b6228893187d2.js"],"/extension/integration/sui/execute-move-call":[e,"static/chunks/pages/extension/integration/sui/execute-move-call-0d20dae09e329454.js"],"/extension/integration/sui/provider":[e,"static/chunks/pages/extension/integration/sui/provider-b0ca14f25d513e5e.js"],"/extension/integration/sui/sign-and-execute-transaction":[e,"static/chunks/pages/extension/integration/sui/sign-and-execute-transaction-69d594a6afb078d6.js"],"/mintscan":[e,"static/chunks/pages/mintscan-f41605ff4f1258d9.js"],"/mintscan/registry/assets":[e,"static/chunks/pages/mintscan/registry/assets-ef8f7929e5d77052.js"],"/mintscan/registry/cw20":[e,"static/chunks/pages/mintscan/registry/cw20-97e96e6544235088.js"],"/mintscan/registry/ecosystem":[e,"static/chunks/pages/mintscan/registry/ecosystem-24c84c5977164a60.js"],"/mintscan/registry/erc20":[e,"static/chunks/pages/mintscan/registry/erc20-be025bec010c93e2.js"],"/mintscan/registry/moniker":[e,"static/chunks/pages/mintscan/registry/moniker-74789a4ca3f4dd83.js"],"/mintstation":[e,"static/chunks/pages/mintstation-5c009ce936af1e59.js"],"/mintstation/cli":[e,"static/chunks/pages/mintstation/cli-eca5d973bc213845.js"],"/mintstation/cli/command":[e,"static/chunks/pages/mintstation/cli/command-51ed23a14d8f8ad3.js"],"/mintstation/cli/setup":[e,"static/chunks/pages/mintstation/cli/setup-cb6dc6c97dbd7d7b.js"],"/mintstation/contracts/compile":[e,"static/chunks/pages/mintstation/contracts/compile-f669f7160d7bebd1.js"],"/mintstation/contracts/create":[e,"static/chunks/pages/mintstation/contracts/create-ed4552aab8355038.js"],"/mintstation/contracts/deploy":[e,"static/chunks/pages/mintstation/contracts/deploy-a1601c9a15a4ecf3.js"],"/mintstation/contracts/execute":[e,"static/chunks/pages/mintstation/contracts/execute-94979a1420c0d6e1.js"],"/mintstation/contracts/query":[e,"static/chunks/pages/mintstation/contracts/query-c5a9ae0704eff889.js"],"/mintstation/module":[e,"static/chunks/pages/mintstation/module-2046048363f0c382.js"],"/mintstation/playground":[e,"static/chunks/pages/mintstation/playground-a589374f85ad9043.js"],"/mintstation/validator/command":[e,"static/chunks/pages/mintstation/validator/command-bf77bf78efb863aa.js"],"/mintstation/validator/delegations":[e,"static/chunks/pages/mintstation/validator/delegations-2ac7d436da64796d.js"],"/mintstation/validator/localnet":[e,"static/chunks/pages/mintstation/validator/localnet-807f357eb62d5947.js"],"/mintstation/validator/mainnet":[e,"static/chunks/pages/mintstation/validator/mainnet-a8558d5a7cb1f976.js"],"/mintstation/validator/upgrade":[e,"static/chunks/pages/mintstation/validator/upgrade-75eaa905f500cc15.js"],"/mobile":[e,"static/chunks/pages/mobile-dbeed056e2b07b53.js"],"/mobile/article":[e,"static/chunks/pages/mobile/article-bf04bfcc91995743.js"],"/mobile/integration/cosmjs":[e,"static/chunks/pages/mobile/integration/cosmjs-5cefdc1c4766d459.js"],"/mobile/integration/cosmostation":[e,"static/chunks/pages/mobile/integration/cosmostation-00a7b446a0e6983f.js"],"/mobile/integration/walletconnect/accounts":[e,"static/chunks/pages/mobile/integration/walletconnect/accounts-f898a3ff0bf2e2a5.js"],"/mobile/integration/walletconnect/connect":[e,"static/chunks/pages/mobile/integration/walletconnect/connect-da5469542e66a288.js"],"/mobile/integration/walletconnect/sign-tx":[e,"static/chunks/pages/mobile/integration/walletconnect/sign-tx-138b3666c566e2af.js"],"/mobile/integration/walletconnect2":[e,"static/chunks/pages/mobile/integration/walletconnect2-670a166e5a6ae087.js"],"/mobile/listing":[e,"static/chunks/pages/mobile/listing-119c2953957e9446.js"],sortedPages:["/","/_app","/_error","/apis","/apis/reference/builder/tx-builder/broadcast","/apis/reference/builder/tx-builder/build","/apis/reference/builder/tx-builder/make-signature","/apis/reference/custom/account","/apis/reference/historical/account/account-balances","/apis/reference/historical/account/account-richlist","/apis/reference/historical/account/account-transactions","/apis/reference/historical/account/account-votes","/apis/reference/historical/validator/validator-block-sign","/apis/reference/historical/validator/validator-commissions","/apis/reference/historical/validator/validator-delegators","/apis/reference/historical/validator/validator-power-events","/apis/reference/historical/validator/validator-proposed-blocks","/apis/reference/historical/validator/validator-votes","/apis/reference/proxy/lcd","/apis/reference/statistics/messages","/apis/reference/statistics/transactions","/apis/reference/utilities/assets","/apis/reference/utilities/inflation","/apis/reference/utilities/node-info","/apis/reference/utilities/prices","/apis/reference/utilities/staking-apr","/extension","/extension/guide/account/add-account","/extension/guide/account/add-ledger-account","/extension/guide/account/intro","/extension/guide/chains","/extension/guide/dapps","/extension/guide/settings","/extension/guide/transfer-coins","/extension/integration/aptos/connect-and-account","/extension/integration/aptos/event","/extension/integration/aptos/network","/extension/integration/aptos/provider","/extension/integration/aptos/sign-and-submit-transaction","/extension/integration/cosmos/Deprecated/accounts","/extension/integration/cosmos/Deprecated/chains","/extension/integration/cosmos/Deprecated/cw20-token","/extension/integration/cosmos/Deprecated/disconnect","/extension/integration/cosmos/Deprecated/error","/extension/integration/cosmos/Deprecated/event","/extension/integration/cosmos/Deprecated/provider","/extension/integration/cosmos/Deprecated/send-tx","/extension/integration/cosmos/Deprecated/sign-message","/extension/integration/cosmos/Deprecated/sign-tx","/extension/integration/cosmos/integrate-cosmjs","/extension/integration/cosmos/integrate-keplr","/extension/integration/cosmos/proto","/extension/integration/cosmos/react-hook","/extension/integration/cosmos/typescript","/extension/integration/cosmos/vanilla","/extension/integration/cosmos/wallet","/extension/integration/evm/event","/extension/integration/evm/provider","/extension/integration/evm/supported-rpc-methods","/extension/integration/evm/use-ethers","/extension/integration/evm/use-web3-js","/extension/integration/sui/connect-and-get-accounts","/extension/integration/sui/execute-move-call","/extension/integration/sui/provider","/extension/integration/sui/sign-and-execute-transaction","/mintscan","/mintscan/registry/assets","/mintscan/registry/cw20","/mintscan/registry/ecosystem","/mintscan/registry/erc20","/mintscan/registry/moniker","/mintstation","/mintstation/cli","/mintstation/cli/command","/mintstation/cli/setup","/mintstation/contracts/compile","/mintstation/contracts/create","/mintstation/contracts/deploy","/mintstation/contracts/execute","/mintstation/contracts/query","/mintstation/module","/mintstation/playground","/mintstation/validator/command","/mintstation/validator/delegations","/mintstation/validator/localnet","/mintstation/validator/mainnet","/mintstation/validator/upgrade","/mobile","/mobile/article","/mobile/integration/cosmjs","/mobile/integration/cosmostation","/mobile/integration/walletconnect/accounts","/mobile/integration/walletconnect/connect","/mobile/integration/walletconnect/sign-tx","/mobile/integration/walletconnect2","/mobile/listing"]}}("static/chunks/2673-94a48fd42354951f.js","static/chunks/9659-7e42213312290ae3.js","static/chunks/5369-d81cbd2830bbc3d6.js","static/chunks/834-cb5fbe4e5053a4fc.js","static/css/bbaf5783f9f9157b.css","static/css/184a94d79f54225f.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(e,t,s,i,n,a){return{__rewrites:{afterFiles:[{has:void 0,source:"/:path*/_meta",destination:"/404"}],beforeFiles:[],fallback:[]},"/":[e,"static/chunks/pages/index-8799e515fca95f3d.js"],"/_error":["static/chunks/pages/_error-f2769d6921702be7.js"],"/apis":[e,"static/chunks/pages/apis-b982809d36f8367e.js"],"/apis/reference/builder/tx-builder/broadcast":[e,t,s,i,n,"static/chunks/pages/apis/reference/builder/tx-builder/broadcast-07cddfbc6a05cda9.js"],"/apis/reference/builder/tx-builder/build":[e,t,s,i,n,"static/chunks/pages/apis/reference/builder/tx-builder/build-fc05befe9f97c77b.js"],"/apis/reference/builder/tx-builder/make-signature":[e,t,s,i,n,"static/chunks/pages/apis/reference/builder/tx-builder/make-signature-35836d371338d25e.js"],"/apis/reference/custom/account":[e,t,s,i,n,"static/chunks/pages/apis/reference/custom/account-e6c18223ffedad54.js"],"/apis/reference/historical/account/account-balances":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/account/account-balances-21d46cb997316a69.js"],"/apis/reference/historical/account/account-richlist":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/account/account-richlist-06e0127911b8d599.js"],"/apis/reference/historical/account/account-transactions":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/account/account-transactions-ea6047ca78e6a427.js"],"/apis/reference/historical/account/account-votes":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/account/account-votes-fbc2972bc724ca3b.js"],"/apis/reference/historical/validator/validator-block-sign":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-block-sign-fc276d014bef47c7.js"],"/apis/reference/historical/validator/validator-commissions":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-commissions-348a55851d9c1978.js"],"/apis/reference/historical/validator/validator-delegators":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-delegators-0ff4f2f0d83683d3.js"],"/apis/reference/historical/validator/validator-power-events":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-power-events-3bfca321ba3d8080.js"],"/apis/reference/historical/validator/validator-proposed-blocks":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-proposed-blocks-86b62f5bd99837da.js"],"/apis/reference/historical/validator/validator-votes":[e,t,s,i,n,"static/chunks/pages/apis/reference/historical/validator/validator-votes-b42bd4c7ffb5b635.js"],"/apis/reference/proxy/lcd":[e,t,s,i,n,"static/chunks/pages/apis/reference/proxy/lcd-e28c74d45ec77774.js"],"/apis/reference/statistics/messages":[e,t,s,i,n,"static/chunks/pages/apis/reference/statistics/messages-dd684c0f3bd00dd9.js"],"/apis/reference/statistics/transactions":[e,t,s,i,n,"static/chunks/pages/apis/reference/statistics/transactions-931dbbc3f3436972.js"],"/apis/reference/utilities/assets":[e,t,s,i,n,"static/chunks/pages/apis/reference/utilities/assets-e46eb592ac2b8727.js"],"/apis/reference/utilities/inflation":[e,t,s,i,n,"static/chunks/pages/apis/reference/utilities/inflation-21c85c1e36d54829.js"],"/apis/reference/utilities/node-info":[e,t,s,i,n,"static/chunks/pages/apis/reference/utilities/node-info-e7589791aa51cf12.js"],"/apis/reference/utilities/prices":[e,t,s,i,n,"static/chunks/pages/apis/reference/utilities/prices-1aead3ba9d7af381.js"],"/apis/reference/utilities/staking-apr":[e,t,s,i,n,"static/chunks/pages/apis/reference/utilities/staking-apr-64762dc4d64ab662.js"],"/extension":[e,"static/chunks/pages/extension-b19ac24e40025ea0.js"],"/extension/guide/account/add-account":[e,"static/chunks/pages/extension/guide/account/add-account-e97d63ab94a33e30.js"],"/extension/guide/account/add-ledger-account":[e,"static/chunks/pages/extension/guide/account/add-ledger-account-32eff735973ba70b.js"],"/extension/guide/account/intro":[e,"static/chunks/pages/extension/guide/account/intro-80ade08395378562.js"],"/extension/guide/chains":[e,"static/chunks/pages/extension/guide/chains-fc7b17cae89775ba.js"],"/extension/guide/dapps":[e,"static/chunks/pages/extension/guide/dapps-7ce295d726b17279.js"],"/extension/guide/settings":[e,"static/chunks/pages/extension/guide/settings-9f404814af08ad3e.js"],"/extension/guide/transfer-coins":[e,"static/chunks/pages/extension/guide/transfer-coins-9cbf644ffd30d5e7.js"],"/extension/integration/aptos/connect-and-account":[e,"static/chunks/pages/extension/integration/aptos/connect-and-account-87fb48bb2b2808cd.js"],"/extension/integration/aptos/event":[e,"static/chunks/pages/extension/integration/aptos/event-db717b33b7586d5b.js"],"/extension/integration/aptos/network":[e,"static/chunks/pages/extension/integration/aptos/network-cfeac72c7d6476de.js"],"/extension/integration/aptos/provider":[e,"static/chunks/pages/extension/integration/aptos/provider-ceddebe64f3aa1e8.js"],"/extension/integration/aptos/sign-and-submit-transaction":[e,"static/chunks/pages/extension/integration/aptos/sign-and-submit-transaction-f483fc53084aea4e.js"],"/extension/integration/cosmos/Deprecated/accounts":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/accounts-97beab31a0ba7704.js"],"/extension/integration/cosmos/Deprecated/chains":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/chains-4c85a4ea5cab60e5.js"],"/extension/integration/cosmos/Deprecated/cw20-token":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/cw20-token-b2a3c9c33a70a1f5.js"],"/extension/integration/cosmos/Deprecated/disconnect":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/disconnect-282124a859b46846.js"],"/extension/integration/cosmos/Deprecated/error":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/error-f7c196e668dd4c11.js"],"/extension/integration/cosmos/Deprecated/event":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/event-11916b8b0954dfbd.js"],"/extension/integration/cosmos/Deprecated/provider":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/provider-63cba436373b62ae.js"],"/extension/integration/cosmos/Deprecated/send-tx":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/send-tx-b5bd1870281af392.js"],"/extension/integration/cosmos/Deprecated/sign-message":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/sign-message-28eef63429caa033.js"],"/extension/integration/cosmos/Deprecated/sign-tx":[e,"static/chunks/pages/extension/integration/cosmos/Deprecated/sign-tx-e989564af8d65c7b.js"],"/extension/integration/cosmos/integrate-cosmjs":[e,"static/chunks/pages/extension/integration/cosmos/integrate-cosmjs-0b4adc5cce99abcb.js"],"/extension/integration/cosmos/integrate-keplr":[e,"static/chunks/pages/extension/integration/cosmos/integrate-keplr-7b17397d69eac51a.js"],"/extension/integration/cosmos/proto":["static/chunks/4ad82c5e-41a8269e9a9413de.js",e,"static/chunks/3248-b7e8af1a14065f4e.js","static/css/452d35adf31273a3.css","static/chunks/pages/extension/integration/cosmos/proto-67afe08431eceee5.js"],"/extension/integration/cosmos/react-hook":[e,"static/css/395a9d5eab9ca9fe.css","static/chunks/pages/extension/integration/cosmos/react-hook-7a12628b3f8be016.js"],"/extension/integration/cosmos/typescript":[e,t,a,"static/chunks/pages/extension/integration/cosmos/typescript-c37756cc5e6d2716.js"],"/extension/integration/cosmos/vanilla":[e,a,"static/chunks/pages/extension/integration/cosmos/vanilla-18ca85ff1e27b4a3.js"],"/extension/integration/cosmos/wallet":[e,t,"static/css/ca123d28da23ee56.css","static/chunks/pages/extension/integration/cosmos/wallet-1aaa84b0b3e41194.js"],"/extension/integration/evm/event":[e,"static/chunks/pages/extension/integration/evm/event-2b680ad131bc11d7.js"],"/extension/integration/evm/provider":[e,"static/chunks/pages/extension/integration/evm/provider-9e0d58d3e2cf944f.js"],"/extension/integration/evm/supported-rpc-methods":[e,"static/chunks/pages/extension/integration/evm/supported-rpc-methods-0077b8458e939640.js"],"/extension/integration/evm/use-ethers":[e,"static/chunks/pages/extension/integration/evm/use-ethers-cf10004e421b12db.js"],"/extension/integration/evm/use-web3-js":[e,"static/chunks/pages/extension/integration/evm/use-web3-js-9856175021add6a3.js"],"/extension/integration/sui/connect-and-get-accounts":[e,"static/chunks/pages/extension/integration/sui/connect-and-get-accounts-714b6228893187d2.js"],"/extension/integration/sui/execute-move-call":[e,"static/chunks/pages/extension/integration/sui/execute-move-call-0d20dae09e329454.js"],"/extension/integration/sui/provider":[e,"static/chunks/pages/extension/integration/sui/provider-b0ca14f25d513e5e.js"],"/extension/integration/sui/sign-and-execute-transaction":[e,"static/chunks/pages/extension/integration/sui/sign-and-execute-transaction-69d594a6afb078d6.js"],"/mintscan":[e,"static/chunks/pages/mintscan-f41605ff4f1258d9.js"],"/mintscan/registry/assets":[e,"static/chunks/pages/mintscan/registry/assets-ef8f7929e5d77052.js"],"/mintscan/registry/cw20":[e,"static/chunks/pages/mintscan/registry/cw20-97e96e6544235088.js"],"/mintscan/registry/ecosystem":[e,"static/chunks/pages/mintscan/registry/ecosystem-24c84c5977164a60.js"],"/mintscan/registry/erc20":[e,"static/chunks/pages/mintscan/registry/erc20-be025bec010c93e2.js"],"/mintscan/registry/moniker":[e,"static/chunks/pages/mintscan/registry/moniker-74789a4ca3f4dd83.js"],"/mintstation":[e,"static/chunks/pages/mintstation-5c009ce936af1e59.js"],"/mintstation/cli":[e,"static/chunks/pages/mintstation/cli-62e132973e0ccd0e.js"],"/mintstation/cli/command":[e,"static/chunks/pages/mintstation/cli/command-51ed23a14d8f8ad3.js"],"/mintstation/cli/setup":[e,"static/chunks/pages/mintstation/cli/setup-cb6dc6c97dbd7d7b.js"],"/mintstation/contracts/compile":[e,"static/chunks/pages/mintstation/contracts/compile-f669f7160d7bebd1.js"],"/mintstation/contracts/create":[e,"static/chunks/pages/mintstation/contracts/create-ed4552aab8355038.js"],"/mintstation/contracts/deploy":[e,"static/chunks/pages/mintstation/contracts/deploy-a1601c9a15a4ecf3.js"],"/mintstation/contracts/execute":[e,"static/chunks/pages/mintstation/contracts/execute-94979a1420c0d6e1.js"],"/mintstation/contracts/query":[e,"static/chunks/pages/mintstation/contracts/query-c5a9ae0704eff889.js"],"/mintstation/module":[e,"static/chunks/pages/mintstation/module-eecbcf0fbfb0e53d.js"],"/mintstation/playground":[e,"static/chunks/pages/mintstation/playground-a589374f85ad9043.js"],"/mintstation/validator/command":[e,"static/chunks/pages/mintstation/validator/command-a87c231c26fd423b.js"],"/mintstation/validator/delegations":[e,"static/chunks/pages/mintstation/validator/delegations-2ac7d436da64796d.js"],"/mintstation/validator/localnet":[e,"static/chunks/pages/mintstation/validator/localnet-807f357eb62d5947.js"],"/mintstation/validator/mainnet":[e,"static/chunks/pages/mintstation/validator/mainnet-11314afa1dd3693c.js"],"/mintstation/validator/upgrade":[e,"static/chunks/pages/mintstation/validator/upgrade-75eaa905f500cc15.js"],"/mobile":[e,"static/chunks/pages/mobile-dbeed056e2b07b53.js"],"/mobile/article":[e,"static/chunks/pages/mobile/article-bf04bfcc91995743.js"],"/mobile/integration/cosmjs":[e,"static/chunks/pages/mobile/integration/cosmjs-5cefdc1c4766d459.js"],"/mobile/integration/cosmostation":[e,"static/chunks/pages/mobile/integration/cosmostation-00a7b446a0e6983f.js"],"/mobile/integration/walletconnect/accounts":[e,"static/chunks/pages/mobile/integration/walletconnect/accounts-f898a3ff0bf2e2a5.js"],"/mobile/integration/walletconnect/connect":[e,"static/chunks/pages/mobile/integration/walletconnect/connect-da5469542e66a288.js"],"/mobile/integration/walletconnect/sign-tx":[e,"static/chunks/pages/mobile/integration/walletconnect/sign-tx-138b3666c566e2af.js"],"/mobile/integration/walletconnect2":[e,"static/chunks/pages/mobile/integration/walletconnect2-670a166e5a6ae087.js"],"/mobile/listing":[e,"static/chunks/pages/mobile/listing-119c2953957e9446.js"],sortedPages:["/","/_app","/_error","/apis","/apis/reference/builder/tx-builder/broadcast","/apis/reference/builder/tx-builder/build","/apis/reference/builder/tx-builder/make-signature","/apis/reference/custom/account","/apis/reference/historical/account/account-balances","/apis/reference/historical/account/account-richlist","/apis/reference/historical/account/account-transactions","/apis/reference/historical/account/account-votes","/apis/reference/historical/validator/validator-block-sign","/apis/reference/historical/validator/validator-commissions","/apis/reference/historical/validator/validator-delegators","/apis/reference/historical/validator/validator-power-events","/apis/reference/historical/validator/validator-proposed-blocks","/apis/reference/historical/validator/validator-votes","/apis/reference/proxy/lcd","/apis/reference/statistics/messages","/apis/reference/statistics/transactions","/apis/reference/utilities/assets","/apis/reference/utilities/inflation","/apis/reference/utilities/node-info","/apis/reference/utilities/prices","/apis/reference/utilities/staking-apr","/extension","/extension/guide/account/add-account","/extension/guide/account/add-ledger-account","/extension/guide/account/intro","/extension/guide/chains","/extension/guide/dapps","/extension/guide/settings","/extension/guide/transfer-coins","/extension/integration/aptos/connect-and-account","/extension/integration/aptos/event","/extension/integration/aptos/network","/extension/integration/aptos/provider","/extension/integration/aptos/sign-and-submit-transaction","/extension/integration/cosmos/Deprecated/accounts","/extension/integration/cosmos/Deprecated/chains","/extension/integration/cosmos/Deprecated/cw20-token","/extension/integration/cosmos/Deprecated/disconnect","/extension/integration/cosmos/Deprecated/error","/extension/integration/cosmos/Deprecated/event","/extension/integration/cosmos/Deprecated/provider","/extension/integration/cosmos/Deprecated/send-tx","/extension/integration/cosmos/Deprecated/sign-message","/extension/integration/cosmos/Deprecated/sign-tx","/extension/integration/cosmos/integrate-cosmjs","/extension/integration/cosmos/integrate-keplr","/extension/integration/cosmos/proto","/extension/integration/cosmos/react-hook","/extension/integration/cosmos/typescript","/extension/integration/cosmos/vanilla","/extension/integration/cosmos/wallet","/extension/integration/evm/event","/extension/integration/evm/provider","/extension/integration/evm/supported-rpc-methods","/extension/integration/evm/use-ethers","/extension/integration/evm/use-web3-js","/extension/integration/sui/connect-and-get-accounts","/extension/integration/sui/execute-move-call","/extension/integration/sui/provider","/extension/integration/sui/sign-and-execute-transaction","/mintscan","/mintscan/registry/assets","/mintscan/registry/cw20","/mintscan/registry/ecosystem","/mintscan/registry/erc20","/mintscan/registry/moniker","/mintstation","/mintstation/cli","/mintstation/cli/command","/mintstation/cli/setup","/mintstation/contracts/compile","/mintstation/contracts/create","/mintstation/contracts/deploy","/mintstation/contracts/execute","/mintstation/contracts/query","/mintstation/module","/mintstation/playground","/mintstation/validator/command","/mintstation/validator/delegations","/mintstation/validator/localnet","/mintstation/validator/mainnet","/mintstation/validator/upgrade","/mobile","/mobile/article","/mobile/integration/cosmjs","/mobile/integration/cosmostation","/mobile/integration/walletconnect/accounts","/mobile/integration/walletconnect/connect","/mobile/integration/walletconnect/sign-tx","/mobile/integration/walletconnect2","/mobile/listing"]}}("static/chunks/2673-94a48fd42354951f.js","static/chunks/9659-7e42213312290ae3.js","static/chunks/5369-d81cbd2830bbc3d6.js","static/chunks/834-cb5fbe4e5053a4fc.js","static/css/bbaf5783f9f9157b.css","static/css/184a94d79f54225f.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/_next/static/uibo7OMlxKWX5Suts7dPd/_ssgManifest.js b/_next/static/fn2HshcLr_CMIWD_3GNCD/_ssgManifest.js similarity index 100% rename from _next/static/uibo7OMlxKWX5Suts7dPd/_ssgManifest.js rename to _next/static/fn2HshcLr_CMIWD_3GNCD/_ssgManifest.js diff --git a/apis.html b/apis.html index 4f17f9b9..780702a8 100644 --- a/apis.html +++ b/apis.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
Introduction

Introduction

+
API
Introduction

Introduction

Mintscan API (opens in a new tab), integral to Mintscan 2.0, stems from enterprise-grade onchain data indexing. Through features like tx builder and historical statistics APIs, it offers easy access to dynamic onchain data, including account balances and staking APR. Streamlining raw data processing, Mintscan API simplifies Interchain dapp development, positioning itself as a key piece in the Interchain infrastructure puzzle.

For inquery, please contact us api@cosmostation.io

How to get API Key?

@@ -42,4 +42,4 @@

Stride

API Reference

-
TypeAPICredit
Proxy APILCD Proxy1
Custom APIAccount5
Statistics APITransaction Statistics3
Message Statistics3
Builder APITransaction Builder5 ~ 10
Historical APIAccount Transactions5
Account Votes5
Account Balance History7
Richlist10
Validator Votes5
Validator Commission History5
Validator Delegators10
Validator Block Sign1
Validator Voting Power1
Validator Proposed Blocks1
Utility APINode Info5
Inflation3
Staking APR5
Assets3
Prices3 ~ 5

MIT 2023 © Nextra.
\ No newline at end of file +
TypeAPICredit
Proxy APILCD Proxy1
Custom APIAccount5
Statistics APITransaction Statistics3
Message Statistics3
Builder APITransaction Builder5 ~ 10
Historical APIAccount Transactions5
Account Votes5
Account Balance History7
Richlist10
Validator Votes5
Validator Commission History5
Validator Delegators10
Validator Block Sign1
Validator Voting Power1
Validator Proposed Blocks1
Utility APINode Info5
Inflation3
Staking APR5
Assets3
Prices3 ~ 5

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/builder/tx-builder/broadcast.html b/apis/reference/builder/tx-builder/broadcast.html index f6923404..7b09c4e2 100644 --- a/apis/reference/builder/tx-builder/broadcast.html +++ b/apis/reference/builder/tx-builder/broadcast.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Builder API
Transaction Builder
Broadcast Transaction

Broadcast Transaction

+
API
API Reference
Builder API
Transaction Builder
Broadcast Transaction

Broadcast Transaction

[POST] /v1/:network/tx-builder/broadcast

Request

Headers
Authorization: Bearer {access_token}
@@ -40,4 +40,4 @@ 

"events": [] } }

-

Try API

You are unable to try executing API from this page.
Method : POST
URL
/v1/:network/tx-builder/broadcast
CallURL
https://apis.mintscan.io/v1/:network/tx-builder/broadcast
Header
Bear Token*
Parameters
network*
Body

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

You are unable to try executing API from this page.
Method : POST
URL
/v1/:network/tx-builder/broadcast
CallURL
https://apis.mintscan.io/v1/:network/tx-builder/broadcast
Header
Bear Token*
Parameters
network*
Body

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/builder/tx-builder/build.html b/apis/reference/builder/tx-builder/build.html index 24d27e47..a77f0508 100644 --- a/apis/reference/builder/tx-builder/build.html +++ b/apis/reference/builder/tx-builder/build.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Builder API
Transaction Builder
Build Transaction

Build Transactions

+
-

Try API

Method : POST
URL
/v1/:network/tx-builder
CallURL
https://apis.mintscan.io/v1/:network/tx-builder
Header
Bear Token*
Parameters
network*
Body

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : POST
URL
/v1/:network/tx-builder
CallURL
https://apis.mintscan.io/v1/:network/tx-builder
Header
Bear Token*
Parameters
network*
Body

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/builder/tx-builder/make-signature.html b/apis/reference/builder/tx-builder/make-signature.html index f77e2200..fd71bc7e 100644 --- a/apis/reference/builder/tx-builder/make-signature.html +++ b/apis/reference/builder/tx-builder/make-signature.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Builder API
Transaction Builder
Sign Transaction

How Make Signature

+
API
API Reference
Builder API
Transaction Builder
Sign Transaction

How Make Signature

This documentation page provides an example of generating a signature using the tx (SignDoc) produced in the Build Transaction process.
The example code in this document is written in Node.js. Users can implement the sign logic based on their respective programming language.

Make Signature
// Import packages for sign
@@ -60,4 +60,4 @@
  
 // Use this to broadcast the transaction
 const signature = `0x${signatureHex}`;
-// Example: 0x10d0688f545e01802023a12cba8a69be50bd6e504b21781d97e7baaab61c4e8619753e64a377e85bf1488b4cdc34c87ce49c4d0d8fc0b52857129bf5aeccaed5

MIT 2023 © Nextra.
\ No newline at end of file +// Example: 0x10d0688f545e01802023a12cba8a69be50bd6e504b21781d97e7baaab61c4e8619753e64a377e85bf1488b4cdc34c87ce49c4d0d8fc0b52857129bf5aeccaed5

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/custom/account.html b/apis/reference/custom/account.html index fbd51313..e45c4983 100644 --- a/apis/reference/custom/account.html +++ b/apis/reference/custom/account.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Custom API
Account

Account

+
API
API Reference
Custom API
Account

Account

[GET] /v1/:network/accounts/:address

Get account information with current balances

Request

@@ -22,4 +22,4 @@

# The address of account # (string, required) address: cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q

-

Try API

Method : GET
URL
/v1/:network/accounts/:address
CallURL
https://apis.mintscan.io/v1/:network/accounts/:address
Header
Bear Token*
Parameters
network*
address*

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/accounts/:address
CallURL
https://apis.mintscan.io/v1/:network/accounts/:address
Header
Bear Token*
Parameters
network*
address*

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/historical/account/account-balances.html b/apis/reference/historical/account/account-balances.html index 46f080ce..73fe8d1e 100644 --- a/apis/reference/historical/account/account-balances.html +++ b/apis/reference/historical/account/account-balances.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Historical API
Account
Account Balance History

Account Balance History

+
API
API Reference
Historical API
Account
Account Balance History

Account Balance History

[GET] /v1/:network/accounts/:address/balances

Get balance history of an account

Request

@@ -34,4 +34,4 @@

# Search end datetime # (datetime, optional, default: CURRENT_TIMESTAMP) toDateTime: 2023-07-21 23:59:59

-

Try API

Method : GET
URL
/v1/:network/accounts/:address/balances
CallURL
https://apis.mintscan.io/v1/:network/accounts/:address/balances
Header
Bear Token*
Parameters
network*
address*
Queries
take
searchAfter
fromDateTime
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/accounts/:address/balances
CallURL
https://apis.mintscan.io/v1/:network/accounts/:address/balances
Header
Bear Token*
Parameters
network*
address*
Queries
take
searchAfter
fromDateTime
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/historical/account/account-richlist.html b/apis/reference/historical/account/account-richlist.html index bc107dc8..5b076f6f 100644 --- a/apis/reference/historical/account/account-richlist.html +++ b/apis/reference/historical/account/account-richlist.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Historical API
Account
Account Richlist

Account Balance History

+
API
API Reference
Historical API
Account
Account Richlist

Account Balance History

[GET] /v1/:network/accounts/richlist/:symbol

Get richlist for the given symbol

Request

@@ -31,4 +31,4 @@

# To display detailed information of the balance # (boolean, optional, default: false) detail: true

-

Try API

Method : GET
URL
/v1/:network/accounts/richlist/:symbol
CallURL
https://apis.mintscan.io/v1/:network/accounts/richlist/:symbol
Header
Bear Token*
Parameters
network*
symbol*
Queries
take
searchAfter
detail

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/accounts/richlist/:symbol
CallURL
https://apis.mintscan.io/v1/:network/accounts/richlist/:symbol
Header
Bear Token*
Parameters
network*
symbol*
Queries
take
searchAfter
detail

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/historical/account/account-transactions.html b/apis/reference/historical/account/account-transactions.html index 17bcb2e9..9e098258 100644 --- a/apis/reference/historical/account/account-transactions.html +++ b/apis/reference/historical/account/account-transactions.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Historical API
Account
Account Transactions

Account Transactions

+
API
API Reference
Historical API
Account
Account Transactions

Account Transactions

[GET] /v1/:network/accounts/:address/transactions

Get transactions of an account

Request

@@ -37,4 +37,4 @@

# Value of `pagination.searchAfter` from previous request for pagination # (string, optional) searchAfter: MTY4MDUxNjI5NjAwMHwxNDczMjU5OQ==

-

Try API

Method : GET
URL
/v1/:network/accounts/:address/transactions
CallURL
https://apis.mintscan.io/v1/:network/accounts/:address/transactions
Header
Bear Token*
Parameters
network*
address*
Queries
take
searchAfter
messageTypes[0]
messageTypes[1]
messageTypes[2]
fromDateTime
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/accounts/:address/transactions
CallURL
https://apis.mintscan.io/v1/:network/accounts/:address/transactions
Header
Bear Token*
Parameters
network*
address*
Queries
take
searchAfter
messageTypes[0]
messageTypes[1]
messageTypes[2]
fromDateTime
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/historical/account/account-votes.html b/apis/reference/historical/account/account-votes.html index 682e92ae..5f6bebae 100644 --- a/apis/reference/historical/account/account-votes.html +++ b/apis/reference/historical/account/account-votes.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Historical API
Account
Account Votes

Account Votes

+
API
API Reference
Historical API
Account
Account Votes

Account Votes

[GET] /v1/:network/accounts/:address/votes

Get a list of votes of an account

Request

@@ -26,4 +26,4 @@

# (boolean, optional, default: false) distinct: true

-

Try API

Method : GET
URL
/v1/:network/accounts/:address/votes
CallURL
https://apis.mintscan.io/v1/:network/accounts/:address/votes
Header
Bear Token*
Parameters
network*
address*
Queries
distinct

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/accounts/:address/votes
CallURL
https://apis.mintscan.io/v1/:network/accounts/:address/votes
Header
Bear Token*
Parameters
network*
address*
Queries
distinct

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/historical/validator/validator-block-sign.html b/apis/reference/historical/validator/validator-block-sign.html index fd267897..05b77a8c 100644 --- a/apis/reference/historical/validator/validator-block-sign.html +++ b/apis/reference/historical/validator/validator-block-sign.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Historical API
Validator
Validator Block Sign

Validator Latest Block Sign

+
API
API Reference
Historical API
Validator
Validator Block Sign

Validator Latest Block Sign

[GET] /v1/:network/validators/:validatorAddress/latestUptime

Get latest blocks signature of validator

Request

@@ -22,4 +22,4 @@

# The address of account # (string, required) validatorAddress: cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn

-

Try API

Method : GET
URL
/v1/:network/validators/:validatorAddress/latestUptime
CallURL
https://apis.mintscan.io/v1/:network/validators/:validatorAddress/latestUptime
Header
Bear Token*
Parameters
network*
validatorAddress*

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/validators/:validatorAddress/latestUptime
CallURL
https://apis.mintscan.io/v1/:network/validators/:validatorAddress/latestUptime
Header
Bear Token*
Parameters
network*
validatorAddress*

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/historical/validator/validator-commissions.html b/apis/reference/historical/validator/validator-commissions.html index c4d0dcf5..ba367b20 100644 --- a/apis/reference/historical/validator/validator-commissions.html +++ b/apis/reference/historical/validator/validator-commissions.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Historical API
Validator
Validator Commission Balance History

Validator Commission Balance History

+
API
API Reference
Historical API
Validator
Validator Commission Balance History

Validator Commission Balance History

[GET] /v1/:network/validators/:validatorAddress/commissions

Get commission balance history of an account

Request

@@ -34,4 +34,4 @@

# Search end datetime # (datetime, optional, default: CURRENT_TIMESTAMP) toDateTime: 2023-07-21 23:59:59

-

Try API

Method : GET
URL
/v1/:network/validators/:validatorAddress/commissions
CallURL
https://apis.mintscan.io/v1/:network/validators/:validatorAddress/commissions
Header
Bear Token*
Parameters
network*
validatorAddress*
Queries
take
searchAfter
fromDateTime
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/validators/:validatorAddress/commissions
CallURL
https://apis.mintscan.io/v1/:network/validators/:validatorAddress/commissions
Header
Bear Token*
Parameters
network*
validatorAddress*
Queries
take
searchAfter
fromDateTime
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/historical/validator/validator-delegators.html b/apis/reference/historical/validator/validator-delegators.html index c1420669..d82516a3 100644 --- a/apis/reference/historical/validator/validator-delegators.html +++ b/apis/reference/historical/validator/validator-delegators.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Historical API
Validator
Validator Delegators

Validator Delegators

+
API
API Reference
Historical API
Validator
Validator Delegators

Validator Delegators

[GET] /v1/:network/validators/:validatorAddress/delegators

Get a list of richlist of a symbol

Request

@@ -29,4 +29,4 @@

# (number, optional, default: 0) from: 20

-

Try API

Method : GET
URL
/v1/:network/validators/:validatorAddress/delegators
CallURL
https://apis.mintscan.io/v1/:network/validators/:validatorAddress/delegators
Header
Bear Token*
Parameters
network*
validatorAddress*
Queries
take
from

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/validators/:validatorAddress/delegators
CallURL
https://apis.mintscan.io/v1/:network/validators/:validatorAddress/delegators
Header
Bear Token*
Parameters
network*
validatorAddress*
Queries
take
from

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/historical/validator/validator-power-events.html b/apis/reference/historical/validator/validator-power-events.html index 9d84e2c4..c484cb37 100644 --- a/apis/reference/historical/validator/validator-power-events.html +++ b/apis/reference/historical/validator/validator-power-events.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Historical API
Validator
Validator Voting Power Events

Validator Voting Power Events

+
API
API Reference
Historical API
Validator
Validator Voting Power Events

Validator Voting Power Events

[GET] /v1/:network/validators/:validatorAddress/powerEvents

Get voting power events of validator

Request

@@ -28,4 +28,4 @@

# Value of `pagination.searchAfter` from previous request for pagination # (string, optional) searchAfter: MTY4OTc1NTU4NjAwMA==

-

Try API

Method : GET
URL
/v1/:network/validators/:validatorAddress/powerEvents
CallURL
https://apis.mintscan.io/v1/:network/validators/:validatorAddress/powerEvents
Header
Bear Token*
Parameters
network*
validatorAddress*
Queries
take
searchAfter

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/validators/:validatorAddress/powerEvents
CallURL
https://apis.mintscan.io/v1/:network/validators/:validatorAddress/powerEvents
Header
Bear Token*
Parameters
network*
validatorAddress*
Queries
take
searchAfter

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/historical/validator/validator-proposed-blocks.html b/apis/reference/historical/validator/validator-proposed-blocks.html index 7b4c47e1..d62f4383 100644 --- a/apis/reference/historical/validator/validator-proposed-blocks.html +++ b/apis/reference/historical/validator/validator-proposed-blocks.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Historical API
Validator
Validator Proposed Blocks

Validator Voting Power Events

+
API
API Reference
Historical API
Validator
Validator Proposed Blocks

Validator Voting Power Events

[GET] /v1/:network/validators/:validatorAddress/proposed

Get blocks proposed by the validator

Request

@@ -28,4 +28,4 @@

# Value of `pagination.searchAfter` from previous request for pagination # (string, optional) searchAfter: MTY4OTc1NTU4NjAwMA==

-

Try API

Method : GET
URL
/v1/:network/validators/:validatorAddress/proposed
CallURL
https://apis.mintscan.io/v1/:network/validators/:validatorAddress/proposed
Header
Bear Token*
Parameters
network*
validatorAddress*
Queries
take
searchAfter

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/validators/:validatorAddress/proposed
CallURL
https://apis.mintscan.io/v1/:network/validators/:validatorAddress/proposed
Header
Bear Token*
Parameters
network*
validatorAddress*
Queries
take
searchAfter

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/historical/validator/validator-votes.html b/apis/reference/historical/validator/validator-votes.html index 58c5e98c..12b9b4df 100644 --- a/apis/reference/historical/validator/validator-votes.html +++ b/apis/reference/historical/validator/validator-votes.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Historical API
Validator
Validator Votes

Validator Votes

+
API
API Reference
Historical API
Validator
Validator Votes

Validator Votes

[GET] /v1/:network/validators/:validatorAddress/transactions

Get a list of votes of a validator

Request

@@ -25,4 +25,4 @@

Queries
# Whether to remove duplicates for the same proposal
 # (boolean, optional, default: false)
 distinct: true

-

Try API

Method : GET
URL
/v1/:network/validators/:address/votes
CallURL
https://apis.mintscan.io/v1/:network/validators/:address/votes
Header
Bear Token*
Parameters
network*
address*
Queries
distinct

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/validators/:address/votes
CallURL
https://apis.mintscan.io/v1/:network/validators/:address/votes
Header
Bear Token*
Parameters
network*
address*
Queries
distinct

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/proxy/lcd.html b/apis/reference/proxy/lcd.html index 45fc7687..36010b72 100644 --- a/apis/reference/proxy/lcd.html +++ b/apis/reference/proxy/lcd.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Proxy
LCD Proxy

LCD Proxy

+
API
API Reference
Proxy
LCD Proxy

LCD Proxy

Proxy API for making LCD requests to BlockChain Node

[GET][POST] /v1/:network/lcd/*

You can directly access the Node LCD API by referring to the Swagger or document of the Network you want to make requests to.
@@ -24,4 +24,4 @@

# The url of lcd API. See details in Swagger or document of the network # (string, required) *: /cosmos/bank/v1beta1/balances/cosmos1clpqr4nrk4khgkxj78fcwwh6dl3uw4ep4tgu9q

-

Try API

Method : GET
URL
/:network/lcd/:url
CallURL
https://apis.mintscan.io/:network/lcd/:url
Header
Bear Token*
Parameters
network*
url*

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/:network/lcd/:url
CallURL
https://apis.mintscan.io/:network/lcd/:url
Header
Bear Token*
Parameters
network*
url*

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/statistics/messages.html b/apis/reference/statistics/messages.html index 1dbf17ce..7130c1e9 100644 --- a/apis/reference/statistics/messages.html +++ b/apis/reference/statistics/messages.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Statistics API
Message Types

Message Counts

+
API
API Reference
Statistics API
Message Types

Message Counts

[GET] /v1/:network/statistics/messages

Get The Number of Transactions per each message type over the last 30 days

Request

@@ -22,4 +22,4 @@

Queries
# Search end datetime
 # (datetime, optional, default: CURRENT_TIMESTAMP)
 toDateTime: 2023-07-21 23:59:59

-

Try API

Method : GET
URL
/v1/:network/statistics/messages
CallURL
https://apis.mintscan.io/v1/:network/statistics/messages
Header
Bear Token*
Parameters
network*
Queries
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/statistics/messages
CallURL
https://apis.mintscan.io/v1/:network/statistics/messages
Header
Bear Token*
Parameters
network*
Queries
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/statistics/transactions.html b/apis/reference/statistics/transactions.html index 828c25df..47f6d956 100644 --- a/apis/reference/statistics/transactions.html +++ b/apis/reference/statistics/transactions.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Statistics API
Transactions

Transactions Counts

+
API
API Reference
Statistics API
Transactions

Transactions Counts

[GET] /v1/:network/statistics/txs/hourly

Get The Number of Transactions Per Hour

Request

@@ -44,4 +44,4 @@

Queries
# Search end datetime
 # (datetime, optional, default: CURRENT_TIMESTAMP)
 toDateTime: 2023-07-21 23:59:59

-

Try API

Method : GET
URL
/v1/:network/statistics/txs/weekly
CallURL
https://apis.mintscan.io/v1/:network/statistics/txs/weekly
Header
Bear Token*
Parameters
network*
Queries
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/statistics/txs/weekly
CallURL
https://apis.mintscan.io/v1/:network/statistics/txs/weekly
Header
Bear Token*
Parameters
network*
Queries
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/utilities/assets.html b/apis/reference/utilities/assets.html index ae0231dd..b204f96c 100644 --- a/apis/reference/utilities/assets.html +++ b/apis/reference/utilities/assets.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Utility API
Assets

Assets

+
-

Try API

Method : GET
URL
/v1/:network/assets/:symbol
CallURL
https://apis.mintscan.io/v1/:network/assets/:symbol
Header
Bear Token*
Parameters
network*
symbol*

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/assets/:symbol
CallURL
https://apis.mintscan.io/v1/:network/assets/:symbol
Header
Bear Token*
Parameters
network*
symbol*

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/utilities/inflation.html b/apis/reference/utilities/inflation.html index 76c42a42..e4d81c36 100644 --- a/apis/reference/utilities/inflation.html +++ b/apis/reference/utilities/inflation.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Utility API
Inflation

Chain Inflation

+
API
API Reference
Utility API
Inflation

Chain Inflation

[GET] /v1/:network/inflation

Get inflation data from the chain

Request

@@ -19,4 +19,4 @@

Parameters
# The name of network
 # (string, required)
 network: cosmos

-

Try API

Method : GET
URL
/v1/:network/inflation
CallURL
https://apis.mintscan.io/v1/:network/inflation
Header
Bear Token*
Parameters
network*

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/inflation
CallURL
https://apis.mintscan.io/v1/:network/inflation
Header
Bear Token*
Parameters
network*

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/utilities/node-info.html b/apis/reference/utilities/node-info.html index 76f83b0d..fdf3be8f 100644 --- a/apis/reference/utilities/node-info.html +++ b/apis/reference/utilities/node-info.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Utility API
Node Info

Node Info

+
API
API Reference
Utility API
Node Info

Node Info

[GET] /v1/:network/node_info

Get node informations with chain parameters

Request

@@ -20,4 +20,4 @@

# (string, required) network: cosmos

-

Try API

Method : GET
URL
/v1/:network/node_info
CallURL
https://apis.mintscan.io/v1/:network/node_info
Header
Bear Token*
Parameters
network*

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/node_info
CallURL
https://apis.mintscan.io/v1/:network/node_info
Header
Bear Token*
Parameters
network*

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/utilities/prices.html b/apis/reference/utilities/prices.html index 7839d65b..91f0905a 100644 --- a/apis/reference/utilities/prices.html +++ b/apis/reference/utilities/prices.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Utility API
Prices

Prices

+
-

Try API

Method : GET
URL
/v1/prices/coingeckoId/:geckoId
CallURL
https://apis.mintscan.io/v1/prices/coingeckoId/:geckoId
Header
Bear Token*
Parameters
geckoId*
Queries
ticks
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/prices/coingeckoId/:geckoId
CallURL
https://apis.mintscan.io/v1/prices/coingeckoId/:geckoId
Header
Bear Token*
Parameters
geckoId*
Queries
ticks
toDateTime

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/apis/reference/utilities/staking-apr.html b/apis/reference/utilities/staking-apr.html index 55e0edd3..53ce0ae7 100644 --- a/apis/reference/utilities/staking-apr.html +++ b/apis/reference/utilities/staking-apr.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
API
API Reference
Utility API
Staking APR

Chain Staking APR

+
API
API Reference
Utility API
Staking APR

Chain Staking APR

[GET] /v1/:network/apr

Get default staking APR of the chain

Request

@@ -30,4 +30,4 @@

# Validator address to delegate # (string, required) validatorAddress: cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn

-

Try API

Method : GET
URL
/v1/:network/apr/:validatorAddress
CallURL
https://apis.mintscan.io/v1/:network/apr/:validatorAddress
Header
Bear Token*
Parameters
network*
validatorAddress*

MIT 2023 © Nextra.
\ No newline at end of file +

Try API

Method : GET
URL
/v1/:network/apr/:validatorAddress
CallURL
https://apis.mintscan.io/v1/:network/apr/:validatorAddress
Header
Bear Token*
Parameters
network*
validatorAddress*

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension.html b/extension.html index fe1d86f4..1aebab4f 100644 --- a/extension.html +++ b/extension.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Introduction

Introduction

+
Extension Wallet
Introduction

Introduction

Cosmostation Wallet Extension is a non-custodial chrome extension wallet that supports multiple sovereign networks and inter-blockchain bridges. The wallet extension allows users to easily interact with networks and decentralized applications with just a few clicks.

To download Cosmostation Wallet Extension, click this link (opens in a new tab) to download from the chrome webstore.

Wallet

@@ -21,4 +21,4 @@

Dashboard

-

MIT 2023 © Nextra.
\ No newline at end of file +

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/guide/account/add-account.html b/extension/guide/account/add-account.html index 17148491..a07c7a5d 100644 --- a/extension/guide/account/add-account.html +++ b/extension/guide/account/add-account.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
User guide
Account
Add Account

Add Account

+
Extension Wallet
User guide
Account
Add Account

Add Account

Create a new wallet, restore with an existing mnemonic phrase, or restore with a private key.

Create wallet

@@ -46,4 +46,4 @@

Step 3 Enter your 'Account name' and 'Private key'. (Private keys start with 0x and consists of a 66 digit string)

Step 4 Choose networks to display in your Cosmostation Wallet Extension. You must select at least 1 chain in order to proceed.

Step 5 Enter your password for Cosmostation Wallet Extension. Password must be more than 8 characters.

-

Import private key


MIT 2023 © Nextra.
\ No newline at end of file +

Import private key


MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/guide/account/add-ledger-account.html b/extension/guide/account/add-ledger-account.html index dd18a1ba..4a07de2c 100644 --- a/extension/guide/account/add-ledger-account.html +++ b/extension/guide/account/add-ledger-account.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
User guide
Account
Add Ledger Account

Add Ledger Account

+

MIT 2023 © Nextra.
\ No newline at end of file +

All the EVM chains' transactions can be signed from the Ethereum app.


MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/guide/account/intro.html b/extension/guide/account/intro.html index 1eb8a863..79e54032 100644 --- a/extension/guide/account/intro.html +++ b/extension/guide/account/intro.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
User guide
Account
Introduction

Introduction

+
Extension Wallet
User guide
Account
Introduction

Introduction

Cosmostation Wallet Extension allows you to add and manage multiple accounts. Securely manage your accounts in a convenient user interface.

Add Account

@@ -33,4 +33,4 @@

You can delete accounts from Cosmostation Extension.

Once deleted, you can restore your account again by importing the same mnemonic phrase or private key.

-
⚠️

You are required to enter your password before deleting your account.

Once deleted, if you lose your mnemonic phrase or private key you will not be able to gain access to the account again.


MIT 2023 © Nextra.
\ No newline at end of file +
⚠️

You are required to enter your password before deleting your account.

Once deleted, if you lose your mnemonic phrase or private key you will not be able to gain access to the account again.


MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/guide/chains.html b/extension/guide/chains.html index 129b1e03..1a1bac22 100644 --- a/extension/guide/chains.html +++ b/extension/guide/chains.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
User guide
Chains

Chains

+
Extension Wallet
User guide
Chains

Chains

Cosmostation Wallet Extension supports various PoS networks.

Add/Remove Chains

@@ -21,4 +21,4 @@

Step 1 View chains that are added to your list. Click 'Add chain' to add/remove chains from the list.

Step 2 By toggling on/off, you can choose chains that you want to display on Cosmostation Wallet Extension.

Step 3 Selected chains are also visible on the top right side of wallet details.

-

Add & Remove chains


MIT 2023 © Nextra.
\ No newline at end of file +

Add & Remove chains


MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/guide/dapps.html b/extension/guide/dapps.html index e12c199a..2edcc0d3 100644 --- a/extension/guide/dapps.html +++ b/extension/guide/dapps.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
User guide
Dapps

dApp

+

MIT 2023 © Nextra.
\ No newline at end of file +

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/guide/settings.html b/extension/guide/settings.html index 097b386b..2d23ae64 100644 --- a/extension/guide/settings.html +++ b/extension/guide/settings.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
User guide
Settings

Settings

+

MIT 2023 © Nextra.
\ No newline at end of file +

!


MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/guide/transfer-coins.html b/extension/guide/transfer-coins.html index aa0890a9..d8baeb94 100644 --- a/extension/guide/transfer-coins.html +++ b/extension/guide/transfer-coins.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
User guide
Transfer Coins

Transfer coins

+
Extension Wallet
User guide
Transfer Coins

Transfer coins

Transfer coins with just one click via Cosmostation Wallet Extension.

⚠️

Cosmostation Wallet Extension currently DOES NOT SUPPORT IBC TRANSFERS.

If you are trying to send assets to a different chain, the send button will be deactivated.

Receive

@@ -26,4 +26,4 @@

Step 1 Enter 'Recipient address', 'Amount,' and 'Memo.' The memo field is optional but required for sending to specific centralized cryptocurrency exchanges. Centralized exchanges will ask you to enter a memo for identification when you make a deposit.

⚠️

Make sure that you enter the correct recipient address.

Entering an incorrect address may result in loss of funds and responsibility of entering the correct address is on the user.

Step 2, 3 Check the transaction information and confirm.

-

Send


MIT 2023 © Nextra.
\ No newline at end of file +

Send


MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/aptos/connect-and-account.html b/extension/integration/aptos/connect-and-account.html index 0b5efb64..9b0c9e3f 100644 --- a/extension/integration/aptos/connect-and-account.html +++ b/extension/integration/aptos/connect-and-account.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
APTOS Network
Connect & Account

Connect, Account

+
Extension Wallet
Integration
APTOS Network
Connect & Account

Connect, Account

connect and get Account via Cosmostation Extension

Connect

Code using @cosmostation/extension-client

@@ -83,4 +83,4 @@

Example
{
   "address": "0x9d8a438fe580db4f7b9e108a4bce46ad6647905495903f295d06458625913644",
   "publicKey": "0x503603cb3ea1801805b952d9d4c6a7302dddfa78cc15042e78132ee907e6b48f"
-}


MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/aptos/event.html b/extension/integration/aptos/event.html index 15f8ae7d..71d8e491 100644 --- a/extension/integration/aptos/event.html +++ b/extension/integration/aptos/event.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
APTOS Network
Event

Event

+

MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/aptos/network.html b/extension/integration/aptos/network.html index 4f40fcce..04398961 100644 --- a/extension/integration/aptos/network.html +++ b/extension/integration/aptos/network.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
APTOS Network
Network

Network

+

Response

Model
export type AptosNetworkResponse = string;
-
Example
"Mainnet"

MIT 2023 © Nextra.
\ No newline at end of file +
Example
"Mainnet"

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/aptos/provider.html b/extension/integration/aptos/provider.html index e4c0a2bd..54532af5 100644 --- a/extension/integration/aptos/provider.html +++ b/extension/integration/aptos/provider.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
APTOS Network
Provider

Provider

+

MIT 2023 © Nextra.
\ No newline at end of file +const provider = aptos();

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/aptos/sign-and-submit-transaction.html b/extension/integration/aptos/sign-and-submit-transaction.html index f3c83886..ac563b58 100644 --- a/extension/integration/aptos/sign-and-submit-transaction.html +++ b/extension/integration/aptos/sign-and-submit-transaction.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
APTOS Network
Sign & Submit Transaction

Sign And Submit Transaction

+

Response

Model
export type AptosSignTransactionResponse = string;
-
Example
"0x9d8a438fe580db4f7b9e108a4bce46ad6647905495903f295d06458625913644100000000000000002000000000000000000000000000000000000000000000000000000000000000104636f696e087472616e73666572010700000000000000000000000000000000000000000000000000000000000000010a6170746f735f636f696e094170746f73436f696e00022084b0d6b75cd160f1e46a7d18b567e79d79898e1a6487795a83e60d29291d94d60840420f0000000000f8030000000000006400000000000000ccc36d6300000000010020503603cb3ea1801805b952d9d4c6a7302dddfa78cc15042e78132ee907e6b48f40a58ef2b76eec70a2a538cd7e2faa97def87576ba766feeeb4cd884e9d848fad93cd2c262235b00915be049edcba0046aed6bbd6823a76051fb1bd83791949508"

MIT 2023 © Nextra.
\ No newline at end of file +
Example
"0x9d8a438fe580db4f7b9e108a4bce46ad6647905495903f295d06458625913644100000000000000002000000000000000000000000000000000000000000000000000000000000000104636f696e087472616e73666572010700000000000000000000000000000000000000000000000000000000000000010a6170746f735f636f696e094170746f73436f696e00022084b0d6b75cd160f1e46a7d18b567e79d79898e1a6487795a83e60d29291d94d60840420f0000000000f8030000000000006400000000000000ccc36d6300000000010020503603cb3ea1801805b952d9d4c6a7302dddfa78cc15042e78132ee907e6b48f40a58ef2b76eec70a2a538cd7e2faa97def87576ba766feeeb4cd884e9d848fad93cd2c262235b00915be049edcba0046aed6bbd6823a76051fb1bd83791949508"

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/Deprecated/accounts.html b/extension/integration/cosmos/Deprecated/accounts.html index 0f30ebc0..a970f542 100644 --- a/extension/integration/cosmos/Deprecated/accounts.html +++ b/extension/integration/cosmos/Deprecated/accounts.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Deprecated
Accounts

Accounts

+

MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/Deprecated/chains.html b/extension/integration/cosmos/Deprecated/chains.html index 09b89fa3..02fd450f 100644 --- a/extension/integration/cosmos/Deprecated/chains.html +++ b/extension/integration/cosmos/Deprecated/chains.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Deprecated
Chains

Chains

+

Response

Model
type ActivatedChainIdsResponse = string[];
-
Example
["cosmoshub-4", "gravity-bridge-3"]

MIT 2023 © Nextra.
\ No newline at end of file +
Example
["cosmoshub-4", "gravity-bridge-3"]

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/Deprecated/cw20-token.html b/extension/integration/cosmos/Deprecated/cw20-token.html index 8b0e11b8..dd29eff7 100644 --- a/extension/integration/cosmos/Deprecated/cw20-token.html +++ b/extension/integration/cosmos/Deprecated/cw20-token.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Deprecated
CW20 Tokens

CW20 token

+

MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/Deprecated/disconnect.html b/extension/integration/cosmos/Deprecated/disconnect.html index 30507155..2588090c 100644 --- a/extension/integration/cosmos/Deprecated/disconnect.html +++ b/extension/integration/cosmos/Deprecated/disconnect.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Deprecated
Disconnect

Disconnect

+

Response

Model
type DisconnectResponse = null;
-
Example
null

MIT 2023 © Nextra.
\ No newline at end of file +
Example
null

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/Deprecated/error.html b/extension/integration/cosmos/Deprecated/error.html index 8a63474c..c70657b8 100644 --- a/extension/integration/cosmos/Deprecated/error.html +++ b/extension/integration/cosmos/Deprecated/error.html @@ -11,6 +11,6 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Deprecated
Error

Error

+
Extension Wallet
Integration
Cosmos Chains
Deprecated
Error

Error

Error description

-
CodeModelDescription
4001-User rejected request
4100-The requested account and/or method has not been authorized by the user.
4200-The requested method is not supported
-32000-Invalid input.
-32600-The JSON sent is not a valid Request object.
-32602-Invalid method parameter(s).
-32603-Internal JSON-RPC error.

MIT 2023 © Nextra.
\ No newline at end of file +
CodeModelDescription
4001-User rejected request
4100-The requested account and/or method has not been authorized by the user.
4200-The requested method is not supported
-32000-Invalid input.
-32600-The JSON sent is not a valid Request object.
-32602-Invalid method parameter(s).
-32603-Internal JSON-RPC error.

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/Deprecated/event.html b/extension/integration/cosmos/Deprecated/event.html index 73b96d5a..96b4dc46 100644 --- a/extension/integration/cosmos/Deprecated/event.html +++ b/extension/integration/cosmos/Deprecated/event.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Deprecated
Event

Event

+

Vanilla Code

-
window.removeEventListener("cosmostation_keystorechange", handler)

MIT 2023 © Nextra.
\ No newline at end of file +
window.removeEventListener("cosmostation_keystorechange", handler)

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/Deprecated/provider.html b/extension/integration/cosmos/Deprecated/provider.html index ad62a822..ac87779f 100644 --- a/extension/integration/cosmos/Deprecated/provider.html +++ b/extension/integration/cosmos/Deprecated/provider.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Deprecated
Provider

Provider

+

MIT 2023 © Nextra.
\ No newline at end of file +};

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/Deprecated/send-tx.html b/extension/integration/cosmos/Deprecated/send-tx.html index 007370b7..2dda4567 100644 --- a/extension/integration/cosmos/Deprecated/send-tx.html +++ b/extension/integration/cosmos/Deprecated/send-tx.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Deprecated
Send Transaction

Send Transcation

+
Extension Wallet
Integration
Cosmos Chains
Deprecated
Send Transaction

Send Transcation

Send transcation via Cosmostation Extension

Code using @cosmostation/extension-client

import { SEND_TRANSACTION_MODE } from "@cosmostation/extension-client/cosmos";
@@ -71,4 +71,4 @@ 

"tx": null, "txhash": "4CC689A1E8CF89E1CF1E98D523BC171FEC749DCF8CFED296FA441AF1E0C47C4C" } -}


MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/Deprecated/sign-message.html b/extension/integration/cosmos/Deprecated/sign-message.html index e0c4806d..06a3bb7e 100644 --- a/extension/integration/cosmos/Deprecated/sign-message.html +++ b/extension/integration/cosmos/Deprecated/sign-message.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Deprecated
Sign Message

Sign Message

+

Response

Model
export type VerifyMessageResponse = boolean;
-
Example
true

MIT 2023 © Nextra.
\ No newline at end of file +
Example
true

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/Deprecated/sign-tx.html b/extension/integration/cosmos/Deprecated/sign-tx.html index faaa1fd8..93dac7a9 100644 --- a/extension/integration/cosmos/Deprecated/sign-tx.html +++ b/extension/integration/cosmos/Deprecated/sign-tx.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Deprecated
Sign Transaction

Sign Transactions

+

MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/integrate-cosmjs.html b/extension/integration/cosmos/integrate-cosmjs.html index 4ff75c73..e4d65f18 100644 --- a/extension/integration/cosmos/integrate-cosmjs.html +++ b/extension/integration/cosmos/integrate-cosmjs.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Integrate Cosmjs

Integrate cosmjs

+

MIT 2023 © Nextra.
\ No newline at end of file +);

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/integrate-keplr.html b/extension/integration/cosmos/integrate-keplr.html index 5117c90c..426aa78f 100644 --- a/extension/integration/cosmos/integrate-keplr.html +++ b/extension/integration/cosmos/integrate-keplr.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Integrate Keplr

Use Cosmostation with Keplr Interface

+
Extension Wallet
Integration
Cosmos Chains
Integrate Keplr

Use Cosmostation with Keplr Interface

Cosmostation is providing Keplr's interface. The purpose is to make it easier for the developers to integrate Cosmostation to dApps that have Keplr integrated already.

Supported functions/variables are as belows:

    @@ -80,4 +80,4 @@

    Event

    window.addEventListener("cosmostation_keystorechange", () => {
         console.log("Key store in Cosmostation is changed. You may need to refetch the account info.")
    -})

MIT 2023 © Nextra.
\ No newline at end of file +})

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/proto.html b/extension/integration/cosmos/proto.html index 91d2feff..1792e56c 100644 --- a/extension/integration/cosmos/proto.html +++ b/extension/integration/cosmos/proto.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Protobuf json

Protobuf JSON

+

MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/react-hook.html b/extension/integration/cosmos/react-hook.html index 5aa334c4..ec4d3817 100644 --- a/extension/integration/cosmos/react-hook.html +++ b/extension/integration/cosmos/react-hook.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
React Hook

React hook

+

MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/typescript.html b/extension/integration/cosmos/typescript.html index 1d2541b0..468c98a5 100644 --- a/extension/integration/cosmos/typescript.html +++ b/extension/integration/cosmos/typescript.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Typescript

Typescript

+

removeEventListener

-
example
window.removeEventListener('cosmostation_keystorechange', handler);

MIT 2023 © Nextra.
\ No newline at end of file +
example
window.removeEventListener('cosmostation_keystorechange', handler);

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/vanilla.html b/extension/integration/cosmos/vanilla.html index a9901781..d4017b1b 100644 --- a/extension/integration/cosmos/vanilla.html +++ b/extension/integration/cosmos/vanilla.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Vanilla

Vanilla

+

removeEventListener

-
example
window.removeEventListener('cosmostation_keystorechange', handler);

MIT 2023 © Nextra.
\ No newline at end of file +
example
window.removeEventListener('cosmostation_keystorechange', handler);

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/cosmos/wallet.html b/extension/integration/cosmos/wallet.html index 5b1b5a81..d15d9877 100644 --- a/extension/integration/cosmos/wallet.html +++ b/extension/integration/cosmos/wallet.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
Cosmos Chains
Wallet

Wallet

+
Extension Wallet
Integration
Cosmos Chains
Wallet

Wallet

The interface of each Cosmos wallet is different, and in order to solve the problem of having to manually attach each wallet to the Dapp, it was developed to automatically add the same interface and wallet.

Installation

npm install @cosmostation/wallets
@@ -402,4 +402,4 @@

}} > Register Leap Wallet -</button>;


MIT 2023 © Nextra.
\ No newline at end of file +</button>;

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/evm/event.html b/extension/integration/evm/event.html index 34af4852..c50043ad 100644 --- a/extension/integration/evm/event.html +++ b/extension/integration/evm/event.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
EVM Network
Event

Event

+

MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/evm/provider.html b/extension/integration/evm/provider.html index c9e5edb9..cca78032 100644 --- a/extension/integration/evm/provider.html +++ b/extension/integration/evm/provider.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
EVM Network
Provider

Provider

+

MIT 2023 © Nextra.
\ No newline at end of file +const provider = ethereum();

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/evm/supported-rpc-methods.html b/extension/integration/evm/supported-rpc-methods.html index cad7a550..7d5a3436 100644 --- a/extension/integration/evm/supported-rpc-methods.html +++ b/extension/integration/evm/supported-rpc-methods.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
EVM Network
Supported RPC Methods

Supported RPC methods

+

MIT 2023 © Nextra.
\ No newline at end of file +});

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/evm/use-ethers.html b/extension/integration/evm/use-ethers.html index 2c8900af..56a22d8c 100644 --- a/extension/integration/evm/use-ethers.html +++ b/extension/integration/evm/use-ethers.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
EVM Network
Use ethers

Use ethers

+

MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/evm/use-web3-js.html b/extension/integration/evm/use-web3-js.html index ff677077..fcc225af 100644 --- a/extension/integration/evm/use-web3-js.html +++ b/extension/integration/evm/use-web3-js.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
EVM Network
Use web3.js

Use web3.js

+

MIT 2023 © Nextra.
\ No newline at end of file +});

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/sui/connect-and-get-accounts.html b/extension/integration/sui/connect-and-get-accounts.html index 190428c9..0674c159 100644 --- a/extension/integration/sui/connect-and-get-accounts.html +++ b/extension/integration/sui/connect-and-get-accounts.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
SUI Network
Connect & Get Accounts

Connect And Get Accounts

+
Extension Wallet
Integration
SUI Network
Connect & Get Accounts

Connect And Get Accounts

connect and get Account via Cosmostation Extension

const response = await window.cosmostation.sui.connect();
  
@@ -33,4 +33,4 @@ 

const publicKey = await window.cosmostation.sui.getPublicKey();

Response

Model
export type SuiAccountResponse = string[];
-
Example
["0xd2d030d4339531d9cb442caf4be7bb954fddedb4"]

MIT 2023 © Nextra.
\ No newline at end of file +
Example
["0xd2d030d4339531d9cb442caf4be7bb954fddedb4"]

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/sui/execute-move-call.html b/extension/integration/sui/execute-move-call.html index bb999dda..954020ab 100644 --- a/extension/integration/sui/execute-move-call.html +++ b/extension/integration/sui/execute-move-call.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
SUI Network
Execute Move Call

Execute Move Call

+

MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/sui/provider.html b/extension/integration/sui/provider.html index a171299a..43ea5859 100644 --- a/extension/integration/sui/provider.html +++ b/extension/integration/sui/provider.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
SUI Network
Provider

Provider

+

MIT 2023 © Nextra.
\ No newline at end of file +const provider = sui();

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/extension/integration/sui/sign-and-execute-transaction.html b/extension/integration/sui/sign-and-execute-transaction.html index a76f6c67..d60dc120 100644 --- a/extension/integration/sui/sign-and-execute-transaction.html +++ b/extension/integration/sui/sign-and-execute-transaction.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Extension Wallet
Integration
SUI Network
Sign & Execute Transaction

Sign And Execute Transaction

+

MIT 2023 © Nextra.
\ No newline at end of file +}

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/index.html b/index.html index 4591872e..28688930 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -

Cosmostation

+

Cosmostation

Cosmostation is a committed interchain service provider in the Cosmos ecosystem, established since its genesis in 2019. Our array of tools, including Mintscan, Mintscan API, and Cosmostation wallets showcases our dedication to the community. This developer documentation is your guide to understanding and utilizing our offerings for enhanced protocol development.


@@ -49,4 +49,4 @@

Industry leading non-custodial mobile wallet supporting 50+ interchain networks. Enjoy native staking, IBC send, voting, and token swap on mobile.

-


MIT 2023 © Nextra.
\ No newline at end of file +

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/mintscan.html b/mintscan.html index e6f9e6d8..c67f40e2 100644 --- a/mintscan.html +++ b/mintscan.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Mintscan
Introduction

Introduction

+
\ No newline at end of file +

MIT 2023 © Nextra.
\ No newline at end of file diff --git a/mintscan/registry/assets.html b/mintscan/registry/assets.html index 0ec2baae..b9238e7a 100644 --- a/mintscan/registry/assets.html +++ b/mintscan/registry/assets.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Mintscan
Registry
Asset Metadata

How to add your token info

+
Mintscan
Registry
Asset Metadata

How to add your token info

To add asset metadata on mintscan.

Assets

@@ -201,4 +201,4 @@
  • From your repository, make pull request (PR)

  • -

    MIT 2023 © Nextra.
    \ No newline at end of file +

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintscan/registry/cw20.html b/mintscan/registry/cw20.html index 91dfdf60..ceef1dc2 100644 --- a/mintscan/registry/cw20.html +++ b/mintscan/registry/cw20.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintscan
    Registry
    CW20 Metadata

    How to add your CW20 token info

    +
    Mintscan
    Registry
    CW20 Metadata

    How to add your CW20 token info

    To add CW20 asset metadata on mintscan assets.

    CW20

    @@ -72,4 +72,4 @@
  • From your repository, make pull request (PR)
  • -

    MIT 2023 © Nextra.
    \ No newline at end of file +

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintscan/registry/ecosystem.html b/mintscan/registry/ecosystem.html index 1e585d01..f76a2619 100644 --- a/mintscan/registry/ecosystem.html +++ b/mintscan/registry/ecosystem.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintscan
    Registry
    Ecosystem

    How to add your project on Ecosystem

    +
    Mintscan
    Registry
    Ecosystem

    How to add your project on Ecosystem

    To add ecosystem on mintscan.

    Ecosystem

    @@ -27,4 +27,4 @@
  • Reference(Optional) : Docs, Github, Blog, Reddit
  • Type : Cosmwasm, EVM, Module
  • Banner : 1125 x 600 px
  • -

    MIT 2023 © Nextra.
    \ No newline at end of file +

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintscan/registry/erc20.html b/mintscan/registry/erc20.html index 3b70d7cd..ea887819 100644 --- a/mintscan/registry/erc20.html +++ b/mintscan/registry/erc20.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintscan
    Registry
    ERC20 Metadata

    How to add your ERC20 token info

    +
    Mintscan
    Registry
    ERC20 Metadata

    How to add your ERC20 token info

    To add erc20 asset metadata on mintscan assets.

    Erc20

    @@ -71,4 +71,4 @@
  • From your repository, make pull request (PR)
  • -

    MIT 2023 © Nextra.
    \ No newline at end of file +

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintscan/registry/moniker.html b/mintscan/registry/moniker.html index be99b943..55eb423b 100644 --- a/mintscan/registry/moniker.html +++ b/mintscan/registry/moniker.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintscan
    Registry
    Validator moniker

    How to add your validator moniker image

    +
    Mintscan
    Registry
    Validator moniker

    How to add your validator moniker image

    To add moniker image on mintscan validator tab.

    Moniker

    @@ -20,4 +20,4 @@
  • Add your image to ${targetchain}/moniker folder
  • Image with png format and validator address name
  • Example will display cosmostation validator moniker logo for cosmos
  • -

    MIT 2023 © Nextra.
    \ No newline at end of file +

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation.html b/mintstation.html index ab38108b..8be37fa5 100644 --- a/mintstation.html +++ b/mintstation.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Introduction

    Introduction

    +
    Mintstation
    Introduction

    Introduction

    Mintstation is a network designed for testing the Cosmos SDK. It provides access to the latest features of the Cosmos ecosystem, allowing users to leverage CosmWasm smart contracts.

    In this documentation, the following topics are covered:

      @@ -22,4 +22,4 @@
    • Custom module development

    Mintstation offers a testing ground for developers and users to explore and experiment with the capabilities of the Cosmos SDK while having the ability to interact with CosmWasm smart contracts. The documentation provides comprehensive guidance on setting up a local network, utilizing the CLI, engaging as a validator, and leveraging Cosmwasm for smart contract deployment. Additionally, developers are encouraged to explore custom module development to tailor the network to their specific needs.

    -

    By providing an environment that maintains the latest features of the Cosmos SDK and supports Cosmwasm smart contracts, Mintstation facilitates a dynamic and insightful experience for individuals and teams working within the Cosmos ecosystem.


    MIT 2023 © Nextra.
    \ No newline at end of file +

    By providing an environment that maintains the latest features of the Cosmos SDK and supports Cosmwasm smart contracts, Mintstation facilitates a dynamic and insightful experience for individuals and teams working within the Cosmos ecosystem.


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/cli.html b/mintstation/cli.html index 20e0607c..a53d8ee8 100644 --- a/mintstation/cli.html +++ b/mintstation/cli.html @@ -11,12 +11,12 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    CLI
    CLI Introduction

    CLI Introduction

    +
    Mintstation
    CLI
    CLI Introduction

    CLI Introduction

    Introduction

    -

    mintstaiond is a command line client for the Mintstation. Mintstation users can use mintstationd to send transactions to the Mintstation network and query the blockchain data.

    +

    mintstationd is a command line client for the Mintstation. Mintstation users can use mintstationd to send transactions to the Mintstation network and query the blockchain data.

    See here for instructions on installing mintstationd.

    Working Directory

    The default working directory for the mintstationd is $HOME/.mintstation, which is mainly used to store configuration files and blockchain data. The Mintstation key data is saved in the working directory of mintstationd. You can also specify the mintstationd working directory by using the --home flag when executing mintstationd.

    Connecting to a Full-Node

    By default, mintstationd uses tcp://localhost:26657 as the RPC address to connect to the Mintstation network. This default configuration assumes that the machine executing mintstationd is running as a full-node.

    -

    The RPC address can be specified to connect to any full-node with an exposed RPC port by adding the --node flag when executing mintstationd


    MIT 2023 © Nextra.
    \ No newline at end of file +

    The RPC address can be specified to connect to any full-node with an exposed RPC port by adding the --node flag when executing mintstationd


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/cli/command.html b/mintstation/cli/command.html index e9eb6baa..40fe881b 100644 --- a/mintstation/cli/command.html +++ b/mintstation/cli/command.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    CLI
    Useful CLI Commands

    Useful CLI Commands

    +
    Mintstation
    CLI
    Useful CLI Commands

    Useful CLI Commands

    Get standard debug info from the mint daemon:

    mintstationd status

    Check if your node is catching up:

    @@ -44,4 +44,4 @@

    Query the validator set (and jailed status) via CLI:

    mintstationd query staking validators --limit 1000 -o json | jq -r '.validators[] | [.operator_address, (.tokens|tonumber / pow(10; 6)), .description.moniker, .jail, .status] | @csv' | column -t -s"," | sort -k2 -n -r | nl

    Get contract state:

    -
    mintstationd q wasm contract-state all <contract-address>

    MIT 2023 © Nextra.
    \ No newline at end of file +
    mintstationd q wasm contract-state all <contract-address>

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/cli/setup.html b/mintstation/cli/setup.html index d90cd190..4d6cbcce 100644 --- a/mintstation/cli/setup.html +++ b/mintstation/cli/setup.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    CLI
    Setup CLI

    Setup CLI

    +
    Mintstation
    CLI
    Setup CLI

    Setup CLI

    Build

    Build Requirements

    Go 1.20.+
    @@ -30,4 +30,4 @@

    Set the chain-id & node,

    #Update config.toml
     mintstationd config chain-id mintstation-1
    -mintstationd config node {NODE_RPC_ENDPOINT:PORT}


    MIT 2023 © Nextra.
    \ No newline at end of file +mintstationd config node {NODE_RPC_ENDPOINT:PORT}

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/contracts/compile.html b/mintstation/contracts/compile.html index a712753b..7618fd34 100644 --- a/mintstation/contracts/compile.html +++ b/mintstation/contracts/compile.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Smart Contracts
    Compile Contracts

    Compile Contracts

    +
    Mintstation
    Smart Contracts
    Compile Contracts

    Compile Contracts

    This guide is from the official CosmWasm/rust-optimizer repository (opens in a new tab). This method of compiling the contract will optimize the final build so that it reduces gas consumption.

    Example contracts for this can be found at https://github.com/CosmWasm/cw-examples (opens in a new tab). This repository requires this section to compile since multiple contracts are involved in a single repository.

    Single Contract Repository

    @@ -45,4 +45,4 @@

    --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ cosmwasm/workspace-optimizer-arm64:0.12.11

    -

    NOTE: See the difference with workspace-optimizer vs rust-optimizer in the previous single contract example.\


    MIT 2023 © Nextra.
    \ No newline at end of file +

    NOTE: See the difference with workspace-optimizer vs rust-optimizer in the previous single contract example.\


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/contracts/create.html b/mintstation/contracts/create.html index 698e0225..05bd36fc 100644 --- a/mintstation/contracts/create.html +++ b/mintstation/contracts/create.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Smart Contracts
    Create Contracts

    Create Contracts

    +
    Mintstation
    Smart Contracts
    Create Contracts

    Create Contracts

    To implement a wasm smart contract, it is highly recommended to learn Rust first. Rust is the language commonly used for wasm development and is well-regarded for its stability and performance. You can begin your Rust learning journey by referring to the following link:

    Rust Language Learning Guide (opens in a new tab)

    For smart contract development, you can follow the structure provided by CosmWasm's template. This template will help you understand the project's architecture and enable you to develop your contract more systematically. You can find the template at the following link:

    @@ -19,4 +19,4 @@

    Among the popular smart contract samples, there are cw20 and cw721 implementations. cw20 represents a widely-used token contract, while cw721 implements a Non-Fungible Token (NFT) contract. These samples can be valuable references during your development process. You can explore the code for each sample through the links below:

    cw20 (opens in a new tab), cw721 (opens in a new tab)

    For all great CosmWasm tools, https://github.com/CosmWasm/awesome-cosmwasm (opens in a new tab)

    -

    Although smart contract development can be complex, leveraging the provided resources will increase your chances of successfully completing your project. Additionally, make sure to actively engage with the community and online resources to continue your learning journey and receive ongoing support. Best of luck!


    MIT 2023 © Nextra.
    \ No newline at end of file +

    Although smart contract development can be complex, leveraging the provided resources will increase your chances of successfully completing your project. Additionally, make sure to actively engage with the community and online resources to continue your learning journey and receive ongoing support. Best of luck!


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/contracts/deploy.html b/mintstation/contracts/deploy.html index 91ccc53e..a6f8d9bf 100644 --- a/mintstation/contracts/deploy.html +++ b/mintstation/contracts/deploy.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Smart Contracts
    Store Codes

    Deploy Contracts

    +
    Mintstation
    Smart Contracts
    Store Codes

    Deploy Contracts

    PreRequisite

    Make sure you follow the create a contract guide first for your project. Once you have a contract compiled in the artifacts/*.wasm directory, you are ready for this guide.

    Upload

    @@ -85,4 +85,4 @@

    #cw20 CODE_ID=2 INIT='{"name":"CW20","symbol":"TOKEN","decimals":2,"initial_balances":[{"amount":"1000000","address":<address>}]}' -mintstationd tx wasm instantiate "$CODE_ID" "$INIT" --from <account> --label "cw-token" $FLAGS -y --admin <your-address-here>


    MIT 2023 © Nextra.
    \ No newline at end of file +mintstationd tx wasm instantiate "$CODE_ID" "$INIT" --from <account> --label "cw-token" $FLAGS -y --admin <your-address-here>

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/contracts/execute.html b/mintstation/contracts/execute.html index 01883b9d..d8db4b8b 100644 --- a/mintstation/contracts/execute.html +++ b/mintstation/contracts/execute.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Smart Contracts
    Execute Contracts

    Execute Contracts

    +
    Mintstation
    Smart Contracts
    Execute Contracts

    Execute Contracts

    Command Line Interface

    When you execute a message, a user can also pass through a flag which sends funds from their account to the contract to do logic. You can check if a user sends any funds in your contract's execute endpoint with the info.funds array of Coins sent by the user. These funds then get added to the contracts balance just like any other account. So it is up to you as the developer to ensure to save how many funds each user has sent via a BTreeMap or other object storage in state (if they can redeem funds back at a later time).

    To send funds to a contract with some arbitrary endpoint, you use the --amount flag.

    @@ -66,4 +66,4 @@

    .execute(address, REVIEWS_CONTRACT_ADDRESS, msg, fee, 'memo', send_amount) .then((res) => { console.log(`Success @ height ${res.height}\n\nTxHash: ${res.transactionHash}`); - });


    MIT 2023 © Nextra.
    \ No newline at end of file + });

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/contracts/query.html b/mintstation/contracts/query.html index c444ab00..24882304 100644 --- a/mintstation/contracts/query.html +++ b/mintstation/contracts/query.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Smart Contracts
    Query Contracts

    Query Contracts

    +
    Mintstation
    Smart Contracts
    Query Contracts

    Query Contracts

    Command Line Interface

    The most common way to query a cosmwasm smart contract is within the mintstationd wasm smart query command. This follows the following format where query is a JSON string with no spaces. By default, the least amount of data this can be is an empty JSON payload '{}'.

    mintstationd query wasm contract-state smart [contract_bech32] [query] [flags]
    @@ -111,4 +111,4 @@

    Enable React Query (opens in a new tab)
  • Enable Recoil (opens in a new tab)
  • Integrate Telescope with ts-codegen (opens in a new tab)
  • -


    MIT 2023 © Nextra.
    \ No newline at end of file +

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/module.html b/mintstation/module.html index 459af7aa..643d8a84 100644 --- a/mintstation/module.html +++ b/mintstation/module.html @@ -11,13 +11,13 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Building Modules

    Building Modules

    +
    Mintstation
    Building Modules

    Building Modules

    In this tutorial we will be going over building a module in Mintstation to show how easy it is to build on top of the Mintstation ecosystem. This module will be simple in nature but will show how to set up and connect a module to Mintstation and can be used as a starting point for more complex modules.

    Set up

    git clone https://github.com/cosmostation/mintstation.git

    Defining Protocol Buffer Types

    The first step in building a new Mintstation Module is to define our Module's types. To do that we use Protocol Buffers which is a used for serializing structured data and generating code for multiple target languages, Protocol Buffers are also smaller than JSON & XML so sending data around the network will be less expensive. Learn More (opens in a new tab).

    -

    Our Protobuf files will all live in proto/mintstation directory. we will create a new directory with the new module greet and add the following files in the proto/greet/v1beta1/ directory

    +

    Our Protobuf files will all live in proto/mintstation directory. We will create a new directory with the new module greet and add the following files in the proto/greet/v1beta1/ directory

    genesis.proto
     greet.proto
     query.proto
    @@ -711,4 +711,4 @@ 

    greeting:
       id: "0"
       message: hello world from mintstation chain
    -  owner: mintstation173w2zz287s36ewnnkf4mjansnthnnsz7rtrxqc


    MIT 2023 © Nextra.
    \ No newline at end of file + owner: mintstation173w2zz287s36ewnnkf4mjansnthnnsz7rtrxqc

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/playground.html b/mintstation/playground.html index d8756980..ab4d6dcb 100644 --- a/mintstation/playground.html +++ b/mintstation/playground.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Playground

    Playground

    +
    Mintstation
    Playground

    Playground

    Welcome to Mintstation Playground, it makes easy to connect your wallet to the Mintstation blockchain and build your projects seamlessly.

    Playground

    With this project, you can easily connect your wallet in any environment, be it on a PC or mobile device. Using the Mintscan API (opens in a new tab), you can conveniently build your products with ease.

    @@ -51,4 +51,4 @@

  • You can easily implement the function to easily stake and unstake tokens within Mintstation.
  • -

    TBD : Governance, Smart Contracts, Swap


    MIT 2023 © Nextra.
    \ No newline at end of file +

    TBD : Governance, Smart Contracts, Swap


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/validator/command.html b/mintstation/validator/command.html index 955954e6..44bbddde 100644 --- a/mintstation/validator/command.html +++ b/mintstation/validator/command.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Node & Validator
    Useful Commands

    Useful commands

    +
    Mintstation
    Node & Validator
    Useful Commands

    Useful commands

    Upgrade to a validator

    Do not attempt to upgrade your node to a validator until the node is fully in sync as per the previous step.

    To upgrade the node to a validator, you will need to submit a create-validator transaction:

    @@ -30,10 +30,10 @@

    The above transaction is just an example. There are many more flags that can be set to customise your validator, such as your validator website, or keybase.io id, etc. To see a full list:

    mintstationd tx staking create-validator --help

    Unjail

    -
    stationed tx slashing unjail --from <key-name> --chain-id mintstation-1 --fees 100umint
    +
    mintstationd tx slashing unjail --from <key-name> --chain-id mintstation-1 --fees 100umint

    To track your validator's signing history, copy the validator public key:

    mintstationd tendermint show-validator

    Use your validators public key queried above as the validator-pubkey below:

    mintstationd query slashing signing-info <validator-pubkey>

    Example:

    -
    mintstationd query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"HlixoxNZBPq4pBOYEimtSq9Ak4peBISVsIbI5ZHrEAU="}'


    MIT 2023 © Nextra.
    \ No newline at end of file +
    mintstationd query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"HlixoxNZBPq4pBOYEimtSq9Ak4peBISVsIbI5ZHrEAU="}'

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/validator/delegations.html b/mintstation/validator/delegations.html index 26af11f1..facac72e 100644 --- a/mintstation/validator/delegations.html +++ b/mintstation/validator/delegations.html @@ -11,8 +11,8 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Node & Validator
    Delegations

    Delegations

    +
    Mintstation
    Node & Validator
    Delegations

    Delegations

    If you wish to perform more extensive testing and require additional delegations, please don't hesitate to get in touch with us at mintstation@cosmostation.io.

    We are more than happy to provide you with the necessary delegations to support your testing efforts. Our delegation services aim to help you thoroughly evaluate and explore the features and capabilities of our platform.

    By reaching out to us, you can access a wide range of resources and support to make the most out of your testing experience. Whether you are testing staking, governance, or any other aspects of our system, we want to ensure that you have a beautiful and seamless experience.

    -

    Feel free to contact us with any specific requirements or questions you may have. Our team at mintstation@cosmostation.io is ready to assist you, and we look forward to supporting your testing journey!


    MIT 2023 © Nextra.
    \ No newline at end of file +

    Feel free to contact us with any specific requirements or questions you may have. Our team at mintstation@cosmostation.io is ready to assist you, and we look forward to supporting your testing journey!


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/validator/localnet.html b/mintstation/validator/localnet.html index 9da3372f..1cfc2b1f 100644 --- a/mintstation/validator/localnet.html +++ b/mintstation/validator/localnet.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Node & Validator
    Setup Local Network

    Setup Local Network

    +
    Mintstation
    Node & Validator
    Setup Local Network

    Setup Local Network

    To set up a single local network easily, you can directly run the script below, and it will start working immediately:

    To get up and running with the mintstationd binary, please follow the instructions here.

    APP_HOME="$HOME/.mintstation"
    @@ -35,4 +35,4 @@
      
     mintstationd collect-gentxs
      
    -mintstationd start --home ${APP_HOME}

    MIT 2023 © Nextra.
    \ No newline at end of file +mintstationd start --home ${APP_HOME}

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/validator/mainnet.html b/mintstation/validator/mainnet.html index 5dac9849..0e66699b 100644 --- a/mintstation/validator/mainnet.html +++ b/mintstation/validator/mainnet.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Node & Validator
    Joining Mainnet

    Joining Mainnet

    +
    Mintstation
    Node & Validator
    Joining Mainnet

    Joining Mainnet

    To get up and running with the mintstationd binary, please follow the instructions here.

    Setting up the Node

    These instructions will direct you on how to initialize your node, synchronize to the network and upgrade your node to a validator.

    @@ -29,7 +29,7 @@

    Download the the geneis file.

    # Download genesis.json file (https://github.com/cosmostation/mintstation)
     rm ~/.mintstation/config/genesis.json
    -mv genesis.json $HOME/.mintstation/config/genesis.json
    +curl -sS "https://rpc-mintstation.cosmostation.io/genesis" | jq .result.genesis > $HOME/.mintstation/config/genesis.json

    This will replace the genesis file created using mintstationd init command with the mainnet genesis.json.

    Set seeds

    We can set the seeds by retrieving the list of seeds from the mintstation repo and using sed to inject into ~/.mintstation/config/config.toml:

    @@ -59,19 +59,48 @@

    Replace <key-name> with a key name of your choosing.

    After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys.

    Get some tokens

    -

    Delegations here.

    +

    We are serving only a few tokens for you to test or do somehting what you want.

    +
    # Check your address which you've generated & copy the address
    +mintstationd keys show <key-name> -a
    + 
    +# Go to minstation faucet and paste your address on it
    +https://faucet-mintstation.cosmostation.io
    +

    If you want to get more tokens or delegations, Please contact us from here.

    Syncing the node

    There are methods to sync a node to the network:

    -

    From genesis

    +

    Sync from genesis

    After starting the mintstationd daemon, the chain will begin to sync to the network. The time to sync to the network will vary depending on your setup and the current size of the blockchain, but could take a very long time. To query the status of your node:

    -
    # Query via the RPC (default port: 26657)
    +
    # Start for your node to sync from genesis
    +mintstationd start
    + 
    +# Query via the RPC (default port: 26657)
     curl http://localhost:26657/status | jq .result.sync_info.catching_up

    If this command returns true then your node is still catching up. If it returns false then your node has caught up to the network current block and you are safe to proceed to upgrade to a validator node.

    When syncing from genesis, you will need to perform upgrades while catching up to the head. mintstation-1 upgrades are detailed in node-upgrade.md along with a description of each type of upgrade.

    +

    Sync with statesync

    +

    When a cosmos-sdk based chain already started to make a new consensus, you need some time to sync from genesis with your node.

    +

    So, you can resolve this problem by using statesync (opens in a new tab) functionality, which is general characteristic in cosoms-sdk based chain. And then we recommend to sync with statesync by using our snapshot provider rpc endpoint.

    +
    # Setup statesync in your config.toml
    +SNAP_RPC="https://rpc-mintstation.cosmostation.io:443"
    + 
    +LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
    +BLOCK_HEIGHT=$((LATEST_HEIGHT - 1500)); \
    +TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
    + 
    +sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
    +s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
    +s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
    +s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.mintstation/config/config.toml
    + 
    +# Check diff between before and after
    +diff $HOME/.mintstation/config/config.toml $HOME/.mintstation/config/config.toml.bak
    + 
    +# Start for your node to sync with statesync
    +mintstationd start

    Backup critical files

    There are certain files that you need to backup to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in ~/.mintstation/config/:

    • priv_validator_key.json
    • node_key.json
    -

    It is recommended that you encrypt the backup of these files.


    MIT 2023 © Nextra.
    \ No newline at end of file +

    It is recommended that you encrypt the backup of these files.


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mintstation/validator/upgrade.html b/mintstation/validator/upgrade.html index 4dfda02e..af7eef57 100644 --- a/mintstation/validator/upgrade.html +++ b/mintstation/validator/upgrade.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mintstation
    Node & Validator
    Node Upgrades

    Node Upgrades

    +
    Mintstation
    Node & Validator
    Node Upgrades

    Node Upgrades

    Upgrades

    Release procedures for validators and node operators are explained here (opens in a new tab).

    Upgrade types

    @@ -24,4 +24,4 @@

    Planned upgrades, as the name suggests, are upgrades that are developed and proposed via governance. If approved by the community, these upgrades are undertaken by the chain automatically halting at the planned upgrade height.

    Node operators are then required to swap the binary for the planned upgrade binary. After all node operators have upgraded and started their nodes the network will continue in the upgraded state.

    Unplanned upgrade

    -

    Where emergency security patches are required node operators will be required to halt their nodes manually at the required upgrade height, swap the patched binary and restart their nodes. After all node operators have upgraded and started their nodes the network will continue in the upgraded state.


    MIT 2023 © Nextra.
    \ No newline at end of file +

    Where emergency security patches are required node operators will be required to halt their nodes manually at the required upgrade height, swap the patched binary and restart their nodes. After all node operators have upgraded and started their nodes the network will continue in the upgraded state.


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mobile.html b/mobile.html index b6d89a33..a53d3c79 100644 --- a/mobile.html +++ b/mobile.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mobile Wallets
    Introduction

    Introduction

    +
    Mobile Wallets
    Introduction

    Introduction

    Mobile wallets support various types of services.

    -

    Connections using Cosmostation and WalletConnect also implement the Keplr and Web3j specifications.


    MIT 2023 © Nextra.
    \ No newline at end of file +

    Connections using Cosmostation and WalletConnect also implement the Keplr and Web3j specifications.


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mobile/article.html b/mobile/article.html index e3811444..04fe2bf7 100644 --- a/mobile/article.html +++ b/mobile/article.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mobile Wallets
    Article

    Articles

    +

    MIT 2023 © Nextra.
    \ No newline at end of file +

    Starname Service (opens in a new tab)


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mobile/integration/cosmjs.html b/mobile/integration/cosmjs.html index 9bcdaa73..b605e403 100644 --- a/mobile/integration/cosmjs.html +++ b/mobile/integration/cosmjs.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mobile Wallets
    Integration
    Cosmjs

    Integrate cosmjs

    +

    MIT 2023 © Nextra.
    \ No newline at end of file +);

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mobile/integration/cosmostation.html b/mobile/integration/cosmostation.html index 9bfc2462..e8b3d497 100644 --- a/mobile/integration/cosmostation.html +++ b/mobile/integration/cosmostation.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mobile Wallets
    Integration
    Cosmostation Specs

    Cosmostation

    +
    Mobile Wallets
    Integration
    Cosmostation Specs

    Cosmostation

    Using @cosmostation/extension-client to support both Mobile and PC in the same way as extensions.

    💡

    If your project's dApp works well in Cosmostation Extension, it will work well in mobile too.

    -

    For more detailed explanation, please refer to the Cosmostation Extension Guide.


    MIT 2023 © Nextra.
    \ No newline at end of file +

    For more detailed explanation, please refer to the Cosmostation Extension Guide.


    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mobile/integration/walletconnect/accounts.html b/mobile/integration/walletconnect/accounts.html index 65931eff..47766083 100644 --- a/mobile/integration/walletconnect/accounts.html +++ b/mobile/integration/walletconnect/accounts.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mobile Wallets
    Integration
    WalletConnect 1.0(Deprecated)
    Accounts

    Accounts

    +
    Mobile Wallets
    Integration
    WalletConnect 1.0(Deprecated)
    Accounts

    Accounts

    Use account on Cosmostation Mobile Wallet via WalletConnect.

    Get Accounts

    @@ -42,4 +42,4 @@

    address: Uint8Array; pubKey: string; bech32Address: string; -};


    MIT 2023 © Nextra.
    \ No newline at end of file +};

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mobile/integration/walletconnect/connect.html b/mobile/integration/walletconnect/connect.html index 36d89ce4..f5c58dfc 100644 --- a/mobile/integration/walletconnect/connect.html +++ b/mobile/integration/walletconnect/connect.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mobile Wallets
    Integration
    WalletConnect 1.0(Deprecated)
    Connect

    Connect

    +

    MIT 2023 © Nextra.
    \ No newline at end of file +});

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mobile/integration/walletconnect/sign-tx.html b/mobile/integration/walletconnect/sign-tx.html index c06bf744..57770297 100644 --- a/mobile/integration/walletconnect/sign-tx.html +++ b/mobile/integration/walletconnect/sign-tx.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mobile Wallets
    Integration
    WalletConnect 1.0(Deprecated)
    Sign Transaction

    Sign Transactions

    +
    Mobile Wallets
    Integration
    WalletConnect 1.0(Deprecated)
    Sign Transaction

    Sign Transactions

    Sign transcation using Cosmostation Mobile Wallet via WalletConnect.

    export function getSignTxRequest(chainId, signer, signDoc) {
       return {
    @@ -52,4 +52,4 @@
     
    Model
    type SignTxResponse = {
       signed: StdSignDoc;
       signature: { signature: string; pub_key: { type: string; value: string } };
    -};

    MIT 2023 © Nextra.
    \ No newline at end of file +};

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mobile/integration/walletconnect2.html b/mobile/integration/walletconnect2.html index 7b014d12..cb07eb7f 100644 --- a/mobile/integration/walletconnect2.html +++ b/mobile/integration/walletconnect2.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mobile Wallets
    Integration
    WalletConnect 2.0

    WalletConnect 2.0

    +

    MIT 2023 © Nextra.
    \ No newline at end of file +}

    MIT 2023 © Nextra.
    \ No newline at end of file diff --git a/mobile/listing.html b/mobile/listing.html index ae95b35c..472443c1 100644 --- a/mobile/listing.html +++ b/mobile/listing.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Mobile Wallets
    Listing on mobile

    How to dApp listing?

    +
    \ No newline at end of file +

    https://github.com/cosmostation/chainlist/blob/main/dapp/README.md (opens in a new tab)


    MIT 2023 © Nextra.
    \ No newline at end of file